Replace codemirror 6 code editor with HDS CodeEditor component#30188
Conversation
|
CI Results: |
c054a3c to
c400092
Compare
There was a problem hiding this comment.
We no longer prevent tab from changing focus within the editor as this behavior has accessibility concerns.
d7ce5a6 to
3b16d45
Compare
0ddfaa9 to
746c217
Compare
fe8b386 to
a5ebc41
Compare
beagins
left a comment
There was a problem hiding this comment.
looks good to me! great work!! 🎉
beagins
left a comment
There was a problem hiding this comment.
Just one outstanding question, otherwise looks good! :)
| await click(GENERAL.ttl.toggle('Automate secret deletion')); | ||
| await fillIn(GENERAL.selectByAttr('ttl-unit'), 's'); | ||
| await fillIn(GENERAL.ttl.input('Automate secret deletion'), '1'); | ||
|
|
| await click(GENERAL.submitButton); | ||
| await waitUntil(() => find('.CodeMirror')); | ||
| /* eslint-disable-next-line ember/no-settled-after-test-helper */ | ||
| await settled(); |
There was a problem hiding this comment.
I believe that we are trying to avoid await settled() where possible. I can see that waitUntil wasn't working for some reason, would using a assert.dom('.CodeMirror').exists(); instead work?
There was a problem hiding this comment.
Good catch! I think the await settled() might have been overkill. There is another waitUntil further down that seems to work just fine.
| await click(SS.secretLink('1/2/3/')); | ||
| assert.dom('[data-test-component="navigate-input"]').hasValue('1/2/3/'); | ||
| assert.dom('[data-test-secret-link]').exists({ count: 2 }); | ||
| assert.dom(SS.secretLink()).exists({ count: 2 }); |
There was a problem hiding this comment.
This PR is already big, so I wouldn't address this here - but it would be nice if we could replace all instances of the SECRET_ENGINE_SELECTORS (SS) with general selectors in a follow up pr.
* Completed initial replacement of editor * fixing ts issues * removing codemirror modifier and deps * working on replacing the code editor * addressing linting concerns * cleaning up policy-form editor * fixing linting issues * fixing linting issues * fixing tests * fixing tests * fixing tests * fixing tests * fixing failing tests * cleaning up PR * fixing tests * remove outdated message for navigating editor * fix linting in tests * add changelog * fix tests * update naming * remove unused lint param + name changes * update test selector usage * update test selector usage * update test selector usage * lint fixes * replace page object selectors * lint fix * fix lint * fix lint after merge * update tests * remove import --------- Co-authored-by: Lane Wetmore <lane.wetmore@hashicorp.com>
* Replace codemirror 6 code editor with HDS CodeEditor component (#30188) * Completed initial replacement of editor * fixing ts issues * removing codemirror modifier and deps * working on replacing the code editor * addressing linting concerns * cleaning up policy-form editor * fixing linting issues * fixing linting issues * fixing tests * fixing tests * fixing tests * fixing tests * fixing failing tests * cleaning up PR * fixing tests * remove outdated message for navigating editor * fix linting in tests * add changelog * fix tests * update naming * remove unused lint param + name changes * update test selector usage * update test selector usage * update test selector usage * lint fixes * replace page object selectors * lint fix * fix lint * fix lint after merge * update tests * remove import --------- Co-authored-by: Lane Wetmore <lane.wetmore@hashicorp.com> * add import * fix test selector mismatches * lint fix * fix timing issue * lint * lint + fix flake --------- Co-authored-by: Zack Moore <zack.moore89@gmail.com>
…corp#30188) * Completed initial replacement of editor * fixing ts issues * removing codemirror modifier and deps * working on replacing the code editor * addressing linting concerns * cleaning up policy-form editor * fixing linting issues * fixing linting issues * fixing tests * fixing tests * fixing tests * fixing tests * fixing failing tests * cleaning up PR * fixing tests * remove outdated message for navigating editor * fix linting in tests * add changelog * fix tests * update naming * remove unused lint param + name changes * update test selector usage * update test selector usage * update test selector usage * lint fixes * replace page object selectors * lint fix * fix lint * fix lint after merge * update tests * remove import --------- Co-authored-by: Lane Wetmore <lane.wetmore@hashicorp.com>
Description
This PR will update the use of the Code Mirror 5 code editor to the new Hds::CodeEditor
component.
This changes the internals of the
JsonEditorcomponent to use theHds::CodeBlockcomponent for readonly views and the newHds::CodeEditorcomponent for editing code.Screenshots
Create/Edit Policy - ACL (also applies to RGP and EDL)
Before:Create/Edit Secret - Cubbyhole
Before:Wrap Data
Before:Sign Key - SSH
Before:Web REPL
Before:Control Group Success
Before:After:
OIDC - Create Scope
Before:Form field - KV - Create New Version (also applies to Patching)
Before:TODO
Add changelog
Screenshots for each instance and smoke test them.
Enterprise tests run on -server and on headless

(Current to latest test updates on 07/16)
Then get the version of this PR to a point where we can "easily" backport to 1.19.x. Only 1.19.x as that is LTS.
Once we backport, then do clean up PR that does not need to be backported. Specifically test clean up using selectors and newer patterns.