From 95ea7c74d5e3cda74fe67e2291d82f29f194d20f Mon Sep 17 00:00:00 2001 From: Zack Moore Date: Mon, 3 Feb 2025 15:35:44 -0500 Subject: [PATCH 01/17] =?UTF-8?q?chore:=20=F0=9F=A4=96=20replace=20Rose::C?= =?UTF-8?q?odeEditor=20with=20Hds::CodeEditor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Remove CodeEditor 5 dependency --- .../rose/code-editor/field-editor/index.hbs | 11 --- .../components/rose/code-editor/index.hbs | 13 --- .../rose/code-editor/toolbar/index.hbs | 34 ------- .../rose/code-editor/toolbar/index.js | 30 ------ addons/rose/addon/modifiers/code-mirror.js | 99 ------------------- .../utilities/register-codemirror-hcl.js | 43 -------- .../rose/app/components/rose/code-editor.js | 6 -- .../rose/components/code-editor/_index.scss | 26 ----- addons/rose/index.js | 5 +- .../components/rose/code-editor-test.js | 32 ------ .../rose/code-editor/field-editor-test.js | 74 -------------- .../rose/code-editor/toolbar-test.js | 60 ----------- 12 files changed, 1 insertion(+), 432 deletions(-) delete mode 100644 addons/rose/addon/components/rose/code-editor/field-editor/index.hbs delete mode 100644 addons/rose/addon/components/rose/code-editor/index.hbs delete mode 100644 addons/rose/addon/components/rose/code-editor/toolbar/index.hbs delete mode 100644 addons/rose/addon/components/rose/code-editor/toolbar/index.js delete mode 100644 addons/rose/addon/modifiers/code-mirror.js delete mode 100644 addons/rose/addon/utilities/register-codemirror-hcl.js delete mode 100644 addons/rose/app/components/rose/code-editor.js delete mode 100644 addons/rose/tests/integration/components/rose/code-editor-test.js delete mode 100644 addons/rose/tests/integration/components/rose/code-editor/field-editor-test.js delete mode 100644 addons/rose/tests/integration/components/rose/code-editor/toolbar-test.js diff --git a/addons/rose/addon/components/rose/code-editor/field-editor/index.hbs b/addons/rose/addon/components/rose/code-editor/field-editor/index.hbs deleted file mode 100644 index 5704db4bf1..0000000000 --- a/addons/rose/addon/components/rose/code-editor/field-editor/index.hbs +++ /dev/null @@ -1,11 +0,0 @@ -{{! - Copyright (c) HashiCorp, Inc. - SPDX-License-Identifier: BUSL-1.1 -}} - -
\ No newline at end of file diff --git a/addons/rose/addon/components/rose/code-editor/index.hbs b/addons/rose/addon/components/rose/code-editor/index.hbs deleted file mode 100644 index 99bcca3f01..0000000000 --- a/addons/rose/addon/components/rose/code-editor/index.hbs +++ /dev/null @@ -1,13 +0,0 @@ -{{! - Copyright (c) HashiCorp, Inc. - SPDX-License-Identifier: BUSL-1.1 -}} - -
- {{yield - (hash - fieldEditor=(component 'rose/code-editor/field-editor' value=@codeValue) - toolbar=(component 'rose/code-editor/toolbar' copyText=@codeValue) - ) - }} -
\ No newline at end of file diff --git a/addons/rose/addon/components/rose/code-editor/toolbar/index.hbs b/addons/rose/addon/components/rose/code-editor/toolbar/index.hbs deleted file mode 100644 index 04e94a7d5b..0000000000 --- a/addons/rose/addon/components/rose/code-editor/toolbar/index.hbs +++ /dev/null @@ -1,34 +0,0 @@ -{{! - Copyright (c) HashiCorp, Inc. - SPDX-License-Identifier: BUSL-1.1 -}} - -
-
- {{yield to='action'}} -
- -
- {{#if (has-block 'menu')}} -
- {{yield to='menu'}} -
-
- {{/if}} - - - Copy code - -
-
\ No newline at end of file diff --git a/addons/rose/addon/components/rose/code-editor/toolbar/index.js b/addons/rose/addon/components/rose/code-editor/toolbar/index.js deleted file mode 100644 index dae6aed118..0000000000 --- a/addons/rose/addon/components/rose/code-editor/toolbar/index.js +++ /dev/null @@ -1,30 +0,0 @@ -/** - * Copyright (c) HashiCorp, Inc. - * SPDX-License-Identifier: BUSL-1.1 - */ - -import Component from '@glimmer/component'; -import { tracked } from '@glimmer/tracking'; -import { action } from '@ember/object'; -import { later } from '@ember/runloop'; - -export const COPY_ICON_TYPE = 'clipboard-copy'; -export const COPIED_ICON_TYPE = 'clipboard-checked'; - -export default class RoseCodeEditorToolbarComponent extends Component { - @tracked copyIconType = COPY_ICON_TYPE; - - @action - copied() { - let { onCopy } = this.args; - let originalIconType = this.copyIconType; - - this.copyIconType = COPIED_ICON_TYPE; - - if (onCopy) { - onCopy(); - } - // eslint-disable-next-line ember/no-runloop - later(() => (this.copyIconType = originalIconType), 1000); - } -} diff --git a/addons/rose/addon/modifiers/code-mirror.js b/addons/rose/addon/modifiers/code-mirror.js deleted file mode 100644 index d6e5d9a96d..0000000000 --- a/addons/rose/addon/modifiers/code-mirror.js +++ /dev/null @@ -1,99 +0,0 @@ -/** - * Copyright (c) HashiCorp, Inc. - * SPDX-License-Identifier: BUSL-1.1 - */ - -import Modifier from 'ember-modifier'; -import codemirror from 'codemirror'; - -import '../utilities/register-codemirror-hcl'; -import 'codemirror/mode/go/go'; -import 'codemirror/mode/javascript/javascript'; -import 'codemirror/mode/shell/shell'; -import 'codemirror/addon/edit/matchbrackets'; -import 'codemirror/addon/edit/closebrackets'; -import 'codemirror/addon/selection/active-line'; -import 'codemirror/addon/display/autorefresh'; -import 'codemirror/addon/lint/lint'; -import 'codemirror/addon/lint/json-lint'; - -// Here we define default options for the editor. -// These should follow the codemirror configuration types -// -const _PRESET_DEFAULTS = { - theme: 'monokai', - lineNumbers: true, - cursorBlinkRate: 500, - matchBrackets: true, - autoCloseBrackets: true, - styleActiveLine: true, - mode: 'hcl', -}; - -/** - * - * `CodeMirror` implements a modifier that creates a CodeMirror instance on the provided element. - * - * The supported modes for the editor are currently: hcl, shell, go, javascript - * The supported themes are: monokai - * - * Sample usage: - * ``` - *
- * ``` - * - * @class CodeMirror - * - */ -export default class CodeMirrorModifier extends Modifier { - _editor; - didSetup = false; - - modify(element, _, named) { - if (!this.didSetup) { - this._setup(element, named); - this.didSetup = true; - } - - if (this._editor?.getValue() !== named.value) { - this._editor?.setValue(named.value); - } - } - - /** - * Called when editor contents change. - * @method CodeMirror#_onChange - * See documentation for the CodeMirror editor events, specifically 'change' event here https://codemirror.net/doc/manual.html#events. - */ - _onChange(editor, named) { - const { onInput } = named; - const newVal = editor.getValue(); - - onInput && onInput(newVal); - } - - /** - * Initializes the editor with default configuration merged with consumer-provided configuration. - * Also registers a 'change' event on the editor. - * @method CodeMirror#_setup - */ - _setup(element, named) { - if (!element) { - throw new Error('CodeMirror modifier has no element'); - } - - const editor = codemirror(element, { - ..._PRESET_DEFAULTS, - ...(named.options || {}), - value: named.value, - }); - - editor.on('change', (editor) => { - this._onChange(editor, named); - }); - - this._editor = editor; - } -} diff --git a/addons/rose/addon/utilities/register-codemirror-hcl.js b/addons/rose/addon/utilities/register-codemirror-hcl.js deleted file mode 100644 index 2c4561b936..0000000000 --- a/addons/rose/addon/utilities/register-codemirror-hcl.js +++ /dev/null @@ -1,43 +0,0 @@ -/** - * Copyright (c) HashiCorp, Inc. - * SPDX-License-Identifier: BUSL-1.1 - */ - -import codemirror from 'codemirror'; -import 'codemirror/addon/mode/simple'; - -// This utility defines 'hcl' mode for a codemirror editor and enables correct syntax highlighting. -// Importing this file in the codemirror modifier will allow 'hcl' to be selected as a mode: -// import 'cloud-ui-core/utils/register-codemirror-hcl' -codemirror.defineSimpleMode('hcl', { - start: [ - { regex: /"(?:[^\\]|\\.)*?(?:"|$)/, token: 'string' }, // strings - { regex: /(\w+)(\s+)(=)/, token: ['keyword', 'null', 'null'] }, // assignment of variables - { - regex: /(build|deploy|release|hook|registry|type|runner|url)( )({)/, - token: ['keyword', 'null', 'null'], - }, // top level keywords - { regex: /(variable)\b/, token: 'keyword' }, // input variable keyword - { regex: /true|false|null|undefined/, token: 'atom' }, // bool keywords - { - regex: /0x[a-f\d]+|[-+]?(?:\.\d+|\d+\.?\d*)(?:e[-+]?\d+)?/i, - token: 'number', - }, // numbers - { regex: /(#|\/\/)(\s*\S*)/, token: 'comment' }, // single line comments - { regex: /(path)(.)/, token: ['variable-2', 'null'] }, // path variables - { regex: /(workspace)(.)(\S*)/, token: ['string', 'null', 'string'] }, // workspace variables - { regex: /\/\*/, token: 'comment', next: 'comment' }, // multi-line comment - { regex: /[-+/*=<>!]+/, token: 'operator' }, // operators - { regex: /[{[(]/, indent: true }, // for auto indent - { regex: /[}\])]/, dedent: true }, - ], - // The multi-line comment state. - comment: [ - { regex: /.*?\*\//, token: 'comment', next: 'start' }, - { regex: /.*/, token: 'comment' }, - ], - meta: { - dontIndentStates: ['comment'], - lineComment: '#', - }, -}); diff --git a/addons/rose/app/components/rose/code-editor.js b/addons/rose/app/components/rose/code-editor.js deleted file mode 100644 index a377f64abc..0000000000 --- a/addons/rose/app/components/rose/code-editor.js +++ /dev/null @@ -1,6 +0,0 @@ -/** - * Copyright (c) HashiCorp, Inc. - * SPDX-License-Identifier: BUSL-1.1 - */ - -export { default } from 'rose/components/rose/code-editor'; diff --git a/addons/rose/app/styles/rose/components/code-editor/_index.scss b/addons/rose/app/styles/rose/components/code-editor/_index.scss index f419925aba..a9bf84c419 100644 --- a/addons/rose/app/styles/rose/components/code-editor/_index.scss +++ b/addons/rose/app/styles/rose/components/code-editor/_index.scss @@ -6,32 +6,6 @@ /* stylelint-disable selector-class-pattern */ @use '../../variables/sizing'; -// Codemirror overrides -.rose-codemirror-container { - width: 100%; -} - -.CodeMirror { - max-width: 100%; - display: flex; - flex: 1; - font-family: ui-monospace, Menlo, monospace; -} - -.rose-autosize { - .CodeMirror { - height: auto; - } -} - -.CodeMirror-scroll { - width: 100%; -} - -.CodeMirror-sizer { - border-right-width: 0 !important; -} - // Toolbar .rose-code-editor-toolbar { display: flex; diff --git a/addons/rose/index.js b/addons/rose/index.js index 624614493c..171c4b9d99 100644 --- a/addons/rose/index.js +++ b/addons/rose/index.js @@ -12,10 +12,7 @@ module.exports = { included(app) { this._super.included.apply(this, arguments); - this.import('node_modules/codemirror/lib/codemirror.css'); - this.import('node_modules/codemirror/theme/monokai.css'); - this.import('node_modules/codemirror/addon/lint/lint.css'); - this.import('node_modules/jsonlint/lib/jsonlint.js'); + app.import('node_modules/jsonlint/lib/jsonlint.js'); this.includeHDSStyles(app); this.includeFlightIcons(app); diff --git a/addons/rose/tests/integration/components/rose/code-editor-test.js b/addons/rose/tests/integration/components/rose/code-editor-test.js deleted file mode 100644 index 7dbb6860e3..0000000000 --- a/addons/rose/tests/integration/components/rose/code-editor-test.js +++ /dev/null @@ -1,32 +0,0 @@ -/** - * Copyright (c) HashiCorp, Inc. - * SPDX-License-Identifier: BUSL-1.1 - */ - -import { module, test } from 'qunit'; -import { setupRenderingTest } from 'ember-qunit'; -import { render } from '@ember/test-helpers'; -import { hbs } from 'ember-cli-htmlbars'; - -module('Integration | Component | rose/code-editor', function (hooks) { - setupRenderingTest(hooks); - - test('it renders', async function (assert) { - const codeValue = 'export HCP_CLIENT_ID = {place your client_id here}'; - this.set('codeValue', codeValue); - - await render(hbs` - - - - - `); - assert.dom('[data-test-code-editor]').isVisible(); - assert.dom('[data-test-code-editor-toolbar]').isVisible(); - assert.dom('[data-test-code-editor-field-editor]').isVisible(); - assert.dom('[data-test-code-editor-field-editor]').includesText(codeValue); - }); -}); diff --git a/addons/rose/tests/integration/components/rose/code-editor/field-editor-test.js b/addons/rose/tests/integration/components/rose/code-editor/field-editor-test.js deleted file mode 100644 index 18e0b064a1..0000000000 --- a/addons/rose/tests/integration/components/rose/code-editor/field-editor-test.js +++ /dev/null @@ -1,74 +0,0 @@ -/** - * Copyright (c) HashiCorp, Inc. - * SPDX-License-Identifier: BUSL-1.1 - */ - -import { module, test } from 'qunit'; -import { setupRenderingTest } from 'ember-qunit'; -import { typeIn, render, waitUntil } from '@ember/test-helpers'; -import { hbs } from 'ember-cli-htmlbars'; - -module( - 'Integration | Component | rose/code-editor/field-editor', - function (hooks) { - setupRenderingTest(hooks); - const editorSelector = '[data-test-code-editor-field-editor]'; - - test('it renders', async function (assert) { - const codeValue = `export HCP_CLIENT_ID = {place your client_id here}`; - this.set('codeValue', codeValue); - await render(hbs` - - `); - assert.dom(editorSelector).isVisible(); - assert.dom(editorSelector).includesText(codeValue); - - const myNewCode = 'NEW CODE'; - await typeIn(`${editorSelector} textarea`, myNewCode); - assert.dom(editorSelector).includesText(myNewCode); - }); - - test('it renders readonly', async function (assert) { - const codeValue = `export HCP_CLIENT_ID = {place your client_id here}`; - this.set('codeValue', codeValue); - this.set('options', { - readOnly: true, - }); - await render(hbs` - - `); - assert.dom(editorSelector).isVisible(); - assert.dom(editorSelector).includesText(codeValue); - - const myNewCode = 'NEW CODE'; - waitUntil(async () => { - try { - // This should fail if the textarea is readonly - await typeIn(`${editorSelector} textarea`, myNewCode); - } catch { - return true; - } - }); - assert.dom(editorSelector).doesNotIncludeText(myNewCode); - }); - - test('it calls onInput on change', async function (assert) { - const codeValue = `export HCP_CLIENT_ID = {place your client_id here}`; - const onInput = () => { - this.set('called', true); - }; - this.set('codeValue', codeValue); - this.set('onInput', onInput); - await render(hbs` - - `); - assert.dom(editorSelector).isVisible(); - assert.dom(editorSelector).includesText(codeValue); - - const myNewCode = 'NEW CODE'; - await typeIn(`${editorSelector} textarea`, myNewCode); - assert.dom(editorSelector).includesText(myNewCode); - assert.true(this.called); - }); - }, -); diff --git a/addons/rose/tests/integration/components/rose/code-editor/toolbar-test.js b/addons/rose/tests/integration/components/rose/code-editor/toolbar-test.js deleted file mode 100644 index 921a8a1b0a..0000000000 --- a/addons/rose/tests/integration/components/rose/code-editor/toolbar-test.js +++ /dev/null @@ -1,60 +0,0 @@ -/** - * Copyright (c) HashiCorp, Inc. - * SPDX-License-Identifier: BUSL-1.1 - */ - -import { module, test } from 'qunit'; -import { setupRenderingTest } from 'ember-qunit'; -import { click, render } from '@ember/test-helpers'; -import { hbs } from 'ember-cli-htmlbars'; - -module('Integration | Component | rose/code-editor/toolbar', function (hooks) { - setupRenderingTest(hooks); - const toolbarSelector = '[data-test-code-editor-toolbar]'; - const copyButtonSelector = '[data-test-code-editor-toolbar-copy-button]'; - const menuDividerSelector = '[data-test-code-editor-toolbar-menu-divider]'; - - hooks.beforeEach(function () { - const copyText = 'copyText'; - this.set('copyText', copyText); - }); - - test('it renders', async function (assert) { - await render(hbs` - - `); - assert.dom(toolbarSelector).isVisible(); - assert.dom(copyButtonSelector).isVisible(); - assert.dom(menuDividerSelector).doesNotExist(); - }); - - test('it displays action', async function (assert) { - await render(hbs` - - <:action> -
Hello
- -
- `); - assert.dom(toolbarSelector).isVisible(); - assert.dom(copyButtonSelector).isVisible(); - assert.dom(menuDividerSelector).doesNotExist(); - assert.dom('[data-test-my-action]').isVisible(); - }); - - test('it calls onCopy callback', async function (assert) { - const onCopy = () => { - this.set('called', true); - }; - this.set('onCopy', onCopy); - await render(hbs` - - `); - assert.dom(toolbarSelector).isVisible(); - assert.dom(copyButtonSelector).isVisible(); - assert.dom(menuDividerSelector).doesNotExist(); - - await click(copyButtonSelector); - assert.true(this.called); - }); -}); From f86b2500bf45fde962c628597a8652a279eceb4c Mon Sep 17 00:00:00 2001 From: Zack Moore Date: Mon, 3 Feb 2025 15:38:51 -0500 Subject: [PATCH 02/17] =?UTF-8?q?chore:=20=F0=9F=A4=96=20Replace=20CodeMir?= =?UTF-8?q?ror5=20dep?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit remove CodeMirror5 and replace existing editors with HDS::CodeEditor --- addons/core/translations/form/en-us.yaml | 1 + ui/admin/.stylelintrc.js | 4 +-- .../form/field/json-secret/index.hbs | 19 ++++------- .../form/worker/create-worker-led/index.js | 33 ++----------------- .../worker-filter-generator/index.hbs | 21 ++++-------- ui/admin/app/styles/app.scss | 12 ------- .../credentials/update-test.js | 13 ++++---- 7 files changed, 27 insertions(+), 76 deletions(-) diff --git a/addons/core/translations/form/en-us.yaml b/addons/core/translations/form/en-us.yaml index 08fa5419d8..0e4c46ac70 100644 --- a/addons/core/translations/form/en-us.yaml +++ b/addons/core/translations/form/en-us.yaml @@ -176,6 +176,7 @@ sync-interval: tags: label: Tags secret-editor: + label: Secret Editor details: This secret is saved but won't be displayed edit: Click to replace this secret created: diff --git a/ui/admin/.stylelintrc.js b/ui/admin/.stylelintrc.js index 63460dc13a..609d387d3a 100644 --- a/ui/admin/.stylelintrc.js +++ b/ui/admin/.stylelintrc.js @@ -24,11 +24,11 @@ module.exports = { 'at-rule-no-vendor-prefix': null, // As a team we want to stick to using kebab-case as our selector class pattern, but there are a couple - // of exceptions in which we overrride CSS from addons like CodeMirror and HDS, in which they use + // of exceptions in which we overrride CSS from addons like HDS, in which they use // pascal case and a double-kebab-case. This regex checks for all of those 3 patterns and won't fail // lint check, but will fail if its any other pattern. 'selector-class-pattern': [ - '(^([a-z][a-z0-9]*)(-{1,2}[a-z0-9]+)*$)|(^CodeMirror)', + '(^([a-z][a-z0-9]*)(-{1,2}[a-z0-9]+)*$)', { message: (selector) => `Expected class selector "${selector}" to be kebab-case`, diff --git a/ui/admin/app/components/form/field/json-secret/index.hbs b/ui/admin/app/components/form/field/json-secret/index.hbs index 14af0e2a8f..293ad17101 100644 --- a/ui/admin/app/components/form/field/json-secret/index.hbs +++ b/ui/admin/app/components/form/field/json-secret/index.hbs @@ -20,17 +20,12 @@ /> {{else}} - - - + {{/if}}
\ No newline at end of file diff --git a/ui/admin/app/components/form/worker/create-worker-led/index.js b/ui/admin/app/components/form/worker/create-worker-led/index.js index 46558c3dea..d80f731e30 100644 --- a/ui/admin/app/components/form/worker/create-worker-led/index.js +++ b/ui/admin/app/components/form/worker/create-worker-led/index.js @@ -38,7 +38,7 @@ export default class FormWorkerCreateWorkerLedComponent extends Component { // =properties /** - * Returns directory creation text for ``. + * Returns directory creation text for ``. * @type {string} */ get createConfigText() { @@ -55,7 +55,7 @@ touch ${this.configFilePath || ''}/pki-worker.hcl`; } /** - * Returns config creation text for ``. The user will see + * Returns config creation text for ``. The user will see * different outputs based on if they are using `hcp` or `oss` binaries. * @type {string} */ @@ -108,7 +108,7 @@ ${listenerText} /** * Returns boundary installation command and start worker server command - * for ``. + * for ``. * @type {string} */ get installBoundaryText() { @@ -129,33 +129,6 @@ unzip *.zip ;\\ : ossContent; } - /** - * Returns `shell` configuration object for ``. - * @type {Object} - */ - get shellCodeEditor() { - return { - mode: 'shell', - readOnly: true, - lineNumbers: false, - cursorBlinkRate: -1, - styleActiveLine: false, - }; - } - - /** - * Returns `hcl` configuration object for ``. - * @type {Object} - */ - get hclCodeEditor() { - return { - mode: 'hcl', - readOnly: true, - cursorBlinkRate: -1, - styleActiveLine: false, - }; - } - //=methods convertCommaSeparatedValuesToArray(input) { diff --git a/ui/admin/app/components/worker-filter-generator/index.hbs b/ui/admin/app/components/worker-filter-generator/index.hbs index 761e697993..b74267ad20 100644 --- a/ui/admin/app/components/worker-filter-generator/index.hbs +++ b/ui/admin/app/components/worker-filter-generator/index.hbs @@ -5,20 +5,13 @@ - - {{#unless @hideToolbar}} - - {{/unless}} - - + {{#if (get @model.errors @name)}} diff --git a/ui/admin/app/styles/app.scss b/ui/admin/app/styles/app.scss index 4c66e097b0..c136ea9a1d 100644 --- a/ui/admin/app/styles/app.scss +++ b/ui/admin/app/styles/app.scss @@ -279,18 +279,6 @@ margin-bottom: sizing.rems(l); width: 100%; - .secret-editor-json { - .CodeMirror { - border-radius: sizing.rems(xxs); - height: var(--secret-editor-height); - display: block; - } - - .CodeMirror-gutters { - background: var(--secret-editor-gutter); - } - } - .secret-editor-skeleton-wrapper { // using ui-gray directly so it does not change when // user is in dark mode since the secret editor diff --git a/ui/admin/tests/acceptance/credential-store/credentials/update-test.js b/ui/admin/tests/acceptance/credential-store/credentials/update-test.js index 31f27727e2..e093a2f26d 100644 --- a/ui/admin/tests/acceptance/credential-store/credentials/update-test.js +++ b/ui/admin/tests/acceptance/credential-store/credentials/update-test.js @@ -566,12 +566,13 @@ module( await click(commonSelectors.EDIT_BTN); assert.strictEqual(currentURL(), urls.jsonCredential); - assert.dom(selectors.REPLACE_SECRET_BTN).isVisible(); - - await click(selectors.REPLACE_SECRET_BTN); - - assert.dom(selectors.REPLACE_SECRET_BTN).doesNotExist(); - await waitUntil(() => assert.dom('.CodeMirror').isVisible()); + assert.dom('.secret-editor-skeleton-message button').isVisible(); + await click( + '.secret-editor-skeleton-message button', + 'Enter editing mode', + ); + assert.dom('.secret-editor-skeleton-message button').doesNotExist(); + await waitUntil(() => assert.dom('.cm-editor').isVisible()); }); }, ); From 698c1bb9d1d7f3c678a70a1231e07cdb055036b2 Mon Sep 17 00:00:00 2001 From: Zack Moore Date: Mon, 3 Feb 2025 15:53:31 -0500 Subject: [PATCH 03/17] =?UTF-8?q?chore:=20=F0=9F=A4=96=20deleting=20old=20?= =?UTF-8?q?codeeditor=20styles?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../rose/code-editor/field-editor.js | 6 -- .../components/rose/code-editor/toolbar.js | 6 -- .../app/styles/rose/components/_index.scss | 25 ++++---- .../rose/components/code-editor/_index.scss | 59 ------------------- 4 files changed, 15 insertions(+), 81 deletions(-) delete mode 100644 addons/rose/app/components/rose/code-editor/field-editor.js delete mode 100644 addons/rose/app/components/rose/code-editor/toolbar.js delete mode 100644 addons/rose/app/styles/rose/components/code-editor/_index.scss diff --git a/addons/rose/app/components/rose/code-editor/field-editor.js b/addons/rose/app/components/rose/code-editor/field-editor.js deleted file mode 100644 index d82e45a813..0000000000 --- a/addons/rose/app/components/rose/code-editor/field-editor.js +++ /dev/null @@ -1,6 +0,0 @@ -/** - * Copyright (c) HashiCorp, Inc. - * SPDX-License-Identifier: BUSL-1.1 - */ - -export { default } from 'rose/components/rose/code-editor/field-editor'; diff --git a/addons/rose/app/components/rose/code-editor/toolbar.js b/addons/rose/app/components/rose/code-editor/toolbar.js deleted file mode 100644 index 55a6aa8b38..0000000000 --- a/addons/rose/app/components/rose/code-editor/toolbar.js +++ /dev/null @@ -1,6 +0,0 @@ -/** - * Copyright (c) HashiCorp, Inc. - * SPDX-License-Identifier: BUSL-1.1 - */ - -export { default } from 'rose/components/rose/code-editor/toolbar'; diff --git a/addons/rose/app/styles/rose/components/_index.scss b/addons/rose/app/styles/rose/components/_index.scss index 907c97f8cc..fcf4975cb1 100644 --- a/addons/rose/app/styles/rose/components/_index.scss +++ b/addons/rose/app/styles/rose/components/_index.scss @@ -5,13 +5,18 @@ // This list is sorted in ascending order to improve readability -@use 'code-editor'; -@use 'form'; -@use 'frame'; -@use 'header'; -@use 'layout'; -@use 'list'; -@use 'metadata-list'; -@use 'nav'; -@use 'page-header'; -@use 'toolbar'; +@import 'button'; +@import 'card'; +@import 'cards'; +@import 'dialog'; +@import 'dropdown'; +@import 'form'; +@import 'frame'; +@import 'header'; +@import 'icon'; +@import 'layout'; +@import 'list'; +@import 'metadata-list'; +@import 'nav'; +@import 'page-header'; +@import 'toolbar'; diff --git a/addons/rose/app/styles/rose/components/code-editor/_index.scss b/addons/rose/app/styles/rose/components/code-editor/_index.scss deleted file mode 100644 index a9bf84c419..0000000000 --- a/addons/rose/app/styles/rose/components/code-editor/_index.scss +++ /dev/null @@ -1,59 +0,0 @@ -/** - * Copyright (c) HashiCorp, Inc. - * SPDX-License-Identifier: BUSL-1.1 - */ - -/* stylelint-disable selector-class-pattern */ -@use '../../variables/sizing'; - -// Toolbar -.rose-code-editor-toolbar { - display: flex; - justify-content: space-between; - align-items: center; - border-bottom: 1px solid var(--ui-gray-subtler-3); - height: 2.75rem; - - &__action { - margin-left: sizing.rems(s); - } - - &__right-aligned { - display: flex; - height: 100%; - align-items: center; - } - - &__menu { - margin-right: sizing.rems(s); - - .pds-dropdownTrigger { - box-shadow: none; - - &__layoutWrapper { - padding-left: sizing.rems(s); - padding-right: sizing.rems(s); - } - } - - &-divider { - border-right: 1px solid var(--ui-gray-subtler-3); - height: sizing.rems(xl); - } - } - - &__copy-button { - border: none; - background-color: inherit; - cursor: pointer; - color: var(--ui-gray-starker-2); - margin-right: sizing.rems(xs); - margin-left: sizing.rems(s); - height: sizing.rems(xl); - white-space: nowrap; - - .hds-icon { - vertical-align: top; - } - } -} From 974185edf6139ac1e8dff277e263a9d3b5f4bb1d Mon Sep 17 00:00:00 2001 From: Zack Moore Date: Fri, 21 Mar 2025 18:10:33 -0400 Subject: [PATCH 04/17] =?UTF-8?q?feat:=20=F0=9F=8E=B8=20changing=20code=20?= =?UTF-8?q?editor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit changing code editor ✅ Closes: 0 --- ui/admin/app/components/form/field/json-secret/index.hbs | 1 + ui/admin/app/components/worker-filter-generator/index.hbs | 1 + 2 files changed, 2 insertions(+) diff --git a/ui/admin/app/components/form/field/json-secret/index.hbs b/ui/admin/app/components/form/field/json-secret/index.hbs index 293ad17101..f5e4b708b6 100644 --- a/ui/admin/app/components/form/field/json-secret/index.hbs +++ b/ui/admin/app/components/form/field/json-secret/index.hbs @@ -24,6 +24,7 @@ class='secret-editor-json' @ariaLabel={{t 'form.secret-editor.json'}} @value={{@value}} + @isLintingEnabled={{true}} @language='json' @onInput={{@onInput}} /> diff --git a/ui/admin/app/components/worker-filter-generator/index.hbs b/ui/admin/app/components/worker-filter-generator/index.hbs index b74267ad20..637a54f848 100644 --- a/ui/admin/app/components/worker-filter-generator/index.hbs +++ b/ui/admin/app/components/worker-filter-generator/index.hbs @@ -8,6 +8,7 @@ Date: Mon, 24 Mar 2025 14:44:34 -0400 Subject: [PATCH 05/17] removed unused export --- addons/rose/app/modifiers/code-mirror.js | 6 ------ 1 file changed, 6 deletions(-) delete mode 100644 addons/rose/app/modifiers/code-mirror.js diff --git a/addons/rose/app/modifiers/code-mirror.js b/addons/rose/app/modifiers/code-mirror.js deleted file mode 100644 index b55d3d4aca..0000000000 --- a/addons/rose/app/modifiers/code-mirror.js +++ /dev/null @@ -1,6 +0,0 @@ -/** - * Copyright (c) HashiCorp, Inc. - * SPDX-License-Identifier: BUSL-1.1 - */ - -export { default } from 'rose/modifiers/code-mirror'; From 1b9625ab793914acb9a117fe8501a89f2be52bde Mon Sep 17 00:00:00 2001 From: Zack Moore Date: Thu, 3 Apr 2025 13:25:50 -0400 Subject: [PATCH 06/17] pr cleanup --- .../app/components/form/worker/create-worker-led/index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ui/admin/app/components/form/worker/create-worker-led/index.js b/ui/admin/app/components/form/worker/create-worker-led/index.js index d80f731e30..5135575467 100644 --- a/ui/admin/app/components/form/worker/create-worker-led/index.js +++ b/ui/admin/app/components/form/worker/create-worker-led/index.js @@ -38,7 +38,7 @@ export default class FormWorkerCreateWorkerLedComponent extends Component { // =properties /** - * Returns directory creation text for ``. + * Returns directory creation text for ``. * @type {string} */ get createConfigText() { @@ -55,7 +55,7 @@ touch ${this.configFilePath || ''}/pki-worker.hcl`; } /** - * Returns config creation text for ``. The user will see + * Returns config creation text for ``. The user will see * different outputs based on if they are using `hcp` or `oss` binaries. * @type {string} */ @@ -108,7 +108,7 @@ ${listenerText} /** * Returns boundary installation command and start worker server command - * for ``. + * for ``. * @type {string} */ get installBoundaryText() { From 87af911bf6a830913dde4bbbc343cbf37c029410 Mon Sep 17 00:00:00 2001 From: Zack Moore Date: Thu, 3 Apr 2025 15:29:32 -0400 Subject: [PATCH 07/17] updating tests for new code editor --- .../credential-store/create-test.js | 24 +++- .../credentials/create-test.js | 22 ++- .../acceptance/credential-store/selectors.js | 2 + .../credential-store/update-test.js | 21 ++- .../acceptance/storage-buckets/create-test.js | 110 ++++++++++----- .../acceptance/storage-buckets/selectors.js | 2 + .../acceptance/storage-buckets/update-test.js | 16 ++- .../create-storage-bucket-test.js | 45 +++++- .../tests/acceptance/targets/workers-test.js | 130 +++++++++++++----- .../components/form/field/json-secret-test.js | 8 +- .../worker-filter-generator/index-test.js | 13 +- 11 files changed, 300 insertions(+), 93 deletions(-) diff --git a/ui/admin/tests/acceptance/credential-store/create-test.js b/ui/admin/tests/acceptance/credential-store/create-test.js index b8dbe5e1f3..fdf6852f01 100644 --- a/ui/admin/tests/acceptance/credential-store/create-test.js +++ b/ui/admin/tests/acceptance/credential-store/create-test.js @@ -4,7 +4,14 @@ */ import { module, test } from 'qunit'; -import { visit, currentURL, click, fillIn } from '@ember/test-helpers'; +import { + visit, + currentURL, + click, + fillIn, + find, + waitFor, +} from '@ember/test-helpers'; import { setupApplicationTest } from 'admin/tests/helpers'; import setupMirage from 'ember-cli-mirage/test-support/setup-mirage'; import { setupIndexedDb } from 'api/test-support/helpers/indexed-db'; @@ -97,10 +104,17 @@ module('Acceptance | credential-stores | create', function (hooks) { await fillIn(commonSelectors.FIELD_NAME, commonSelectors.FIELD_NAME_VALUE); await click(selectors.TYPE_VAULT); - await fillIn( - commonSelectors.CODE_EDITOR_CONTENT, - selectors.EDITOR_WORKER_FILTER_VALUE, - ); + await waitFor(selectors.CODE_EDITOR_CM_LOADED); + + const editorElement = find(selectors.CODE_EDITOR_BODY); + const editorView = editorElement.editor; + editorView.dispatch({ + changes: { + from: editorView.state.selection.main.from, + insert: selectors.EDITOR_WORKER_FILTER_VALUE, + }, + }); + await click(commonSelectors.SAVE_BTN); assert.dom(selectors.CODE_BLOCK_BODY).doesNotExist(); diff --git a/ui/admin/tests/acceptance/credential-store/credentials/create-test.js b/ui/admin/tests/acceptance/credential-store/credentials/create-test.js index 62dae4d433..1f3da77fc5 100644 --- a/ui/admin/tests/acceptance/credential-store/credentials/create-test.js +++ b/ui/admin/tests/acceptance/credential-store/credentials/create-test.js @@ -4,7 +4,14 @@ */ import { module, test } from 'qunit'; -import { visit, currentURL, click, fillIn } from '@ember/test-helpers'; +import { + visit, + currentURL, + click, + fillIn, + find, + waitFor, +} from '@ember/test-helpers'; import { setupApplicationTest } from 'admin/tests/helpers'; import setupMirage from 'ember-cli-mirage/test-support/setup-mirage'; import { setupIndexedDb } from 'api/test-support/helpers/indexed-db'; @@ -191,12 +198,23 @@ module( test('users can switch away from JSON type credentials and the json_object value will be cleared', async function (assert) { featuresService.enable('json-credentials'); + const editorSelector = '.cm-content'; + const newSecret = '{"test": "value"}'; await visit(urls.credentials); await click(commonSelectors.HREF(urls.newCredential)); await click(selectors.FIELD_TYPE_JSON); - await fillIn(selectors.FIELD_EDITOR, selectors.FIELD_EDITOR_VALUE); + await waitFor('.cm-editor'); + + const editorElement = find('.hds-code-editor__editor'); + const editorView = editorElement.editor; + editorView.dispatch({ + changes: { + from: editorView.state.selection.main.from, + insert: selectors.FIELD_EDITOR_VALUE, + }, + }); assert.dom(selectors.EDITOR).includesText(selectors.FIELD_EDITOR_VALUE); await click(selectors.FIELD_TYPE_USERNAME_PASSWORD); diff --git a/ui/admin/tests/acceptance/credential-store/selectors.js b/ui/admin/tests/acceptance/credential-store/selectors.js index 73d2f7d7d6..51e3c55d71 100644 --- a/ui/admin/tests/acceptance/credential-store/selectors.js +++ b/ui/admin/tests/acceptance/credential-store/selectors.js @@ -16,6 +16,8 @@ export const DELETE_ACTION = // Search filtering selectors export const NO_RESULTS_MSG = '[data-test-no-credential-store-results]'; +export const CODE_EDITOR_CM_LOADED = '.cm-editor'; +export const CODE_EDITOR_BODY = '.hds-code-editor__editor'; export const CODE_BLOCK_BODY = '.hds-code-block__code'; export const EDITOR_WORKER_FILTER_VALUE = '"dev" in "/tags/env"'; diff --git a/ui/admin/tests/acceptance/credential-store/update-test.js b/ui/admin/tests/acceptance/credential-store/update-test.js index 93091815c4..27c8eab75a 100644 --- a/ui/admin/tests/acceptance/credential-store/update-test.js +++ b/ui/admin/tests/acceptance/credential-store/update-test.js @@ -4,7 +4,14 @@ */ import { module, test } from 'qunit'; -import { visit, currentURL, click, fillIn } from '@ember/test-helpers'; +import { + visit, + currentURL, + click, + fillIn, + find, + waitFor, +} from '@ember/test-helpers'; import { setupApplicationTest } from 'admin/tests/helpers'; import setupMirage from 'ember-cli-mirage/test-support/setup-mirage'; import { setupIndexedDb } from 'api/test-support/helpers/indexed-db'; @@ -381,7 +388,17 @@ module('Acceptance | credential-stores | update', function (hooks) { await click(commonSelectors.HREF(urls.workerFilter)); await click(selectors.MANAGE_DROPDOWN); await click(selectors.EDIT_WORKER_FILTER_ACTION); - await fillIn(commonSelectors.CODE_EDITOR_CONTENT, '"bar" in "/tags/foo"'); + await waitFor(selectors.CODE_EDITOR_CM_LOADED); + + const editorElement = find(selectors.CODE_EDITOR_BODY); + const editorView = editorElement.editor; + editorView.dispatch({ + changes: { + from: editorView.state.selection.main.from, + insert: '"bar" in "/tags/foo"', + }, + }); + await click(commonSelectors.SAVE_BTN); assert.dom(selectors.CODE_BLOCK_BODY).exists(); diff --git a/ui/admin/tests/acceptance/storage-buckets/create-test.js b/ui/admin/tests/acceptance/storage-buckets/create-test.js index 28d455d4c5..1bf9a6b3c7 100644 --- a/ui/admin/tests/acceptance/storage-buckets/create-test.js +++ b/ui/admin/tests/acceptance/storage-buckets/create-test.js @@ -4,7 +4,15 @@ */ import { module, test } from 'qunit'; -import { visit, currentURL, click, fillIn, select } from '@ember/test-helpers'; +import { + visit, + currentURL, + click, + fillIn, + select, + find, + waitFor, +} from '@ember/test-helpers'; import { setupApplicationTest } from 'admin/tests/helpers'; import setupMirage from 'ember-cli-mirage/test-support/setup-mirage'; import { Response } from 'miragejs'; @@ -56,11 +64,16 @@ module('Acceptance | storage-buckets | create', function (hooks) { await click(`[href="${urls.newStorageBucket}"]`); await fillIn(commonSelectors.FIELD_NAME, commonSelectors.FIELD_NAME_VALUE); await select(selectors.FIELD_SCOPE, 'global'); - - await fillIn( - commonSelectors.CODE_EDITOR_CONTENT, - selectors.EDITOR_WORKER_FILTER_VALUE, - ); + await waitFor(selectors.CODE_EDITOR_CM_LOADED); + + const editorElement = find(selectors.EDITOR_WORKER_FILTER); + const editorView = editorElement.editor; + editorView.dispatch({ + changes: { + from: editorView.state.selection.main.from, + insert: selectors.EDITOR_WORKER_FILTER_VALUE, + }, + }); assert.dom(selectors.FIELD_BUCKET_NAME).isNotDisabled(); assert.dom(selectors.FIELD_BUCKET_PREFIX).isNotDisabled(); @@ -87,11 +100,16 @@ module('Acceptance | storage-buckets | create', function (hooks) { await click(`[href="${urls.newStorageBucket}"]`); await fillIn(commonSelectors.FIELD_NAME, commonSelectors.FIELD_NAME_VALUE); await select(selectors.FIELD_SCOPE, instances.scopes.org.id); - - await fillIn( - commonSelectors.CODE_EDITOR_CONTENT, - selectors.EDITOR_WORKER_FILTER_VALUE, - ); + await waitFor(selectors.CODE_EDITOR_CM_LOADED); + + const editorElement = find(selectors.EDITOR_WORKER_FILTER); + const editorView = editorElement.editor; + editorView.dispatch({ + changes: { + from: editorView.state.selection.main.from, + insert: selectors.EDITOR_WORKER_FILTER_VALUE, + }, + }); assert.dom(selectors.FIELD_BUCKET_NAME).isNotDisabled(); assert.dom(selectors.FIELD_BUCKET_PREFIX).isNotDisabled(); @@ -132,10 +150,16 @@ module('Acceptance | storage-buckets | create', function (hooks) { ); await fillIn(selectors.FIELD_ACCESS_KEY, selectors.FIELD_ACCESS_KEY_VALUE); await fillIn(selectors.FIELD_SECRET_KEY, selectors.FIELD_SECRET_KEY_VALUE); - await fillIn( - commonSelectors.CODE_EDITOR_CONTENT, - selectors.EDITOR_WORKER_FILTER_VALUE, - ); + await waitFor(selectors.CODE_EDITOR_CM_LOADED); + + const editorElement = find(selectors.EDITOR_WORKER_FILTER); + const editorView = editorElement.editor; + editorView.dispatch({ + changes: { + from: editorView.state.selection.main.from, + insert: selectors.EDITOR_WORKER_FILTER_VALUE, + }, + }); await click(commonSelectors.SAVE_BTN); @@ -169,10 +193,16 @@ module('Acceptance | storage-buckets | create', function (hooks) { await click(selectors.FIELD_DYNAMIC_CREDENTIAL); await fillIn(selectors.FIELD_ROLE_ARN, selectors.FIELD_ROLE_ARN_VALUE); - await fillIn( - commonSelectors.CODE_EDITOR_CONTENT, - selectors.EDITOR_WORKER_FILTER_VALUE, - ); + await waitFor(selectors.CODE_EDITOR_CM_LOADED); + + const editorElement = find(selectors.EDITOR_WORKER_FILTER); + const editorView = editorElement.editor; + editorView.dispatch({ + changes: { + from: editorView.state.selection.main.from, + insert: selectors.EDITOR_WORKER_FILTER_VALUE, + }, + }); await click(commonSelectors.SAVE_BTN); const storageBucket = this.server.schema.storageBuckets.findBy({ @@ -196,10 +226,16 @@ module('Acceptance | storage-buckets | create', function (hooks) { await click(selectors.FIELD_STATIC_CREDENTIAL); await fillIn(selectors.FIELD_ACCESS_KEY, selectors.FIELD_ACCESS_KEY_VALUE); await fillIn(selectors.FIELD_SECRET_KEY, selectors.FIELD_SECRET_KEY_VALUE); - await fillIn( - commonSelectors.CODE_EDITOR_CONTENT, - selectors.EDITOR_WORKER_FILTER_VALUE, - ); + await waitFor(selectors.CODE_EDITOR_CM_LOADED); + + const editorElement = find(selectors.EDITOR_WORKER_FILTER); + const editorView = editorElement.editor; + editorView.dispatch({ + changes: { + from: editorView.state.selection.main.from, + insert: selectors.EDITOR_WORKER_FILTER_VALUE, + }, + }); await click(commonSelectors.SAVE_BTN); @@ -233,10 +269,16 @@ module('Acceptance | storage-buckets | create', function (hooks) { ); await fillIn(selectors.FIELD_ACCESS_KEY, selectors.FIELD_ACCESS_KEY_VALUE); await fillIn(selectors.FIELD_SECRET_KEY, selectors.FIELD_SECRET_KEY_VALUE); - await fillIn( - commonSelectors.CODE_EDITOR_CONTENT, - selectors.EDITOR_WORKER_FILTER_VALUE, - ); + await waitFor(selectors.CODE_EDITOR_CM_LOADED); + + const editorElement = find(selectors.EDITOR_WORKER_FILTER); + const editorView = editorElement.editor; + editorView.dispatch({ + changes: { + from: editorView.state.selection.main.from, + insert: selectors.EDITOR_WORKER_FILTER_VALUE, + }, + }); await click(commonSelectors.SAVE_BTN); @@ -293,10 +335,16 @@ module('Acceptance | storage-buckets | create', function (hooks) { await visit(urls.storageBuckets); await click(`[href="${urls.newStorageBucket}"]`); - await fillIn( - commonSelectors.CODE_EDITOR_CONTENT, - selectors.EDITOR_WORKER_FILTER_VALUE, - ); + await waitFor(selectors.CODE_EDITOR_CM_LOADED); + + const editorElement = find(selectors.EDITOR_WORKER_FILTER); + const editorView = editorElement.editor; + editorView.dispatch({ + changes: { + from: editorView.state.selection.main.from, + insert: selectors.EDITOR_WORKER_FILTER_VALUE, + }, + }); await click(commonSelectors.SAVE_BTN); assert diff --git a/ui/admin/tests/acceptance/storage-buckets/selectors.js b/ui/admin/tests/acceptance/storage-buckets/selectors.js index d98d219c94..f59dec0a3b 100644 --- a/ui/admin/tests/acceptance/storage-buckets/selectors.js +++ b/ui/admin/tests/acceptance/storage-buckets/selectors.js @@ -30,6 +30,8 @@ export const FIELD_SECRET_KEY_EDIT_BTN = export const FIELD_WORKER_FILTER = '[name=worker_filter]'; export const FIELD_WORKER_FILTER_ERROR = '[data-test-worker-filter-error]'; export const READONLY_WORKER_FILTER = '[data-test-worker-filter]'; +export const CODE_EDITOR_CM_LOADED = '.cm-editor'; +export const EDITOR_WORKER_FILTER = '.hds-code-editor__editor'; export const EDITOR_WORKER_FILTER_VALUE = '"dev" in "/tags/env"'; export const TOAST = '[role=alert] div'; export const TOAST_SUCCESSFUL_VALUE = 'Saved successfully.'; diff --git a/ui/admin/tests/acceptance/storage-buckets/update-test.js b/ui/admin/tests/acceptance/storage-buckets/update-test.js index 8621ceacd2..af0a96f343 100644 --- a/ui/admin/tests/acceptance/storage-buckets/update-test.js +++ b/ui/admin/tests/acceptance/storage-buckets/update-test.js @@ -4,7 +4,7 @@ */ import { module, test } from 'qunit'; -import { visit, click, fillIn } from '@ember/test-helpers'; +import { visit, click, fillIn, find, waitFor } from '@ember/test-helpers'; import { setupApplicationTest } from 'admin/tests/helpers'; import setupMirage from 'ember-cli-mirage/test-support/setup-mirage'; import { Response } from 'miragejs'; @@ -165,10 +165,16 @@ module('Acceptance | storage-buckets | update', function (hooks) { await click(`[href="${urls.storageBucket}"]`); await click(commonSelectors.EDIT_BTN, 'Activate edit mode'); - await fillIn( - commonSelectors.CODE_EDITOR_CONTENT, - selectors.EDITOR_WORKER_FILTER_VALUE, - ); + await waitFor(selectors.CODE_EDITOR_CM_LOADED); + + const editorElement = find(selectors.EDITOR_WORKER_FILTER); + const editorView = editorElement.editor; + editorView.dispatch({ + changes: { + from: editorView.state.selection.main.from, + insert: selectors.EDITOR_WORKER_FILTER_VALUE, + }, + }); await click(commonSelectors.SAVE_BTN); assert diff --git a/ui/admin/tests/acceptance/targets/enable-session-recording/create-storage-bucket-test.js b/ui/admin/tests/acceptance/targets/enable-session-recording/create-storage-bucket-test.js index 5ba8f12766..fbf9f8eb0b 100644 --- a/ui/admin/tests/acceptance/targets/enable-session-recording/create-storage-bucket-test.js +++ b/ui/admin/tests/acceptance/targets/enable-session-recording/create-storage-bucket-test.js @@ -4,7 +4,14 @@ */ import { module, test } from 'qunit'; -import { visit, currentURL, click, fillIn } from '@ember/test-helpers'; +import { + visit, + currentURL, + click, + fillIn, + find, + waitFor, +} from '@ember/test-helpers'; import { setupApplicationTest } from 'admin/tests/helpers'; import setupMirage from 'ember-cli-mirage/test-support/setup-mirage'; import { Response } from 'miragejs'; @@ -23,9 +30,10 @@ module( const FIELD_BUCKET_NAME = '[name="bucket_name"]'; const FIELD_BUCKET_PREFIX = '[name="bucket_prefix"]'; - const FIELD_EDITOR = '[data-test-code-editor-field-editor] textarea'; const WORKER_FILTER_VALUE = '"dev" in "/tags/env"'; const FIELD_SCOPE = (scope) => `[value="${scope}"]`; + const EDITOR_WORKER_FILTER_CM_LOADED = '.cm-editor'; + const EDITOR_WORKER_FILTER = '.hds-code-editor__editor'; const instances = { scopes: { @@ -79,7 +87,16 @@ module( commonSelectors.FIELD_NAME_VALUE, ); await click(FIELD_SCOPE('global')); - await fillIn(FIELD_EDITOR, WORKER_FILTER_VALUE); + await waitFor(EDITOR_WORKER_FILTER_CM_LOADED); + + const editorElement = find(EDITOR_WORKER_FILTER); + const editorView = editorElement.editor; + editorView.dispatch({ + changes: { + from: editorView.state.selection.main.from, + insert: WORKER_FILTER_VALUE, + }, + }); assert.dom(FIELD_BUCKET_NAME).isNotDisabled(); assert.dom(FIELD_BUCKET_PREFIX).isNotDisabled(); @@ -106,7 +123,16 @@ module( commonSelectors.FIELD_NAME_VALUE, ); await click(FIELD_SCOPE(instances.scopes.org.scope.id)); - await fillIn(FIELD_EDITOR, WORKER_FILTER_VALUE); + await waitFor(EDITOR_WORKER_FILTER_CM_LOADED); + + const editorElement = find(EDITOR_WORKER_FILTER); + const editorView = editorElement.editor; + editorView.dispatch({ + changes: { + from: editorView.state.selection.main.from, + insert: WORKER_FILTER_VALUE, + }, + }); assert.dom(FIELD_BUCKET_NAME).isNotDisabled(); assert.dom(FIELD_BUCKET_PREFIX).isNotDisabled(); @@ -163,7 +189,16 @@ module( await visit(urls.enableSessionRecording); await click(commonSelectors.HREF(urls.newStorageBucket)); - await fillIn(FIELD_EDITOR, WORKER_FILTER_VALUE); + await waitFor(EDITOR_WORKER_FILTER_CM_LOADED); + + const editorElement = find(EDITOR_WORKER_FILTER); + const editorView = editorElement.editor; + editorView.dispatch({ + changes: { + from: editorView.state.selection.main.from, + insert: WORKER_FILTER_VALUE, + }, + }); await click(commonSelectors.SAVE_BTN); assert.dom(commonSelectors.ALERT_TOAST_BODY).hasText(errorMessage); diff --git a/ui/admin/tests/acceptance/targets/workers-test.js b/ui/admin/tests/acceptance/targets/workers-test.js index 827edc2436..ef39314315 100644 --- a/ui/admin/tests/acceptance/targets/workers-test.js +++ b/ui/admin/tests/acceptance/targets/workers-test.js @@ -4,7 +4,7 @@ */ import { module, test } from 'qunit'; -import { visit, currentURL, click, fillIn } from '@ember/test-helpers'; +import { visit, currentURL, click, find, waitFor } from '@ember/test-helpers'; import { setupApplicationTest } from 'admin/tests/helpers'; import setupMirage from 'ember-cli-mirage/test-support/setup-mirage'; import a11yAudit from 'ember-a11y-testing/test-support/audit'; @@ -20,8 +20,21 @@ module('Acceptance | targets | workers', function (hooks) { let featuresService; let featureEdition; +<<<<<<< HEAD const EGRESS_WORKER_FILTER_VALUE = '"egress" in "/worker/filters"'; const INGRESS_WORKER_FILTER_VALUE = '"ingress" in "/worker/filters"'; +======= + const ACCORDION_DROPDOWN_TEXT_SELECTOR = (name) => + `[data-test-target-${name}-workers-accordion-item] a`; + const ACCORDION_DROPDOWN_SELECTOR = (name) => + `[data-test-target-${name}-workers-accordion-item] .hds-accordion-item__button`; + const CODE_BLOCK_SELECTOR = (name) => + `[data-test-target-${name}-workers-accordion-item] .hds-code-block__body`; + const CODE_EDITOR_CM_LOADED = '.cm-editor'; + const CODE_EDITOR_CONTENT_SELECTOR = '.hds-code-editor__editor'; + const SAVE_BUTTON_SELECTOR = '[type="submit"]'; + const CANCEL_BUTTON_SELECTOR = '.rose-form-actions [type="button"]'; +>>>>>>> ed0916f8c (updating tests for new code editor) const instances = { scopes: { @@ -187,11 +200,17 @@ module('Acceptance | targets | workers', function (hooks) { await click(commonSelectors.HREF(urls.targetEditIngressFilter)); assert.strictEqual(currentURL(), urls.targetEditIngressFilter); + await waitFor(CODE_EDITOR_CM_LOADED); + + const editorElement = find(CODE_EDITOR_CONTENT_SELECTOR); + const editorView = editorElement.editor; + editorView.dispatch({ + changes: { + from: editorView.state.selection.main.from, + insert: INGRESS_WORKER_FILTER_VALUE, + }, + }); - await fillIn( - commonSelectors.CODE_EDITOR_CONTENT, - INGRESS_WORKER_FILTER_VALUE, - ); await click(commonSelectors.SAVE_BTN); assert.strictEqual(currentURL(), urls.targetWorkers); @@ -208,11 +227,17 @@ module('Acceptance | targets | workers', function (hooks) { await click(commonSelectors.HREF(urls.targetEditIngressFilter)); assert.strictEqual(currentURL(), urls.targetEditIngressFilter); + await waitFor(CODE_EDITOR_CM_LOADED); + + const editorElement = find(CODE_EDITOR_CONTENT_SELECTOR); + const editorView = editorElement.editor; + editorView.dispatch({ + changes: { + from: editorView.state.selection.main.from, + insert: INGRESS_WORKER_FILTER_VALUE, + }, + }); - await fillIn( - commonSelectors.CODE_EDITOR_CONTENT, - INGRESS_WORKER_FILTER_VALUE, - ); await click(commonSelectors.CANCEL_BTN); assert.strictEqual(currentURL(), urls.targetWorkers); @@ -234,10 +259,17 @@ module('Acceptance | targets | workers', function (hooks) { assert.strictEqual(currentURL(), urls.targetEditEgressFilter); - await fillIn( - commonSelectors.CODE_EDITOR_CONTENT, - EGRESS_WORKER_FILTER_VALUE, - ); + await waitFor(CODE_EDITOR_CM_LOADED); + + const editorElement = find(CODE_EDITOR_CONTENT_SELECTOR); + const editorView = editorElement.editor; + editorView.dispatch({ + changes: { + from: editorView.state.selection.main.from, + insert: EGRESS_WORKER_FILTER_VALUE, + }, + }); + await click(commonSelectors.SAVE_BTN); assert.strictEqual(currentURL(), urls.targetWorkers); @@ -285,11 +317,17 @@ module('Acceptance | targets | workers', function (hooks) { await click(commonSelectors.HREF(urls.targetEditEgressFilter)); assert.strictEqual(currentURL(), urls.targetEditEgressFilter); + await waitFor(CODE_EDITOR_CM_LOADED); + + const editorElement = find(CODE_EDITOR_CONTENT_SELECTOR); + const editorView = editorElement.editor; + editorView.dispatch({ + changes: { + from: editorView.state.selection.main.from, + insert: EGRESS_WORKER_FILTER_VALUE, + }, + }); - await fillIn( - commonSelectors.CODE_EDITOR_CONTENT, - EGRESS_WORKER_FILTER_VALUE, - ); await click(commonSelectors.CANCEL_BTN); assert.strictEqual(currentURL(), urls.targetWorkers); @@ -312,10 +350,16 @@ module('Acceptance | targets | workers', function (hooks) { await click(commonSelectors.HREF(urls.targetEditIngressFilter)); assert.strictEqual(currentURL(), urls.targetEditIngressFilter); - await fillIn( - commonSelectors.CODE_EDITOR_CONTENT, - INGRESS_WORKER_FILTER_VALUE, - ); + await waitFor(CODE_EDITOR_CM_LOADED); + + const editorElement = find(CODE_EDITOR_CONTENT_SELECTOR); + const editorView = editorElement.editor; + editorView.dispatch({ + changes: { + from: editorView.state.selection.main.from, + insert: INGRESS_WORKER_FILTER_VALUE, + }, + }); await click(commonSelectors.HREF(urls.target)); assert.dom(commonSelectors.MODAL_WARNING).isVisible(); @@ -339,10 +383,17 @@ module('Acceptance | targets | workers', function (hooks) { await click(commonSelectors.HREF(urls.targetEditIngressFilter)); assert.strictEqual(currentURL(), urls.targetEditIngressFilter); - await fillIn( - commonSelectors.CODE_EDITOR_CONTENT, - INGRESS_WORKER_FILTER_VALUE, - ); + await waitFor(CODE_EDITOR_CM_LOADED); + + const editorElement = find(CODE_EDITOR_CONTENT_SELECTOR); + const editorView = editorElement.editor; + editorView.dispatch({ + changes: { + from: editorView.state.selection.main.from, + insert: ingressWorkerFilter, + }, + }); + await click(commonSelectors.HREF(urls.target)); assert.dom(commonSelectors.MODAL_WARNING).isVisible(); @@ -365,10 +416,17 @@ module('Acceptance | targets | workers', function (hooks) { await click(commonSelectors.HREF(urls.targetEditEgressFilter)); assert.strictEqual(currentURL(), urls.targetEditEgressFilter); - await fillIn( - commonSelectors.CODE_EDITOR_CONTENT, - EGRESS_WORKER_FILTER_VALUE, - ); + await waitFor(CODE_EDITOR_CM_LOADED); + + const editorElement = find(CODE_EDITOR_CONTENT_SELECTOR); + const editorView = editorElement.editor; + editorView.dispatch({ + changes: { + from: editorView.state.selection.main.from, + insert: EGRESS_WORKER_FILTER_VALUE, + }, + }); + await click(commonSelectors.HREF(urls.target)); assert.dom(commonSelectors.MODAL_WARNING).isVisible(); @@ -391,11 +449,17 @@ module('Acceptance | targets | workers', function (hooks) { await click(commonSelectors.HREF(urls.targetEditEgressFilter)); assert.strictEqual(currentURL(), urls.targetEditEgressFilter); + await waitFor(CODE_EDITOR_CM_LOADED); + + const editorElement = find(CODE_EDITOR_CONTENT_SELECTOR); + const editorView = editorElement.editor; + editorView.dispatch({ + changes: { + from: editorView.state.selection.main.from, + insert: EGRESS_WORKER_FILTER_VALUE, + }, + }); - await fillIn( - commonSelectors.CODE_EDITOR_CONTENT, - EGRESS_WORKER_FILTER_VALUE, - ); await click(commonSelectors.HREF(urls.target)); assert.dom(commonSelectors.MODAL_WARNING).isVisible(); diff --git a/ui/admin/tests/integration/components/form/field/json-secret-test.js b/ui/admin/tests/integration/components/form/field/json-secret-test.js index 806536006d..21da1eca23 100644 --- a/ui/admin/tests/integration/components/form/field/json-secret-test.js +++ b/ui/admin/tests/integration/components/form/field/json-secret-test.js @@ -5,7 +5,7 @@ import { module, test } from 'qunit'; import { setupRenderingTest } from 'ember-qunit'; -import { render, click } from '@ember/test-helpers'; +import { render, click, waitFor } from '@ember/test-helpers'; import { hbs } from 'ember-cli-htmlbars'; import { setupIntl } from 'ember-intl/test-support'; @@ -30,9 +30,9 @@ module('Integration | Component | form/field/json-secret', function (hooks) { assert.dom('.secret-editor').isVisible(); assert.dom('.secret-editor-json').isVisible(); - assert - .dom('.secret-editor-json .CodeMirror-line') - .hasText(this.model.json_object); + + await waitFor('.cm-editor'); + assert.dom('.cm-content').hasText(this.model.json_object); }); test('it renders the disabled editor', async function (assert) { diff --git a/ui/admin/tests/integration/components/worker-filter-generator/index-test.js b/ui/admin/tests/integration/components/worker-filter-generator/index-test.js index 21d40cb930..8037ec2e2f 100644 --- a/ui/admin/tests/integration/components/worker-filter-generator/index-test.js +++ b/ui/admin/tests/integration/components/worker-filter-generator/index-test.js @@ -5,7 +5,7 @@ import { module, test } from 'qunit'; import { setupRenderingTest } from 'ember-qunit'; -import { render, click, fillIn, select } from '@ember/test-helpers'; +import { render, click, fillIn, select, waitFor } from '@ember/test-helpers'; import { hbs } from 'ember-cli-htmlbars'; import { setupIntl } from 'ember-intl/test-support'; @@ -15,9 +15,8 @@ module( setupRenderingTest(hooks); setupIntl(hooks, 'en-us'); - const CODE_EDITOR = '[data-test-code-editor-field-editor]'; - const CODE_EDITOR_LINE = - '[data-test-code-editor-field-editor] .CodeMirror-line'; + const CODE_EDITOR = '.hds-code-editor__editor'; + const CODE_EDITOR_CONTENT = '.cm-content'; const FILTER_GENERATOR = '[name="filter_generator"]'; const SHOW_FILTER_GENERATOR = '[name="show_filter_generator"]'; const TAG_TYPE_OPTION = '[value="tag"]'; @@ -32,9 +31,10 @@ module( await render( hbs``, ); + await waitFor('.cm-editor'); assert.dom(CODE_EDITOR).isVisible(); - assert.dom(CODE_EDITOR_LINE).hasText(this.model.egress_worker_filter); + assert.dom(CODE_EDITOR_CONTENT).hasText(this.model.egress_worker_filter); }); test('it renders correct content when ingress_worker_filter is passed in', async function (assert) { @@ -42,9 +42,10 @@ module( await render( hbs``, ); + await waitFor('.cm-editor'); assert.dom(CODE_EDITOR).isVisible(); - assert.dom(CODE_EDITOR_LINE).hasText(this.model.ingress_worker_filter); + assert.dom(CODE_EDITOR_CONTENT).hasText(this.model.ingress_worker_filter); }); test('toggleFilterGenerator shows filter generator when toggled on', async function (assert) { From 6b66a8b5267787dee9a4bde622881d9297a25ca9 Mon Sep 17 00:00:00 2001 From: Zack Moore Date: Fri, 25 Apr 2025 16:07:32 -0400 Subject: [PATCH 08/17] responding to PR feedback --- addons/rose/package.json | 2 +- .../form/field/json-secret/index.hbs | 2 +- .../worker-filter-generator/index.hbs | 5 ++--- ui/admin/app/styles/app.scss | 5 +++++ .../tests/acceptance/targets/workers-test.js | 18 +++++++++--------- 5 files changed, 18 insertions(+), 14 deletions(-) diff --git a/addons/rose/package.json b/addons/rose/package.json index 70f6167bf4..69642c8439 100644 --- a/addons/rose/package.json +++ b/addons/rose/package.json @@ -116,4 +116,4 @@ ], "*.{mdx,yaml}": "prettier --write" } -} +} \ No newline at end of file diff --git a/ui/admin/app/components/form/field/json-secret/index.hbs b/ui/admin/app/components/form/field/json-secret/index.hbs index f5e4b708b6..3615389cc5 100644 --- a/ui/admin/app/components/form/field/json-secret/index.hbs +++ b/ui/admin/app/components/form/field/json-secret/index.hbs @@ -22,7 +22,7 @@ {{else}} `[data-test-target-${name}-workers-accordion-item] .hds-code-block__body`; - const CODE_EDITOR_CM_LOADED = '.cm-editor'; + const CODE_EDITOR_CM = '.cm-editor'; const CODE_EDITOR_CONTENT_SELECTOR = '.hds-code-editor__editor'; const SAVE_BUTTON_SELECTOR = '[type="submit"]'; const CANCEL_BUTTON_SELECTOR = '.rose-form-actions [type="button"]'; @@ -200,7 +200,7 @@ module('Acceptance | targets | workers', function (hooks) { await click(commonSelectors.HREF(urls.targetEditIngressFilter)); assert.strictEqual(currentURL(), urls.targetEditIngressFilter); - await waitFor(CODE_EDITOR_CM_LOADED); + await waitFor(CODE_EDITOR_CM); const editorElement = find(CODE_EDITOR_CONTENT_SELECTOR); const editorView = editorElement.editor; @@ -227,7 +227,7 @@ module('Acceptance | targets | workers', function (hooks) { await click(commonSelectors.HREF(urls.targetEditIngressFilter)); assert.strictEqual(currentURL(), urls.targetEditIngressFilter); - await waitFor(CODE_EDITOR_CM_LOADED); + await waitFor(CODE_EDITOR_CM); const editorElement = find(CODE_EDITOR_CONTENT_SELECTOR); const editorView = editorElement.editor; @@ -259,7 +259,7 @@ module('Acceptance | targets | workers', function (hooks) { assert.strictEqual(currentURL(), urls.targetEditEgressFilter); - await waitFor(CODE_EDITOR_CM_LOADED); + await waitFor(CODE_EDITOR_CM); const editorElement = find(CODE_EDITOR_CONTENT_SELECTOR); const editorView = editorElement.editor; @@ -317,7 +317,7 @@ module('Acceptance | targets | workers', function (hooks) { await click(commonSelectors.HREF(urls.targetEditEgressFilter)); assert.strictEqual(currentURL(), urls.targetEditEgressFilter); - await waitFor(CODE_EDITOR_CM_LOADED); + await waitFor(CODE_EDITOR_CM); const editorElement = find(CODE_EDITOR_CONTENT_SELECTOR); const editorView = editorElement.editor; @@ -350,7 +350,7 @@ module('Acceptance | targets | workers', function (hooks) { await click(commonSelectors.HREF(urls.targetEditIngressFilter)); assert.strictEqual(currentURL(), urls.targetEditIngressFilter); - await waitFor(CODE_EDITOR_CM_LOADED); + await waitFor(CODE_EDITOR_CM); const editorElement = find(CODE_EDITOR_CONTENT_SELECTOR); const editorView = editorElement.editor; @@ -383,7 +383,7 @@ module('Acceptance | targets | workers', function (hooks) { await click(commonSelectors.HREF(urls.targetEditIngressFilter)); assert.strictEqual(currentURL(), urls.targetEditIngressFilter); - await waitFor(CODE_EDITOR_CM_LOADED); + await waitFor(CODE_EDITOR_CM); const editorElement = find(CODE_EDITOR_CONTENT_SELECTOR); const editorView = editorElement.editor; @@ -416,7 +416,7 @@ module('Acceptance | targets | workers', function (hooks) { await click(commonSelectors.HREF(urls.targetEditEgressFilter)); assert.strictEqual(currentURL(), urls.targetEditEgressFilter); - await waitFor(CODE_EDITOR_CM_LOADED); + await waitFor(CODE_EDITOR_CM); const editorElement = find(CODE_EDITOR_CONTENT_SELECTOR); const editorView = editorElement.editor; @@ -449,7 +449,7 @@ module('Acceptance | targets | workers', function (hooks) { await click(commonSelectors.HREF(urls.targetEditEgressFilter)); assert.strictEqual(currentURL(), urls.targetEditEgressFilter); - await waitFor(CODE_EDITOR_CM_LOADED); + await waitFor(CODE_EDITOR_CM); const editorElement = find(CODE_EDITOR_CONTENT_SELECTOR); const editorView = editorElement.editor; From ba3e580945d4a0589b3d4add146f73c13dce961f Mon Sep 17 00:00:00 2001 From: Zack Moore Date: Fri, 25 Apr 2025 16:23:40 -0400 Subject: [PATCH 09/17] added whitespace --- addons/rose/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/rose/package.json b/addons/rose/package.json index 69642c8439..70f6167bf4 100644 --- a/addons/rose/package.json +++ b/addons/rose/package.json @@ -116,4 +116,4 @@ ], "*.{mdx,yaml}": "prettier --write" } -} \ No newline at end of file +} From 243f0f6aeb20be0656d8c37d5a4e549166bbeafb Mon Sep 17 00:00:00 2001 From: Zack Moore Date: Fri, 25 Apr 2025 16:30:49 -0400 Subject: [PATCH 10/17] fixing linting violations --- .../acceptance/credential-store/credentials/create-test.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/ui/admin/tests/acceptance/credential-store/credentials/create-test.js b/ui/admin/tests/acceptance/credential-store/credentials/create-test.js index 1f3da77fc5..d599a813b4 100644 --- a/ui/admin/tests/acceptance/credential-store/credentials/create-test.js +++ b/ui/admin/tests/acceptance/credential-store/credentials/create-test.js @@ -198,8 +198,6 @@ module( test('users can switch away from JSON type credentials and the json_object value will be cleared', async function (assert) { featuresService.enable('json-credentials'); - const editorSelector = '.cm-content'; - const newSecret = '{"test": "value"}'; await visit(urls.credentials); await click(commonSelectors.HREF(urls.newCredential)); From 1fbfe4cd6cae4ceecaa305b18fd27a7e010f2337 Mon Sep 17 00:00:00 2001 From: Zack Moore Date: Fri, 11 Jul 2025 20:13:51 -0600 Subject: [PATCH 11/17] =?UTF-8?q?chore:=20=F0=9F=A4=96=20self-review=20PR?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit self-review PR in the course of switching to new HDS code editor --- .../credential-store/credentials/update-test.js | 11 +++++------ ui/admin/tests/acceptance/targets/workers-test.js | 11 ----------- 2 files changed, 5 insertions(+), 17 deletions(-) diff --git a/ui/admin/tests/acceptance/credential-store/credentials/update-test.js b/ui/admin/tests/acceptance/credential-store/credentials/update-test.js index e093a2f26d..02e5dfdba5 100644 --- a/ui/admin/tests/acceptance/credential-store/credentials/update-test.js +++ b/ui/admin/tests/acceptance/credential-store/credentials/update-test.js @@ -566,12 +566,11 @@ module( await click(commonSelectors.EDIT_BTN); assert.strictEqual(currentURL(), urls.jsonCredential); - assert.dom('.secret-editor-skeleton-message button').isVisible(); - await click( - '.secret-editor-skeleton-message button', - 'Enter editing mode', - ); - assert.dom('.secret-editor-skeleton-message button').doesNotExist(); + assert.dom(selectors.REPLACE_SECRET_BTN).isVisible(); + + await click(selectors.REPLACE_SECRET_BTN); + + assert.dom(selectors.REPLACE_SECRET_BTN).doesNotExist(); await waitUntil(() => assert.dom('.cm-editor').isVisible()); }); }, diff --git a/ui/admin/tests/acceptance/targets/workers-test.js b/ui/admin/tests/acceptance/targets/workers-test.js index 304d966c39..456d762058 100644 --- a/ui/admin/tests/acceptance/targets/workers-test.js +++ b/ui/admin/tests/acceptance/targets/workers-test.js @@ -20,21 +20,10 @@ module('Acceptance | targets | workers', function (hooks) { let featuresService; let featureEdition; -<<<<<<< HEAD const EGRESS_WORKER_FILTER_VALUE = '"egress" in "/worker/filters"'; const INGRESS_WORKER_FILTER_VALUE = '"ingress" in "/worker/filters"'; -======= - const ACCORDION_DROPDOWN_TEXT_SELECTOR = (name) => - `[data-test-target-${name}-workers-accordion-item] a`; - const ACCORDION_DROPDOWN_SELECTOR = (name) => - `[data-test-target-${name}-workers-accordion-item] .hds-accordion-item__button`; - const CODE_BLOCK_SELECTOR = (name) => - `[data-test-target-${name}-workers-accordion-item] .hds-code-block__body`; const CODE_EDITOR_CM = '.cm-editor'; const CODE_EDITOR_CONTENT_SELECTOR = '.hds-code-editor__editor'; - const SAVE_BUTTON_SELECTOR = '[type="submit"]'; - const CANCEL_BUTTON_SELECTOR = '.rose-form-actions [type="button"]'; ->>>>>>> ed0916f8c (updating tests for new code editor) const instances = { scopes: { From 504aacde35c823e02772fb0a844467f674ce0b65 Mon Sep 17 00:00:00 2001 From: Zack Moore Date: Sun, 13 Jul 2025 21:07:42 -0700 Subject: [PATCH 12/17] =?UTF-8?q?fix:=20=F0=9F=90=9B=20fix=20linting=20bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/admin/tests/acceptance/targets/workers-test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/admin/tests/acceptance/targets/workers-test.js b/ui/admin/tests/acceptance/targets/workers-test.js index 456d762058..54bcd1c91d 100644 --- a/ui/admin/tests/acceptance/targets/workers-test.js +++ b/ui/admin/tests/acceptance/targets/workers-test.js @@ -379,7 +379,7 @@ module('Acceptance | targets | workers', function (hooks) { editorView.dispatch({ changes: { from: editorView.state.selection.main.from, - insert: ingressWorkerFilter, + insert: INGRESS_WORKER_FILTER_VALUE, }, }); From 3496ea7890bbca6bcf34cf3de470c14cc4f63e9b Mon Sep 17 00:00:00 2001 From: Zack Moore Date: Sun, 13 Jul 2025 21:23:51 -0700 Subject: [PATCH 13/17] =?UTF-8?q?fix:=20=F0=9F=90=9B=20unneeded=20dependen?= =?UTF-8?q?cy?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit remove jslint dependency as this is handled in the new code editor from HDS --- addons/rose/index.js | 2 -- addons/rose/package.json | 1 - pnpm-lock.yaml | 56 ---------------------------------------- 3 files changed, 59 deletions(-) diff --git a/addons/rose/index.js b/addons/rose/index.js index 171c4b9d99..bdc195caa8 100644 --- a/addons/rose/index.js +++ b/addons/rose/index.js @@ -12,8 +12,6 @@ module.exports = { included(app) { this._super.included.apply(this, arguments); - app.import('node_modules/jsonlint/lib/jsonlint.js'); - this.includeHDSStyles(app); this.includeFlightIcons(app); this.includePublic(app); diff --git a/addons/rose/package.json b/addons/rose/package.json index 70f6167bf4..d9df2ee7e2 100644 --- a/addons/rose/package.json +++ b/addons/rose/package.json @@ -42,7 +42,6 @@ "ember-cli-sass": "^11.0.1", "ember-focus-trap": "^1.0.1", "ember-named-blocks-polyfill": "^0.2.5", - "jsonlint": "^1.6.3", "sass": "^1.69.5", "uuid": "^11.0.3" }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 899d567d5b..bf6ad21b79 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -548,9 +548,6 @@ importers: ember-named-blocks-polyfill: specifier: ^0.2.5 version: 0.2.5 - jsonlint: - specifier: ^1.6.3 - version: 1.6.3 sass: specifier: ^1.69.5 version: 1.88.0 @@ -2775,9 +2772,6 @@ packages: '@xtuc/long@4.2.2': resolution: {integrity: sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==} - JSV@4.0.2: - resolution: {integrity: sha512-ZJ6wx9xaKJ3yFUhq5/sk82PJMuUyLk277I8mQeyDgCTjGdjWJIvPfaU5LIXaMuaN2UO1X3kZH4+lgphublZUHw==} - abbrev@1.1.1: resolution: {integrity: sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==} @@ -2879,10 +2873,6 @@ packages: resolution: {integrity: sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==} engines: {node: '>=12'} - ansi-styles@1.0.0: - resolution: {integrity: sha512-3iF4FIKdxaVYT3JqQuY3Wat/T2t7TRbbQ94Fu50ZUCbLy4TFbTzr90NOHQodQkNqmeEGCw8WbeP78WNi6SKYUA==} - engines: {node: '>=0.8.0'} - ansi-styles@3.2.1: resolution: {integrity: sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==} engines: {node: '>=4'} @@ -3412,10 +3402,6 @@ packages: ccount@1.1.0: resolution: {integrity: sha512-vlNK021QdI7PNeiUh/lKkC/mNHHfV0m/Ad5JoI0TYtlBnJAslM/JIkm/tGC88bkLIwO6OQ5uV6ztS6kVAtCDlg==} - chalk@0.4.0: - resolution: {integrity: sha512-sQfYDlfv2DGVtjdoQqxS0cEZDroyG8h6TamA6rvxwlrU5BaSLDx9xhatBYl2pxZ7gmpNaPFVwBtdGdu5rQ+tYQ==} - engines: {node: '>=0.8.0'} - chalk@2.4.2: resolution: {integrity: sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==} engines: {node: '>=4'} @@ -5471,10 +5457,6 @@ packages: resolution: {integrity: sha512-R3pbpkcIqv2Pm3dUwgjclDRVmWpTJW2DcMzcIhEXEx1oh/CEMObMm3KLmRJOdvhM7o4uQBnwr8pzRK2sJWIqfg==} engines: {node: '>= 0.4'} - has-color@0.1.7: - resolution: {integrity: sha512-kaNz5OTAYYmt646Hkqw50/qyxP2vFnTVu5AQ1Zmk22Kk5+4Qx6BpO8+u7IKsML5fOsFk0ZT0AcCJNYwcvaLBvw==} - engines: {node: '>=0.10.0'} - has-flag@3.0.0: resolution: {integrity: sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==} engines: {node: '>=4'} @@ -6078,11 +6060,6 @@ packages: jsonify@0.0.1: resolution: {integrity: sha512-2/Ki0GcmuqSrgFyelQq9M05y7PS0mEwuIzrf3f1fPqkVDVRvZrPZtVSMHxdgo8Aq0sxAOb/cr2aqqA3LeWHVPg==} - jsonlint@1.6.3: - resolution: {integrity: sha512-jMVTMzP+7gU/IyC6hvKyWpUU8tmTkK5b3BPNuMI9U8Sit+YAWLlZwB6Y6YrdCxfg2kNz05p3XY3Bmm4m26Nv3A==} - engines: {node: '>= 0.6'} - hasBin: true - junk@3.1.0: resolution: {integrity: sha512-pBxcB3LFc8QVgdggvZWyeys+hnrNWg4OcZIU/1X59k5jQdLBlCsYGRQaz234SqoRLTCgMH00fY0xRJH+F9METQ==} engines: {node: '>=8'} @@ -6702,10 +6679,6 @@ packages: resolution: {integrity: sha512-3l4E8uMPY1HdMMryPRUAl+oIHtXtyiTlIiESNSVSNxcPfzAFzeTbXFQkZfAwBbo0B1qMSG8nUABx+Gd+YrbKrQ==} engines: {node: '>=6'} - nomnom@1.8.1: - resolution: {integrity: sha512-5s0JxqhDx9/rksG2BTMVN1enjWSvPidpoSgViZU4ZXULyTe+7jxcCRLB6f42Z0l1xYJpleCBtSyY6Lwg3uu5CQ==} - deprecated: Package no longer supported. Contact support@npmjs.com for more info. - nopt@3.0.6: resolution: {integrity: sha512-4GUt3kSEYmk4ITxzB/b9vaIDfUVWN/Ml1Fwl11IlnIG2iaJ9O6WXZ9SrYM9NLI8OCBieN2Y8SWC2oJV0RQ7qYg==} hasBin: true @@ -7968,11 +7941,6 @@ packages: string_decoder@1.3.0: resolution: {integrity: sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==} - strip-ansi@0.1.1: - resolution: {integrity: sha512-behete+3uqxecWlDAm5lmskaSaISA+ThQ4oNNBDTBJt0x2ppR6IPqfZNuj6BLaLJ/Sji4TPZlcRyOis8wXQTLg==} - engines: {node: '>=0.8.0'} - hasBin: true - strip-ansi@4.0.0: resolution: {integrity: sha512-4XaJ2zQdCzROZDivEVIDPkcQn8LMFSa8kj8Gxb/Lnwzv9A8VctNZ+lfivC/sV3ivW8ElJTERXZoPBRrZKkNKow==} engines: {node: '>=4'} @@ -11131,8 +11099,6 @@ snapshots: '@xtuc/long@4.2.2': {} - JSV@4.0.2: {} - abbrev@1.1.1: {} accepts@1.3.8: @@ -11223,8 +11189,6 @@ snapshots: ansi-regex@6.0.1: {} - ansi-styles@1.0.0: {} - ansi-styles@3.2.1: dependencies: color-convert: 1.9.3 @@ -12082,12 +12046,6 @@ snapshots: ccount@1.1.0: {} - chalk@0.4.0: - dependencies: - ansi-styles: 1.0.0 - has-color: 0.1.7 - strip-ansi: 0.1.1 - chalk@2.4.2: dependencies: ansi-styles: 3.2.1 @@ -14987,8 +14945,6 @@ snapshots: has-bigints@1.1.0: {} - has-color@0.1.7: {} - has-flag@3.0.0: {} has-flag@4.0.0: {} @@ -15587,11 +15543,6 @@ snapshots: jsonify@0.0.1: {} - jsonlint@1.6.3: - dependencies: - JSV: 4.0.2 - nomnom: 1.8.1 - junk@3.1.0: {} just-extend@6.2.0: {} @@ -16292,11 +16243,6 @@ snapshots: node-watch@0.7.3: {} - nomnom@1.8.1: - dependencies: - chalk: 0.4.0 - underscore: 1.13.7 - nopt@3.0.6: dependencies: abbrev: 1.1.1 @@ -17661,8 +17607,6 @@ snapshots: dependencies: safe-buffer: 5.2.1 - strip-ansi@0.1.1: {} - strip-ansi@4.0.0: dependencies: ansi-regex: 3.0.1 From 8b43acda8ed833222c73e59999efd03edde3abef Mon Sep 17 00:00:00 2001 From: Zack Moore Date: Sun, 13 Jul 2025 21:36:59 -0700 Subject: [PATCH 14/17] =?UTF-8?q?fix:=20=F0=9F=90=9B=20Fixing=20import=20b?= =?UTF-8?q?ug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix import bug caused by importing scss modules that no longer exist --- .../app/styles/rose/components/_index.scss | 24 +++++++------------ 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/addons/rose/app/styles/rose/components/_index.scss b/addons/rose/app/styles/rose/components/_index.scss index fcf4975cb1..82f3c7519f 100644 --- a/addons/rose/app/styles/rose/components/_index.scss +++ b/addons/rose/app/styles/rose/components/_index.scss @@ -5,18 +5,12 @@ // This list is sorted in ascending order to improve readability -@import 'button'; -@import 'card'; -@import 'cards'; -@import 'dialog'; -@import 'dropdown'; -@import 'form'; -@import 'frame'; -@import 'header'; -@import 'icon'; -@import 'layout'; -@import 'list'; -@import 'metadata-list'; -@import 'nav'; -@import 'page-header'; -@import 'toolbar'; +@use 'form'; +@use 'frame'; +@use 'header'; +@use 'layout'; +@use 'list'; +@use 'metadata-list'; +@use 'nav'; +@use 'page-header'; +@use 'toolbar'; From 81ef96bdca8f5e03c446429ede0ccd556cf25b1c Mon Sep 17 00:00:00 2001 From: calcaide Date: Wed, 16 Jul 2025 12:17:05 -0700 Subject: [PATCH 15/17] Fix and refactor code editor acceptance test --- .../form/field/json-secret/index.hbs | 1 + .../worker-filter-generator/index.hbs | 1 + .../acceptance/storage-buckets/create-test.js | 61 ++++++++++--------- .../acceptance/storage-buckets/delete-test.js | 2 +- .../acceptance/storage-buckets/selectors.js | 4 +- .../acceptance/storage-buckets/update-test.js | 14 ++--- ui/admin/tests/helpers/selectors.js | 6 ++ 7 files changed, 48 insertions(+), 41 deletions(-) diff --git a/ui/admin/app/components/form/field/json-secret/index.hbs b/ui/admin/app/components/form/field/json-secret/index.hbs index 3615389cc5..989a875138 100644 --- a/ui/admin/app/components/form/field/json-secret/index.hbs +++ b/ui/admin/app/components/form/field/json-secret/index.hbs @@ -27,6 +27,7 @@ @isLintingEnabled={{true}} @language='json' @onInput={{@onInput}} + data-test-code-editor /> {{/if}} \ No newline at end of file diff --git a/ui/admin/app/components/worker-filter-generator/index.hbs b/ui/admin/app/components/worker-filter-generator/index.hbs index 535b842ad8..ef6789ee8a 100644 --- a/ui/admin/app/components/worker-filter-generator/index.hbs +++ b/ui/admin/app/components/worker-filter-generator/index.hbs @@ -11,6 +11,7 @@ @language='shell' @value={{or (get @model @name) ''}} @onInput={{fn this.setWorkerFilter @model @name}} + data-test-code-editor /> {{#if (get @model.errors @name)}} diff --git a/ui/admin/tests/acceptance/storage-buckets/create-test.js b/ui/admin/tests/acceptance/storage-buckets/create-test.js index 1bf9a6b3c7..11583f776e 100644 --- a/ui/admin/tests/acceptance/storage-buckets/create-test.js +++ b/ui/admin/tests/acceptance/storage-buckets/create-test.js @@ -61,17 +61,17 @@ module('Acceptance | storage-buckets | create', function (hooks) { const storageBucketCount = getStorageBucketCount(); await visit(urls.storageBuckets); - await click(`[href="${urls.newStorageBucket}"]`); + await click(commonSelectors.HREF(urls.newStorageBucket)); await fillIn(commonSelectors.FIELD_NAME, commonSelectors.FIELD_NAME_VALUE); await select(selectors.FIELD_SCOPE, 'global'); - await waitFor(selectors.CODE_EDITOR_CM_LOADED); + await waitFor(commonSelectors.CODE_EDITOR_CM); - const editorElement = find(selectors.EDITOR_WORKER_FILTER); + const editorElement = find(commonSelectors.CODE_EDITOR_CODE); const editorView = editorElement.editor; editorView.dispatch({ changes: { from: editorView.state.selection.main.from, - insert: selectors.EDITOR_WORKER_FILTER_VALUE, + insert: '"dev" in "/tags/env"', }, }); @@ -87,9 +87,10 @@ module('Acceptance | storage-buckets | create', function (hooks) { assert.strictEqual(storageBucket.name, commonSelectors.FIELD_NAME_VALUE); assert.strictEqual(storageBucket.scopeId, 'global'); + assert .dom(selectors.READONLY_WORKER_FILTER) - .hasText(selectors.EDITOR_WORKER_FILTER_VALUE); + .hasText('"dev" in "/tags/env"'); assert.strictEqual(getStorageBucketCount(), storageBucketCount + 1); }); @@ -97,17 +98,17 @@ module('Acceptance | storage-buckets | create', function (hooks) { const storageBucketCount = getStorageBucketCount(); await visit(urls.storageBuckets); - await click(`[href="${urls.newStorageBucket}"]`); + await click(commonSelectors.HREF(urls.newStorageBucket)); await fillIn(commonSelectors.FIELD_NAME, commonSelectors.FIELD_NAME_VALUE); await select(selectors.FIELD_SCOPE, instances.scopes.org.id); - await waitFor(selectors.CODE_EDITOR_CM_LOADED); + await waitFor(commonSelectors.CODE_EDITOR_CM); - const editorElement = find(selectors.EDITOR_WORKER_FILTER); + const editorElement = find(commonSelectors.CODE_EDITOR_CODE); const editorView = editorElement.editor; editorView.dispatch({ changes: { from: editorView.state.selection.main.from, - insert: selectors.EDITOR_WORKER_FILTER_VALUE, + insert: '"dev" in "/tags/env"', }, }); @@ -134,7 +135,7 @@ module('Acceptance | storage-buckets | create', function (hooks) { // Navigate to new storage bucket await visit(urls.storageBuckets); - await click(`[href="${urls.newStorageBucket}"]`); + await click(commonSelectors.HREF(urls.newStorageBucket)); // Fill the form await fillIn(commonSelectors.FIELD_NAME, commonSelectors.FIELD_NAME_VALUE); @@ -150,14 +151,14 @@ module('Acceptance | storage-buckets | create', function (hooks) { ); await fillIn(selectors.FIELD_ACCESS_KEY, selectors.FIELD_ACCESS_KEY_VALUE); await fillIn(selectors.FIELD_SECRET_KEY, selectors.FIELD_SECRET_KEY_VALUE); - await waitFor(selectors.CODE_EDITOR_CM_LOADED); + await waitFor(commonSelectors.CODE_EDITOR_CM); - const editorElement = find(selectors.EDITOR_WORKER_FILTER); + const editorElement = find(commonSelectors.CODE_EDITOR_CODE); const editorView = editorElement.editor; editorView.dispatch({ changes: { from: editorView.state.selection.main.from, - insert: selectors.EDITOR_WORKER_FILTER_VALUE, + insert: '"dev" in "/tags/env"', }, }); @@ -185,7 +186,7 @@ module('Acceptance | storage-buckets | create', function (hooks) { const storageBucketCount = getStorageBucketCount(); await visit(urls.storageBuckets); - await click(`[href="${urls.newStorageBucket}"]`); + await click(commonSelectors.HREF(urls.newStorageBucket)); await fillIn(commonSelectors.FIELD_NAME, commonSelectors.FIELD_NAME_VALUE); // There are 2 credential types @@ -193,14 +194,14 @@ module('Acceptance | storage-buckets | create', function (hooks) { await click(selectors.FIELD_DYNAMIC_CREDENTIAL); await fillIn(selectors.FIELD_ROLE_ARN, selectors.FIELD_ROLE_ARN_VALUE); - await waitFor(selectors.CODE_EDITOR_CM_LOADED); + await waitFor(commonSelectors.CODE_EDITOR_CM); - const editorElement = find(selectors.EDITOR_WORKER_FILTER); + const editorElement = find(commonSelectors.CODE_EDITOR_CODE); const editorView = editorElement.editor; editorView.dispatch({ changes: { from: editorView.state.selection.main.from, - insert: selectors.EDITOR_WORKER_FILTER_VALUE, + insert: '"dev" in "/tags/env"', }, }); @@ -219,21 +220,21 @@ module('Acceptance | storage-buckets | create', function (hooks) { const storageBucketCount = getStorageBucketCount(); await visit(urls.storageBuckets); - await click(`[href="${urls.newStorageBucket}"]`); + await click(commonSelectors.HREF(urls.newStorageBucket)); await fillIn(commonSelectors.FIELD_NAME, commonSelectors.FIELD_NAME_VALUE); assert.dom(selectors.GROUP_CREDENTIAL_TYPE).exists({ count: 2 }); await click(selectors.FIELD_STATIC_CREDENTIAL); await fillIn(selectors.FIELD_ACCESS_KEY, selectors.FIELD_ACCESS_KEY_VALUE); await fillIn(selectors.FIELD_SECRET_KEY, selectors.FIELD_SECRET_KEY_VALUE); - await waitFor(selectors.CODE_EDITOR_CM_LOADED); + await waitFor(commonSelectors.CODE_EDITOR_CM); - const editorElement = find(selectors.EDITOR_WORKER_FILTER); + const editorElement = find(commonSelectors.CODE_EDITOR_CODE); const editorView = editorElement.editor; editorView.dispatch({ changes: { from: editorView.state.selection.main.from, - insert: selectors.EDITOR_WORKER_FILTER_VALUE, + insert: '"dev" in "/tags/env"', }, }); @@ -254,7 +255,7 @@ module('Acceptance | storage-buckets | create', function (hooks) { // Navigate to new storage bucket await visit(urls.storageBuckets); - await click(`[href="${urls.newStorageBucket}"]`); + await click(commonSelectors.HREF(urls.newStorageBucket)); // Fill the form await fillIn(commonSelectors.FIELD_NAME, commonSelectors.FIELD_NAME_VALUE); @@ -269,14 +270,14 @@ module('Acceptance | storage-buckets | create', function (hooks) { ); await fillIn(selectors.FIELD_ACCESS_KEY, selectors.FIELD_ACCESS_KEY_VALUE); await fillIn(selectors.FIELD_SECRET_KEY, selectors.FIELD_SECRET_KEY_VALUE); - await waitFor(selectors.CODE_EDITOR_CM_LOADED); + await waitFor(commonSelectors.CODE_EDITOR_CM); - const editorElement = find(selectors.EDITOR_WORKER_FILTER); + const editorElement = find(commonSelectors.CODE_EDITOR_CODE); const editorView = editorElement.editor; editorView.dispatch({ changes: { from: editorView.state.selection.main.from, - insert: selectors.EDITOR_WORKER_FILTER_VALUE, + insert: '"dev" in "/tags/env"', }, }); @@ -303,7 +304,7 @@ module('Acceptance | storage-buckets | create', function (hooks) { const storageBucketCount = getStorageBucketCount(); await visit(urls.storageBuckets); - await click(`[href="${urls.newStorageBucket}"]`); + await click(commonSelectors.HREF(urls.newStorageBucket)); await fillIn(commonSelectors.FIELD_NAME, commonSelectors.FIELD_NAME_VALUE); await click(commonSelectors.CANCEL_BTN); @@ -334,15 +335,15 @@ module('Acceptance | storage-buckets | create', function (hooks) { }); await visit(urls.storageBuckets); - await click(`[href="${urls.newStorageBucket}"]`); - await waitFor(selectors.CODE_EDITOR_CM_LOADED); + await click(commonSelectors.HREF(urls.newStorageBucket)); + await waitFor(commonSelectors.CODE_EDITOR_CM); - const editorElement = find(selectors.EDITOR_WORKER_FILTER); + const editorElement = find(commonSelectors.CODE_EDITOR_CODE); const editorView = editorElement.editor; editorView.dispatch({ changes: { from: editorView.state.selection.main.from, - insert: selectors.EDITOR_WORKER_FILTER_VALUE, + insert: '"dev" in "/tags/env"', }, }); await click(commonSelectors.SAVE_BTN); diff --git a/ui/admin/tests/acceptance/storage-buckets/delete-test.js b/ui/admin/tests/acceptance/storage-buckets/delete-test.js index d54d3b9c0e..bee5446da3 100644 --- a/ui/admin/tests/acceptance/storage-buckets/delete-test.js +++ b/ui/admin/tests/acceptance/storage-buckets/delete-test.js @@ -75,7 +75,7 @@ module('Acceptance | storage-buckets | delete', function (hooks) { const storageBucketCount = getStorageBucketCount(); await visit(urls.globalScope); - await click(`[href="${urls.storageBuckets}"]`); + await click(commonSelectors.HREF(urls.storageBuckets)); await click(DROPDOWN_BUTTON_SELECTOR); await click(DELETE_DROPDOWN_SELECTOR); diff --git a/ui/admin/tests/acceptance/storage-buckets/selectors.js b/ui/admin/tests/acceptance/storage-buckets/selectors.js index f59dec0a3b..6dfbc7355d 100644 --- a/ui/admin/tests/acceptance/storage-buckets/selectors.js +++ b/ui/admin/tests/acceptance/storage-buckets/selectors.js @@ -30,9 +30,7 @@ export const FIELD_SECRET_KEY_EDIT_BTN = export const FIELD_WORKER_FILTER = '[name=worker_filter]'; export const FIELD_WORKER_FILTER_ERROR = '[data-test-worker-filter-error]'; export const READONLY_WORKER_FILTER = '[data-test-worker-filter]'; -export const CODE_EDITOR_CM_LOADED = '.cm-editor'; -export const EDITOR_WORKER_FILTER = '.hds-code-editor__editor'; -export const EDITOR_WORKER_FILTER_VALUE = '"dev" in "/tags/env"'; + export const TOAST = '[role=alert] div'; export const TOAST_SUCCESSFUL_VALUE = 'Saved successfully.'; diff --git a/ui/admin/tests/acceptance/storage-buckets/update-test.js b/ui/admin/tests/acceptance/storage-buckets/update-test.js index af0a96f343..9f7fe8445b 100644 --- a/ui/admin/tests/acceptance/storage-buckets/update-test.js +++ b/ui/admin/tests/acceptance/storage-buckets/update-test.js @@ -56,7 +56,7 @@ module('Acceptance | storage-buckets | update', function (hooks) { await fillIn(commonSelectors.FIELD_NAME, commonSelectors.FIELD_NAME_VALUE); await click(commonSelectors.SAVE_BTN, 'Click save'); - assert.dom(`[href="${urls.storageBucket}"]`).isVisible(); + assert.dom(commonSelectors.HREF(urls.storageBucket)).isVisible(); assert .dom(commonSelectors.FIELD_NAME) .hasValue(commonSelectors.FIELD_NAME_VALUE); @@ -163,16 +163,16 @@ module('Acceptance | storage-buckets | update', function (hooks) { ); }); - await click(`[href="${urls.storageBucket}"]`); + await click(commonSelectors.HREF(urls.storageBucket)); await click(commonSelectors.EDIT_BTN, 'Activate edit mode'); - await waitFor(selectors.CODE_EDITOR_CM_LOADED); + await waitFor(commonSelectors.CODE_EDITOR_CM); - const editorElement = find(selectors.EDITOR_WORKER_FILTER); + const editorElement = find(commonSelectors.CODE_EDITOR_CODE); const editorView = editorElement.editor; editorView.dispatch({ changes: { from: editorView.state.selection.main.from, - insert: selectors.EDITOR_WORKER_FILTER_VALUE, + insert: '"dev" in "/tags/env"', }, }); await click(commonSelectors.SAVE_BTN); @@ -229,11 +229,11 @@ module('Acceptance | storage-buckets | update', function (hooks) { await click(commonSelectors.HREF(urls.storageBucketMinio)); assert.dom(selectors.READONLY_WORKER_FILTER).isVisible(); - assert.dom(commonSelectors.CODE_EDITOR_CONTENT).doesNotExist(); + assert.dom(commonSelectors.CODE_EDITOR).doesNotExist(); await click(commonSelectors.EDIT_BTN, 'Click edit mode'); - assert.dom(commonSelectors.CODE_EDITOR_CONTENT).isVisible(); + assert.dom(commonSelectors.CODE_EDITOR).isVisible(); assert.dom(selectors.READONLY_WORKER_FILTER).doesNotExist(); }); }); diff --git a/ui/admin/tests/helpers/selectors.js b/ui/admin/tests/helpers/selectors.js index 04ea289ce4..970cfc931d 100644 --- a/ui/admin/tests/helpers/selectors.js +++ b/ui/admin/tests/helpers/selectors.js @@ -96,5 +96,11 @@ export const TABLE_SORT_BTN_ARROW_UP = (column) => export const TABLE_SORT_BTN_ARROW_DOWN = (column) => `thead tr th:nth-child(${column}) button .hds-icon-arrow-down`; +// Check if we delete it export const CODE_EDITOR_CONTENT = '[data-test-code-editor-field-editor] textarea'; +// Perhaps, new? +export const CODE_EDITOR = '[data-test-code-editor]'; +export const CODE_EDITOR_CODE = + '[data-test-code-editor] .hds-code-editor__editor'; +export const CODE_EDITOR_CM = '[data-test-code-editor] .cm-editor'; From 84392a213833b230f2ad49d4764f4670657bd727 Mon Sep 17 00:00:00 2001 From: calcaide Date: Wed, 16 Jul 2025 12:56:28 -0700 Subject: [PATCH 16/17] Fix and refactor code editor acceptance test --- .../acceptance/credential-store/create-test.js | 6 +++--- .../credential-store/credentials/create-test.js | 13 ++++++++----- .../credential-store/credentials/selectors.js | 3 --- .../credential-store/credentials/update-test.js | 4 +++- .../tests/acceptance/credential-store/selectors.js | 2 -- .../acceptance/credential-store/update-test.js | 5 ++--- 6 files changed, 16 insertions(+), 17 deletions(-) diff --git a/ui/admin/tests/acceptance/credential-store/create-test.js b/ui/admin/tests/acceptance/credential-store/create-test.js index fdf6852f01..3fa020f2a2 100644 --- a/ui/admin/tests/acceptance/credential-store/create-test.js +++ b/ui/admin/tests/acceptance/credential-store/create-test.js @@ -104,9 +104,9 @@ module('Acceptance | credential-stores | create', function (hooks) { await fillIn(commonSelectors.FIELD_NAME, commonSelectors.FIELD_NAME_VALUE); await click(selectors.TYPE_VAULT); - await waitFor(selectors.CODE_EDITOR_CM_LOADED); + await waitFor(commonSelectors.CODE_EDITOR_CM); - const editorElement = find(selectors.CODE_EDITOR_BODY); + const editorElement = find(commonSelectors.CODE_EDITOR_CODE); const editorView = editorElement.editor; editorView.dispatch({ changes: { @@ -117,7 +117,7 @@ module('Acceptance | credential-stores | create', function (hooks) { await click(commonSelectors.SAVE_BTN); - assert.dom(selectors.CODE_BLOCK_BODY).doesNotExist(); + assert.dom(commonSelectors.CODE_EDITOR).doesNotExist(); assert.strictEqual(getVaultCredentialStoresCount(), count + 1); }); diff --git a/ui/admin/tests/acceptance/credential-store/credentials/create-test.js b/ui/admin/tests/acceptance/credential-store/credentials/create-test.js index d599a813b4..b9f9d41a6a 100644 --- a/ui/admin/tests/acceptance/credential-store/credentials/create-test.js +++ b/ui/admin/tests/acceptance/credential-store/credentials/create-test.js @@ -203,21 +203,24 @@ module( await click(commonSelectors.HREF(urls.newCredential)); await click(selectors.FIELD_TYPE_JSON); - await waitFor('.cm-editor'); + await waitFor(commonSelectors.CODE_EDITOR_CM); - const editorElement = find('.hds-code-editor__editor'); + const editorElement = find(commonSelectors.CODE_EDITOR_CODE); const editorView = editorElement.editor; editorView.dispatch({ changes: { from: editorView.state.selection.main.from, - insert: selectors.FIELD_EDITOR_VALUE, + insert: '{"test": "value"}', }, }); - assert.dom(selectors.EDITOR).includesText(selectors.FIELD_EDITOR_VALUE); + + assert + .dom(commonSelectors.CODE_EDITOR_CODE) + .includesText('{"test": "value"}'); await click(selectors.FIELD_TYPE_USERNAME_PASSWORD); await click(selectors.FIELD_TYPE_JSON); - assert.dom(selectors.EDITOR).includesText('{}'); + assert.dom(commonSelectors.CODE_EDITOR_CODE).includesText('{}'); }); test('users cannot navigate to new credential route without proper authorization', async function (assert) { diff --git a/ui/admin/tests/acceptance/credential-store/credentials/selectors.js b/ui/admin/tests/acceptance/credential-store/credentials/selectors.js index 0e34b5c243..bad5bdc5ec 100644 --- a/ui/admin/tests/acceptance/credential-store/credentials/selectors.js +++ b/ui/admin/tests/acceptance/credential-store/credentials/selectors.js @@ -6,15 +6,12 @@ export const FIELD_TYPE_SSH = '[value=ssh_private_key]'; export const FIELD_TYPE_USERNAME_PASSWORD = '[value=username_password]'; export const FIELD_TYPE_JSON = '[value=json]'; -export const FIELD_EDITOR = '[data-test-code-editor-field-editor] textarea'; -export const FIELD_EDITOR_VALUE = '{"test": "value"}'; export const FIELD_PASSWORD_ERROR = '[data-test-error-message-password]'; export const FIELD_SSH_PRIVATE_KEY = '[name=private_key]'; export const FIELD_SSH_PRIVATE_KEY_ERROR = '[data-test-error-message-private-key]'; export const FIELD_SSH_PRIVATE_KEY_PASSPHRASE = '[name=private_key_passphrase]'; -export const EDITOR = '[data-test-code-editor-field-editor]'; export const MANAGE_DROPDOWN = '[data-test-manage-credentials-dropdown] button'; export const MANAGE_DROPDOWN_DELETE = '[data-test-manage-credentials-dropdown] ul li button'; diff --git a/ui/admin/tests/acceptance/credential-store/credentials/update-test.js b/ui/admin/tests/acceptance/credential-store/credentials/update-test.js index 02e5dfdba5..a5685d6ee8 100644 --- a/ui/admin/tests/acceptance/credential-store/credentials/update-test.js +++ b/ui/admin/tests/acceptance/credential-store/credentials/update-test.js @@ -571,7 +571,9 @@ module( await click(selectors.REPLACE_SECRET_BTN); assert.dom(selectors.REPLACE_SECRET_BTN).doesNotExist(); - await waitUntil(() => assert.dom('.cm-editor').isVisible()); + await waitUntil(() => + assert.dom(commonSelectors.CODE_EDITOR_CM).isVisible(), + ); }); }, ); diff --git a/ui/admin/tests/acceptance/credential-store/selectors.js b/ui/admin/tests/acceptance/credential-store/selectors.js index 51e3c55d71..73d2f7d7d6 100644 --- a/ui/admin/tests/acceptance/credential-store/selectors.js +++ b/ui/admin/tests/acceptance/credential-store/selectors.js @@ -16,8 +16,6 @@ export const DELETE_ACTION = // Search filtering selectors export const NO_RESULTS_MSG = '[data-test-no-credential-store-results]'; -export const CODE_EDITOR_CM_LOADED = '.cm-editor'; -export const CODE_EDITOR_BODY = '.hds-code-editor__editor'; export const CODE_BLOCK_BODY = '.hds-code-block__code'; export const EDITOR_WORKER_FILTER_VALUE = '"dev" in "/tags/env"'; diff --git a/ui/admin/tests/acceptance/credential-store/update-test.js b/ui/admin/tests/acceptance/credential-store/update-test.js index 27c8eab75a..41cb88a2ba 100644 --- a/ui/admin/tests/acceptance/credential-store/update-test.js +++ b/ui/admin/tests/acceptance/credential-store/update-test.js @@ -388,9 +388,9 @@ module('Acceptance | credential-stores | update', function (hooks) { await click(commonSelectors.HREF(urls.workerFilter)); await click(selectors.MANAGE_DROPDOWN); await click(selectors.EDIT_WORKER_FILTER_ACTION); - await waitFor(selectors.CODE_EDITOR_CM_LOADED); + await waitFor(commonSelectors.CODE_EDITOR_CM); - const editorElement = find(selectors.CODE_EDITOR_BODY); + const editorElement = find(commonSelectors.CODE_EDITOR_CODE); const editorView = editorElement.editor; editorView.dispatch({ changes: { @@ -400,7 +400,6 @@ module('Acceptance | credential-stores | update', function (hooks) { }); await click(commonSelectors.SAVE_BTN); - assert.dom(selectors.CODE_BLOCK_BODY).exists(); assert.dom(selectors.CODE_BLOCK_BODY).includesText('"bar" in "/tags/foo"'); }); From 41d89a59b416e756ec4036c748538ac9bfd5209a Mon Sep 17 00:00:00 2001 From: Zack Moore Date: Wed, 16 Jul 2025 13:45:01 -0700 Subject: [PATCH 17/17] =?UTF-8?q?chore:=20=F0=9F=A4=96=20remove=20codemirr?= =?UTF-8?q?or=20dependency?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- addons/rose/package.json | 1 - pnpm-lock.yaml | 104 ++++++++++----------------------------- 2 files changed, 27 insertions(+), 78 deletions(-) diff --git a/addons/rose/package.json b/addons/rose/package.json index d9df2ee7e2..fe7eb6e923 100644 --- a/addons/rose/package.json +++ b/addons/rose/package.json @@ -34,7 +34,6 @@ "@hashicorp/design-system-tokens": "^2.3.0", "@hashicorp/flight-icons": "^3.10.0", "@nullvoxpopuli/ember-composable-helpers": "^5.2.10", - "codemirror": "5.65.7", "ember-auto-import": "^2.10.0", "ember-cli-babel": "^8.2.0", "ember-cli-clipboard": "^1.2.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index bf6ad21b79..e099df1b16 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -520,13 +520,10 @@ importers: version: 2.3.0 '@hashicorp/flight-icons': specifier: ^3.10.0 - version: 3.10.0 + version: 3.11.1 '@nullvoxpopuli/ember-composable-helpers': specifier: ^5.2.10 version: 5.2.10(@babel/core@7.27.1)(ember-source@5.12.0(@glimmer/component@1.1.2(@babel/core@7.27.1))(@glint/template@1.5.2)(rsvp@4.8.5)(webpack@5.99.8)) - codemirror: - specifier: 5.65.7 - version: 5.65.7 ember-auto-import: specifier: ^2.10.0 version: 2.10.0(@glint/template@1.5.2)(webpack@5.99.8) @@ -822,7 +819,7 @@ importers: version: 3.3.3(ember-cli@5.12.0(handlebars@4.7.8)(underscore@1.13.7)) ember-cli-flash: specifier: ^6.0.0 - version: 6.0.0(@ember/string@4.0.1)(@embroider/macros@1.18.0(@glint/template@1.5.2))(ember-modifier@4.2.0(@babel/core@7.27.1)(ember-source@5.12.0(@glimmer/component@1.1.2(@babel/core@7.27.1))(@glint/template@1.5.2)(rsvp@4.8.5)(webpack@5.99.8))) + version: 6.0.0(@ember/string@4.0.1)(@embroider/macros@1.18.0(@glint/template@1.5.2))(ember-modifier@4.2.2(@babel/core@7.27.1)) ember-cli-htmlbars: specifier: ^6.3.0 version: 6.3.0 @@ -852,7 +849,7 @@ importers: version: 2.1.2(@babel/core@7.27.1) ember-modifier: specifier: ^4.2.0 - version: 4.2.0(@babel/core@7.27.1)(ember-source@5.12.0(@glimmer/component@1.1.2(@babel/core@7.27.1))(@glint/template@1.5.2)(rsvp@4.8.5)(webpack@5.99.8)) + version: 4.2.2(@babel/core@7.27.1) ember-page-title: specifier: ^8.2.3 version: 8.2.4(ember-source@5.12.0(@glimmer/component@1.1.2(@babel/core@7.27.1))(@glint/template@1.5.2)(rsvp@4.8.5)(webpack@5.99.8)) @@ -1024,7 +1021,7 @@ importers: version: 3.3.3(ember-cli@5.12.0(handlebars@4.7.8)(underscore@1.13.7)) ember-cli-flash: specifier: ^6.0.0 - version: 6.0.0(@ember/string@4.0.1)(@embroider/macros@1.18.0(@glint/template@1.5.2))(ember-modifier@4.2.0(@babel/core@7.27.1)(ember-source@5.12.0(@glimmer/component@1.1.2(@babel/core@7.27.1))(@glint/template@1.5.2)(rsvp@4.8.5)(webpack@5.99.8))) + version: 6.0.0(@ember/string@4.0.1)(@embroider/macros@1.18.0(@glint/template@1.5.2))(ember-modifier@4.2.2(@babel/core@7.27.1)) ember-cli-htmlbars: specifier: ^6.3.0 version: 6.3.0 @@ -1057,7 +1054,7 @@ importers: version: 2.1.2(@babel/core@7.27.1) ember-modifier: specifier: ^4.2.0 - version: 4.2.0(@babel/core@7.27.1)(ember-source@5.12.0(@glimmer/component@1.1.2(@babel/core@7.27.1))(@glint/template@1.5.2)(rsvp@4.8.5)(webpack@5.99.8)) + version: 4.2.2(@babel/core@7.27.1) ember-page-title: specifier: ^8.2.3 version: 8.2.4(ember-source@5.12.0(@glimmer/component@1.1.2(@babel/core@7.27.1))(@glint/template@1.5.2)(rsvp@4.8.5)(webpack@5.99.8)) @@ -2286,9 +2283,6 @@ packages: peerDependencies: ember-source: ^3.28.0 || ^4.0.0 - '@hashicorp/flight-icons@3.10.0': - resolution: {integrity: sha512-wtufYZ5Ntihmy+vbR0dM+Q7X56xPX/dtpcfVs4nCRgvYZZic5ayqE8tefs2FGtxauH6zuzzVk48s5S6psv9g+g==} - '@hashicorp/flight-icons@3.11.1': resolution: {integrity: sha512-FQOHB2qCzHoG3dm6zidS39D4U0ida/7Sge5EG+KqcebH5jsbJQiMyB/qMc3YQBo5vGBe8XUa+rVW8v4JNpzk1Q==} @@ -3545,9 +3539,6 @@ packages: codemirror-lang-hcl@0.0.0-beta.2: resolution: {integrity: sha512-R3ew7Z2EYTdHTMXsWKBW9zxnLoLPYO+CrAa3dPZjXLrIR96Q3GR4cwJKF7zkSsujsnWgwRQZonyWpXYXfhQYuQ==} - codemirror@5.65.7: - resolution: {integrity: sha512-zb67cXzgugIQmb6tfD4G11ILjYoMfTjwcjn+cWsa4GewlI2adhR/h3kolkoCQTm1msD/1BuqVTKuO09ELsS++A==} - color-convert@1.9.3: resolution: {integrity: sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==} @@ -4548,14 +4539,6 @@ packages: resolution: {integrity: sha512-ezcPQhH8jUfcJQbbHji4/ZG/h0yyj1jRDknfYue/ypQS8fM8LrGcCMo0rjDZLzL1Vd11InjNs3BD7BdxFlzGoA==} engines: {node: 12.* || >= 14} - ember-modifier@4.2.0: - resolution: {integrity: sha512-BJ48eTEGxD8J7+lofwVmee7xDgNDgpr5dd6+MSu4gk+I6xb35099RMNorXY5hjjwMJEyi/IRR6Yn3M7iJMz8Zw==} - peerDependencies: - ember-source: ^3.24 || >=4.0 - peerDependenciesMeta: - ember-source: - optional: true - ember-modifier@4.2.2: resolution: {integrity: sha512-pPYBAGyczX0hedGWQFQOEiL9s45KS9efKxJxUQkMLjQyh+1Uef1mcmAGsdw2KmvNupITkE/nXxmVO1kZ9tt3ag==} @@ -5742,9 +5725,6 @@ packages: resolution: {integrity: sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==} engines: {node: '>= 0.4'} - is-core-module@2.13.1: - resolution: {integrity: sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==} - is-core-module@2.16.1: resolution: {integrity: sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w==} engines: {node: '>= 0.4'} @@ -7476,10 +7456,6 @@ packages: engines: {node: '>= 0.4'} hasBin: true - resolve@1.22.8: - resolution: {integrity: sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==} - hasBin: true - responselike@2.0.1: resolution: {integrity: sha512-4gl03wn3hj1HP3yzgdI7d3lCkF95F21Pz4BPGvKHinyQzALR5CapwC8yIi0Rh58DEMQ/SguC03wFj2k0M/mHhw==} @@ -10129,7 +10105,7 @@ snapshots: '@embroider/test-setup@4.0.0': dependencies: lodash: 4.17.21 - resolve: 1.22.8 + resolve: 1.22.10 '@embroider/util@1.13.2(@glint/template@1.5.2)(ember-source@5.12.0(@glimmer/component@1.1.2(@babel/core@7.27.1))(@glint/template@1.5.2)(rsvp@4.8.5)(webpack@5.99.8))': dependencies: @@ -10527,8 +10503,6 @@ snapshots: - supports-color - webpack - '@hashicorp/flight-icons@3.10.0': {} - '@hashicorp/flight-icons@3.11.1': {} '@humanwhocodes/config-array@0.13.0': @@ -11400,7 +11374,7 @@ snapshots: glob: 9.3.5 pkg-up: 3.1.0 reselect: 4.1.8 - resolve: 1.22.8 + resolve: 1.22.10 babel-plugin-polyfill-corejs2@0.4.13(@babel/core@7.27.1): dependencies: @@ -11879,7 +11853,7 @@ snapshots: ensure-posix-path: 1.1.1 fs-extra: 8.1.0 minimatch: 3.1.2 - resolve: 1.22.8 + resolve: 1.22.10 rsvp: 4.8.5 symlink-or-copy: 1.3.1 walk-sync: 1.1.4 @@ -12175,8 +12149,6 @@ snapshots: '@lezer/highlight': 1.2.1 '@lezer/lr': 1.4.2 - codemirror@5.65.7: {} - color-convert@1.9.3: dependencies: color-name: 1.1.3 @@ -12708,7 +12680,7 @@ snapshots: minimatch: 3.1.2 parse5: 6.0.1 pkg-entry-points: 1.1.1 - resolve: 1.22.8 + resolve: 1.22.10 resolve-package-path: 4.0.3 semver: 7.7.2 style-loader: 2.0.0(webpack@5.99.8) @@ -12843,7 +12815,7 @@ snapshots: ember-auto-import: 2.10.0(@glint/template@1.5.2)(webpack@5.99.8) ember-cli-babel: 7.26.11 ember-cli-htmlbars: 6.3.0 - ember-modifier: 3.2.7(@babel/core@7.27.1) + ember-modifier: 4.2.2(@babel/core@7.27.1) prop-types: 15.8.1 transitivePeerDependencies: - '@babel/core' @@ -12881,15 +12853,15 @@ snapshots: ember-cli: 5.12.0(handlebars@4.7.8)(underscore@1.13.7) find-yarn-workspace-root: 2.0.0 is-git-url: 1.0.0 - resolve: 1.22.8 + resolve: 1.22.10 semver: 5.7.2 - ember-cli-flash@6.0.0(@ember/string@4.0.1)(@embroider/macros@1.18.0(@glint/template@1.5.2))(ember-modifier@4.2.0(@babel/core@7.27.1)(ember-source@5.12.0(@glimmer/component@1.1.2(@babel/core@7.27.1))(@glint/template@1.5.2)(rsvp@4.8.5)(webpack@5.99.8))): + ember-cli-flash@6.0.0(@ember/string@4.0.1)(@embroider/macros@1.18.0(@glint/template@1.5.2))(ember-modifier@4.2.2(@babel/core@7.27.1)): dependencies: '@ember/string': 4.0.1 '@embroider/addon-shim': 1.10.0 '@embroider/macros': 1.18.0(@glint/template@1.5.2) - ember-modifier: 4.2.0(@babel/core@7.27.1)(ember-source@5.12.0(@glimmer/component@1.1.2(@babel/core@7.27.1))(@glint/template@1.5.2)(rsvp@4.8.5)(webpack@5.99.8)) + ember-modifier: 4.2.2(@babel/core@7.27.1) transitivePeerDependencies: - supports-color @@ -12910,7 +12882,7 @@ snapshots: json-stable-stringify: 1.3.0 semver: 6.3.1 strip-bom: 4.0.0 - walk-sync: 2.0.2 + walk-sync: 2.2.0 transitivePeerDependencies: - supports-color @@ -13050,7 +13022,7 @@ snapshots: ember-cli-babel-plugin-helpers: 1.1.1 execa: 1.0.0 fs-extra: 7.0.1 - resolve: 1.22.8 + resolve: 1.22.10 rsvp: 4.8.5 semver: 6.3.1 stagehand: 1.0.1 @@ -13067,7 +13039,7 @@ snapshots: ember-cli-babel-plugin-helpers: 1.1.1 execa: 2.1.0 fs-extra: 8.1.0 - resolve: 1.22.8 + resolve: 1.22.10 rsvp: 4.8.5 semver: 6.3.1 stagehand: 1.0.1 @@ -13083,7 +13055,7 @@ snapshots: debug: 4.4.0 execa: 4.1.0 fs-extra: 9.1.0 - resolve: 1.22.8 + resolve: 1.22.10 rsvp: 4.8.5 semver: 7.7.2 stagehand: 1.0.1 @@ -13098,7 +13070,7 @@ snapshots: debug: 4.4.0 execa: 4.1.0 fs-extra: 9.1.0 - resolve: 1.22.8 + resolve: 1.22.10 rsvp: 4.8.5 semver: 7.7.2 stagehand: 1.0.1 @@ -13108,7 +13080,7 @@ snapshots: ember-cli-version-checker@2.2.0: dependencies: - resolve: 1.22.8 + resolve: 1.22.10 semver: 5.7.2 ember-cli-version-checker@3.1.3: @@ -13202,7 +13174,7 @@ snapshots: promise.hash.helper: 1.0.8 quick-temp: 0.1.8 remove-types: 1.0.0 - resolve: 1.22.8 + resolve: 1.22.10 resolve-package-path: 4.0.3 safe-stable-stringify: 2.5.0 sane: 5.0.1 @@ -13577,18 +13549,6 @@ snapshots: - '@babel/core' - supports-color - ember-modifier@4.2.0(@babel/core@7.27.1)(ember-source@5.12.0(@glimmer/component@1.1.2(@babel/core@7.27.1))(@glint/template@1.5.2)(rsvp@4.8.5)(webpack@5.99.8)): - dependencies: - '@embroider/addon-shim': 1.10.0 - decorator-transforms: 2.3.0(@babel/core@7.27.1) - ember-cli-normalize-entity-name: 1.0.0 - ember-cli-string-utils: 1.1.0 - optionalDependencies: - ember-source: 5.12.0(@glimmer/component@1.1.2(@babel/core@7.27.1))(@glint/template@1.5.2)(rsvp@4.8.5)(webpack@5.99.8) - transitivePeerDependencies: - - '@babel/core' - - supports-color - ember-modifier@4.2.2(@babel/core@7.27.1): dependencies: '@embroider/addon-shim': 1.10.0 @@ -13812,7 +13772,7 @@ snapshots: is-glob: 4.0.3 language-tags: 1.0.9 micromatch: 4.0.8 - resolve: 1.22.8 + resolve: 1.22.10 v8-compile-cache: 2.4.0 yargs: 17.7.2 transitivePeerDependencies: @@ -13868,7 +13828,7 @@ snapshots: ember-try-config: 4.0.0(encoding@0.1.13) execa: 4.1.0 fs-extra: 6.0.1 - resolve: 1.22.8 + resolve: 1.22.10 rimraf: 3.0.2 semver: 7.7.2 walk-sync: 2.2.0 @@ -14097,9 +14057,9 @@ snapshots: globals: 13.24.0 ignore: 5.3.2 is-builtin-module: 3.2.1 - is-core-module: 2.13.1 + is-core-module: 2.16.1 minimatch: 3.1.2 - resolve: 1.22.8 + resolve: 1.22.10 semver: 7.7.2 eslint-plugin-playwright@2.2.0(eslint@8.57.1): @@ -14971,7 +14931,7 @@ snapshots: heimdalljs: 0.2.6 heimdalljs-logger: 0.1.10 path-root: 0.1.1 - resolve: 1.22.8 + resolve: 1.22.10 resolve-package-path: 1.2.7 transitivePeerDependencies: - supports-color @@ -15261,10 +15221,6 @@ snapshots: is-callable@1.2.7: {} - is-core-module@2.13.1: - dependencies: - hasown: 2.0.2 - is-core-module@2.16.1: dependencies: hasown: 2.0.2 @@ -16266,7 +16222,7 @@ snapshots: normalize-package-data@3.0.3: dependencies: hosted-git-info: 4.1.0 - is-core-module: 2.13.1 + is-core-module: 2.16.1 semver: 7.7.2 validate-npm-package-license: 3.0.4 @@ -17027,7 +16983,7 @@ snapshots: resolve-package-path@3.1.0: dependencies: path-root: 0.1.1 - resolve: 1.22.8 + resolve: 1.22.10 resolve-package-path@4.0.3: dependencies: @@ -17048,12 +17004,6 @@ snapshots: path-parse: 1.0.7 supports-preserve-symlinks-flag: 1.0.0 - resolve@1.22.8: - dependencies: - is-core-module: 2.13.1 - path-parse: 1.0.7 - supports-preserve-symlinks-flag: 1.0.0 - responselike@2.0.1: dependencies: lowercase-keys: 2.0.0