From a6c990c6fe618c10040d64b8f3f7e0e0463e7b7a Mon Sep 17 00:00:00 2001 From: Chris Hut Date: Tue, 17 Oct 2023 06:27:42 -0700 Subject: [PATCH] Cc 5545: Upgrade HDS packages and modifiers (#19226) * Upgrade @hashicorp/design-system-tokens to 1.9.0 * Upgrade @hashicorp/design-system-components to 1.8.1 * Upgrade @hashicorp/design-system-components and ember-in-viewport * Explicitly install ember-modifier@4.1.0 * rename copy-button * Fix how cleanup is done in with-copyable * Update aria-menu modifier for new structure * Update css-prop modifier to new structure * Convert did-upsert to regular class modifier * Update notification modifier for new structure * Update on-oustside modifier for new structure * Move destroy handler registration in with-copyable * Update style modifier for new structure * Update validate modifier for new structure * Guard against setting on destroyed object * Upgrade @hashicorp/design-system-components to 2.14.1 * Remove debugger * Guard against null in aria-menu * Fix undefined hash in validate addon * Upgrade ember-on-resize-modifier * Fix copy button import, missing import and array destructuring --------- Co-authored-by: wenincode --- .../consul/lock-session/list/index.hbs | 4 +- .../consul/peer/address/list/index.hbs | 2 +- .../app/components/code-editor/README.mdx | 2 +- .../app/components/code-editor/index.hbs | 2 +- .../app/components/code-editor/index.js | 32 +- .../README.mdx | 8 +- .../chart.xstate.js | 0 .../index.hbs | 4 +- .../index.js | 2 +- .../index.scss | 0 .../layout.scss | 0 .../skin.scss | 0 .../consul/exposed-path/list/index.hbs | 2 +- .../consul/health-check/list/index.hbs | 2 +- .../app/components/consul/node/list/index.hbs | 2 +- .../components/consul/token/list/index.hbs | 4 +- .../consul/upstream-instance/list/index.hbs | 4 +- .../components/consul/upstream/list/index.hbs | 2 +- .../app/components/copyable-code/index.hbs | 4 +- .../components/disclosure-menu/menu/index.hbs | 18 +- .../components/horizontal-kv-list/README.mdx | 8 +- .../consul-ui/app/components/menu/index.hbs | 25 +- .../consul-ui/app/modifiers/aria-menu.js | 48 +-- .../consul-ui/app/modifiers/css-prop.js | 9 +- .../consul-ui/app/modifiers/did-upsert.js | 46 +- .../consul-ui/app/modifiers/notification.js | 29 +- .../consul-ui/app/modifiers/on-outside.js | 43 +- ui/packages/consul-ui/app/modifiers/style.js | 14 +- .../consul-ui/app/modifiers/validate.js | 57 ++- .../consul-ui/app/modifiers/with-copyable.js | 40 +- .../consul-ui/app/styles/components.scss | 2 +- .../consul-ui/app/templates/dc/nodes/show.hbs | 2 +- .../app/templates/dc/services/instance.hbs | 2 +- ui/packages/consul-ui/package.json | 14 +- .../en-us.yaml | 0 ui/yarn.lock | 408 ++++++++++++++---- 36 files changed, 529 insertions(+), 312 deletions(-) rename ui/packages/consul-ui/app/components/{copy-button => consul-copy-button}/README.mdx (93%) rename ui/packages/consul-ui/app/components/{copy-button => consul-copy-button}/chart.xstate.js (100%) rename ui/packages/consul-ui/app/components/{copy-button => consul-copy-button}/index.hbs (76%) rename ui/packages/consul-ui/app/components/{copy-button => consul-copy-button}/index.js (80%) rename ui/packages/consul-ui/app/components/{copy-button => consul-copy-button}/index.scss (100%) rename ui/packages/consul-ui/app/components/{copy-button => consul-copy-button}/layout.scss (100%) rename ui/packages/consul-ui/app/components/{copy-button => consul-copy-button}/skin.scss (100%) rename ui/packages/consul-ui/translations/components/{copy-button => consul-copy-button}/en-us.yaml (100%) diff --git a/ui/packages/consul-lock-sessions/app/components/consul/lock-session/list/index.hbs b/ui/packages/consul-lock-sessions/app/components/consul/lock-session/list/index.hbs index 247b0dd8fc..465c0721ec 100644 --- a/ui/packages/consul-lock-sessions/app/components/consul/lock-session/list/index.hbs +++ b/ui/packages/consul-lock-sessions/app/components/consul/lock-session/list/index.hbs @@ -14,7 +14,7 @@ as |item index|> {{else}} {{item.ID}} - @@ -28,7 +28,7 @@ as |item index|> ID
- diff --git a/ui/packages/consul-peerings/app/components/consul/peer/address/list/index.hbs b/ui/packages/consul-peerings/app/components/consul/peer/address/list/index.hbs index bc6294e015..aabada41ad 100644 --- a/ui/packages/consul-peerings/app/components/consul/peer/address/list/index.hbs +++ b/ui/packages/consul-peerings/app/components/consul/peer/address/list/index.hbs @@ -18,7 +18,7 @@
{{address}}
-
- diff --git a/ui/packages/consul-ui/app/components/code-editor/index.js b/ui/packages/consul-ui/app/components/code-editor/index.js index 72e3abf8eb..65566d159b 100644 --- a/ui/packages/consul-ui/app/components/code-editor/index.js +++ b/ui/packages/consul-ui/app/components/code-editor/index.js @@ -36,22 +36,24 @@ export default Component.extend({ } }, setMode: function (mode) { - let options = { - ...DEFAULTS, - mode: mode.mime, - readOnly: this.readonly, - }; - if (mode.name === 'XML') { - options.htmlMode = mode.htmlMode; - options.matchClosing = mode.matchClosing; - options.alignCDATA = mode.alignCDATA; - } - set(this, 'options', options); + if (!this.isDestroying && !this.isDestroyed) { + let options = { + ...DEFAULTS, + mode: mode.mime, + readOnly: this.readonly, + }; + if (mode.name === 'XML') { + options.htmlMode = mode.htmlMode; + options.matchClosing = mode.matchClosing; + options.alignCDATA = mode.alignCDATA; + } + set(this, 'options', options); - const editor = this.editor; - editor.setOption('mode', mode.mime); - this.helper.lint(editor, mode.mode); - set(this, 'mode', mode); + const editor = this.editor; + editor.setOption('mode', mode.mime); + this.helper.lint(editor, mode.mode); + set(this, 'mode', mode); + } }, willDestroyElement: function () { this._super(...arguments); diff --git a/ui/packages/consul-ui/app/components/copy-button/README.mdx b/ui/packages/consul-ui/app/components/consul-copy-button/README.mdx similarity index 93% rename from ui/packages/consul-ui/app/components/copy-button/README.mdx rename to ui/packages/consul-ui/app/components/consul-copy-button/README.mdx index 7f45737fdb..c207545f30 100644 --- a/ui/packages/consul-ui/app/components/copy-button/README.mdx +++ b/ui/packages/consul-ui/app/components/consul-copy-button/README.mdx @@ -1,4 +1,4 @@ -# CopyButton +# ConsulCopyButton Button component used for copy-to-clipboard functionality so the user can easily copy specified text to their clipboard, along with tooltip-like notifications so the user has some sort of feedback to know the value has been copied. @@ -10,7 +10,7 @@ Can be used inline to render only a small icon for the button with no other text
Icon only
- @@ -20,12 +20,12 @@ Can be used inline to render only a small icon for the button with no other text
Icon and text
- Copy me! - +
``` diff --git a/ui/packages/consul-ui/app/components/copy-button/chart.xstate.js b/ui/packages/consul-ui/app/components/consul-copy-button/chart.xstate.js similarity index 100% rename from ui/packages/consul-ui/app/components/copy-button/chart.xstate.js rename to ui/packages/consul-ui/app/components/consul-copy-button/chart.xstate.js diff --git a/ui/packages/consul-ui/app/components/copy-button/index.hbs b/ui/packages/consul-ui/app/components/consul-copy-button/index.hbs similarity index 76% rename from ui/packages/consul-ui/app/components/copy-button/index.hbs rename to ui/packages/consul-ui/app/components/consul-copy-button/index.hbs index ed3b42388c..ace1ff3232 100644 --- a/ui/packages/consul-ui/app/components/copy-button/index.hbs +++ b/ui/packages/consul-ui/app/components/consul-copy-button/index.hbs @@ -14,12 +14,12 @@ {{#let (fn dispatch 'SUCCESS') (fn dispatch 'ERROR') (fn dispatch 'RESET') as |success error reset|}}