From 4b92782edbd04897b1158168e914d0fc97b602eb Mon Sep 17 00:00:00 2001 From: Jordan Reimer Date: Tue, 5 Apr 2022 13:54:18 -0600 Subject: [PATCH 01/10] updates ember-test-selectors, ember-cli-page-object and ember-cli-string-helpers --- ui/package.json | 6 +++--- ui/yarn.lock | 35 +++++++++++++++++++---------------- 2 files changed, 22 insertions(+), 19 deletions(-) diff --git a/ui/package.json b/ui/package.json index 90600a926b2b..228765b7ae69 100644 --- a/ui/package.json +++ b/ui/package.json @@ -107,10 +107,10 @@ "ember-cli-htmlbars": "^5.7.2", "ember-cli-inject-live-reload": "^2.1.0", "ember-cli-mirage": "2.4.0", - "ember-cli-page-object": "^1.17.0", + "ember-cli-page-object": "1.17.9", "ember-cli-sass": "^10.0.1", "ember-cli-sri": "meirish/ember-cli-sri#rooturl", - "ember-cli-string-helpers": "^4.0.0", + "ember-cli-string-helpers": "6.1.0", "ember-cli-terser": "^4.0.2", "ember-composable-helpers": "^4.3.0", "ember-concurrency": "^2.1.2", @@ -141,7 +141,7 @@ "ember-svg-jar": "^2.1.0", "ember-template-lint": "4.3.0", "ember-template-lint-plugin-prettier": "4.0.0", - "ember-test-selectors": "^2.1.0", + "ember-test-selectors": "6.0.0", "ember-tether": "^2.0.1", "ember-truth-helpers": "3.0.0", "ember-wormhole": "0.6.0", diff --git a/ui/yarn.lock b/ui/yarn.lock index 1e5cda557d7d..828d92154aae 100644 --- a/ui/yarn.lock +++ b/ui/yarn.lock @@ -130,7 +130,7 @@ semver "^6.3.0" source-map "^0.5.0" -"@babel/core@^7.13.8": +"@babel/core@^7.13.10", "@babel/core@^7.13.8": version "7.17.8" resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.17.8.tgz#3dac27c190ebc3a4381110d46c80e77efe172e1a" integrity sha512-OdQDV/7cRBtJHLSOBqqbYNkOcydOgnX59TZx4puf41fzcVtN3e/4yqY8lMQsK+5X2lJtAdmA+6OHqsj1hBJ4IQ== @@ -10508,7 +10508,7 @@ ember-cli-babel-plugin-helpers@^1.0.0, ember-cli-babel-plugin-helpers@^1.1.0, em resolved "https://registry.yarnpkg.com/ember-cli-babel-plugin-helpers/-/ember-cli-babel-plugin-helpers-1.1.1.tgz#5016b80cdef37036c4282eef2d863e1d73576879" integrity sha512-sKvOiPNHr5F/60NLd7SFzMpYPte/nnGkq/tMIfXejfKHIhaiIkYFqX8Z9UFTKWLLn+V7NOaby6niNPZUdvKCRw== -ember-cli-babel@^6.0.0-beta.4, ember-cli-babel@^6.16.0, ember-cli-babel@^6.6.0, ember-cli-babel@^6.8.2, ember-cli-babel@^6.9.0, ember-cli-babel@^6.9.2: +ember-cli-babel@^6.0.0-beta.4, ember-cli-babel@^6.16.0, ember-cli-babel@^6.6.0, ember-cli-babel@^6.9.0, ember-cli-babel@^6.9.2: version "6.18.0" resolved "https://registry.yarnpkg.com/ember-cli-babel/-/ember-cli-babel-6.18.0.tgz#3f6435fd275172edeff2b634ee7b29ce74318957" integrity sha512-7ceC8joNYxY2wES16iIBlbPSxwKDBhYwC8drU3ZEvuPDMwVv1KzxCNu1fvxyFEBWhwaRNTUxSCsEVoTd9nosGA== @@ -10527,7 +10527,7 @@ ember-cli-babel@^6.0.0-beta.4, ember-cli-babel@^6.16.0, ember-cli-babel@^6.6.0, ember-cli-version-checker "^2.1.2" semver "^5.5.0" -ember-cli-babel@^7.0.0, ember-cli-babel@^7.1.2, ember-cli-babel@^7.1.3, ember-cli-babel@^7.10.0, ember-cli-babel@^7.13.0, ember-cli-babel@^7.13.2, ember-cli-babel@^7.17.2, ember-cli-babel@^7.18.0, ember-cli-babel@^7.19.0, ember-cli-babel@^7.20.0, ember-cli-babel@^7.21.0, ember-cli-babel@^7.22.1, ember-cli-babel@^7.23.0, ember-cli-babel@^7.23.1, ember-cli-babel@^7.26.0, ember-cli-babel@^7.26.10, ember-cli-babel@^7.26.2, ember-cli-babel@^7.26.3, ember-cli-babel@^7.26.5, ember-cli-babel@^7.26.6, ember-cli-babel@^7.26.8, ember-cli-babel@^7.5.0, ember-cli-babel@^7.7.3: +ember-cli-babel@^7.0.0, ember-cli-babel@^7.1.2, ember-cli-babel@^7.1.3, ember-cli-babel@^7.10.0, ember-cli-babel@^7.13.0, ember-cli-babel@^7.13.2, ember-cli-babel@^7.17.2, ember-cli-babel@^7.18.0, ember-cli-babel@^7.19.0, ember-cli-babel@^7.20.0, ember-cli-babel@^7.21.0, ember-cli-babel@^7.22.1, ember-cli-babel@^7.23.0, ember-cli-babel@^7.23.1, ember-cli-babel@^7.26.0, ember-cli-babel@^7.26.10, ember-cli-babel@^7.26.2, ember-cli-babel@^7.26.3, ember-cli-babel@^7.26.4, ember-cli-babel@^7.26.5, ember-cli-babel@^7.26.6, ember-cli-babel@^7.26.8, ember-cli-babel@^7.5.0, ember-cli-babel@^7.7.3: version "7.26.11" resolved "https://registry.yarnpkg.com/ember-cli-babel/-/ember-cli-babel-7.26.11.tgz#50da0fe4dcd99aada499843940fec75076249a9f" integrity sha512-JJYeYjiz/JTn34q7F5DSOjkkZqy8qwFOOxXfE6pe9yEJqWGu4qErKxlz8I22JoVEQ/aBUO+OcKTpmctvykM9YA== @@ -10787,7 +10787,7 @@ ember-cli-normalize-entity-name@^1.0.0: dependencies: silent-error "^1.0.0" -ember-cli-page-object@^1.17.0: +ember-cli-page-object@1.17.9: version "1.17.9" resolved "https://registry.yarnpkg.com/ember-cli-page-object/-/ember-cli-page-object-1.17.9.tgz#d5d730661755083987db599732d24145b9f25521" integrity sha512-c2pMCuPRM0x/eO8Ot3NDesebdJGlNPwwOWAtXsXH339j/TDeh2DIz2sGJNnmZkFqEsdTqgVq2rkmGzmd7i1xeg== @@ -10832,13 +10832,15 @@ ember-cli-sri@meirish/ember-cli-sri#rooturl: dependencies: broccoli-sri-hash "^2.1.0" -ember-cli-string-helpers@^4.0.0: - version "4.0.7" - resolved "https://registry.yarnpkg.com/ember-cli-string-helpers/-/ember-cli-string-helpers-4.0.7.tgz#181e36f5cd6e99a211cca0a5e2d90381c4658f5f" - integrity sha512-jG99vlO4wzHk0jQcl4wFCJfaEsXBWITXsETuoIPd0r5hNMuhKUJ0CA0qif1Lr7Udwl52ay2D3VLqEmZZYdvSjw== +ember-cli-string-helpers@6.1.0: + version "6.1.0" + resolved "https://registry.yarnpkg.com/ember-cli-string-helpers/-/ember-cli-string-helpers-6.1.0.tgz#aeb96112bb91c540b869ed8b9c680f7fd5859cb6" + integrity sha512-Lw8B6MJx2n8CNF2TSIKs+hWLw0FqSYjr2/NRPyquyYA05qsl137WJSYW3ZqTsLgoinHat0DGF2qaCXocLhLmyA== dependencies: - broccoli-funnel "^2.0.2" + "@babel/core" "^7.13.10" + broccoli-funnel "^3.0.3" ember-cli-babel "^7.7.3" + resolve "^1.20.0" ember-cli-string-utils@^1.0.0, ember-cli-string-utils@^1.1.0: version "1.1.0" @@ -10945,7 +10947,7 @@ ember-cli-version-checker@^2.1.0, ember-cli-version-checker@^2.1.2: resolve "^1.3.3" semver "^5.3.0" -ember-cli-version-checker@^3.1.2, ember-cli-version-checker@^3.1.3: +ember-cli-version-checker@^3.1.3: version "3.1.3" resolved "https://registry.yarnpkg.com/ember-cli-version-checker/-/ember-cli-version-checker-3.1.3.tgz#7c9b4f5ff30fdebcd480b1c06c4de43bb51c522c" integrity sha512-PZNSvpzwWgv68hcXxyjREpj3WWb81A7rtYNQq1lLEgrWIchF8ApKJjWP3NBpHjaatwILkZAV8klair5WFlXAKg== @@ -11616,13 +11618,14 @@ ember-template-recast@^6.1.3: tmp "^0.2.1" workerpool "^6.1.5" -ember-test-selectors@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/ember-test-selectors/-/ember-test-selectors-2.1.0.tgz#faebdf06702aaa0bc510d55eb721ce54d2e85793" - integrity sha512-c5HmvefmeABH8hg380TSNZiE9VAK1CBeXWrgyXy+IXHtsew4lZHHw7GnqCAqsakxwvmaMARbAKY9KfSAE91s1g== +ember-test-selectors@6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/ember-test-selectors/-/ember-test-selectors-6.0.0.tgz#ba9bb19550d9dec6e4037d86d2b13c2cfd329341" + integrity sha512-PgYcI9PeNvtKaF0QncxfbS68olMYM1idwuI8v/WxsjOGqUx5bmsu6V17vy/d9hX4mwmjgsBhEghrVasGSuaIgw== dependencies: - ember-cli-babel "^6.8.2" - ember-cli-version-checker "^3.1.2" + calculate-cache-key-for-tree "^2.0.0" + ember-cli-babel "^7.26.4" + ember-cli-version-checker "^5.1.2" ember-tether@^2.0.1: version "2.0.1" From 436a1f75fa663ca02a11a6e9d13fada8ab694765 Mon Sep 17 00:00:00 2001 From: Jordan Reimer Date: Tue, 5 Apr 2022 13:55:04 -0600 Subject: [PATCH 02/10] adds attributeBindings to classic components with data-test property --- ui/app/components/console/log-json.js | 1 + ui/app/components/console/log-text.js | 1 + ui/app/components/console/output-log.js | 1 + ui/app/components/console/ui-panel.js | 1 + ui/app/components/hover-copy-button.js | 1 + ui/app/components/identity/edit-form.js | 1 + ui/app/components/nav-header.js | 1 + ui/app/components/pgp-file.js | 1 + ui/app/components/radial-progress.js | 2 +- ui/lib/core/addon/components/form-field.js | 3 ++- ui/lib/core/addon/components/info-table-item-array.js | 1 + ui/lib/core/addon/components/info-tooltip.js | 1 + ui/lib/core/addon/components/replication-header.js | 1 + ui/lib/core/addon/components/search-select.js | 1 + ui/lib/core/addon/components/string-list.js | 1 + ui/lib/core/addon/components/ttl-picker.js | 1 + ui/lib/replication/addon/components/path-filter-config-list.js | 1 + 17 files changed, 18 insertions(+), 2 deletions(-) diff --git a/ui/app/components/console/log-json.js b/ui/app/components/console/log-json.js index 2eef304e8dea..a176c260ede1 100644 --- a/ui/app/components/console/log-json.js +++ b/ui/app/components/console/log-json.js @@ -2,4 +2,5 @@ import Component from '@ember/component'; export default Component.extend({ 'data-test-component': 'console/log-json', + attributeBindings: ['data-test-component'], }); diff --git a/ui/app/components/console/log-text.js b/ui/app/components/console/log-text.js index 227e2c872d4e..ebd80a51ec19 100644 --- a/ui/app/components/console/log-text.js +++ b/ui/app/components/console/log-text.js @@ -2,4 +2,5 @@ import Component from '@ember/component'; export default Component.extend({ 'data-test-component': 'console/log-text', + attributeBindings: ['data-test-component'], }); diff --git a/ui/app/components/console/output-log.js b/ui/app/components/console/output-log.js index b5f6864487a9..c2993f582d5d 100644 --- a/ui/app/components/console/output-log.js +++ b/ui/app/components/console/output-log.js @@ -2,5 +2,6 @@ import Component from '@ember/component'; export default Component.extend({ 'data-test-component': 'console/output-log', + attributeBindings: ['data-test-component'], log: null, }); diff --git a/ui/app/components/console/ui-panel.js b/ui/app/components/console/ui-panel.js index ea52fee8ba4e..572dec8065ea 100644 --- a/ui/app/components/console/ui-panel.js +++ b/ui/app/components/console/ui-panel.js @@ -20,6 +20,7 @@ export default Component.extend({ controlGroup: service(), store: service(), 'data-test-component': 'console/ui-panel', + attributeBindings: ['data-test-component'], classNames: 'console-ui-panel', classNameBindings: ['isFullscreen:fullscreen'], diff --git a/ui/app/components/hover-copy-button.js b/ui/app/components/hover-copy-button.js index 8c4f08ee3799..63a4564ab846 100644 --- a/ui/app/components/hover-copy-button.js +++ b/ui/app/components/hover-copy-button.js @@ -2,6 +2,7 @@ import Component from '@ember/component'; export default Component.extend({ 'data-test-hover-copy': true, + attributeBindings: ['data-test-hover-copy'], classNameBindings: 'alwaysShow:hover-copy-button-static:hover-copy-button', copyValue: null, alwaysShow: false, diff --git a/ui/app/components/identity/edit-form.js b/ui/app/components/identity/edit-form.js index b4e4bfde2f1d..ae8b6c148e9d 100644 --- a/ui/app/components/identity/edit-form.js +++ b/ui/app/components/identity/edit-form.js @@ -8,6 +8,7 @@ import { waitFor } from '@ember/test-waiters'; export default Component.extend({ flashMessages: service(), 'data-test-component': 'identity-edit-form', + attributeBindings: ['data-test-component'], model: null, // 'create', 'edit', 'merge' diff --git a/ui/app/components/nav-header.js b/ui/app/components/nav-header.js index 3726af4a3f62..7697c6fc1a0b 100644 --- a/ui/app/components/nav-header.js +++ b/ui/app/components/nav-header.js @@ -5,6 +5,7 @@ import { computed } from '@ember/object'; export default Component.extend({ router: service(), 'data-test-navheader': true, + attributeBindings: ['data-test-navheader'], classNameBindings: 'consoleFullscreen:panel-fullscreen', tagName: 'header', navDrawerOpen: false, diff --git a/ui/app/components/pgp-file.js b/ui/app/components/pgp-file.js index e3ff786754ec..fd1a7d1fbbe2 100644 --- a/ui/app/components/pgp-file.js +++ b/ui/app/components/pgp-file.js @@ -7,6 +7,7 @@ const BASE_64_REGEX = /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/] export default Component.extend({ 'data-test-pgp-file': true, + attributeBindings: ['data-test-pgp-file'], classNames: ['box', 'is-fullwidth', 'is-marginless', 'is-shadowless'], key: null, index: null, diff --git a/ui/app/components/radial-progress.js b/ui/app/components/radial-progress.js index e3bec6380837..ba2693d3cd89 100644 --- a/ui/app/components/radial-progress.js +++ b/ui/app/components/radial-progress.js @@ -5,7 +5,7 @@ export default Component.extend({ 'data-test-radial-progress': true, tagName: 'svg', classNames: 'radial-progress', - attributeBindings: ['size:width', 'size:height', 'viewBox'], + attributeBindings: ['size:width', 'size:height', 'viewBox', 'data-test-radial-progress'], progressDecimal: null, size: 20, strokeWidth: 1, diff --git a/ui/lib/core/addon/components/form-field.js b/ui/lib/core/addon/components/form-field.js index 0f8234870571..56ae6770a503 100644 --- a/ui/lib/core/addon/components/form-field.js +++ b/ui/lib/core/addon/components/form-field.js @@ -31,7 +31,8 @@ import layout from '../templates/components/form-field'; export default Component.extend({ layout, 'data-test-field': true, - classNames: ['field'], + attributeBindings: ['data-test-field'], + classNames: ['field-foo'], disabled: false, showHelpText: true, subText: '', diff --git a/ui/lib/core/addon/components/info-table-item-array.js b/ui/lib/core/addon/components/info-table-item-array.js index e163f11df735..e670c8a24b99 100644 --- a/ui/lib/core/addon/components/info-table-item-array.js +++ b/ui/lib/core/addon/components/info-table-item-array.js @@ -29,6 +29,7 @@ import { isWildcardString } from 'vault/helpers/is-wildcard-string'; export default Component.extend({ layout, 'data-test-info-table-item-array': true, + attributeBindings: ['data-test-info-table-item-array'], allOptions: null, displayArray: null, wildcardInDisplayArray: false, diff --git a/ui/lib/core/addon/components/info-tooltip.js b/ui/lib/core/addon/components/info-tooltip.js index a03b2594108b..822453b242da 100644 --- a/ui/lib/core/addon/components/info-tooltip.js +++ b/ui/lib/core/addon/components/info-tooltip.js @@ -4,6 +4,7 @@ import layout from '../templates/components/info-tooltip'; export default Component.extend({ layout, 'data-test-component': 'info-tooltip', + attributeBindings: ['data-test-component'], tagName: 'span', classNames: ['is-inline-block'], }); diff --git a/ui/lib/core/addon/components/replication-header.js b/ui/lib/core/addon/components/replication-header.js index f34a1ac4db54..829950f71c67 100644 --- a/ui/lib/core/addon/components/replication-header.js +++ b/ui/lib/core/addon/components/replication-header.js @@ -28,4 +28,5 @@ export default Component.extend({ secondaryId: null, isSummaryDashboard: false, 'data-test-replication-header': true, + attributeBindings: ['data-test-replication-header'], }); diff --git a/ui/lib/core/addon/components/search-select.js b/ui/lib/core/addon/components/search-select.js index 34d3a4ec544c..3c6538703c4b 100644 --- a/ui/lib/core/addon/components/search-select.js +++ b/ui/lib/core/addon/components/search-select.js @@ -39,6 +39,7 @@ import layout from '../templates/components/search-select'; export default Component.extend({ layout, 'data-test-component': 'search-select', + attributeBindings: ['data-test-component'], classNameBindings: ['displayInherit:display-inherit'], classNames: ['field', 'search-select'], store: service(), diff --git a/ui/lib/core/addon/components/string-list.js b/ui/lib/core/addon/components/string-list.js index f532be26dbfb..ee4c4823b71a 100644 --- a/ui/lib/core/addon/components/string-list.js +++ b/ui/lib/core/addon/components/string-list.js @@ -7,6 +7,7 @@ import layout from '../templates/components/string-list'; export default Component.extend({ layout, 'data-test-component': 'string-list', + attributeBindings: ['data-test-component'], classNames: ['field', 'string-list', 'form-section'], /* diff --git a/ui/lib/core/addon/components/ttl-picker.js b/ui/lib/core/addon/components/ttl-picker.js index 39cfda0baa51..99086b00abd4 100644 --- a/ui/lib/core/addon/components/ttl-picker.js +++ b/ui/lib/core/addon/components/ttl-picker.js @@ -32,6 +32,7 @@ const ERROR_MESSAGE = 'TTLs must be specified in whole number increments, please export default Component.extend({ layout, 'data-test-component': 'ttl-picker', + attributeBindings: ['data-test-component'], classNames: 'field', onChange: () => {}, diff --git a/ui/lib/replication/addon/components/path-filter-config-list.js b/ui/lib/replication/addon/components/path-filter-config-list.js index f598d70a8482..ee5280098da5 100644 --- a/ui/lib/replication/addon/components/path-filter-config-list.js +++ b/ui/lib/replication/addon/components/path-filter-config-list.js @@ -6,6 +6,7 @@ import { task, timeout } from 'ember-concurrency'; export default Component.extend({ 'data-test-component': 'path-filter-config', + attributeBindings: ['data-test-component'], namespace: service(), store: service(), config: null, From be2dc98d4b1304f0d6edf9edb43341780e0c1dd3 Mon Sep 17 00:00:00 2001 From: Jordan Reimer Date: Tue, 5 Apr 2022 17:11:25 -0600 Subject: [PATCH 03/10] glimmerizes toolbar-link component and removes data-test args --- .../components/generated-item-list.hbs | 2 +- .../templates/components/generated-item.hbs | 2 +- .../components/identity/entity-nav.hbs | 4 +- .../components/secret-edit-toolbar.hbs | 4 +- .../cluster/access/identity/aliases/show.hbs | 2 +- .../vault/cluster/access/identity/show.hbs | 4 +- .../vault/cluster/access/method/section.hbs | 2 +- .../vault/cluster/policies/index.hbs | 2 +- .../templates/vault/cluster/policy/edit.hbs | 2 +- .../templates/vault/cluster/policy/show.hbs | 2 +- .../cluster/secrets/backend/configuration.hbs | 2 +- .../vault/cluster/secrets/backends.hbs | 2 +- .../vault/cluster/settings/auth/configure.hbs | 2 +- .../settings/configure-secret-backend.hbs | 2 +- ui/lib/core/addon/components/toolbar-link.hbs | 22 ++++++++++ ui/lib/core/addon/components/toolbar-link.js | 21 +++------ .../templates/components/toolbar-link.hbs | 44 ------------------- .../components/known-secondaries-card.hbs | 2 +- .../mode/secondaries/config-show.hbs | 4 +- .../templates/mode/secondaries/index.hbs | 2 +- 20 files changed, 49 insertions(+), 80 deletions(-) create mode 100644 ui/lib/core/addon/components/toolbar-link.hbs delete mode 100644 ui/lib/core/addon/templates/components/toolbar-link.hbs diff --git a/ui/app/templates/components/generated-item-list.hbs b/ui/app/templates/components/generated-item-list.hbs index 1632486c8ed6..327808a30140 100644 --- a/ui/app/templates/components/generated-item-list.hbs +++ b/ui/app/templates/components/generated-item-list.hbs @@ -37,7 +37,7 @@ diff --git a/ui/app/templates/components/generated-item.hbs b/ui/app/templates/components/generated-item.hbs index b815afac1811..b952f2fe157a 100644 --- a/ui/app/templates/components/generated-item.hbs +++ b/ui/app/templates/components/generated-item.hbs @@ -45,7 +45,7 @@
Edit {{singularize this.itemType}} diff --git a/ui/app/templates/components/identity/entity-nav.hbs b/ui/app/templates/components/identity/entity-nav.hbs index 4464974a151e..7f77b523f1ef 100644 --- a/ui/app/templates/components/identity/entity-nav.hbs +++ b/ui/app/templates/components/identity/entity-nav.hbs @@ -27,7 +27,7 @@ {{#if (eq this.identityType "entity")}} Merge {{pluralize this.identityType}} @@ -36,7 +36,7 @@ Create {{this.identityType}} diff --git a/ui/app/templates/components/secret-edit-toolbar.hbs b/ui/app/templates/components/secret-edit-toolbar.hbs index 57ab99d1371a..8e4bf21c99af 100644 --- a/ui/app/templates/components/secret-edit-toolbar.hbs +++ b/ui/app/templates/components/secret-edit-toolbar.hbs @@ -98,14 +98,14 @@ @model.id (query-params version=(if @model.canReadMetadata @modelForData.version "")) }} - @data-test-secret-edit="true" + data-test-secret-edit="true" @replace={{true}} @type="add" > Create new version {{else}} - + Edit secret {{/if}} diff --git a/ui/app/templates/vault/cluster/access/identity/aliases/show.hbs b/ui/app/templates/vault/cluster/access/identity/aliases/show.hbs index da70cabec322..fa27949dbca8 100644 --- a/ui/app/templates/vault/cluster/access/identity/aliases/show.hbs +++ b/ui/app/templates/vault/cluster/access/identity/aliases/show.hbs @@ -32,7 +32,7 @@ Edit {{lowercase (humanize this.model.identityType)}} diff --git a/ui/app/templates/vault/cluster/access/identity/show.hbs b/ui/app/templates/vault/cluster/access/identity/show.hbs index b33a5e03923b..e1d0b6babdbc 100644 --- a/ui/app/templates/vault/cluster/access/identity/show.hbs +++ b/ui/app/templates/vault/cluster/access/identity/show.hbs @@ -39,14 +39,14 @@ Add alias {{/unless}} Edit {{this.model.identityType}} diff --git a/ui/app/templates/vault/cluster/access/method/section.hbs b/ui/app/templates/vault/cluster/access/method/section.hbs index ad392e939972..df24feda4373 100644 --- a/ui/app/templates/vault/cluster/access/method/section.hbs +++ b/ui/app/templates/vault/cluster/access/method/section.hbs @@ -31,7 +31,7 @@ {{#if (eq this.section "configuration")}} - + Configure diff --git a/ui/app/templates/vault/cluster/policies/index.hbs b/ui/app/templates/vault/cluster/policies/index.hbs index f3ad5c64790b..b6e3b1852bdf 100644 --- a/ui/app/templates/vault/cluster/policies/index.hbs +++ b/ui/app/templates/vault/cluster/policies/index.hbs @@ -44,7 +44,7 @@ {{/if}} - + Create {{uppercase this.policyType}} policy diff --git a/ui/app/templates/vault/cluster/policy/edit.hbs b/ui/app/templates/vault/cluster/policy/edit.hbs index 04933c3923ce..bc36db87a492 100644 --- a/ui/app/templates/vault/cluster/policy/edit.hbs +++ b/ui/app/templates/vault/cluster/policy/edit.hbs @@ -35,7 +35,7 @@
{{/if}} - + Back to policy
diff --git a/ui/app/templates/vault/cluster/policy/show.hbs b/ui/app/templates/vault/cluster/policy/show.hbs index 27dd87463ec3..a24ae1492f0b 100644 --- a/ui/app/templates/vault/cluster/policy/show.hbs +++ b/ui/app/templates/vault/cluster/policy/show.hbs @@ -30,7 +30,7 @@ @data={{this.model.policy}} /> {{#if (and (not-eq this.model.id "root") (or this.capabilities.canUpdate this.capabilities.canDelete))}} - + Edit policy {{/if}} diff --git a/ui/app/templates/vault/cluster/secrets/backend/configuration.hbs b/ui/app/templates/vault/cluster/secrets/backend/configuration.hbs index 0b990173fa33..33ee61fdb1df 100644 --- a/ui/app/templates/vault/cluster/secrets/backend/configuration.hbs +++ b/ui/app/templates/vault/cluster/secrets/backend/configuration.hbs @@ -14,7 +14,7 @@ Configure diff --git a/ui/app/templates/vault/cluster/secrets/backends.hbs b/ui/app/templates/vault/cluster/secrets/backends.hbs index ea738f377aaa..53a1fab8c321 100644 --- a/ui/app/templates/vault/cluster/secrets/backends.hbs +++ b/ui/app/templates/vault/cluster/secrets/backends.hbs @@ -11,7 +11,7 @@ Enable new engine diff --git a/ui/app/templates/vault/cluster/settings/auth/configure.hbs b/ui/app/templates/vault/cluster/settings/auth/configure.hbs index bdb2cc0dbc0f..9275a2ebf8ab 100644 --- a/ui/app/templates/vault/cluster/settings/auth/configure.hbs +++ b/ui/app/templates/vault/cluster/settings/auth/configure.hbs @@ -14,7 +14,7 @@ - + View method diff --git a/ui/app/templates/vault/cluster/settings/configure-secret-backend.hbs b/ui/app/templates/vault/cluster/settings/configure-secret-backend.hbs index 17ab5346ec76..30995c1b3ba6 100644 --- a/ui/app/templates/vault/cluster/settings/configure-secret-backend.hbs +++ b/ui/app/templates/vault/cluster/settings/configure-secret-backend.hbs @@ -17,7 +17,7 @@ - + View backend diff --git a/ui/lib/core/addon/components/toolbar-link.hbs b/ui/lib/core/addon/components/toolbar-link.hbs new file mode 100644 index 000000000000..6d4da11531e4 --- /dev/null +++ b/ui/lib/core/addon/components/toolbar-link.hbs @@ -0,0 +1,22 @@ +{{#let (component "link-to" class="toolbar-link" disabled=@disabled params=@params) as |LinkToComponent|}} + {{#if (and @disabled @disabledTooltip)}} + + + + {{yield}} + + + + +
+ {{@disabledTooltip}} +
+
+
+ {{else}} + + {{yield}} + + + {{/if}} +{{/let}} \ No newline at end of file diff --git a/ui/lib/core/addon/components/toolbar-link.js b/ui/lib/core/addon/components/toolbar-link.js index f9bb007eccd8..cbc1b228c641 100644 --- a/ui/lib/core/addon/components/toolbar-link.js +++ b/ui/lib/core/addon/components/toolbar-link.js @@ -1,3 +1,4 @@ +import Component from '@glimmer/component'; /** * @module ToolbarLink * `ToolbarLink` components style links and buttons for the Toolbar @@ -20,18 +21,8 @@ * @param {string} disabledTooltip - tooltip to display on hover when disabled */ -import Component from '@ember/component'; -import { computed } from '@ember/object'; -import layout from '../templates/components/toolbar-link'; - -export default Component.extend({ - layout, - tagName: '', - supportsDataTestProperties: true, - type: null, - disabled: false, - disabledTooltip: null, - glyph: computed('type', function () { - return this.type == 'add' ? 'plus' : 'chevron-right'; - }), -}); +export default class ToolbarLinkComponent extends Component { + get glyph() { + return this.args.type == 'add' ? 'plus' : 'chevron-right'; + } +} diff --git a/ui/lib/core/addon/templates/components/toolbar-link.hbs b/ui/lib/core/addon/templates/components/toolbar-link.hbs deleted file mode 100644 index dc20cf54fa5d..000000000000 --- a/ui/lib/core/addon/templates/components/toolbar-link.hbs +++ /dev/null @@ -1,44 +0,0 @@ -{{#let - (component - "link-to" - class="toolbar-link" - disabled=this.disabled - params=this.params - data-test-secret-edit=this.data-test-secret-edit - data-test-secondary-add=this.data-test-secondary-add - data-test-configure-link=this.data-test-configure-link - data-test-alias-edit-link=this.data-test-alias-edit-link - data-test-entity-edit-link=this.data-test-entity-edit-link - data-test-replication-link=this.data-test-replication-link - data-test-entity-merge-link=this.data-test-entity-merge-link - data-test-backend-view-link=this.data-test-backend-view-link - data-test-entity-create-link=this.data-test-entity-create-link - data-test-policy-create-link=this.data-test-policy-create-link - data-test-policy-edit-toggle=this.data-test-policy-edit-toggle - data-test-secret-backend-configure=this.data-test-secret-backend-configure - data-test-enable-engine=this.data-test-enable-engine - data-test-manage-link=this.data-test-manage-link - ) - as |LinkToComponent| -}} - {{#if (and this.disabled this.disabledTooltip)}} - - - - {{yield}} - - - - -
- {{this.disabledTooltip}} -
-
-
- {{else}} - - {{yield}} - - - {{/if}} -{{/let}} \ No newline at end of file diff --git a/ui/lib/replication/addon/templates/components/known-secondaries-card.hbs b/ui/lib/replication/addon/templates/components/known-secondaries-card.hbs index fa626566e605..335aacc6c8c4 100644 --- a/ui/lib/replication/addon/templates/components/known-secondaries-card.hbs +++ b/ui/lib/replication/addon/templates/components/known-secondaries-card.hbs @@ -1,7 +1,7 @@

{{this.replicationAttrs.secondaries.length}} Known Secondaries

- + View all
diff --git a/ui/lib/replication/addon/templates/mode/secondaries/config-show.hbs b/ui/lib/replication/addon/templates/mode/secondaries/config-show.hbs index 35fbcd3bd087..52ce12069ace 100644 --- a/ui/lib/replication/addon/templates/mode/secondaries/config-show.hbs +++ b/ui/lib/replication/addon/templates/mode/secondaries/config-show.hbs @@ -3,14 +3,14 @@ {{#if this.model.config.mode}} Edit config {{else}} Create config diff --git a/ui/lib/replication/addon/templates/mode/secondaries/index.hbs b/ui/lib/replication/addon/templates/mode/secondaries/index.hbs index 4ad0fe63b862..bfca6e259852 100644 --- a/ui/lib/replication/addon/templates/mode/secondaries/index.hbs +++ b/ui/lib/replication/addon/templates/mode/secondaries/index.hbs @@ -12,7 +12,7 @@ Add secondary From 3f06edf83e49065067a09121a54501c12e92af1f Mon Sep 17 00:00:00 2001 From: Jordan Reimer Date: Tue, 5 Apr 2022 17:13:59 -0600 Subject: [PATCH 04/10] glimmerizes toolbar-secret-link and secret-link components and removes data-test and class args --- ui/app/components/secret-link.js | 42 +++++++++---------- ui/app/components/toolbar-secret-link.js | 21 +++------- ui/app/templates/components/alphabet-edit.hbs | 4 +- .../components/database-connection.hbs | 8 ++-- .../components/database-role-edit.hbs | 4 +- ui/app/templates/components/role-aws-edit.hbs | 4 +- ui/app/templates/components/role-pki-edit.hbs | 8 ++-- ui/app/templates/components/role-ssh-edit.hbs | 8 ++-- .../components/secret-create-or-update.hbs | 2 +- .../components/secret-edit-metadata.hbs | 2 +- ui/app/templates/components/secret-link.hbs | 12 +----- .../secret-list/database-list-item.hbs | 8 +--- .../templates/components/secret-list/item.hbs | 10 ++--- .../secret-list/transform-list-item.hbs | 6 +-- .../transform-transformation-item.hbs | 6 +-- .../components/secret-version-menu.hbs | 4 +- .../components/toolbar-secret-link.hbs | 19 +++------ .../components/transform-create-form.hbs | 2 +- .../components/transform-edit-form.hbs | 2 +- .../components/transform-role-edit.hbs | 4 +- .../components/transform-template-edit.hbs | 4 +- .../components/transformation-edit.hbs | 2 +- .../components/transit-form-create.hbs | 2 +- .../components/transit-form-edit.hbs | 2 +- .../components/transit-form-show.hbs | 6 +-- .../vault/cluster/secrets/backend/list.hbs | 8 ++-- .../cluster/secrets/backend/overview.hbs | 4 +- .../backend/transit-actions-layout.hbs | 6 +-- .../cluster/secrets/backend/versions.hbs | 6 +-- .../secrets/backend/kv/secret-test.js | 4 +- 30 files changed, 94 insertions(+), 126 deletions(-) diff --git a/ui/app/components/secret-link.js b/ui/app/components/secret-link.js index 30c516a1919c..15a1ec41a2d2 100644 --- a/ui/app/components/secret-link.js +++ b/ui/app/components/secret-link.js @@ -1,28 +1,26 @@ -import { computed } from '@ember/object'; -import Component from '@ember/component'; +import Component from '@glimmer/component'; +import { action } from '@ember/object'; import { encodePath } from 'vault/utils/path-encoding-helpers'; -export default Component.extend({ - onLinkClick() {}, - tagName: '', - // so that ember-test-selectors doesn't log a warning - supportsDataTestProperties: true, - mode: 'list', - - secret: null, - queryParams: null, - ariaLabel: null, - - link: computed('mode', 'secret', function () { - const route = `vault.cluster.secrets.backend.${this.mode}`; - if ((this.mode !== 'versions' && !this.secret) || this.secret === ' ') { +export default class SecretLink extends Component { + get link() { + const { mode, secret } = this.args; + const route = `vault.cluster.secrets.backend.${mode}`; + if ((mode !== 'versions' && !secret) || secret === ' ') { return { route: `${route}-root`, models: [] }; } else { - return { route, models: [encodePath(this.secret)] }; + return { route, models: [encodePath(secret)] }; } - }), - query: computed('queryParams', function () { - const qp = this.queryParams || {}; + } + get query() { + const qp = this.args.queryParams || {}; return qp.isQueryParams ? qp.values : qp; - }), -}); + } + + @action + onLinkClick() { + if (this.args.onLinkClick) { + this.args.onLinkClick(...arguments); + } + } +} diff --git a/ui/app/components/toolbar-secret-link.js b/ui/app/components/toolbar-secret-link.js index e1c6347dc02b..44a1348ca673 100644 --- a/ui/app/components/toolbar-secret-link.js +++ b/ui/app/components/toolbar-secret-link.js @@ -1,3 +1,4 @@ +import Component from '@glimmer/component'; /** * @module ToolbarSecretLink * `ToolbarSecretLink` styles SecretLink for the Toolbar. @@ -16,18 +17,8 @@ * * @param type="" {String} - Use "add" to change icon */ - -import OuterHTML from './outer-html'; -import { computed } from '@ember/object'; - -export default OuterHTML.extend({ - glyph: computed('type', function () { - if (this.type == 'add') { - return 'plus'; - } else { - return 'chevron-right'; - } - }), - tagName: '', - supportsDataTestProperties: true, -}); +export default class ToolbarSecretLink extends Component { + get glyph() { + return this.args.type === 'add' ? 'plus' : 'chevron-right'; + } +} diff --git a/ui/app/templates/components/alphabet-edit.hbs b/ui/app/templates/components/alphabet-edit.hbs index 67d4937f77d5..8d58eff1b005 100644 --- a/ui/app/templates/components/alphabet-edit.hbs +++ b/ui/app/templates/components/alphabet-edit.hbs @@ -35,7 +35,7 @@ Edit alphabet @@ -89,7 +89,7 @@ Cancel diff --git a/ui/app/templates/components/database-connection.hbs b/ui/app/templates/components/database-connection.hbs index 3c0533bb1cc3..1e049604d8c1 100644 --- a/ui/app/templates/components/database-connection.hbs +++ b/ui/app/templates/components/database-connection.hbs @@ -64,13 +64,13 @@ @mode="create" @type="add" @queryParams={{query-params initialKey=@model.name itemType="role"}} - @data-test-secret-create={{true}} + data-test-secret-create={{true}} > Add role {{/if}} {{#if @model.canEdit}} - + Edit configuration {{/if}} @@ -167,7 +167,7 @@
- + Cancel
@@ -287,7 +287,7 @@
- + Cancel
diff --git a/ui/app/templates/components/database-role-edit.hbs b/ui/app/templates/components/database-role-edit.hbs index dc1b521daaa0..416608324547 100644 --- a/ui/app/templates/components/database-role-edit.hbs +++ b/ui/app/templates/components/database-role-edit.hbs @@ -52,7 +52,7 @@ @mode="edit" @replace={{true}} @queryParams={{query-params itemType="role"}} - @data-test-edit-link={{true}} + data-test-edit-link={{true}} > Edit role @@ -145,7 +145,7 @@ {{/if}}
- + Cancel
diff --git a/ui/app/templates/components/role-aws-edit.hbs b/ui/app/templates/components/role-aws-edit.hbs index 2dc5871f441e..d2db6a92d9d1 100644 --- a/ui/app/templates/components/role-aws-edit.hbs +++ b/ui/app/templates/components/role-aws-edit.hbs @@ -33,7 +33,7 @@
{{/if}} {{#if this.model.canGenerate}} - + Generate credentials {{/if}} @@ -71,7 +71,7 @@ Save {{/if}} - + Cancel diff --git a/ui/app/templates/components/role-pki-edit.hbs b/ui/app/templates/components/role-pki-edit.hbs index e8a05f3d7505..b3404ae8c3f3 100644 --- a/ui/app/templates/components/role-pki-edit.hbs +++ b/ui/app/templates/components/role-pki-edit.hbs @@ -36,7 +36,7 @@ @secret={{this.model.id}} @mode="credentials" @queryParams={{query-params action="issue"}} - @data-test-credentials-link={{true}} + data-test-credentials-link={{true}} > Generate Certificate @@ -46,13 +46,13 @@ @secret={{this.model.id}} @mode="credentials" @queryParams={{query-params action="sign"}} - @data-test-sign-link={{true}} + data-test-sign-link={{true}} > Sign Certificate {{/if}} {{#if this.model.canEdit}} - + Edit role {{/if}} @@ -75,7 +75,7 @@ Save {{/if}} - + Cancel diff --git a/ui/app/templates/components/role-ssh-edit.hbs b/ui/app/templates/components/role-ssh-edit.hbs index 2fa17fd59a57..bdcf551d744a 100644 --- a/ui/app/templates/components/role-ssh-edit.hbs +++ b/ui/app/templates/components/role-ssh-edit.hbs @@ -35,18 +35,18 @@ Generate Credential {{else}} - + Sign Keys {{/if}} {{#if (or this.model.canUpdate this.model.canDelete)}} - + Edit role {{/if}} @@ -70,7 +70,7 @@ Save {{/if}} - + Cancel diff --git a/ui/app/templates/components/secret-create-or-update.hbs b/ui/app/templates/components/secret-create-or-update.hbs index 359c3411cc6c..8117f8d82998 100644 --- a/ui/app/templates/components/secret-create-or-update.hbs +++ b/ui/app/templates/components/secret-create-or-update.hbs @@ -139,7 +139,7 @@
- + Cancel
diff --git a/ui/app/templates/components/secret-edit-metadata.hbs b/ui/app/templates/components/secret-edit-metadata.hbs index b04c7cbcd4f4..a4227fab17db 100644 --- a/ui/app/templates/components/secret-edit-metadata.hbs +++ b/ui/app/templates/components/secret-edit-metadata.hbs @@ -42,7 +42,7 @@
- + Cancel
diff --git a/ui/app/templates/components/secret-link.hbs b/ui/app/templates/components/secret-link.hbs index b554867a63bb..a261eeaec148 100644 --- a/ui/app/templates/components/secret-link.hbs +++ b/ui/app/templates/components/secret-link.hbs @@ -2,18 +2,8 @@ @route={{this.link.route}} @models={{this.link.models}} @query={{this.query}} - class={{this.class}} - data-test-secret-create={{this.data-test-secret-create}} - data-test-credentials-link={{this.data-test-credentials-link}} - data-test-backend-credentials={{this.data-test-backend-credentials}} - data-test-edit-link={{this.data-test-edit-link}} - data-test-sign-link={{this.data-test-sign-link}} - data-test-transit-link={{this.data-test-transit-link}} - data-test-transit-key-actions-link={{this.data-test-transit-key-actions-link}} - data-test-transit-action-link={{this.data-test-transit-action-link}} - data-test-version-history={{this.data-test-version-history}} - data-test-version={{this.data-test-version}} {{on "click" this.onLinkClick}} + ...attributes > {{yield}} \ No newline at end of file diff --git a/ui/app/templates/components/secret-list/database-list-item.hbs b/ui/app/templates/components/secret-list/database-list-item.hbs index 2095ca27b2fa..144db4e6319b 100644 --- a/ui/app/templates/components/secret-list/database-list-item.hbs +++ b/ui/app/templates/components/secret-list/database-list-item.hbs @@ -26,18 +26,14 @@