+
+
{{#let
(hash
- value=(or sortBy "State:asc")
- change=(action (mut sortBy) value="target.selected")
+ value=(or this.sortBy "State:asc")
+ change=(action (mut this.sortBy) value="target.selected")
)
(hash
state=(hash
- value=(if state (split state ",") undefined)
- change=(action (mut state) value="target.selectedItems")
+ value=(if this.state (split this.state ",") undefined)
+ change=(action (mut this.state) value="target.selectedItems")
)
searchproperty=(hash
value=(if
- (not-eq searchproperty undefined)
- (split searchproperty ",")
- searchProperties
+ (not-eq this.searchproperty undefined)
+ (split this.searchproperty ",")
+ this.searchProperties
)
- change=(action (mut searchproperty) value="target.selectedItems")
- default=searchProperties
+ change=(action (mut this.searchproperty) value="target.selectedItems")
+ default=this.searchProperties
)
)
loader.data
@@ -54,8 +54,8 @@
{{#if (gt items.length 0)}}
@@ -70,7 +70,7 @@
as |modal|
>
- {{did-insert (set this "create" modal)}}
+ {{did-insert-helper (set this "create" modal)}}
Add peer connection
@@ -84,7 +84,7 @@
@onsubmit={{fn this.redirectToPeerShow modal.close}}
as |form|
>
- {{did-insert (set this "form" form)}}
+ {{did-insert-helper (set this "form" form)}}
@@ -133,7 +133,7 @@
as |modal|
>
- {{did-insert (set this "regenerate" modal)}}
+ {{did-insert-helper (set this "regenerate" modal)}}
Regenerate token
@@ -146,7 +146,7 @@
@regenerate={{true}}
as |form|
>
- {{did-insert (set this "regenerateForm" form)}}
+ {{did-insert-helper (set this "regenerateForm" form)}}
{{/if}}
@@ -162,7 +162,7 @@
@type="peer"
@sort={{sort.value}}
@filters={{filters}}
- @search={{search}}
+ @search={{this.search}}
@items={{items}}
as |collection|
>
diff --git a/ui/packages/consul-peerings/app/templates/dc/peers/show.hbs b/ui/packages/consul-peerings/app/templates/dc/peers/show.hbs
index 843c54adf8ef..9b0d7551c5ca 100644
--- a/ui/packages/consul-peerings/app/templates/dc/peers/show.hbs
+++ b/ui/packages/consul-peerings/app/templates/dc/peers/show.hbs
@@ -3,7 +3,7 @@
SPDX-License-Identifier: BUSL-1.1
}}
-
+
+
{{#if (gt route.model.items.length 0)}}
{{else}}
diff --git a/ui/packages/consul-peerings/app/templates/dc/peers/show/exported.hbs b/ui/packages/consul-peerings/app/templates/dc/peers/show/exported.hbs
index 35198bfe8df3..09b8118c993c 100644
--- a/ui/packages/consul-peerings/app/templates/dc/peers/show/exported.hbs
+++ b/ui/packages/consul-peerings/app/templates/dc/peers/show/exported.hbs
@@ -3,7 +3,7 @@
SPDX-License-Identifier: BUSL-1.1
}}
-
+
+
{{#let
(hash
- value=(or sortBy "Status:asc")
- change=(action (mut sortBy) value="target.selected")
+ value=(or this.sortBy "Status:asc")
+ change=(action (mut this.sortBy) value="target.selected")
)
(hash
status=(hash
- value=(if status (split status ",") undefined)
- change=(action (mut status) value="target.selectedItems")
+ value=(if this.status (split this.status ",") undefined)
+ change=(action (mut this.status) value="target.selectedItems")
)
kind=(hash
- value=(if kind (split kind ",") undefined)
- change=(action (mut kind) value="target.selectedItems")
+ value=(if this.kind (split this.kind ",") undefined)
+ change=(action (mut this.kind) value="target.selectedItems")
)
source=(hash
- value=(if source (split source ",") undefined)
- change=(action (mut source) value="target.selectedItems")
+ value=(if this.source (split this.source ",") undefined)
+ change=(action (mut this.source) value="target.selectedItems")
)
searchproperty=(hash
value=(if
- (not-eq searchproperty undefined)
- (split searchproperty ",")
+ (not-eq this.searchproperty undefined)
+ (split this.searchproperty ",")
this.searchProperties
)
- change=(action (mut searchproperty) value="target.selectedItems")
+ change=(action (mut this.searchproperty) value="target.selectedItems")
default=this.searchProperties
)
)
@@ -63,8 +63,8 @@
@sources={{get items "ExternalSources"}}
@partitions={{get items "Partitions"}}
@partition={{partition}}
- @search={{search}}
- @onsearch={{action (mut search) value="target.value"}}
+ @search={{this.search}}
+ @onsearch={{action (mut this.search) value="target.value"}}
@sort={{sort}}
@filter={{filters}}
@peer={{route.model.peer}}
@@ -75,7 +75,7 @@
@type="service"
@sort={{sort.value}}
@filters={{filters}}
- @search={{search}}
+ @search={{this.search}}
@items={{items}}
as |collection|
>
diff --git a/ui/packages/consul-peerings/app/templates/dc/peers/show/index.hbs b/ui/packages/consul-peerings/app/templates/dc/peers/show/index.hbs
index 9a077304e400..5adc800c22c3 100644
--- a/ui/packages/consul-peerings/app/templates/dc/peers/show/index.hbs
+++ b/ui/packages/consul-peerings/app/templates/dc/peers/show/index.hbs
@@ -3,6 +3,6 @@
SPDX-License-Identifier: BUSL-1.1
}}
-
- {{did-insert this.transitionToImported}}
+
+ {{did-insert-helper this.transitionToImported}}
\ No newline at end of file
diff --git a/ui/packages/consul-ui/.eslintrc.js b/ui/packages/consul-ui/.eslintrc.js
index 114ea2c2f7d3..5e533c002741 100644
--- a/ui/packages/consul-ui/.eslintrc.js
+++ b/ui/packages/consul-ui/.eslintrc.js
@@ -5,10 +5,17 @@
module.exports = {
root: true,
- parser: 'babel-eslint',
+ parser: '@babel/eslint-parser',
parserOptions: {
- ecmaVersion: 2018,
+ ecmaVersion: 2022,
sourceType: 'module',
+ requireConfigFile: false,
+ babelOptions: {
+ plugins: [
+ ['@babel/plugin-proposal-decorators', { legacy: true }],
+ ['@babel/plugin-transform-class-properties', { loose: true }],
+ ],
+ },
ecmaFeatures: {
legacyDecorators: true,
},
@@ -22,8 +29,6 @@ module.exports = {
'no-console': ['error', { allow: ['error', 'info'] }],
'no-unused-vars': ['error', { args: 'none' }],
'ember/no-new-mixins': ['warn'],
- 'ember/no-jquery': 'warn',
- 'ember/no-global-jquery': 'warn',
// for 3.24 update
'ember/classic-decorator-no-classic-methods': ['warn'],
diff --git a/ui/packages/consul-ui/app/abilities/base.js b/ui/packages/consul-ui/app/abilities/base.js
index c2f58ab7b485..5c807df460f3 100644
--- a/ui/packages/consul-ui/app/abilities/base.js
+++ b/ui/packages/consul-ui/app/abilities/base.js
@@ -5,7 +5,7 @@
import { inject as service } from '@ember/service';
import { get } from '@ember/object';
-import { Ability } from 'ember-can';
+import Ability from 'ember-can/ability';
export const ACCESS_READ = 'read';
export const ACCESS_WRITE = 'write';
diff --git a/ui/packages/consul-ui/app/components/consul/health-check/list/pageobject.js b/ui/packages/consul-ui/app/components/consul/health-check/list/pageobject.js
index d7040294a0f5..c29976e080ef 100644
--- a/ui/packages/consul-ui/app/components/consul/health-check/list/pageobject.js
+++ b/ui/packages/consul-ui/app/components/consul/health-check/list/pageobject.js
@@ -5,13 +5,9 @@
export default (collection, text) =>
(scope = '.consul-health-check-list') => {
- return collection({
- scope,
- itemScope: 'li',
- item: {
- name: text('header h2'),
- type: text('[data-health-check-type]'),
- exposed: text('[data-test-exposed]'),
- },
+ return collection(`${scope} li`, {
+ name: text('header h2'),
+ type: text('[data-health-check-type]'),
+ exposed: text('[data-test-exposed]'),
});
};
diff --git a/ui/packages/consul-ui/app/components/consul/kv/list/pageobject.js b/ui/packages/consul-ui/app/components/consul/kv/list/pageobject.js
index 43f58bce828a..421a4e098480 100644
--- a/ui/packages/consul-ui/app/components/consul/kv/list/pageobject.js
+++ b/ui/packages/consul-ui/app/components/consul/kv/list/pageobject.js
@@ -6,10 +6,10 @@
export default (collection, clickable, attribute, deletable) => () => {
return collection('.consul-kv-list [data-test-tabular-row]', {
name: attribute('data-test-kv', '[data-test-kv]'),
- kv: clickable('a'),
- actions: clickable('label'),
+ kv: clickable('a', { at: 0 }),
+ actions: clickable('label', { at: 0 }),
...deletable(),
- delete: clickable('[data-test-delete] [role="menuitem"]'),
+ delete: clickable('[data-test-delete] [role="menuitem"]', { at: 0 }),
confirmInlineDelete: clickable("#confirm-modal [data-test-id='confirm-action']", {
resetScope: true,
testContainer: 'body', // modal is rendered in the body
diff --git a/ui/packages/consul-ui/app/components/consul/policy/list/pageobject.js b/ui/packages/consul-ui/app/components/consul/policy/list/pageobject.js
index eaaed90a14ba..34d7c0e193c1 100644
--- a/ui/packages/consul-ui/app/components/consul/policy/list/pageobject.js
+++ b/ui/packages/consul-ui/app/components/consul/policy/list/pageobject.js
@@ -7,7 +7,7 @@ export default (collection, clickable, attribute, text, actions) => () => {
return collection('.consul-policy-list [data-test-list-row]', {
name: attribute('data-test-policy', '[data-test-policy]'),
description: text('[data-test-description]'),
- policy: clickable('a'),
+ policy: clickable('a', { at: 0 }),
...actions(['edit', 'delete']),
});
};
diff --git a/ui/packages/consul-ui/app/components/consul/role/list/pageobject.js b/ui/packages/consul-ui/app/components/consul/role/list/pageobject.js
index f858d1117c72..9818ceb24332 100644
--- a/ui/packages/consul-ui/app/components/consul/role/list/pageobject.js
+++ b/ui/packages/consul-ui/app/components/consul/role/list/pageobject.js
@@ -5,7 +5,7 @@
export default (collection, clickable, attribute, text, actions) => () => {
return collection('.consul-role-list [data-test-list-row]', {
- role: clickable('a'),
+ role: clickable('a', { at: 0 }),
name: attribute('data-test-role', '[data-test-role]'),
description: text('[data-test-description]'),
policy: text('[data-test-policy].policy', { multiple: true }),
diff --git a/ui/packages/consul-ui/app/components/consul/token/list/pageobject.js b/ui/packages/consul-ui/app/components/consul/token/list/pageobject.js
index f6fd0a2b213d..a096a1fe694a 100644
--- a/ui/packages/consul-ui/app/components/consul/token/list/pageobject.js
+++ b/ui/packages/consul-ui/app/components/consul/token/list/pageobject.js
@@ -10,7 +10,7 @@ export default (collection, clickable, attribute, text, actions) => () => {
policy: text('[data-test-policy].policy', { multiple: true }),
role: text('[data-test-policy].role', { multiple: true }),
serviceIdentity: text('[data-test-policy].policy-service-identity', { multiple: true }),
- token: clickable('a'),
+ token: clickable('a', { at: 0 }),
...actions(['edit', 'delete', 'use', 'logout', 'clone']),
});
};
diff --git a/ui/packages/consul-ui/app/components/consul/tomography/graph/index.hbs b/ui/packages/consul-ui/app/components/consul/tomography/graph/index.hbs
index 3cd793c00e68..421e00a73a1e 100644
--- a/ui/packages/consul-ui/app/components/consul/tomography/graph/index.hbs
+++ b/ui/packages/consul-ui/app/components/consul/tomography/graph/index.hbs
@@ -8,7 +8,7 @@
...attributes
>
-
+
\ No newline at end of file
diff --git a/ui/packages/consul-ui/app/components/data-collection/index.hbs b/ui/packages/consul-ui/app/components/data-collection/index.hbs
index 3c301a49f7f5..cd02fa4f2c99 100644
--- a/ui/packages/consul-ui/app/components/data-collection/index.hbs
+++ b/ui/packages/consul-ui/app/components/data-collection/index.hbs
@@ -3,7 +3,7 @@
SPDX-License-Identifier: BUSL-1.1
}}
-{{did-update (action (fn (set this 'term') '') @search)}}
+{{did-update-helper (action (fn (set this 'term') '') @search)}}
{{yield (hash
search=(action this.search)
items=this.items
diff --git a/ui/packages/consul-ui/app/components/data-form/index.hbs b/ui/packages/consul-ui/app/components/data-form/index.hbs
index e03202c209af..a3f792396bbe 100644
--- a/ui/packages/consul-ui/app/components/data-form/index.hbs
+++ b/ui/packages/consul-ui/app/components/data-form/index.hbs
@@ -12,7 +12,7 @@
nspace=@nspace
dc=@dc
type=@type
- src=@src
+ src=(or @src '')
)
}}
@onchange={{action "setData"}}
diff --git a/ui/packages/consul-ui/app/components/data-loader/index.hbs b/ui/packages/consul-ui/app/components/data-loader/index.hbs
index 33ba547bd418..d945817ffc27 100644
--- a/ui/packages/consul-ui/app/components/data-loader/index.hbs
+++ b/ui/packages/consul-ui/app/components/data-loader/index.hbs
@@ -31,7 +31,7 @@
@onchange={{queue (action "change" value="data") (action dispatch "SUCCESS")}}
@onerror={{api.dispatchError}}
as |source|>
- {{did-insert (set this 'invalidate' source.invalidate)}}
+ {{did-insert-helper (set this 'invalidate' source.invalidate)}}
{{/if}}
@@ -86,5 +86,5 @@
{{/let}}
- {{did-update (fn dispatch "LOAD") src=@src}}
+ {{did-update-helper (fn dispatch "LOAD") src=@src}}
\ No newline at end of file
diff --git a/ui/packages/consul-ui/app/components/data-source/index.hbs b/ui/packages/consul-ui/app/components/data-source/index.hbs
index 65d006801626..2a1aa1a031ed 100644
--- a/ui/packages/consul-ui/app/components/data-source/index.hbs
+++ b/ui/packages/consul-ui/app/components/data-source/index.hbs
@@ -12,13 +12,13 @@
style="width: 0;height: 0;font-size: 0;padding: 0;margin: 0;"
/>
{{else}}
- {{did-insert this.connect}}
+ {{did-insert-helper this.connect}}
{{/if}}
- {{did-update this.attributeChanged 'src' @src}}
- {{did-update this.attributeChanged 'loading' @loading}}
- {{will-destroy this.disconnect}}
+ {{did-update-helper this.attributeChanged 'src' @src}}
+ {{did-update-helper this.attributeChanged 'loading' @loading}}
+ {{will-destroy-helper this.disconnect}}
{{/if}}
-{{did-update this.attributeChanged 'disabled' @disabled}}
+{{did-update-helper this.attributeChanged 'disabled' @disabled}}
{{yield (hash
data=this.data
error=this.error
diff --git a/ui/packages/consul-ui/app/components/disclosure/details/index.hbs b/ui/packages/consul-ui/app/components/disclosure/details/index.hbs
index 3ecfdb6ee4ea..566af9c19902 100644
--- a/ui/packages/consul-ui/app/components/disclosure/details/index.hbs
+++ b/ui/packages/consul-ui/app/components/disclosure/details/index.hbs
@@ -4,7 +4,7 @@
}}
{{#let
- (unique-id)
+ (dom-guid)
as |id|}}
{{#if (or
(and (eq @auto undefined) @disclosure.expanded)
@@ -16,6 +16,6 @@ as |id|}}
expanded=@disclosure.expanded
)}}
{{/if}}
-{{did-insert (fn @disclosure.add id)}}
-{{will-destroy (fn @disclosure.remove id)}}
+{{did-insert-helper (fn @disclosure.add id)}}
+{{will-destroy-helper (fn @disclosure.remove id)}}
{{/let}}
diff --git a/ui/packages/consul-ui/app/components/disclosure/index.hbs b/ui/packages/consul-ui/app/components/disclosure/index.hbs
index 5632f83f2f72..c87bd447a5f0 100644
--- a/ui/packages/consul-ui/app/components/disclosure/index.hbs
+++ b/ui/packages/consul-ui/app/components/disclosure/index.hbs
@@ -13,7 +13,7 @@ as |State Guard Action dispatch state|>
open=(fn dispatch 'TRUE')
expanded=(state-matches state 'true')
event=state.context
- button=(unique-id)
+ button=(dom-guid)
controls=this.ids
) as |_api|}}
{{#let (assign _api (hash
diff --git a/ui/packages/consul-ui/app/components/hashicorp-consul/pageobject.js b/ui/packages/consul-ui/app/components/hashicorp-consul/pageobject.js
index f2a470c93ee2..34e5bea1598b 100644
--- a/ui/packages/consul-ui/app/components/hashicorp-consul/pageobject.js
+++ b/ui/packages/consul-ui/app/components/hashicorp-consul/pageobject.js
@@ -1,4 +1,4 @@
-export default (collection, clickable, attribute, is, authForm, emptyState) => (scope) => {
+export default (collection, clickable, attribute, property, authForm, emptyState) => (scope) => {
const page = {
navigation: [
'services',
@@ -49,7 +49,7 @@ export default (collection, clickable, attribute, is, authForm, emptyState) => (
page.navigation.manageNspaces = clickable(
'[data-test-nspace-menu] [data-test-nav-selector-footer-link]'
);
- page.navigation.manageNspacesIsVisible = is(
+ page.navigation.manageNspacesIsVisible = property(
':checked',
'[data-test-nspace-menu] > input[type="checkbox"]'
);
diff --git a/ui/packages/consul-ui/app/components/modal-dialog/index.hbs b/ui/packages/consul-ui/app/components/modal-dialog/index.hbs
index 28a79c167d9c..cd04d14a09f5 100644
--- a/ui/packages/consul-ui/app/components/modal-dialog/index.hbs
+++ b/ui/packages/consul-ui/app/components/modal-dialog/index.hbs
@@ -4,7 +4,7 @@
}}
{{#let (hash
- labelledby=(unique-id)
+ labelledby=(dom-guid)
) as |aria|}}