Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UI: upgrade Ember to 5.4 #26708

Merged
merged 26 commits into from
May 7, 2024
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
a69eb92
update to ember 5.4
hashishaw Apr 30, 2024
fb3c46d
upgrade ember-a11y-testing
hashishaw Apr 30, 2024
21d1e08
update ember-power-select
hashishaw Apr 30, 2024
1e25496
Remove extended basic-dropdown/trigger
hashishaw Apr 30, 2024
6023ccd
keep ember-data on 4.12.2
hashishaw Apr 30, 2024
14b5d78
do required changes for upgrade to ember-concurrency v4
hashishaw Apr 30, 2024
0b43c9c
bump ember-template-lint-plugin-prettier to fix lint issues
hashishaw Apr 30, 2024
ffaae49
globally disable lint rule qunit/require-expect in tests
hashishaw Apr 30, 2024
da59513
update ember-cli-page-object version to 2
hashishaw Apr 30, 2024
e7dcdf2
run lint:js:fix
hashishaw Apr 30, 2024
9a44c08
only typeInSearch, clickTrigger come from ember-power-select/test-sup…
hashishaw May 2, 2024
409a67e
Add ariaLabel to search-select component
hashishaw May 2, 2024
5ff13ea
Silence ember-data 5 deprecations only
hashishaw May 2, 2024
62fa2ae
Merge branch 'main' into ui/VAULT-26131/upgrade-ember-to-5.4
hashishaw May 3, 2024
8df9bfa
remove unused test selector
hashishaw May 2, 2024
b1ed908
ensure ember-concurrency is correctly loaded in pki and replication e…
hashishaw May 3, 2024
370e99e
update ember version in readme
hashishaw May 3, 2024
835c432
update deprecation filter
hashishaw May 3, 2024
e4db9b6
fix aws role test and shared test
hashishaw May 3, 2024
06fde1b
fix accessibility error on search-select: ARIA input fields must have…
hashishaw May 6, 2024
15c1ebf
Require ariaLabel on search select
hashishaw May 6, 2024
e258719
Merge branch 'main' into ui/VAULT-26131/upgrade-ember-to-5.4
hashishaw May 6, 2024
6e39200
fix get-credentials-card test
hashishaw May 6, 2024
a394207
Merge branch 'main' into ui/VAULT-26131/upgrade-ember-to-5.4
hashishaw May 6, 2024
52dc6a2
Add changelog
hashishaw May 6, 2024
4a568e2
Merge branch 'main' into ui/VAULT-26131/upgrade-ember-to-5.4
hashishaw May 7, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions ui/.eslintignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# unconventional js
/blueprints/*/files/
/vendor/

# compiled output
/dist/
Expand All @@ -15,7 +14,6 @@
/coverage/
!.*
.*/
.eslintcache

# ember-try
/.node_modules.ember-try/
Expand Down
3 changes: 3 additions & 0 deletions ui/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ module.exports = {
// test files
files: ['tests/**/*-test.{js,ts}'],
extends: ['plugin:qunit/recommended'],
rules: {
'qunit/require-expect': 'off',
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this rule would have made us remove assert.expect in places where it really does help ensure that certain assertions get called (eg in mirage server requests). So I've turned it off and we can revisit in the future if we want to update our tests and turn it on. https://github.com/platinumazure/eslint-plugin-qunit/blob/main/docs/rules/require-expect.md

},
},
{
files: ['**/*.ts'],
Expand Down
10 changes: 3 additions & 7 deletions ui/.gitignore
Original file line number Diff line number Diff line change
@@ -1,27 +1,23 @@
# See https://help.github.com/ignore-files/ for more about ignoring files.

# compiled output
/dist/
/tmp/
/declarations/

# dependencies
/bower_components/
/node_modules/

# misc
/.sass-cache
/.env*
/.pnp*
/.eslintcache
/connect.lock
/coverage/
/libpeerconnection.log
/npm-debug.log*
/testem.log
/yarn-error.log
package-lock.json

# ember-try
/.node_modules.ember-try/
/bower.json.ember-try
/npm-shrinkwrap.json.ember-try
/package.json.ember-try
/package-lock.json.ember-try
Expand Down
14 changes: 1 addition & 13 deletions ui/.prettierignore
Original file line number Diff line number Diff line change
@@ -1,25 +1,13 @@
# unconventional js
/blueprints/*/files/
/vendor/

# compiled output
/dist/
/tmp/

# dependencies
/bower_components/
/node_modules/

# misc
/coverage/
!.*
.eslintcache
.lint-todo/
.*/

# ember-try
/.node_modules.ember-try/
/bower.json.ember-try
/npm-shrinkwrap.json.ember-try
/package.json.ember-try
/package-lock.json.ember-try
/yarn.lock.ember-try
2 changes: 1 addition & 1 deletion ui/.watchmanconfig
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"ignore_dirs": ["tmp", "dist"]
"ignore_dirs": ["dist"]
}
10 changes: 0 additions & 10 deletions ui/app/components/basic-dropdown/trigger.js

