Skip to content

Commit

Permalink
Ember Upgrade to 3.24 (#13443)
Browse files Browse the repository at this point in the history
* Update browserslist

* Add browserslistrc

* ember-cli-update --to 3.26, fix conflicts

* Run codemodes that start with ember-*

* More codemods - before cp*

* More codemods (curly data-test-*)

* WIP ember-basic-dropdown template errors

* updates ember-basic-dropdown and related deps to fix build issues

* updates basic dropdown instances to new version API

* updates more deps -- ember-template-lint is working again

* runs no-implicit-this codemod

* creates and runs no-quoteless-attributes codemod

* runs angle brackets codemod

* updates lint:hbs globs to only touch hbs files

* removes yield only templates

* creates and runs deprecated args transform

* supresses lint error for invokeAction on LinkTo component

* resolves remaining ambiguous path lint errors

* resolves simple-unless lint errors

* adds warnings for deprecated tagName arg on LinkTo components

* adds warnings for remaining curly component invocation

* updates global template lint rules

* resolves remaining template lint errors

* disables some ember specfic lint rules that target pre octane patterns

* js lint fix run

* resolves remaining js lint errors

* fixes test run

* adds npm-run-all dep

* fixes test attribute issues

* fixes console acceptance tests

* fixes tests

* adds yield only wizard/tutorial-active template

* fixes more tests

* attempts to fix more flaky tests

* removes commented out settled in transit test

* updates deprecations workflow and adds initializer to filter by version

* updates flaky policies acl old test

* updates to flaky transit test

* bumps ember deps down to LTS version

* runs linters after main merge

* fixes client count tests after bad merge conflict fixes

* fixes client count history test

* more updates to lint config

* another round of hbs lint fixes after extending stylistic rule

* updates lint-staged commands

* removes indent eslint rule since it seems to break things

* fixes bad attribute in transform-edit-form template

* test fixes

* fixes enterprise tests

* adds changelog

* removes deprecated ember-concurrency-test-waiters dep and adds @ember/test-waiters

* flaky test fix

Co-authored-by: hashishaw <[email protected]>
  • Loading branch information
zofskeez and hashishaw authored Dec 17, 2021
1 parent 1aca265 commit e5b1f71
Show file tree
Hide file tree
Showing 1,093 changed files with 14,681 additions and 12,293 deletions.
3 changes: 3 additions & 0 deletions changelog/13443.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:change
ui: Upgrade Ember to version 3.24
```
3 changes: 3 additions & 0 deletions ui/.browserslistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
defaults
not IE 11
maintained node versions
2 changes: 2 additions & 0 deletions ui/.eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

# misc
/coverage/
!.*
.eslintcache

# ember-try
/.node_modules.ember-try/
Expand Down
21 changes: 14 additions & 7 deletions ui/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,32 +12,39 @@ module.exports = {
legacyDecorators: true,
},
},
plugins: ['ember', 'prettier'],
extends: ['eslint:recommended', 'plugin:ember/recommended', 'prettier'],
plugins: ['ember'],
extends: ['eslint:recommended', 'plugin:ember/recommended', 'plugin:prettier/recommended'],
env: {
browser: true,
es6: true,
},
rules: {
// TODO revisit once figure out how to replace, added during upgrade to 3.20
'ember/no-new-mixins': 'off',
'ember/no-mixins': 'off',
'no-console': 'warn',
'ember/no-mixins': 'warn',
'ember/no-new-mixins': 'off', // should be warn but then every line of the mixin is green
// need to be fully glimmerized before these rules can be turned on
'ember/no-classic-classes': 'off',
'ember/no-classic-components': 'off',
'ember/no-actions-hash': 'off',
'ember/require-tagless-components': 'off',
'ember/no-component-lifecycle-hooks': 'off',
},
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',
'scripts/start-vault.js',
'server/**/*.js',
],
parserOptions: {
sourceType: 'script',
ecmaVersion: 2018,
},
env: {
browser: false,
Expand Down
1 change: 1 addition & 0 deletions ui/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

# misc
/.sass-cache
/.eslintcache
/connect.lock
/coverage/
/libpeerconnection.log
Expand Down
21 changes: 21 additions & 0 deletions ui/.prettierignore
Original file line number Diff line number Diff line change
@@ -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
5 changes: 0 additions & 5 deletions ui/.prettierrc

This file was deleted.

16 changes: 16 additions & 0 deletions ui/.prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
'use strict';

module.exports = {
singleQuote: true,
trailingComma: 'es5',
printWidth: 110,
overrides: [
{
files: '*.hbs',
options: {
singleQuote: false,
printWidth: 125,
},
},
],
};
6 changes: 3 additions & 3 deletions ui/.storybook/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@ function loadStories() {
// automatically import all files ending in *.stories.js
const appStories = require.context('../stories', true, /.stories.js$/);
const addonAndRepoStories = require.context('../lib', true, /.stories.js$/);
appStories.keys().forEach(filename => appStories(filename));
addonAndRepoStories.keys().forEach(filename => addonAndRepoStories(filename));
appStories.keys().forEach((filename) => appStories(filename));
addonAndRepoStories.keys().forEach((filename) => addonAndRepoStories(filename));
}

addParameters({
viewport: { viewports: INITIAL_VIEWPORTS },
options: { theme },
});

addDecorator(storyFn => {
addDecorator((storyFn) => {
const { template, context } = storyFn();

// flight icon sprite must be inserted into dom for icon lookup via use element
Expand Down
32 changes: 11 additions & 21 deletions ui/.template-lintrc.js
Original file line number Diff line number Diff line change
@@ -1,27 +1,17 @@
'use strict';

module.exports = {
extends: 'recommended',
extends: ['octane', 'stylistic'],
rules: {
// should definitely move to template only
// glimmer components for this one
'no-partial': false,

// these need to be looked into, but
// may be a bigger change
'no-invalid-interactive': false,
'simple-unless': false,

'self-closing-void-elements': false,
'no-unnecessary-concat': false,
'no-quoteless-attributes': false,
'no-nested-interactive': false,

// not sure we'll ever want these on,
// would be nice but if prettier isn't doing
// it for us, then not sure it's worth it
'attribute-indentation': false,
'block-indentation': false,
quotes: false,
'no-bare-strings': 'off',
'no-action': 'off',
'no-duplicate-landmark-elements': 'warn',
'no-implicit-this': {
allow: ['supported-auth-backends'],
},
'require-input-label': 'off',
'no-down-event-binding': 'warn',
'self-closing-void-elements': 'off',
},
ignore: ['lib/story-md', 'tests/**'],
};
128 changes: 85 additions & 43 deletions ui/MODULE_REPORT.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,90 @@
## Module Report
### Unknown Global

**Global**: `Ember.testing`

**Location**: `app/components/auth-jwt.js` at line 9

```js

/* eslint-disable ember/no-ember-testing-in-module-scope */
const WAIT_TIME = Ember.testing ? 0 : 500;
const ERROR_WINDOW_CLOSED =
'The provider window was closed before authentication was complete. Please click Sign In to try again.';
```

### Unknown Global

**Global**: `Ember.testing`

**Location**: `app/components/auth-form.js` at line 252

```js

delayAuthMessageReminder: task(function*() {
if (Ember.testing) {
this.showLoading = true;
yield timeout(0);
```
### Unknown Global
**Global**: `Ember.testing`
**Location**: `app/routes/vault/cluster/logout.js` at line 30
```js
this.flashMessages.clearMessages();
this.permissions.reset();
if (Ember.testing) {
// Don't redirect on the test
this.replaceWith('vault.cluster.auth', { queryParams: { with: authType } });
```
### Unknown Global
**Global**: `Ember.testing`
**Location**: `app/components/mount-backend-form.js` at line 100
```js
capabilities = yield this.store.findRecord('capabilities', `${path}/config`);
} catch (err) {
if (Ember.testing) {
//captures mount-backend-form component test
yield mountModel.save();
```
### Unknown Global
**Global**: `Ember.testing`
**Location**: `app/components/oidc-consent-block.js` at line 47
```js
let { redirect, ...params } = this.args;
let redirectUrl = this.buildUrl(redirect, params);
if (Ember.testing) {
this.args.testRedirect(redirectUrl.toString());
} else {
```
### Unknown Global
**Global**: `Ember.testing`
**Location**: `lib/core/addon/components/ttl-form.js` at line 82
```js
this.set('time', parsedTime);
this.handleChange();
if (Ember.testing) {
return;
}
```
### Unknown Global
**Global**: `Ember.onerror`
**Location**: `tests/helpers/wait-for-error.js` at line 5
Expand Down Expand Up @@ -143,34 +227,6 @@ export default function waitForError(opts) {
**Global**: `Ember.testing`
**Location**: `app/components/auth-jwt.js` at line 9
```js

/* eslint-disable ember/no-ember-testing-in-module-scope */
const WAIT_TIME = Ember.testing ? 0 : 500;
const ERROR_WINDOW_CLOSED =
'The provider window was closed before authentication was complete. Please click Sign In to try again.';
```
### Unknown Global
**Global**: `Ember.testing`
**Location**: `app/components/auth-jwt.js` at line 119
```js
exchangeOIDC: task(function*(event, oidcWindow) {
// in non-incognito mode we need to use a timeout because it takes time before oidcState is written to local storage.
let oidcState = Ember.testing
? event.storageArea.getItem('oidcState')
: yield timeout(1000).then(() => event.storageArea.getItem('oidcState'));
```
### Unknown Global
**Global**: `Ember.testing`
**Location**: `app/routes/vault.js` at line 7
```js
Expand All @@ -185,7 +241,7 @@ export default Route.extend({
**Global**: `Ember.testing`
**Location**: `app/services/auth.js` at line 267
**Location**: `app/services/auth.js` at line 268
```js
checkShouldRenew: task(function*() {
Expand All @@ -194,17 +250,3 @@ export default Route.extend({
return;
}
```
### Unknown Global
**Global**: `Ember.testing`
**Location**: `lib/core/addon/components/ttl-form.js` at line 82
```js
this.set('time', parsedTime);
this.handleChange();
if (Ember.testing) {
return;
}
```
5 changes: 2 additions & 3 deletions ui/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,8 @@ To run the tests locally in a browser other than IE11, swap out `launch_in_ci: [

### Linting

- `yarn lint:hbs`
- `yarn lint:js`
- `yarn lint:js -- --fix`
* `yarn lint`
* `yarn lint:fix`

### Building Vault UI into a Vault Binary

Expand Down
8 changes: 4 additions & 4 deletions ui/app/adapters/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@ export default RESTAdapter.extend({
headers['X-Vault-Wrap-TTL'] = options.wrapTTL;
}
let namespace = typeof options.namespace === 'undefined' ? this.namespaceService.path : options.namespace;
if (namespace && !NAMESPACE_ROOT_URLS.some(str => url.includes(str))) {
if (namespace && !NAMESPACE_ROOT_URLS.some((str) => url.includes(str))) {
headers['X-Vault-Namespace'] = namespace;
}
options.headers = assign(options.headers || {}, headers);
},

_preRequest(url, options) {
this.addHeaders(url, options);
const isPolling = POLLING_URLS.some(str => url.includes(str));
const isPolling = POLLING_URLS.some((str) => url.includes(str));
if (!isPolling) {
this.auth.setLastFetch(Date.now());
}
Expand Down Expand Up @@ -86,7 +86,7 @@ export default RESTAdapter.extend({
const [resp] = args;
if (resp && resp.warnings) {
let flash = this.flashMessages;
resp.warnings.forEach(message => {
resp.warnings.forEach((message) => {
flash.info(message);
});
}
Expand All @@ -102,7 +102,7 @@ export default RESTAdapter.extend({
headers: opts.headers || {},
body: opts.body,
signal: opts.signal,
}).then(response => {
}).then((response) => {
if (response.status >= 200 && response.status < 300) {
return RSVP.resolve(response);
} else {
Expand Down
4 changes: 2 additions & 2 deletions ui/app/adapters/auth-method.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default ApplicationAdapter.extend({
return this.ajax(url, 'GET', {
unauthenticated: true,
})
.then(result => {
.then((result) => {
return {
data: result.data.auth,
};
Expand All @@ -33,7 +33,7 @@ export default ApplicationAdapter.extend({
};
});
}
return this.ajax(this.url(), 'GET').catch(e => {
return this.ajax(this.url(), 'GET').catch((e) => {
if (e instanceof AdapterError) {
set(e, 'policyPath', 'sys/auth');
}
Expand Down
Loading

0 comments on commit e5b1f71

Please sign in to comment.