WIP: Hds 4340 test branch - #31208
Closed
lane-wetmore wants to merge 16 commits into
Closed
Conversation
|
Build Results: |
|
CI Results: failed ❌ |
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the legacy CodeMirror-based JSON editor to the new HDS CodeEditor, updates related helpers and test suites, and cleans up obsolete dependencies and styles.
- Migrate
JsonEditorComponentand templates to use HDSCodeEditorwith newonBlur,onLint, andonSetuphooks. - Revamp the
codemirrortest helper: point at.hds-code-editor__editor, addsetCodeEditorValue,getCodeEditorValue, andassertCodeBlockValue. - Update all affected tests to wait for
.cm-editorand use the new helper functions instead of directCodeMirrorAPI calls. - Remove old CodeMirror dependencies and styles from
package.json, build files, and SCSS.
Reviewed Changes
Copilot reviewed 53 out of 54 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| ui/lib/core/addon/components/json-editor.js | Refactor JSON editor component to HDS CodeEditor API |
| ui/lib/core/addon/components/json-editor.hbs | Update template to use <Hds::CodeBlock> for read-only mode |
| ui/tests/helpers/codemirror.js | Revise helper to target .hds-code-editor__editor and add new APIs |
| ui/tests/integration/components/transit-key-actions-test.js | Convert CM calls to setCodeEditorValue / getCodeEditorValue |
| ui/tests/** | Bulk-update tests to await .cm-editor and use new helper methods |
| ui/package.json | Remove obsolete codemirror and related type deps |
| ui/lib/core/addon/modifiers/code-mirror.js | Remove legacy CodeMirror modifier |
| ui/app/styles/components/codemirror.scss | Delete deprecated CodeMirror styles |
Comments suppressed due to low confidence (2)
ui/lib/core/addon/components/json-editor.js:24
- [nitpick] There are two
@param {String} [value]entries in the jsdoc. Please remove the duplicate to avoid confusion.
* @param {String} [value] - Value within the display. Generally, a json string.
ui/tests/integration/components/transit-key-actions-test.js:153
- [nitpick] Consider importing and using the shared
setEditorValuehelper fromvault/tests/helpers/codemirror.jsto replace thewaitFor+codemirror()+setCodeEditorValuepattern for better consistency and reduced duplication.
await waitFor('.cm-editor');
| const cm = element.CodeMirror; | ||
| invariant(cm, `No registered CodeMirror instance for '.CodeMirror'`); | ||
| const cm = element.editor; | ||
| invariant(cm, `No registered CodeMirror instance for ''${selector}'`); |
There was a problem hiding this comment.
The invariant message has extra single quotes around the selector; remove the redundant quotes so it reads No registered CodeMirror instance for '${selector}'.
Suggested change
| invariant(cm, `No registered CodeMirror instance for ''${selector}'`); | |
| invariant(cm, `No registered CodeMirror instance for '${selector}'`); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Testing after rebase
TODO only if you're a HashiCorp employee
backport/label that matches the desired release branch. Note that in the CE repo, the latest release branch will look likebackport/x.x.x, but older release branches will bebackport/ent/x.x.x+ent.of a public function, even if that change is in a CE file, double check that
applying the patch for this PR to the ENT repo and running tests doesn't
break any tests. Sometimes ENT only tests rely on public functions in CE
files.
in the PR description, commit message, or branch name.
description. Also, make sure the changelog is in this PR, not in your ENT PR.
PCI review checklist
Examples of changes to security controls include using new access control methods, adding or removing logging pipelines, etc.