From 60675a12a6a11c8db46576fccc903caa4aec6c7f Mon Sep 17 00:00:00 2001 From: Randall Morey Date: Fri, 5 Mar 2021 17:27:00 -0500 Subject: [PATCH] =?UTF-8?q?refactor:=20=F0=9F=92=A1=20upgrade=20ui/admin?= =?UTF-8?q?=20to=20Ember=203.24?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/admin/.eslintignore | 1 + ui/admin/.eslintrc.js | 36 +++++++++------ ui/admin/.prettierignore | 21 +++++++++ ui/admin/.prettierrc.js | 5 ++ ui/admin/.template-lintrc.js | 16 +++++-- ui/admin/app/components/copyable/index.hbs | 2 +- ui/admin/app/components/copyable/index.js | 5 +- ui/admin/app/routes/scopes/scope.js | 2 + .../accounts/account/set-password.js | 5 +- .../routes/scopes/scope/auth-methods/new.js | 4 +- .../scopes/scope/authenticate/method.js | 10 ++-- .../host-sets/host-set/add-hosts.js | 5 +- .../host-sets/host-set/create-and-add-host.js | 5 +- .../host-catalog/host-sets/host-set/hosts.js | 5 +- .../routes/scopes/scope/roles/role/index.js | 2 +- ui/admin/app/routes/scopes/scope/sessions.js | 1 + ui/admin/config/ember-cli-update.json | 2 +- ui/admin/config/environment.js | 4 +- ui/admin/ember-cli-build.js | 8 ++-- ui/admin/package.json | 46 +++++++++++-------- ui/admin/tests/acceptance/accounts-test.js | 4 +- .../tests/acceptance/auth-methods-test.js | 2 +- ui/admin/tests/index.html | 7 +++ ui/admin/tests/test-helper.js | 8 +++- .../scope/auth-methods/auth-method-test.js | 25 +++++----- .../scope/groups/group/add-members-test.js | 25 +++++----- .../scopes/scope/groups/group/members-test.js | 25 +++++----- .../scope/host-catalogs/host-catalog-test.js | 25 +++++----- .../scope/roles/role/add-principals-test.js | 25 +++++----- .../scope/roles/role/principals-test.js | 25 +++++----- .../scope/targets/target/host-sets-test.js | 25 +++++----- .../scopes/scope/users/user/accounts-test.js | 25 +++++----- .../scope/users/user/add-accounts-test.js | 25 +++++----- .../scope/auth-methods/auth-method-test.js | 23 +++++----- .../auth-methods/auth-method/index-test.js | 23 +++++----- .../scope/groups/group/add-members-test.js | 23 +++++----- .../scope/host-catalogs/host-catalog-test.js | 23 +++++----- .../scope/roles/role/add-principals-test.js | 23 +++++----- .../targets/target/add-host-sets-test.js | 23 +++++----- .../scope/targets/target/host-sets-test.js | 23 +++++----- ui/desktop/app/components/copyable/index.hbs | 2 +- ui/desktop/app/components/copyable/index.js | 4 +- yarn.lock | 8 ++++ 43 files changed, 340 insertions(+), 266 deletions(-) create mode 100644 ui/admin/.prettierignore create mode 100644 ui/admin/.prettierrc.js diff --git a/ui/admin/.eslintignore b/ui/admin/.eslintignore index 72df37307..922165552 100644 --- a/ui/admin/.eslintignore +++ b/ui/admin/.eslintignore @@ -13,6 +13,7 @@ # misc /coverage/ !.* +.eslintcache # ember-try /.node_modules.ember-try/ diff --git a/ui/admin/.eslintrc.js b/ui/admin/.eslintrc.js index 26d707835..5062441ff 100644 --- a/ui/admin/.eslintrc.js +++ b/ui/admin/.eslintrc.js @@ -7,47 +7,53 @@ module.exports = { ecmaVersion: 2018, sourceType: 'module', ecmaFeatures: { - legacyDecorators: true - } + legacyDecorators: true, + }, }, - plugins: [ - 'ember' - ], + plugins: ['ember'], extends: [ 'eslint:recommended', - 'plugin:ember/recommended' + 'plugin:ember/recommended', + 'plugin:prettier/recommended', ], env: { - browser: true + browser: true, + }, + rules: { + 'ember/no-get': 'off', + 'ember/no-get-with-default': 'off', + 'ember/no-computed-properties-in-native-classes': 'off', + 'ember/no-assignment-of-untracked-properties-used-in-tracking-contexts': + 'off', }, - rules: {}, overrides: [ // node files { files: [ '.eslintrc.js', + '.prettierrc.js', '.template-lintrc.js', 'ember-cli-build.js', 'testem.js', 'blueprints/*/index.js', 'config/**/*.js', 'lib/*/index.js', - 'server/**/*.js' + 'server/**/*.js', ], parserOptions: { - sourceType: 'script' + sourceType: 'script', }, env: { browser: false, - node: true + node: true, }, plugins: ['node'], extends: ['plugin:node/recommended'], rules: { // this can be removed once the following is fixed // https://github.com/mysticatea/eslint-plugin-node/issues/77 - 'node/no-unpublished-require': 'off' - } - } - ] + 'node/no-unpublished-require': 'off', + }, + }, + ], }; diff --git a/ui/admin/.prettierignore b/ui/admin/.prettierignore new file mode 100644 index 000000000..922165552 --- /dev/null +++ b/ui/admin/.prettierignore @@ -0,0 +1,21 @@ +# unconventional js +/blueprints/*/files/ +/vendor/ + +# compiled output +/dist/ +/tmp/ + +# dependencies +/bower_components/ +/node_modules/ + +# misc +/coverage/ +!.* +.eslintcache + +# ember-try +/.node_modules.ember-try/ +/bower.json.ember-try +/package.json.ember-try diff --git a/ui/admin/.prettierrc.js b/ui/admin/.prettierrc.js new file mode 100644 index 000000000..534e6d35a --- /dev/null +++ b/ui/admin/.prettierrc.js @@ -0,0 +1,5 @@ +'use strict'; + +module.exports = { + singleQuote: true, +}; diff --git a/ui/admin/.template-lintrc.js b/ui/admin/.template-lintrc.js index b887df9af..be0764215 100644 --- a/ui/admin/.template-lintrc.js +++ b/ui/admin/.template-lintrc.js @@ -4,7 +4,17 @@ module.exports = { extends: 'octane', rules: { 'no-bare-strings': true, - 'no-curly-component-invocation': { allow: ['app-name', 'company-name', 'company-copyright'] }, - 'no-implicit-this': { allow: ['app-name', 'company-name', 'company-copyright', 'doc-url', 'is-loading'] } - } + 'no-curly-component-invocation': { + allow: ['app-name', 'company-name', 'company-copyright'], + }, + 'no-implicit-this': { + allow: [ + 'app-name', + 'company-name', + 'company-copyright', + 'doc-url', + 'is-loading', + ], + }, + }, }; diff --git a/ui/admin/app/components/copyable/index.hbs b/ui/admin/app/components/copyable/index.hbs index 618f3315b..ac3474940 100644 --- a/ui/admin/app/components/copyable/index.hbs +++ b/ui/admin/app/components/copyable/index.hbs @@ -2,7 +2,7 @@ id={{this.id}} class="copyable" {{did-insert this.register}} - {{will-destroy this.destroy}} + {{will-destroy this.tearDown}} > {{#if this.copied}} diff --git a/ui/admin/app/components/copyable/index.js b/ui/admin/app/components/copyable/index.js index 17652e911..09da77365 100644 --- a/ui/admin/app/components/copyable/index.js +++ b/ui/admin/app/components/copyable/index.js @@ -36,6 +36,7 @@ export default class CopyableComponent extends Component { this.copied = true; yield timeout(1000); this.copied = false; + /* eslint-disable-next-line prettier/prettier */ }).drop() confirmCopyTimer; /** @@ -53,7 +54,7 @@ export default class CopyableComponent extends Component { */ @action register() { - this.destroy(); + this.tearDown(); /* istanbul ignore next */ this.clipboard = new ClipboardJS(`#${this.copyableButtonId}`, { text: () => this.args.text, @@ -69,7 +70,7 @@ export default class CopyableComponent extends Component { * Destroy ClipboardJS library instance and cancel icon timer. */ @action - destroy() { + tearDown() { this.clipboard?.destroy(); this.clipboard = null; this.confirmCopyTimer.cancelAll(); diff --git a/ui/admin/app/routes/scopes/scope.js b/ui/admin/app/routes/scopes/scope.js index 52799df7c..196164793 100644 --- a/ui/admin/app/routes/scopes/scope.js +++ b/ui/admin/app/routes/scopes/scope.js @@ -70,6 +70,7 @@ export default class ScopesScopeRoute extends Route { // Update the controller (if exists), since setupController is only // called once the first time the route is activated. It is not called // again on route refreshes. + /* eslint-disable-next-line ember/no-controller-access-in-routes */ if (this.controller) this.setControllerProperties(this.scopes); } @@ -87,6 +88,7 @@ export default class ScopesScopeRoute extends Route { * @param {array} scopes */ setControllerProperties(scopes) { + /* eslint-disable-next-line ember/no-controller-access-in-routes */ this.controller.setProperties({ scopes }); } diff --git a/ui/admin/app/routes/scopes/scope/auth-methods/auth-method/accounts/account/set-password.js b/ui/admin/app/routes/scopes/scope/auth-methods/auth-method/accounts/account/set-password.js index 72d2c0609..66b8b2236 100644 --- a/ui/admin/app/routes/scopes/scope/auth-methods/auth-method/accounts/account/set-password.js +++ b/ui/admin/app/routes/scopes/scope/auth-methods/auth-method/accounts/account/set-password.js @@ -2,10 +2,7 @@ import Route from '@ember/routing/route'; import { action } from '@ember/object'; import { inject as service } from '@ember/service'; import loading from 'ember-loading/decorator'; -import { - notifySuccess, - notifyError, -} from 'core/decorators/notify'; +import { notifySuccess, notifyError } from 'core/decorators/notify'; export default class ScopesScopeAuthMethodsAuthMethodAccountsAccountSettingsRoute extends Route { // =services diff --git a/ui/admin/app/routes/scopes/scope/auth-methods/new.js b/ui/admin/app/routes/scopes/scope/auth-methods/new.js index 04ab0aacf..dee0dc759 100644 --- a/ui/admin/app/routes/scopes/scope/auth-methods/new.js +++ b/ui/admin/app/routes/scopes/scope/auth-methods/new.js @@ -5,8 +5,8 @@ export default class ScopesScopeAuthMethodsNewRoute extends Route { queryParams = { type: { - refreshModel: true - } + refreshModel: true, + }, }; // =methods diff --git a/ui/admin/app/routes/scopes/scope/authenticate/method.js b/ui/admin/app/routes/scopes/scope/authenticate/method.js index cfb2c5acf..1e4c9f46a 100644 --- a/ui/admin/app/routes/scopes/scope/authenticate/method.js +++ b/ui/admin/app/routes/scopes/scope/authenticate/method.js @@ -37,12 +37,10 @@ export default class ScopesScopeAuthenticateMethodRoute extends Route { const authMethod = this.modelFor('scopes.scope.authenticate.method'); const authenticatorName = `authenticator:${authMethod.type}`; const requestCookies = false; - await this.session.authenticate( - authenticatorName, - creds, - requestCookies, - { scope, authMethod } - ); + await this.session.authenticate(authenticatorName, creds, requestCookies, { + scope, + authMethod, + }); this.transitionTo('index'); } } diff --git a/ui/admin/app/routes/scopes/scope/host-catalogs/host-catalog/host-sets/host-set/add-hosts.js b/ui/admin/app/routes/scopes/scope/host-catalogs/host-catalog/host-sets/host-set/add-hosts.js index b92c16814..5232404f1 100644 --- a/ui/admin/app/routes/scopes/scope/host-catalogs/host-catalog/host-sets/host-set/add-hosts.js +++ b/ui/admin/app/routes/scopes/scope/host-catalogs/host-catalog/host-sets/host-set/add-hosts.js @@ -3,10 +3,7 @@ import { inject as service } from '@ember/service'; import { action } from '@ember/object'; import { hash } from 'rsvp'; import loading from 'ember-loading/decorator'; -import { - notifySuccess, - notifyError, -} from 'core/decorators/notify'; +import { notifySuccess, notifyError } from 'core/decorators/notify'; export default class ScopesScopeHostCatalogsHostCatalogHostSetsHostSetAddHostsRoute extends Route { // =services diff --git a/ui/admin/app/routes/scopes/scope/host-catalogs/host-catalog/host-sets/host-set/create-and-add-host.js b/ui/admin/app/routes/scopes/scope/host-catalogs/host-catalog/host-sets/host-set/create-and-add-host.js index 977fc45f4..dfb871e6a 100644 --- a/ui/admin/app/routes/scopes/scope/host-catalogs/host-catalog/host-sets/host-set/create-and-add-host.js +++ b/ui/admin/app/routes/scopes/scope/host-catalogs/host-catalog/host-sets/host-set/create-and-add-host.js @@ -2,10 +2,7 @@ import Route from '@ember/routing/route'; import { inject as service } from '@ember/service'; import { action } from '@ember/object'; import loading from 'ember-loading/decorator'; -import { - notifySuccess, - notifyError, -} from 'core/decorators/notify'; +import { notifySuccess, notifyError } from 'core/decorators/notify'; export default class ScopesScopeHostCatalogsHostCatalogHostSetsHostSetCreateAndAddHostRoute extends Route { // =services diff --git a/ui/admin/app/routes/scopes/scope/host-catalogs/host-catalog/host-sets/host-set/hosts.js b/ui/admin/app/routes/scopes/scope/host-catalogs/host-catalog/host-sets/host-set/hosts.js index 5c3fbae73..b3f1a1c23 100644 --- a/ui/admin/app/routes/scopes/scope/host-catalogs/host-catalog/host-sets/host-set/hosts.js +++ b/ui/admin/app/routes/scopes/scope/host-catalogs/host-catalog/host-sets/host-set/hosts.js @@ -4,10 +4,7 @@ import { action } from '@ember/object'; import { inject as service } from '@ember/service'; import loading from 'ember-loading/decorator'; import { confirm } from 'core/decorators/confirm'; -import { - notifySuccess, - notifyError, -} from 'core/decorators/notify'; +import { notifySuccess, notifyError } from 'core/decorators/notify'; export default class ScopesScopeHostCatalogsHostCatalogHostSetsHostSetHostsRoute extends Route { // =services diff --git a/ui/admin/app/routes/scopes/scope/roles/role/index.js b/ui/admin/app/routes/scopes/scope/roles/role/index.js index 24dd3c658..1f9589be7 100644 --- a/ui/admin/app/routes/scopes/scope/roles/role/index.js +++ b/ui/admin/app/routes/scopes/scope/roles/role/index.js @@ -19,7 +19,7 @@ export default class ScopesScopeRolesRoleIndexRoute extends Route { subScopes, }, ]; - this.set('grantScopes', grantScopes); + this.grantScopes = grantScopes; } /** diff --git a/ui/admin/app/routes/scopes/scope/sessions.js b/ui/admin/app/routes/scopes/scope/sessions.js index 2bcb606c1..2df7c8b4b 100644 --- a/ui/admin/app/routes/scopes/scope/sessions.js +++ b/ui/admin/app/routes/scopes/scope/sessions.js @@ -34,6 +34,7 @@ export default class ScopesScopeSessionsRoute extends Route { yield timeout(POLL_TIMEOUT_SECONDS * 1000); yield this.refresh(); } + /* eslint-disable-next-line prettier/prettier */ }).drop() poller; // =methods diff --git a/ui/admin/config/ember-cli-update.json b/ui/admin/config/ember-cli-update.json index 4c2450a37..c408f46f0 100644 --- a/ui/admin/config/ember-cli-update.json +++ b/ui/admin/config/ember-cli-update.json @@ -3,7 +3,7 @@ "packages": [ { "name": "ember-cli", - "version": "3.20.2", + "version": "3.24.0", "blueprints": [ { "name": "app", diff --git a/ui/admin/config/environment.js b/ui/admin/config/environment.js index 7cd8efa3e..fd3f8da64 100644 --- a/ui/admin/config/environment.js +++ b/ui/admin/config/environment.js @@ -81,8 +81,8 @@ module.exports = function (environment) { }, 'ember-cli-mirage': { - directory: '../../addons/api/mirage' - } + directory: '../../addons/api/mirage', + }, }; // Unsafe policy is necessary in development and test environments, but should diff --git a/ui/admin/ember-cli-build.js b/ui/admin/ember-cli-build.js index e99e80679..68a02a237 100644 --- a/ui/admin/ember-cli-build.js +++ b/ui/admin/ember-cli-build.js @@ -5,7 +5,7 @@ const EmberApp = require('ember-cli/lib/broccoli/ember-app'); module.exports = function (defaults) { let app = new EmberApp(defaults, { 'ember-cli-babel': { - includeExternalHelpers: true + includeExternalHelpers: true, }, babel: { sourceMaps: 'inline', @@ -22,10 +22,8 @@ module.exports = function (defaults) { importCss: false, }, svg: { - paths: [ - '../../addons/core/public' - ] - } + paths: ['../../addons/core/public'], + }, }); // Only import when in development or test mode diff --git a/ui/admin/package.json b/ui/admin/package.json index 9df05a650..ad2580897 100644 --- a/ui/admin/package.json +++ b/ui/admin/package.json @@ -13,13 +13,16 @@ "doc:toc": "doctoc README.md", "build:development": "ember build", "build": "ember build --environment=production", - "lint": "npm-run-all --aggregate-output --continue-on-error --parallel lint:*", + "lint": "npm-run-all --aggregate-output --continue-on-error --parallel 'lint:!(fix)'", + "lint:fix": "npm-run-all --aggregate-output --continue-on-error --parallel lint:*:fix", "lint:hbs": "ember-template-lint .", + "lint:hbs:fix": "ember-template-lint . --fix", "lint:js": "eslint .", "lint:sass": "sass-lint -v -q", "format": "npm-run-all format:*", "format:js": "prettier --write '{app,config,stories,tests}/**/*.js' *.js", "format:sass": "prettier --write app/**/*.scss", + "lint:js:fix": "eslint . --fix", "start": "ember serve", "clean:coverage": "rm -rf coverage_*", "pretest": "yarn clean:coverage", @@ -29,10 +32,11 @@ }, "devDependencies": { "@babel/core": "^7.9.6", - "@ember/optional-features": "^1.3.0", + "@ember/optional-features": "^2.0.0", "@ember/render-modifiers": "^1.0.2", - "@glimmer/component": "^1.0.1", - "@glimmer/tracking": "^1.0.0", + "@ember/test-helpers": "^2.1.4", + "@glimmer/component": "^1.0.3", + "@glimmer/tracking": "^1.0.3", "babel-eslint": "^10.1.0", "babel-loader": "^8.1.0", "broccoli-asset-rev": "^3.0.0", @@ -40,41 +44,45 @@ "core": "*", "doctoc": "^1.4.0", "ember-a11y-testing": "^3.0.0", - "ember-auto-import": "^1.6.0", + "ember-auto-import": "^1.10.1", "ember-breadcrumbs": "^0.2.3", - "ember-cli": "~3.20.2", - "ember-cli-app-version": "^3.2.0", - "ember-cli-babel": "^7.21.0", + "ember-cli": "~3.24.0", + "ember-cli-app-version": "^4.0.0", + "ember-cli-babel": "^7.23.0", "ember-cli-code-coverage": "^1.0.2", "ember-cli-content-security-policy": "^1.1.1", "ember-cli-dependency-checker": "^3.2.0", - "ember-cli-htmlbars": "^5.2.0", + "ember-cli-htmlbars": "^5.3.1", "ember-cli-inject-live-reload": "^2.0.2", "ember-cli-sass": "^10.0.1", "ember-cli-sri": "^2.1.1", "ember-cli-template-lint": "^2.0.2", - "ember-cli-uglify": "^3.0.0", + "ember-cli-terser": "^4.0.1", "ember-cli-update": "^0.54.6", "ember-concurrency": "^1.3.0", "ember-exam": "^6.0.1", "ember-export-application-global": "^2.0.1", "ember-inline-svg": "^1.0.0", - "ember-load-initializers": "^2.1.1", + "ember-load-initializers": "^2.1.2", "ember-maybe-import-regenerator": "^0.1.6", "ember-modifier": "^2.1.1", "ember-notify": "^6.0.0", - "ember-qunit": "^4.6.0", - "ember-resolver": "^8.0.0", - "ember-source": "~3.20.2", - "ember-template-lint": "^2.14.0", - "eslint": "^7.5.0", - "eslint-plugin-ember": "^8.9.1", + "ember-page-title": "^6.0.3", + "ember-qunit": "^5.1.1", + "ember-resolver": "^8.0.2", + "ember-source": "~3.24.0", + "ember-template-lint": "^2.15.0", + "eslint": "^7.17.0", + "eslint-config-prettier": "^7.1.0", + "eslint-plugin-ember": "^10.1.1", "eslint-plugin-node": "^11.1.0", + "eslint-plugin-prettier": "^3.3.1", "faker": "^5.1.0", "loader.js": "^4.7.0", "npm-run-all": "^4.1.5", - "prettier": "^2.1.2", - "qunit-dom": "^1.2.0", + "prettier": "^2.2.1", + "qunit": "^2.13.0", + "qunit-dom": "^1.6.0", "rose": "*", "sass": "^1.29.0", "sass-lint": "^1.13.1", diff --git a/ui/admin/tests/acceptance/accounts-test.js b/ui/admin/tests/acceptance/accounts-test.js index c12cc02a0..5b16765f8 100644 --- a/ui/admin/tests/acceptance/accounts-test.js +++ b/ui/admin/tests/acceptance/accounts-test.js @@ -79,8 +79,8 @@ module('Acceptance | accounts', function (hooks) { test('can update an account and save changes', async function (assert) { assert.expect(1); await visit(urls.account); + await click('form [type="button"]', 'Activate edit mode'); await fillIn('[name="name"]', 'update name'); - await click('form [type="button"]'); await click('form [type="submit"]:not(:disabled)'); assert.equal(this.server.db.accounts[0].name, 'update name'); }); @@ -175,8 +175,8 @@ module('Acceptance | accounts', function (hooks) { ); }); await visit(urls.account); + await click('form [type="button"]', 'Activate edit mode'); await fillIn('[name="name"]', 'save account'); - await click('form [type="button"]'); await click('form [type="submit"]'); await a11yAudit(); assert.ok( diff --git a/ui/admin/tests/acceptance/auth-methods-test.js b/ui/admin/tests/acceptance/auth-methods-test.js index bdc509df2..67e73d624 100644 --- a/ui/admin/tests/acceptance/auth-methods-test.js +++ b/ui/admin/tests/acceptance/auth-methods-test.js @@ -161,8 +161,8 @@ module('Acceptance | auth methods', function (hooks) { ); }); await visit(urls.authMethod); + await click('form [type="button"]', 'Activate edit mode'); await fillIn('[name="name"]', 'save auth method'); - await click('form [type="button"]'); await click('form [type="submit"]'); await a11yAudit(); assert.ok( diff --git a/ui/admin/tests/index.html b/ui/admin/tests/index.html index 97040205c..5591db965 100644 --- a/ui/admin/tests/index.html +++ b/ui/admin/tests/index.html @@ -21,6 +21,13 @@ {{content-for "body"}} {{content-for "test-body"}} +
+
+
+
+
+
+ diff --git a/ui/admin/tests/test-helper.js b/ui/admin/tests/test-helper.js index bc88900fc..f4950f34d 100644 --- a/ui/admin/tests/test-helper.js +++ b/ui/admin/tests/test-helper.js @@ -1,9 +1,13 @@ -import Application from '../app'; -import config from '../config/environment'; +import Application from 'admin/app'; +import config from 'admin/config/environment'; +import * as QUnit from 'qunit'; import { setApplication } from '@ember/test-helpers'; +import { setup } from 'qunit-dom'; //import { start } from 'ember-qunit'; import start from 'ember-exam/test-support/start'; setApplication(Application.create(config.APP)); +setup(QUnit.assert); + start(); diff --git a/ui/admin/tests/unit/controllers/scopes/scope/auth-methods/auth-method-test.js b/ui/admin/tests/unit/controllers/scopes/scope/auth-methods/auth-method-test.js index f9fe31d0b..f1396eba0 100644 --- a/ui/admin/tests/unit/controllers/scopes/scope/auth-methods/auth-method-test.js +++ b/ui/admin/tests/unit/controllers/scopes/scope/auth-methods/auth-method-test.js @@ -1,16 +1,17 @@ import { module, test } from 'qunit'; import { setupTest } from 'ember-qunit'; -module('Unit | Controller | scopes/scope/auth-methods/auth-method', function ( - hooks -) { - setupTest(hooks); +module( + 'Unit | Controller | scopes/scope/auth-methods/auth-method', + function (hooks) { + setupTest(hooks); - // Replace this with your real tests. - test('it exists', function (assert) { - let controller = this.owner.lookup( - 'controller:scopes/scope/auth-methods/auth-method' - ); - assert.ok(controller); - }); -}); + // Replace this with your real tests. + test('it exists', function (assert) { + let controller = this.owner.lookup( + 'controller:scopes/scope/auth-methods/auth-method' + ); + assert.ok(controller); + }); + } +); diff --git a/ui/admin/tests/unit/controllers/scopes/scope/groups/group/add-members-test.js b/ui/admin/tests/unit/controllers/scopes/scope/groups/group/add-members-test.js index baffc2dda..263e690aa 100644 --- a/ui/admin/tests/unit/controllers/scopes/scope/groups/group/add-members-test.js +++ b/ui/admin/tests/unit/controllers/scopes/scope/groups/group/add-members-test.js @@ -1,16 +1,17 @@ import { module, test } from 'qunit'; import { setupTest } from 'ember-qunit'; -module('Unit | Controller | scopes/scope/groups/group/add-members', function ( - hooks -) { - setupTest(hooks); +module( + 'Unit | Controller | scopes/scope/groups/group/add-members', + function (hooks) { + setupTest(hooks); - // Replace this with your real tests. - test('it exists', function (assert) { - let controller = this.owner.lookup( - 'controller:scopes/scope/groups/group/add-members' - ); - assert.ok(controller); - }); -}); + // Replace this with your real tests. + test('it exists', function (assert) { + let controller = this.owner.lookup( + 'controller:scopes/scope/groups/group/add-members' + ); + assert.ok(controller); + }); + } +); diff --git a/ui/admin/tests/unit/controllers/scopes/scope/groups/group/members-test.js b/ui/admin/tests/unit/controllers/scopes/scope/groups/group/members-test.js index 46dbddf58..0d8b1c81a 100644 --- a/ui/admin/tests/unit/controllers/scopes/scope/groups/group/members-test.js +++ b/ui/admin/tests/unit/controllers/scopes/scope/groups/group/members-test.js @@ -1,16 +1,17 @@ import { module, test } from 'qunit'; import { setupTest } from 'ember-qunit'; -module('Unit | Controller | scopes/scope/groups/group/members', function ( - hooks -) { - setupTest(hooks); +module( + 'Unit | Controller | scopes/scope/groups/group/members', + function (hooks) { + setupTest(hooks); - // TODO: Replace this with your real tests. - test('it exists', function (assert) { - let controller = this.owner.lookup( - 'controller:scopes/scope/groups/group/members' - ); - assert.ok(controller); - }); -}); + // TODO: Replace this with your real tests. + test('it exists', function (assert) { + let controller = this.owner.lookup( + 'controller:scopes/scope/groups/group/members' + ); + assert.ok(controller); + }); + } +); diff --git a/ui/admin/tests/unit/controllers/scopes/scope/host-catalogs/host-catalog-test.js b/ui/admin/tests/unit/controllers/scopes/scope/host-catalogs/host-catalog-test.js index fa1b421b7..9782d1c12 100644 --- a/ui/admin/tests/unit/controllers/scopes/scope/host-catalogs/host-catalog-test.js +++ b/ui/admin/tests/unit/controllers/scopes/scope/host-catalogs/host-catalog-test.js @@ -1,16 +1,17 @@ import { module, test } from 'qunit'; import { setupTest } from 'ember-qunit'; -module('Unit | Controller | scopes/scope/host-catalogs/host-catalog', function ( - hooks -) { - setupTest(hooks); +module( + 'Unit | Controller | scopes/scope/host-catalogs/host-catalog', + function (hooks) { + setupTest(hooks); - // TODO: Replace this with your real tests. - test('it exists', function (assert) { - let controller = this.owner.lookup( - 'controller:scopes/scope/host-catalogs/host-catalog' - ); - assert.ok(controller); - }); -}); + // TODO: Replace this with your real tests. + test('it exists', function (assert) { + let controller = this.owner.lookup( + 'controller:scopes/scope/host-catalogs/host-catalog' + ); + assert.ok(controller); + }); + } +); diff --git a/ui/admin/tests/unit/controllers/scopes/scope/roles/role/add-principals-test.js b/ui/admin/tests/unit/controllers/scopes/scope/roles/role/add-principals-test.js index ed13dde40..7eb851443 100644 --- a/ui/admin/tests/unit/controllers/scopes/scope/roles/role/add-principals-test.js +++ b/ui/admin/tests/unit/controllers/scopes/scope/roles/role/add-principals-test.js @@ -1,16 +1,17 @@ import { module, test } from 'qunit'; import { setupTest } from 'ember-qunit'; -module('Unit | Controller | scopes/scope/roles/role/add-principals', function ( - hooks -) { - setupTest(hooks); +module( + 'Unit | Controller | scopes/scope/roles/role/add-principals', + function (hooks) { + setupTest(hooks); - // Replace this with your real tests. - test('it exists', function (assert) { - let controller = this.owner.lookup( - 'controller:scopes/scope/roles/role/add-principals' - ); - assert.ok(controller); - }); -}); + // Replace this with your real tests. + test('it exists', function (assert) { + let controller = this.owner.lookup( + 'controller:scopes/scope/roles/role/add-principals' + ); + assert.ok(controller); + }); + } +); diff --git a/ui/admin/tests/unit/controllers/scopes/scope/roles/role/principals-test.js b/ui/admin/tests/unit/controllers/scopes/scope/roles/role/principals-test.js index 14de1a906..d8ad32897 100644 --- a/ui/admin/tests/unit/controllers/scopes/scope/roles/role/principals-test.js +++ b/ui/admin/tests/unit/controllers/scopes/scope/roles/role/principals-test.js @@ -1,16 +1,17 @@ import { module, test } from 'qunit'; import { setupTest } from 'ember-qunit'; -module('Unit | Controller | scopes/scope/roles/role/principals', function ( - hooks -) { - setupTest(hooks); +module( + 'Unit | Controller | scopes/scope/roles/role/principals', + function (hooks) { + setupTest(hooks); - // TODO: Replace this with your real tests. - test('it exists', function (assert) { - let controller = this.owner.lookup( - 'controller:scopes/scope/roles/role/principals' - ); - assert.ok(controller); - }); -}); + // TODO: Replace this with your real tests. + test('it exists', function (assert) { + let controller = this.owner.lookup( + 'controller:scopes/scope/roles/role/principals' + ); + assert.ok(controller); + }); + } +); diff --git a/ui/admin/tests/unit/controllers/scopes/scope/targets/target/host-sets-test.js b/ui/admin/tests/unit/controllers/scopes/scope/targets/target/host-sets-test.js index 1cc1b3aa1..46ca085a6 100644 --- a/ui/admin/tests/unit/controllers/scopes/scope/targets/target/host-sets-test.js +++ b/ui/admin/tests/unit/controllers/scopes/scope/targets/target/host-sets-test.js @@ -1,16 +1,17 @@ import { module, test } from 'qunit'; import { setupTest } from 'ember-qunit'; -module('Unit | Controller | scopes/scope/targets/target/host-sets', function ( - hooks -) { - setupTest(hooks); +module( + 'Unit | Controller | scopes/scope/targets/target/host-sets', + function (hooks) { + setupTest(hooks); - // TODO: Replace this with your real tests. - test('it exists', function (assert) { - let controller = this.owner.lookup( - 'controller:scopes/scope/targets/target/host-sets' - ); - assert.ok(controller); - }); -}); + // TODO: Replace this with your real tests. + test('it exists', function (assert) { + let controller = this.owner.lookup( + 'controller:scopes/scope/targets/target/host-sets' + ); + assert.ok(controller); + }); + } +); diff --git a/ui/admin/tests/unit/controllers/scopes/scope/users/user/accounts-test.js b/ui/admin/tests/unit/controllers/scopes/scope/users/user/accounts-test.js index f11f78bce..214b1a0a5 100644 --- a/ui/admin/tests/unit/controllers/scopes/scope/users/user/accounts-test.js +++ b/ui/admin/tests/unit/controllers/scopes/scope/users/user/accounts-test.js @@ -1,16 +1,17 @@ import { module, test } from 'qunit'; import { setupTest } from 'ember-qunit'; -module('Unit | Controller | scopes/scope/users/user/accounts', function ( - hooks -) { - setupTest(hooks); +module( + 'Unit | Controller | scopes/scope/users/user/accounts', + function (hooks) { + setupTest(hooks); - // TODO: Replace this with your real tests. - test('it exists', function (assert) { - let controller = this.owner.lookup( - 'controller:scopes/scope/users/user/accounts' - ); - assert.ok(controller); - }); -}); + // TODO: Replace this with your real tests. + test('it exists', function (assert) { + let controller = this.owner.lookup( + 'controller:scopes/scope/users/user/accounts' + ); + assert.ok(controller); + }); + } +); diff --git a/ui/admin/tests/unit/controllers/scopes/scope/users/user/add-accounts-test.js b/ui/admin/tests/unit/controllers/scopes/scope/users/user/add-accounts-test.js index 451f97d18..7971e808f 100644 --- a/ui/admin/tests/unit/controllers/scopes/scope/users/user/add-accounts-test.js +++ b/ui/admin/tests/unit/controllers/scopes/scope/users/user/add-accounts-test.js @@ -1,16 +1,17 @@ import { module, test } from 'qunit'; import { setupTest } from 'ember-qunit'; -module('Unit | Controller | scopes/scope/users/user/add-accounts', function ( - hooks -) { - setupTest(hooks); +module( + 'Unit | Controller | scopes/scope/users/user/add-accounts', + function (hooks) { + setupTest(hooks); - // Replace this with your real tests. - test('it exists', function (assert) { - let controller = this.owner.lookup( - 'controller:scopes/scope/users/user/add-accounts' - ); - assert.ok(controller); - }); -}); + // Replace this with your real tests. + test('it exists', function (assert) { + let controller = this.owner.lookup( + 'controller:scopes/scope/users/user/add-accounts' + ); + assert.ok(controller); + }); + } +); diff --git a/ui/admin/tests/unit/routes/scopes/scope/auth-methods/auth-method-test.js b/ui/admin/tests/unit/routes/scopes/scope/auth-methods/auth-method-test.js index 147a0a52b..01be4e6b1 100644 --- a/ui/admin/tests/unit/routes/scopes/scope/auth-methods/auth-method-test.js +++ b/ui/admin/tests/unit/routes/scopes/scope/auth-methods/auth-method-test.js @@ -1,15 +1,16 @@ import { module, test } from 'qunit'; import { setupTest } from 'ember-qunit'; -module('Unit | Route | scopes/scope/auth-methods/auth-method', function ( - hooks -) { - setupTest(hooks); +module( + 'Unit | Route | scopes/scope/auth-methods/auth-method', + function (hooks) { + setupTest(hooks); - test('it exists', function (assert) { - let route = this.owner.lookup( - 'route:scopes/scope/auth-methods/auth-method' - ); - assert.ok(route); - }); -}); + test('it exists', function (assert) { + let route = this.owner.lookup( + 'route:scopes/scope/auth-methods/auth-method' + ); + assert.ok(route); + }); + } +); diff --git a/ui/admin/tests/unit/routes/scopes/scope/auth-methods/auth-method/index-test.js b/ui/admin/tests/unit/routes/scopes/scope/auth-methods/auth-method/index-test.js index 1f9e281c9..84b88453f 100644 --- a/ui/admin/tests/unit/routes/scopes/scope/auth-methods/auth-method/index-test.js +++ b/ui/admin/tests/unit/routes/scopes/scope/auth-methods/auth-method/index-test.js @@ -1,15 +1,16 @@ import { module, test } from 'qunit'; import { setupTest } from 'ember-qunit'; -module('Unit | Route | scopes/scope/auth-methods/auth-method/index', function ( - hooks -) { - setupTest(hooks); +module( + 'Unit | Route | scopes/scope/auth-methods/auth-method/index', + function (hooks) { + setupTest(hooks); - test('it exists', function (assert) { - let route = this.owner.lookup( - 'route:scopes/scope/auth-methods/auth-method/index' - ); - assert.ok(route); - }); -}); + test('it exists', function (assert) { + let route = this.owner.lookup( + 'route:scopes/scope/auth-methods/auth-method/index' + ); + assert.ok(route); + }); + } +); diff --git a/ui/admin/tests/unit/routes/scopes/scope/groups/group/add-members-test.js b/ui/admin/tests/unit/routes/scopes/scope/groups/group/add-members-test.js index 03d00b579..065b23e40 100644 --- a/ui/admin/tests/unit/routes/scopes/scope/groups/group/add-members-test.js +++ b/ui/admin/tests/unit/routes/scopes/scope/groups/group/add-members-test.js @@ -1,15 +1,16 @@ import { module, test } from 'qunit'; import { setupTest } from 'ember-qunit'; -module('Unit | Route | scopes/scope/groups/group/add-members', function ( - hooks -) { - setupTest(hooks); +module( + 'Unit | Route | scopes/scope/groups/group/add-members', + function (hooks) { + setupTest(hooks); - test('it exists', function (assert) { - let route = this.owner.lookup( - 'route:scopes/scope/groups/group/add-members' - ); - assert.ok(route); - }); -}); + test('it exists', function (assert) { + let route = this.owner.lookup( + 'route:scopes/scope/groups/group/add-members' + ); + assert.ok(route); + }); + } +); diff --git a/ui/admin/tests/unit/routes/scopes/scope/host-catalogs/host-catalog-test.js b/ui/admin/tests/unit/routes/scopes/scope/host-catalogs/host-catalog-test.js index 7fc517187..8766e1ba1 100644 --- a/ui/admin/tests/unit/routes/scopes/scope/host-catalogs/host-catalog-test.js +++ b/ui/admin/tests/unit/routes/scopes/scope/host-catalogs/host-catalog-test.js @@ -1,15 +1,16 @@ import { module, test } from 'qunit'; import { setupTest } from 'ember-qunit'; -module('Unit | Route | scopes/scope/host-catalogs/host-catalog', function ( - hooks -) { - setupTest(hooks); +module( + 'Unit | Route | scopes/scope/host-catalogs/host-catalog', + function (hooks) { + setupTest(hooks); - test('it exists', function (assert) { - let route = this.owner.lookup( - 'route:scopes/scope/host-catalogs/host-catalog' - ); - assert.ok(route); - }); -}); + test('it exists', function (assert) { + let route = this.owner.lookup( + 'route:scopes/scope/host-catalogs/host-catalog' + ); + assert.ok(route); + }); + } +); diff --git a/ui/admin/tests/unit/routes/scopes/scope/roles/role/add-principals-test.js b/ui/admin/tests/unit/routes/scopes/scope/roles/role/add-principals-test.js index d70535062..d8ac4fac7 100644 --- a/ui/admin/tests/unit/routes/scopes/scope/roles/role/add-principals-test.js +++ b/ui/admin/tests/unit/routes/scopes/scope/roles/role/add-principals-test.js @@ -1,15 +1,16 @@ import { module, test } from 'qunit'; import { setupTest } from 'ember-qunit'; -module('Unit | Route | scopes/scope/roles/role/add-principals', function ( - hooks -) { - setupTest(hooks); +module( + 'Unit | Route | scopes/scope/roles/role/add-principals', + function (hooks) { + setupTest(hooks); - test('it exists', function (assert) { - let route = this.owner.lookup( - 'route:scopes/scope/roles/role/add-principals' - ); - assert.ok(route); - }); -}); + test('it exists', function (assert) { + let route = this.owner.lookup( + 'route:scopes/scope/roles/role/add-principals' + ); + assert.ok(route); + }); + } +); diff --git a/ui/admin/tests/unit/routes/scopes/scope/targets/target/add-host-sets-test.js b/ui/admin/tests/unit/routes/scopes/scope/targets/target/add-host-sets-test.js index cc7f6a011..e2a87487e 100644 --- a/ui/admin/tests/unit/routes/scopes/scope/targets/target/add-host-sets-test.js +++ b/ui/admin/tests/unit/routes/scopes/scope/targets/target/add-host-sets-test.js @@ -1,15 +1,16 @@ import { module, test } from 'qunit'; import { setupTest } from 'ember-qunit'; -module('Unit | Route | scopes/scope/targets/target/add-host-sets', function ( - hooks -) { - setupTest(hooks); +module( + 'Unit | Route | scopes/scope/targets/target/add-host-sets', + function (hooks) { + setupTest(hooks); - test('it exists', function (assert) { - let route = this.owner.lookup( - 'route:scopes/scope/targets/target/add-host-sets' - ); - assert.ok(route); - }); -}); + test('it exists', function (assert) { + let route = this.owner.lookup( + 'route:scopes/scope/targets/target/add-host-sets' + ); + assert.ok(route); + }); + } +); diff --git a/ui/admin/tests/unit/routes/scopes/scope/targets/target/host-sets-test.js b/ui/admin/tests/unit/routes/scopes/scope/targets/target/host-sets-test.js index 77d9430d2..214bf28b3 100644 --- a/ui/admin/tests/unit/routes/scopes/scope/targets/target/host-sets-test.js +++ b/ui/admin/tests/unit/routes/scopes/scope/targets/target/host-sets-test.js @@ -1,15 +1,16 @@ import { module, test } from 'qunit'; import { setupTest } from 'ember-qunit'; -module('Unit | Route | scopes/scope/targets/target/host-sets', function ( - hooks -) { - setupTest(hooks); +module( + 'Unit | Route | scopes/scope/targets/target/host-sets', + function (hooks) { + setupTest(hooks); - test('it exists', function (assert) { - let route = this.owner.lookup( - 'route:scopes/scope/targets/target/host-sets' - ); - assert.ok(route); - }); -}); + test('it exists', function (assert) { + let route = this.owner.lookup( + 'route:scopes/scope/targets/target/host-sets' + ); + assert.ok(route); + }); + } +); diff --git a/ui/desktop/app/components/copyable/index.hbs b/ui/desktop/app/components/copyable/index.hbs index 618f3315b..ac3474940 100644 --- a/ui/desktop/app/components/copyable/index.hbs +++ b/ui/desktop/app/components/copyable/index.hbs @@ -2,7 +2,7 @@ id={{this.id}} class="copyable" {{did-insert this.register}} - {{will-destroy this.destroy}} + {{will-destroy this.tearDown}} > {{#if this.copied}} diff --git a/ui/desktop/app/components/copyable/index.js b/ui/desktop/app/components/copyable/index.js index 3de4687ff..86a18c2ea 100644 --- a/ui/desktop/app/components/copyable/index.js +++ b/ui/desktop/app/components/copyable/index.js @@ -66,7 +66,7 @@ export default class CopyableComponent extends Component { */ @action register() { - this.destroy(); + this.tearDown(); /* istanbul ignore next */ this.clipboard = new ClipboardJS(`#${this.copyableButtonId}`, { text: () => this.args.text, @@ -89,7 +89,7 @@ export default class CopyableComponent extends Component { * Destroy ClipboardJS library instance and cancel icon timer. */ @action - destroy() { + tearDown() { this.clipboard?.destroy(); this.clipboard = null; this.confirmCopyTimer.cancelAll(); diff --git a/yarn.lock b/yarn.lock index 4fc969092..065b3e2da 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8573,6 +8573,14 @@ ember-cli-app-version@^3.2.0: ember-cli-babel "^6.12.0" git-repo-version "^1.0.2" +ember-cli-app-version@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/ember-cli-app-version/-/ember-cli-app-version-4.0.0.tgz#033057ec5fe4d3ecdf5ac5380d442e2dc9f7526a" + integrity sha512-YRH1r4vjA9ZIgTVJ38zWxhtt4SCzIHb0ppEsO/z+JV0ZTQlS3+2dT5RhJWz7O3dyw5FWnlIng+gPRoQEz1umHA== + dependencies: + ember-cli-babel "^7.22.1" + git-repo-info "^2.1.1" + ember-cli-babel-plugin-helpers@^1.0.0, ember-cli-babel-plugin-helpers@^1.1.0, ember-cli-babel-plugin-helpers@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/ember-cli-babel-plugin-helpers/-/ember-cli-babel-plugin-helpers-1.1.1.tgz#5016b80cdef37036c4282eef2d863e1d73576879"