This file was deleted.

9 changes: 6 additions & 3 deletions ui/app/helpers/-date-base.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,12 @@ export default Helper.extend({
* as the run loop queue is never clear so tests will stay locked waiting
* for queue to clear.
*/
this.intervalTimer = setTimeout(() => {
run(() => this.recompute());
}, parseInt(interval, 10));
this.intervalTimer = setTimeout(
() => {
run(() => this.recompute());
},
parseInt(interval, 10)
);
}
},

Expand Down
2 changes: 1 addition & 1 deletion ui/app/initializers/deprecation-filter.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export function initialize() {
registerDeprecationHandler((message, options, next) => {
// filter deprecations that are scheduled to be removed in a specific version
// when upgrading or addressing deprecation warnings be sure to update this or remove if not needed
if (options?.until.includes('5.0')) {
if (options?.until.includes('5.0') && options?.for === 'ember-data') {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that we're on Ember 5, we only want to turn of EmberData 5 deprecations

return;
}
next(message, options);
Expand Down
1 change: 1 addition & 0 deletions ui/app/templates/application.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@
<div class="page-container">
{{outlet}}
</div>
<BasicDropdownWormhole />
</Sidebar::Frame>
2 changes: 1 addition & 1 deletion ui/config/ember-cli-update.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"packages": [
{
"name": "ember-cli",
"version": "4.12.1",
"version": "5.4.2",
"blueprints": [
{
"name": "app",
Expand Down
5 changes: 3 additions & 2 deletions ui/ember-cli-build.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ const appConfig = {
serviceWorkerScope: config.serviceWorkerScope,
skipWaitingOnMessage: true,
},
babel: {
plugins: [require.resolve('ember-concurrency/async-arrow-task-transform')],
},
svgJar: {
//optimize: false,
//paths: [],
optimizer: {},
sourceDirs: ['public'],
rootURL: '/ui/',
Expand Down
1 change: 1 addition & 0 deletions ui/lib/core/addon/components/search-select.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
@renderInPlace={{@renderInPlace}}
@verticalPosition="below"
@disabled={{@disabled}}
@ariaLabel={{or @label (humanize @id)}}
as |option|
>
{{#if this.shouldRenderName}}
Expand Down
40 changes: 23 additions & 17 deletions ui/lib/core/addon/utils/client-count-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,13 @@ export const formatByNamespace = (namespaceArray: NamespaceObject[]) => {
// when querying historical data the response will always contain the latest client type keys because the activity log is
// constructed based on the version of Vault the user is on (key values will be 0)
export const destructureClientCounts = (verboseObject: Counts | ByNamespaceClients) => {
return CLIENT_TYPES.reduce((newObj: Record<ClientTypes, Counts[ClientTypes]>, clientType: ClientTypes) => {
newObj[clientType] = verboseObject[clientType];
return newObj;
}, {} as Record<ClientTypes, Counts[ClientTypes]>);
return CLIENT_TYPES.reduce(
(newObj: Record<ClientTypes, Counts[ClientTypes]>, clientType: ClientTypes) => {
newObj[clientType] = verboseObject[clientType];
return newObj;
},
{} as Record<ClientTypes, Counts[ClientTypes]>
);
};

export const sortMonthsByTimestamp = (monthsArray: ActivityMonthBlock[] | EmptyActivityMonthBlock[]) => {
Expand All @@ -159,19 +162,22 @@ export const namespaceArrayToObject = (
// mounts_by_key is is used to filter further in a namespace and get monthly activity by mount
// it's an object inside the namespace block where the keys are mount paths
// and the values include new and total client counts for that mount in that month
const mounts_by_key = ns.mounts.reduce((mountObj: { [key: string]: MountByKey }, mount) => {
const newMountClients = newNsClients.mounts.find((m) => m.label === mount.label);

if (newMountClients) {
mountObj[mount.label] = {
...mount,
timestamp,
month,
new_clients: { month, timestamp, ...newMountClients },
};
}
return mountObj;
}, {} as { [key: string]: MountByKey });
const mounts_by_key = ns.mounts.reduce(
(mountObj: { [key: string]: MountByKey }, mount) => {
const newMountClients = newNsClients.mounts.find((m) => m.label === mount.label);

if (newMountClients) {
mountObj[mount.label] = {
...mount,
timestamp,
month,
new_clients: { month, timestamp, ...newMountClients },
};
}
return mountObj;
},
{} as { [key: string]: MountByKey }
);

nsObject[ns.label] = {
...destructureClientCounts(ns),
Expand Down
5 changes: 5 additions & 0 deletions ui/lib/core/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@

module.exports = {
name: require('./package').name,

babel: {
plugins: [require.resolve('ember-concurrency/async-arrow-task-transform')],
},

isDevelopingAddon() {
return true;
},
Expand Down
3 changes: 3 additions & 0 deletions ui/lib/kubernetes/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ module.exports = buildEngine({
lazyLoading: {
enabled: false,
},
babel: {
plugins: [require.resolve('ember-concurrency/async-arrow-task-transform')],
},
isDevelopingAddon() {
return true;
},
Expand Down
4 changes: 4 additions & 0 deletions ui/lib/kv/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ module.exports = buildEngine({
enabled: false,
},

babel: {
plugins: [require.resolve('ember-concurrency/async-arrow-task-transform')],
},

isDevelopingAddon() {
return true;
},
Expand Down
3 changes: 2 additions & 1 deletion ui/lib/kv/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"ember-engine"
],
"dependencies": {
"ember-auto-import": "*",
"ember-cli-htmlbars": "*",
"ember-cli-babel": "*",
"ember-concurrency": "*",
Expand All @@ -16,4 +17,4 @@
"../core"
]
}
}
}
4 changes: 4 additions & 0 deletions ui/lib/ldap/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ module.exports = buildEngine({
enabled: false,
}),

babel: {
plugins: [require.resolve('ember-concurrency/async-arrow-task-transform')],
},

isDevelopingAddon() {
return true;
},
Expand Down
16 changes: 8 additions & 8 deletions ui/lib/pki/addon/components/page/pki-issuer-rotate-root.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,14 +108,14 @@ export default class PagePkiIssuerRotateRootComponent extends Component<Args> {
const endpoint = `/v1/${this.secretMountPath.currentPath}/issuer/${this.args.newRootModel.issuerId}/${format}`;
const adapter = this.store.adapterFor('application');
try {
return adapter
.rawRequest(endpoint, 'GET', { unauthenticated: true })
.then(function (response: Response) {
if (format === 'der') {
return response.blob();
}
return response.text();
});
return adapter.rawRequest(endpoint, 'GET', { unauthenticated: true }).then(function (
response: Response
) {
if (format === 'der') {
return response.blob();
}
return response.text();
});
} catch (e) {
return null;
}
Expand Down
4 changes: 4 additions & 0 deletions ui/lib/sync/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ module.exports = buildEngine({
enabled: false,
}),

babel: {
plugins: [require.resolve('ember-concurrency/async-arrow-task-transform')],
},

isDevelopingAddon() {
return true;
},
Expand Down
Loading
Loading