Ember Upgrade to 3.24 (#13443)
* 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 <cshaw@hashicorp.com>
This commit is contained in:
parent
5e316537f2
commit
5c2a08de6d
|
@ -0,0 +1,3 @@
|
|||
```release-note:change
|
||||
ui: Upgrade Ember to version 3.24
|
||||
```
|
|
@ -0,0 +1,3 @@
|
|||
defaults
|
||||
not IE 11
|
||||
maintained node versions
|
|
@ -16,6 +16,8 @@
|
|||
|
||||
# misc
|
||||
/coverage/
|
||||
!.*
|
||||
.eslintcache
|
||||
|
||||
# ember-try
|
||||
/.node_modules.ember-try/
|
||||
|
|
|
@ -12,21 +12,28 @@ 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',
|
||||
|
@ -34,10 +41,10 @@ module.exports = {
|
|||
'config/**/*.js',
|
||||
'lib/*/index.js',
|
||||
'scripts/start-vault.js',
|
||||
'server/**/*.js',
|
||||
],
|
||||
parserOptions: {
|
||||
sourceType: 'script',
|
||||
ecmaVersion: 2018,
|
||||
},
|
||||
env: {
|
||||
browser: false,
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
|
||||
# misc
|
||||
/.sass-cache
|
||||
/.eslintcache
|
||||
/connect.lock
|
||||
/coverage/
|
||||
/libpeerconnection.log
|
||||
|
|
|
@ -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
|
|
@ -1,5 +0,0 @@
|
|||
{
|
||||
"singleQuote": true,
|
||||
"trailingComma": "es5",
|
||||
"printWidth": 110
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
'use strict';
|
||||
|
||||
module.exports = {
|
||||
singleQuote: true,
|
||||
trailingComma: 'es5',
|
||||
printWidth: 110,
|
||||
overrides: [
|
||||
{
|
||||
files: '*.hbs',
|
||||
options: {
|
||||
singleQuote: false,
|
||||
printWidth: 125,
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
|
@ -7,8 +7,8 @@ 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({
|
||||
|
@ -16,7 +16,7 @@ addParameters({
|
|||
options: { theme },
|
||||
});
|
||||
|
||||
addDecorator(storyFn => {
|
||||
addDecorator((storyFn) => {
|
||||
const { template, context } = storyFn();
|
||||
|
||||
// flight icon sprite must be inserted into dom for icon lookup via use element
|
||||
|
|
|
@ -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/**'],
|
||||
};
|
||||
|
|
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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*() {
|
||||
|
@ -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;
|
||||
}
|
||||
```
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@ 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);
|
||||
|
@ -49,7 +49,7 @@ export default RESTAdapter.extend({
|
|||
|
||||
_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());
|
||||
}
|
||||
|
@ -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);
|
||||
});
|
||||
}
|
||||
|
@ -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 {
|
||||
|
|
|
@ -22,7 +22,7 @@ export default ApplicationAdapter.extend({
|
|||
return this.ajax(url, 'GET', {
|
||||
unauthenticated: true,
|
||||
})
|
||||
.then(result => {
|
||||
.then((result) => {
|
||||
return {
|
||||
data: result.data.auth,
|
||||
};
|
||||
|
@ -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');
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@ export default ApplicationAdapter.extend({
|
|||
let role = snapshot.attr('role');
|
||||
let url = `/v1/${role.backend}/creds/${role.name}`;
|
||||
|
||||
return this.ajax(url, method, options).then(response => {
|
||||
return this.ajax(url, method, options).then((response) => {
|
||||
response.id = snapshot.id;
|
||||
response.modelName = type.modelName;
|
||||
store.pushPayload(type.modelName, response);
|
||||
|
|
|
@ -8,7 +8,7 @@ export default ApplicationAdapter.extend({
|
|||
},
|
||||
|
||||
findRecord(store, type, id) {
|
||||
return this.ajax(this.buildURL(type), 'POST', { data: { paths: [id] } }).catch(e => {
|
||||
return this.ajax(this.buildURL(type), 'POST', { data: { paths: [id] } }).catch((e) => {
|
||||
if (e instanceof AdapterError) {
|
||||
set(e, 'policyPath', 'sys/capabilities-self');
|
||||
}
|
||||
|
@ -21,7 +21,7 @@ export default ApplicationAdapter.extend({
|
|||
if (!id) {
|
||||
return;
|
||||
}
|
||||
return this.findRecord(store, type, id).then(resp => {
|
||||
return this.findRecord(store, type, id).then((resp) => {
|
||||
resp.path = id;
|
||||
return resp;
|
||||
});
|
||||
|
|
|
@ -11,7 +11,7 @@ export default Application.extend({
|
|||
query = null;
|
||||
}
|
||||
// API accepts start and end as query params
|
||||
return this.ajax(url, 'GET', { data: query }).then(resp => {
|
||||
return this.ajax(url, 'GET', { data: query }).then((resp) => {
|
||||
let response = resp || {};
|
||||
// if the response is a 204 it has no request id
|
||||
response.id = response.request_id || 'no-data';
|
||||
|
|
|
@ -2,7 +2,7 @@ import Application from '../application';
|
|||
|
||||
export default Application.extend({
|
||||
queryRecord() {
|
||||
return this.ajax(this.urlForQuery(), 'GET').then(resp => {
|
||||
return this.ajax(this.urlForQuery(), 'GET').then((resp) => {
|
||||
resp.id = resp.request_id;
|
||||
return resp;
|
||||
});
|
||||
|
|
|
@ -40,10 +40,10 @@ export default ApplicationAdapter.extend({
|
|||
findRecord(store, type, id, snapshot) {
|
||||
let fetches = {
|
||||
health: this.health(),
|
||||
sealStatus: this.sealStatus().catch(e => e),
|
||||
sealStatus: this.sealStatus().catch((e) => e),
|
||||
};
|
||||
if (this.version.isEnterprise && this.namespaceService.inRootNamespace) {
|
||||
fetches.replicationStatus = this.replicationStatus().catch(e => e);
|
||||
fetches.replicationStatus = this.replicationStatus().catch((e) => e);
|
||||
}
|
||||
return hash(fetches).then(({ health, sealStatus, replicationStatus }) => {
|
||||
let ret = {
|
||||
|
|
|
@ -11,7 +11,7 @@ export default ApplicationAdapter.extend({
|
|||
data: {
|
||||
accessor: id,
|
||||
},
|
||||
}).then(response => {
|
||||
}).then((response) => {
|
||||
response.id = id;
|
||||
return response;
|
||||
});
|
||||
|
|
|
@ -24,7 +24,7 @@ export default ApplicationAdapter.extend({
|
|||
},
|
||||
fetchByQuery(store, query) {
|
||||
const { backend, id } = query;
|
||||
return this.ajax(this.urlFor(backend, id), 'GET', this.optionsForQuery(id)).then(resp => {
|
||||
return this.ajax(this.urlFor(backend, id), 'GET', this.optionsForQuery(id)).then((resp) => {
|
||||
resp.backend = backend;
|
||||
if (id) {
|
||||
resp.id = id;
|
||||
|
|
|
@ -9,14 +9,14 @@ export default ApplicationAdapter.extend({
|
|||
return this.ajax(
|
||||
`${this.buildURL()}/${encodeURIComponent(backend)}/static-creds/${encodeURIComponent(secret)}`,
|
||||
'GET'
|
||||
).then(resp => ({ ...resp, roleType: 'static' }));
|
||||
).then((resp) => ({ ...resp, roleType: 'static' }));
|
||||
},
|
||||
|
||||
_dynamicCreds(backend, secret) {
|
||||
return this.ajax(
|
||||
`${this.buildURL()}/${encodeURIComponent(backend)}/creds/${encodeURIComponent(secret)}`,
|
||||
'GET'
|
||||
).then(resp => ({ ...resp, roleType: 'dynamic' }));
|
||||
).then((resp) => ({ ...resp, roleType: 'dynamic' }));
|
||||
},
|
||||
|
||||
fetchByQuery(store, query) {
|
||||
|
|
|
@ -25,7 +25,7 @@ export default ApplicationAdapter.extend({
|
|||
},
|
||||
|
||||
staticRoles(backend, id) {
|
||||
return this.ajax(this.urlFor(backend, id, 'static'), 'GET', this.optionsForQuery(id)).then(resp => {
|
||||
return this.ajax(this.urlFor(backend, id, 'static'), 'GET', this.optionsForQuery(id)).then((resp) => {
|
||||
if (id) {
|
||||
return {
|
||||
...resp,
|
||||
|
@ -39,7 +39,7 @@ export default ApplicationAdapter.extend({
|
|||
},
|
||||
|
||||
dynamicRoles(backend, id) {
|
||||
return this.ajax(this.urlFor(backend, id), 'GET', this.optionsForQuery(id)).then(resp => {
|
||||
return this.ajax(this.urlFor(backend, id), 'GET', this.optionsForQuery(id)).then((resp) => {
|
||||
if (id) {
|
||||
return {
|
||||
...resp,
|
||||
|
|
|
@ -21,7 +21,7 @@ export default ApplicationAdapter.extend({
|
|||
yield this.getDynamicApiPath.perform(id);
|
||||
}
|
||||
|
||||
return this.ajax(this.urlForItem(id, isList, this.dynamicApiPath), 'GET', { data }).then(resp => {
|
||||
return this.ajax(this.urlForItem(id, isList, this.dynamicApiPath), 'GET', { data }).then((resp) => {
|
||||
const data = {
|
||||
id,
|
||||
method: id,
|
||||
|
|
|
@ -3,7 +3,7 @@ import IdentityAdapter from './base';
|
|||
export default IdentityAdapter.extend({
|
||||
lookup(store, data) {
|
||||
let url = `/${this.urlPrefix()}/identity/lookup/entity`;
|
||||
return this.ajax(url, 'POST', { data }).then(response => {
|
||||
return this.ajax(url, 'POST', { data }).then((response) => {
|
||||
// unsuccessful lookup is a 204
|
||||
if (!response) return;
|
||||
let modelName = 'identity/entity';
|
||||
|
|
|
@ -3,7 +3,7 @@ import IdentityAdapter from './base';
|
|||
export default IdentityAdapter.extend({
|
||||
lookup(store, data) {
|
||||
let url = `/${this.urlPrefix()}/identity/lookup/group`;
|
||||
return this.ajax(url, 'POST', { data }).then(response => {
|
||||
return this.ajax(url, 'POST', { data }).then((response) => {
|
||||
// unsuccessful lookup is a 204
|
||||
if (!response) return;
|
||||
let modelName = 'identity/group';
|
||||
|
|
|
@ -38,7 +38,7 @@ export default ApplicationAdapter.extend({
|
|||
},
|
||||
|
||||
query(store, type, query) {
|
||||
return this.ajax(this.urlForQuery(query, type.modelName), 'GET').then(resp => {
|
||||
return this.ajax(this.urlForQuery(query, type.modelName), 'GET').then((resp) => {
|
||||
// remove pagination query items here
|
||||
const { ...modelAttrs } = query;
|
||||
resp._requestQuery = modelAttrs;
|
||||
|
@ -49,7 +49,7 @@ export default ApplicationAdapter.extend({
|
|||
queryRecord(store, type, query) {
|
||||
let id = query.id;
|
||||
delete query.id;
|
||||
return this.ajax(this._url(type.modelName, query, id), 'GET').then(resp => {
|
||||
return this.ajax(this._url(type.modelName, query, id), 'GET').then((resp) => {
|
||||
resp.id = id;
|
||||
resp = { ...resp, ...query };
|
||||
return resp;
|
||||
|
|
|
@ -8,7 +8,7 @@ export default BaseAdapter.extend({
|
|||
role: snapshot.record.role,
|
||||
});
|
||||
url = `${url}/generate`;
|
||||
return this.ajax(url, 'POST', { data: snapshot.serialize() }).then(model => {
|
||||
return this.ajax(url, 'POST', { data: snapshot.serialize() }).then((model) => {
|
||||
model.data.id = model.data.serial_number;
|
||||
return model;
|
||||
});
|
||||
|
|
|
@ -48,7 +48,7 @@ export default ApplicationAdapter.extend({
|
|||
data: {
|
||||
list: true,
|
||||
},
|
||||
}).then(resp => {
|
||||
}).then((resp) => {
|
||||
if (prefix) {
|
||||
resp.prefix = prefix;
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@ export default ApplicationAdapter.extend({
|
|||
},
|
||||
|
||||
findRecord(store, type, id) {
|
||||
return this.ajax(this.url(id), 'GET').then(resp => {
|
||||
return this.ajax(this.url(id), 'GET').then((resp) => {
|
||||
resp.id = id;
|
||||
return resp;
|
||||
});
|
||||
|
|
|
@ -34,7 +34,7 @@ export default ApplicationAdapter.extend({
|
|||
data = serializer.serialize(snapshot, requestType);
|
||||
}
|
||||
|
||||
return this.ajax(this.url(snapshot, action), 'POST', { data }).then(response => {
|
||||
return this.ajax(this.url(snapshot, action), 'POST', { data }).then((response) => {
|
||||
// uploading CA, setting signed intermediate cert, and attempting to generate
|
||||
// a new CA if one exists, all return a 204
|
||||
if (!response) {
|
||||
|
|
|
@ -23,7 +23,7 @@ export default Adapter.extend({
|
|||
|
||||
fetchByQuery(store, query) {
|
||||
const { backend, id } = query;
|
||||
return this.ajax(this.urlFor(backend, id), 'GET', this.optionsForQuery(id)).then(resp => {
|
||||
return this.ajax(this.urlFor(backend, id), 'GET', this.optionsForQuery(id)).then((resp) => {
|
||||
const data = {
|
||||
backend,
|
||||
};
|
||||
|
@ -53,7 +53,7 @@ export default Adapter.extend({
|
|||
const data = {
|
||||
serial_number: id,
|
||||
};
|
||||
return this.ajax(`${this.buildURL()}/${backend}/revoke`, 'POST', { data }).then(resp => {
|
||||
return this.ajax(`${this.buildURL()}/${backend}/revoke`, 'POST', { data }).then((resp) => {
|
||||
const data = {
|
||||
id,
|
||||
serial_number: id,
|
||||
|
|
|
@ -31,7 +31,7 @@ export default ApplicationAdapter.extend({
|
|||
}
|
||||
return data;
|
||||
}, {});
|
||||
return this.ajax(url, 'POST', { data }).then(resp => {
|
||||
return this.ajax(url, 'POST', { data }).then((resp) => {
|
||||
let response = resp || {};
|
||||
response.id = `${snapshot.record.get('backend')}-${snapshot.adapterOptions.method}`;
|
||||
return response;
|
||||
|
@ -69,9 +69,11 @@ export default ApplicationAdapter.extend({
|
|||
return hash({
|
||||
backend: backendPath,
|
||||
id: this.id(backendPath),
|
||||
der: this.rawRequest(derURL, 'GET', { unauthenticated: true }).then(response => response.blob()),
|
||||
pem: this.rawRequest(pemURL, 'GET', { unauthenticated: true }).then(response => response.text()),
|
||||
ca_chain: this.rawRequest(chainURL, 'GET', { unauthenticated: true }).then(response => response.text()),
|
||||
der: this.rawRequest(derURL, 'GET', { unauthenticated: true }).then((response) => response.blob()),
|
||||
pem: this.rawRequest(pemURL, 'GET', { unauthenticated: true }).then((response) => response.text()),
|
||||
ca_chain: this.rawRequest(chainURL, 'GET', { unauthenticated: true }).then((response) =>
|
||||
response.text()
|
||||
),
|
||||
});
|
||||
},
|
||||
|
||||
|
@ -79,12 +81,12 @@ export default ApplicationAdapter.extend({
|
|||
const url = `/v1/${backendPath}/config/urls`;
|
||||
const id = this.id(backendPath);
|
||||
return this.ajax(url, 'GET')
|
||||
.then(resp => {
|
||||
.then((resp) => {
|
||||
resp.id = id;
|
||||
resp.backend = backendPath;
|
||||
return resp;
|
||||
})
|
||||
.catch(e => {
|
||||
.catch((e) => {
|
||||
if (e.httpStatus === 404) {
|
||||
return resolve({ id });
|
||||
} else {
|
||||
|
@ -97,12 +99,12 @@ export default ApplicationAdapter.extend({
|
|||
const url = `/v1/${backendPath}/config/crl`;
|
||||
const id = this.id(backendPath);
|
||||
return this.ajax(url, 'GET')
|
||||
.then(resp => {
|
||||
.then((resp) => {
|
||||
resp.id = id;
|
||||
resp.backend = backendPath;
|
||||
return resp;
|
||||
})
|
||||
.catch(e => {
|
||||
.catch((e) => {
|
||||
if (e.httpStatus === 404) {
|
||||
return { id };
|
||||
} else {
|
||||
|
@ -118,7 +120,7 @@ export default ApplicationAdapter.extend({
|
|||
|
||||
queryRecord(store, type, query) {
|
||||
const { backend, section } = query;
|
||||
return this.fetchSection(backend, section).then(resp => {
|
||||
return this.fetchSection(backend, section).then((resp) => {
|
||||
resp.backend = backend;
|
||||
return resp;
|
||||
});
|
||||
|
|
|
@ -13,7 +13,7 @@ export default ApplicationAdapter.extend({
|
|||
const data = serializer.serialize(snapshot, requestType);
|
||||
const role = snapshot.attr('role');
|
||||
|
||||
return this.ajax(this.url(role, snapshot), 'POST', { data }).then(response => {
|
||||
return this.ajax(this.url(role, snapshot), 'POST', { data }).then((response) => {
|
||||
response.id = snapshot.id;
|
||||
response.modelName = type.modelName;
|
||||
store.pushPayload(type.modelName, response);
|
||||
|
|
|
@ -7,7 +7,7 @@ export default ApplicationAdapter.extend({
|
|||
|
||||
fetchStatus(mode) {
|
||||
let url = this.getStatusUrl(mode);
|
||||
return this.ajax(url, 'GET', { unauthenticated: true }).then(resp => {
|
||||
return this.ajax(url, 'GET', { unauthenticated: true }).then((resp) => {
|
||||
return resp.data;
|
||||
});
|
||||
},
|
||||
|
|
|
@ -49,7 +49,7 @@ export default ApplicationAdapter.extend({
|
|||
|
||||
fetchByQuery(store, query) {
|
||||
const { id, backend } = query;
|
||||
return this.ajax(this.urlForRole(backend, id), 'GET', this.optionsForQuery(id)).then(resp => {
|
||||
return this.ajax(this.urlForRole(backend, id), 'GET', this.optionsForQuery(id)).then((resp) => {
|
||||
const data = {
|
||||
id,
|
||||
name: id,
|
||||
|
|
|
@ -49,7 +49,7 @@ export default ApplicationAdapter.extend({
|
|||
|
||||
fetchByQuery(store, query) {
|
||||
const { id, backend } = query;
|
||||
return this.ajax(this.urlForRole(backend, id), 'GET', this.optionsForQuery(id)).then(resp => {
|
||||
return this.ajax(this.urlForRole(backend, id), 'GET', this.optionsForQuery(id)).then((resp) => {
|
||||
const data = {
|
||||
id,
|
||||
name: id,
|
||||
|
|
|
@ -58,7 +58,7 @@ export default ApplicationAdapter.extend({
|
|||
zeroAddressAjax = this.findAllZeroAddress(store, query);
|
||||
}
|
||||
|
||||
return allSettled([queryAjax, zeroAddressAjax]).then(results => {
|
||||
return allSettled([queryAjax, zeroAddressAjax]).then((results) => {
|
||||
// query result 404d, so throw the adapterError
|
||||
if (!results[0].value) {
|
||||
throw results[0].reason;
|
||||
|
@ -70,7 +70,7 @@ export default ApplicationAdapter.extend({
|
|||
data: {},
|
||||
};
|
||||
|
||||
results.forEach(result => {
|
||||
results.forEach((result) => {
|
||||
if (result.value) {
|
||||
if (result.value.data.roles) {
|
||||
resp.data = assign({}, resp.data, { zero_address_roles: result.value.data.roles });
|
||||
|
|
|
@ -100,7 +100,7 @@ export default ApplicationAdapter.extend({
|
|||
|
||||
queryRecord(store, type, query) {
|
||||
if (query.type === 'aws') {
|
||||
return this.ajax(`/v1/${encodePath(query.backend)}/config/lease`, 'GET').then(resp => {
|
||||
return this.ajax(`/v1/${encodePath(query.backend)}/config/lease`, 'GET').then((resp) => {
|
||||
resp.path = query.backend + '/';
|
||||
return resp;
|
||||
});
|
||||
|
@ -135,11 +135,7 @@ export default ApplicationAdapter.extend({
|
|||
|
||||
saveZeroAddressConfig(store, type, snapshot) {
|
||||
const path = encodePath(snapshot.id);
|
||||
const roles = store
|
||||
.peekAll('role-ssh')
|
||||
.filterBy('zeroAddress')
|
||||
.mapBy('id')
|
||||
.join(',');
|
||||
const roles = store.peekAll('role-ssh').filterBy('zeroAddress').mapBy('id').join(',');
|
||||
const url = `/v1/${path}/config/zeroaddress`;
|
||||
const data = { roles };
|
||||
if (roles === '') {
|
||||
|
|
|
@ -26,7 +26,7 @@ export default ApplicationAdapter.extend({
|
|||
},
|
||||
|
||||
findRecord() {
|
||||
return this._super(...arguments).catch(errorOrModel => {
|
||||
return this._super(...arguments).catch((errorOrModel) => {
|
||||
// if the response is a real 404 or if the secret is gated by a control group this will be an error,
|
||||
// otherwise the response will be the body of a deleted / destroyed version
|
||||
if (errorOrModel instanceof AdapterError) {
|
||||
|
@ -44,7 +44,7 @@ export default ApplicationAdapter.extend({
|
|||
},
|
||||
|
||||
queryRecord(id, options) {
|
||||
return this.ajax(this.urlForQueryRecord(id), 'GET', options).then(resp => {
|
||||
return this.ajax(this.urlForQueryRecord(id), 'GET', options).then((resp) => {
|
||||
if (options.wrapTTL) {
|
||||
return resp;
|
||||
}
|
||||
|
@ -56,10 +56,10 @@ export default ApplicationAdapter.extend({
|
|||
|
||||
querySecretDataByVersion(id) {
|
||||
return this.ajax(this.urlForQueryRecord(id), 'GET')
|
||||
.then(resp => {
|
||||
.then((resp) => {
|
||||
return resp.data;
|
||||
})
|
||||
.catch(error => {
|
||||
.catch((error) => {
|
||||
return error.data;
|
||||
});
|
||||
},
|
||||
|
@ -73,7 +73,7 @@ export default ApplicationAdapter.extend({
|
|||
createRecord(store, modelName, snapshot) {
|
||||
let backend = snapshot.belongsTo('secret').belongsTo('engine').id;
|
||||
let path = snapshot.attr('path');
|
||||
return this._super(...arguments).then(resp => {
|
||||
return this._super(...arguments).then((resp) => {
|
||||
resp.id = JSON.stringify([backend, path, resp.version]);
|
||||
return resp;
|
||||
});
|
||||
|
|
|
@ -56,7 +56,7 @@ export default ApplicationAdapter.extend({
|
|||
fetchByQuery(query, action) {
|
||||
const { id, backend, wrapTTL } = query;
|
||||
return this.ajax(this.urlForSecret(backend, id), 'GET', this.optionsForQuery(id, action, wrapTTL)).then(
|
||||
resp => {
|
||||
(resp) => {
|
||||
if (wrapTTL) {
|
||||
return resp;
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@ export default ApplicationAdapter.extend({
|
|||
const data = serializer.serialize(snapshot, requestType);
|
||||
const role = snapshot.attr('role');
|
||||
|
||||
return this.ajax(this.url(role), 'POST', { data }).then(response => {
|
||||
return this.ajax(this.url(role), 'POST', { data }).then((response) => {
|
||||
response.id = snapshot.id;
|
||||
response.modelName = type.modelName;
|
||||
store.pushPayload(type.modelName, response);
|
||||
|
|
|
@ -52,7 +52,7 @@ export default ApplicationAdapter.extend({
|
|||
const { id, backend } = query;
|
||||
const queryAjax = this.ajax(this.urlForTransformations(backend, id), 'GET', this.optionsForQuery(id));
|
||||
|
||||
return allSettled([queryAjax]).then(results => {
|
||||
return allSettled([queryAjax]).then((results) => {
|
||||
// query result 404d, so throw the adapterError
|
||||
if (!results[0].value) {
|
||||
throw results[0].reason;
|
||||
|
@ -64,7 +64,7 @@ export default ApplicationAdapter.extend({
|
|||
data: {},
|
||||
};
|
||||
|
||||
results.forEach(result => {
|
||||
results.forEach((result) => {
|
||||
if (result.value) {
|
||||
let d = result.value.data;
|
||||
if (d.templates) {
|
||||
|
|
|
@ -41,7 +41,7 @@ export default ApplicationAdapter.extend({
|
|||
|
||||
fetchByQuery(query) {
|
||||
const { backend, modelName, id } = query;
|
||||
return this.ajax(this.url(backend, modelName, id), 'GET').then(resp => {
|
||||
return this.ajax(this.url(backend, modelName, id), 'GET').then((resp) => {
|
||||
return {
|
||||
...resp,
|
||||
backend,
|
||||
|
@ -54,7 +54,7 @@ export default ApplicationAdapter.extend({
|
|||
},
|
||||
|
||||
queryRecord(store, type, query) {
|
||||
return this.ajax(this.url(query.backend, type.modelName, query.id), 'GET').then(result => {
|
||||
return this.ajax(this.url(query.backend, type.modelName, query.id), 'GET').then((result) => {
|
||||
// CBS TODO: Add name to response and unmap name <> id on models
|
||||
return {
|
||||
id: query.id,
|
||||
|
|
|
@ -14,7 +14,7 @@ export default ApplicationAdapter.extend({
|
|||
url = url + '/config';
|
||||
}
|
||||
|
||||
return this.ajax(url, 'POST', { data }).then(resp => {
|
||||
return this.ajax(url, 'POST', { data }).then((resp) => {
|
||||
let response = resp || {};
|
||||
response.id = name;
|
||||
return response;
|
||||
|
@ -86,7 +86,7 @@ export default ApplicationAdapter.extend({
|
|||
|
||||
fetchByQuery(query) {
|
||||
const { id, backend } = query;
|
||||
return this.ajax(this.urlForSecret(backend, id), 'GET', this.optionsForQuery(id)).then(resp => {
|
||||
return this.ajax(this.urlForSecret(backend, id), 'GET', this.optionsForQuery(id)).then((resp) => {
|
||||
resp.id = id;
|
||||
resp.backend = backend;
|
||||
return resp;
|
||||
|
|
|
@ -2,9 +2,7 @@ import Application from '@ember/application';
|
|||
import Resolver from 'ember-resolver';
|
||||
import loadInitializers from 'ember-load-initializers';
|
||||
import config from 'vault/config/environment';
|
||||
import defineModifier from 'ember-concurrency-test-waiter/define-modifier';
|
||||
|
||||
defineModifier();
|
||||
export default class App extends Application {
|
||||
modulePrefix = config.modulePrefix;
|
||||
podModulePrefix = config.podModulePrefix;
|
||||
|
|
|
@ -2,6 +2,7 @@ import AdapterError from '@ember-data/adapter/error';
|
|||
import { inject as service } from '@ember/service';
|
||||
import Component from '@ember/component';
|
||||
import { task } from 'ember-concurrency';
|
||||
import { waitFor } from '@ember/test-waiters';
|
||||
|
||||
/**
|
||||
* @module AuthConfigForm/Config
|
||||
|
@ -23,7 +24,8 @@ const AuthConfigBase = Component.extend({
|
|||
flashMessages: service(),
|
||||
router: service(),
|
||||
wizard: service(),
|
||||
saveModel: task(function*() {
|
||||
saveModel: task(
|
||||
waitFor(function* () {
|
||||
try {
|
||||
yield this.model.save();
|
||||
} catch (err) {
|
||||
|
@ -39,7 +41,8 @@ const AuthConfigBase = Component.extend({
|
|||
}
|
||||
this.router.transitionTo('vault.cluster.access.methods').followRedirects();
|
||||
this.flashMessages.success('The configuration was saved successfully.');
|
||||
}).withTestWaiter(),
|
||||
})
|
||||
),
|
||||
});
|
||||
|
||||
AuthConfigBase.reopenClass({
|
||||
|
|
|
@ -2,6 +2,7 @@ import AdapterError from '@ember-data/adapter/error';
|
|||
import AuthConfigComponent from './config';
|
||||
import { inject as service } from '@ember/service';
|
||||
import { task } from 'ember-concurrency';
|
||||
import { waitFor } from '@ember/test-waiters';
|
||||
|
||||
/**
|
||||
* @module AuthConfigForm/Options
|
||||
|
@ -19,7 +20,8 @@ import { task } from 'ember-concurrency';
|
|||
export default AuthConfigComponent.extend({
|
||||
router: service(),
|
||||
wizard: service(),
|
||||
saveModel: task(function*() {
|
||||
saveModel: task(
|
||||
waitFor(function* () {
|
||||
let data = this.model.config.serialize();
|
||||
data.description = this.model.description;
|
||||
|
||||
|
@ -50,5 +52,6 @@ export default AuthConfigComponent.extend({
|
|||
}
|
||||
this.router.transitionTo('vault.cluster.access.methods').followRedirects();
|
||||
this.flashMessages.success('The configuration was saved successfully.');
|
||||
}).withTestWaiter(),
|
||||
})
|
||||
),
|
||||
});
|
||||
|
|
|
@ -8,6 +8,8 @@ import Component from '@ember/component';
|
|||
import { computed } from '@ember/object';
|
||||
import { supportedAuthBackends } from 'vault/helpers/supported-auth-backends';
|
||||
import { task, timeout } from 'ember-concurrency';
|
||||
import { waitFor } from '@ember/test-waiters';
|
||||
|
||||
const BACKENDS = supportedAuthBackends();
|
||||
|
||||
/**
|
||||
|
@ -153,11 +155,14 @@ export default Component.extend(DEFAULTS, {
|
|||
}),
|
||||
methodsToShow: computed('methods', function () {
|
||||
let methods = this.methods || [];
|
||||
let shownMethods = methods.filter(m => BACKENDS.find(b => b.type.toLowerCase() === m.type.toLowerCase()));
|
||||
let shownMethods = methods.filter((m) =>
|
||||
BACKENDS.find((b) => b.type.toLowerCase() === m.type.toLowerCase())
|
||||
);
|
||||
return shownMethods.length ? shownMethods : BACKENDS;
|
||||
}),
|
||||
|
||||
unwrapToken: task(function*(token) {
|
||||
unwrapToken: task(
|
||||
waitFor(function* (token) {
|
||||
// will be using the Token Auth Method, so set it here
|
||||
this.set('selectedAuth', 'token');
|
||||
let adapter = this.store.adapterFor('tools');
|
||||
|
@ -168,9 +173,11 @@ export default Component.extend(DEFAULTS, {
|
|||
} catch (e) {
|
||||
this.set('error', `Token unwrap failed: ${e.errors[0]}`);
|
||||
}
|
||||
}).withTestWaiter(),
|
||||
})
|
||||
),
|
||||
|
||||
fetchMethods: task(function*() {
|
||||
fetchMethods: task(
|
||||
waitFor(function* () {
|
||||
let store = this.store;
|
||||
try {
|
||||
let methods = yield store.findAll('auth-method', {
|
||||
|
@ -180,7 +187,7 @@ export default Component.extend(DEFAULTS, {
|
|||
});
|
||||
this.set(
|
||||
'methods',
|
||||
methods.map(m => {
|
||||
methods.map((m) => {
|
||||
const method = m.serialize({ includeId: true });
|
||||
return {
|
||||
...method,
|
||||
|
@ -194,7 +201,8 @@ export default Component.extend(DEFAULTS, {
|
|||
} catch (e) {
|
||||
this.set('error', `There was an error fetching Auth Methods: ${e.errors[0]}`);
|
||||
}
|
||||
}).withTestWaiter(),
|
||||
})
|
||||
),
|
||||
|
||||
showLoading: or('isLoading', 'authenticate.isRunning', 'fetchMethods.isRunning', 'unwrapToken.isRunning'),
|
||||
|
||||
|
@ -202,7 +210,7 @@ export default Component.extend(DEFAULTS, {
|
|||
this.set('loading', false);
|
||||
let errors;
|
||||
if (e.errors) {
|
||||
errors = e.errors.map(error => {
|
||||
errors = e.errors.map((error) => {
|
||||
if (error.detail) {
|
||||
return error.detail;
|
||||
}
|
||||
|
@ -215,7 +223,8 @@ export default Component.extend(DEFAULTS, {
|
|||
this.set('error', `${message}${errors.join('.')}`);
|
||||
},
|
||||
|
||||
authenticate: task(function*(backendType, data) {
|
||||
authenticate: task(
|
||||
waitFor(function* (backendType, data) {
|
||||
let clusterId = this.cluster.id;
|
||||
try {
|
||||
if (backendType === 'okta') {
|
||||
|
@ -246,7 +255,8 @@ export default Component.extend(DEFAULTS, {
|
|||
} catch (e) {
|
||||
this.handleError(e);
|
||||
}
|
||||
}).withTestWaiter(),
|
||||
})
|
||||
),
|
||||
|
||||
delayAuthMessageReminder: task(function* () {
|
||||
if (Ember.testing) {
|
||||
|
@ -274,7 +284,7 @@ export default Component.extend(DEFAULTS, {
|
|||
});
|
||||
let backend = this.selectedAuthBackend || {};
|
||||
let backendMeta = BACKENDS.find(
|
||||
b => (b.type || '').toLowerCase() === (backend.type || '').toLowerCase()
|
||||
(b) => (b.type || '').toLowerCase() === (backend.type || '').toLowerCase()
|
||||
);
|
||||
let attributes = (backendMeta || {}).formAttributes || [];
|
||||
|
||||
|
|
|
@ -4,9 +4,9 @@ import Component from './outer-html';
|
|||
import { later } from '@ember/runloop';
|
||||
import { task, timeout, waitForEvent } from 'ember-concurrency';
|
||||
import { computed } from '@ember/object';
|
||||
import { waitFor } from '@ember/test-waiters';
|
||||
|
||||
/* eslint-disable ember/no-ember-testing-in-module-scope */
|
||||
const WAIT_TIME = Ember.testing ? 0 : 500;
|
||||
const WAIT_TIME = 500;
|
||||
const ERROR_WINDOW_CLOSED =
|
||||
'The provider window was closed before authentication was complete. Please click Sign In to try again.';
|
||||
const ERROR_MISSING_PARAMS =
|
||||
|
@ -29,6 +29,7 @@ export default Component.extend({
|
|||
onNamespace() {},
|
||||
|
||||
didReceiveAttrs() {
|
||||
this._super();
|
||||
let { oldSelectedAuthPath, selectedAuthPath } = this;
|
||||
let shouldDebounce = !oldSelectedAuthPath && !selectedAuthPath;
|
||||
if (oldSelectedAuthPath !== selectedAuthPath) {
|
||||
|
@ -52,11 +53,12 @@ export default Component.extend({
|
|||
return this.window || window;
|
||||
},
|
||||
|
||||
fetchRole: task(function*(roleName, options = { debounce: true }) {
|
||||
fetchRole: task(
|
||||
waitFor(function* (roleName, options = { debounce: true }) {
|
||||
if (options.debounce) {
|
||||
this.onRoleName(roleName);
|
||||
// debounce
|
||||
yield timeout(WAIT_TIME);
|
||||
yield timeout(Ember.testing ? 0 : WAIT_TIME);
|
||||
}
|
||||
let path = this.selectedAuthPath || this.selectedAuthType;
|
||||
let id = JSON.stringify([path, roleName]);
|
||||
|
@ -64,7 +66,8 @@ export default Component.extend({
|
|||
try {
|
||||
role = yield this.store.findRecord('role-jwt', id, { adapterOptions: { namespace: this.namespace } });
|
||||
} catch (e) {
|
||||
if (!e.httpStatus || e.httpStatus !== 400) {
|
||||
// throwing here causes failures in tests
|
||||
if ((!e.httpStatus || e.httpStatus !== 400) && !Ember.testing) {
|
||||
throw e;
|
||||
}
|
||||
if (e.errors && e.errors.length > 0) {
|
||||
|
@ -73,8 +76,7 @@ export default Component.extend({
|
|||
}
|
||||
this.set('role', role);
|
||||
})
|
||||
.restartable()
|
||||
.withTestWaiter(),
|
||||
).restartable(),
|
||||
|
||||
handleOIDCError(err) {
|
||||
this.onLoading(false);
|
||||
|
|
|
@ -99,6 +99,7 @@ export default Component.extend({
|
|||
},
|
||||
|
||||
didReceiveAttrs() {
|
||||
this._super();
|
||||
// if there's no value, reset encoding
|
||||
if (this.value === '') {
|
||||
set(this, 'currentEncoding', UTF8);
|
||||
|
|
|
@ -34,7 +34,7 @@ export default class HistoryComponent extends Component {
|
|||
return null;
|
||||
}
|
||||
let dataList = this.args.model.activity.byNamespace;
|
||||
return dataList.map(d => {
|
||||
return dataList.map((d) => {
|
||||
return {
|
||||
name: d['namespace_id'],
|
||||
id: d['namespace_path'] === '' ? 'root' : d['namespace_path'],
|
||||
|
@ -48,7 +48,7 @@ export default class HistoryComponent extends Component {
|
|||
return null;
|
||||
}
|
||||
let dataset = this.args.model.activity.byNamespace.slice(0, this.max_namespaces);
|
||||
return dataset.map(d => {
|
||||
return dataset.map((d) => {
|
||||
return {
|
||||
label: d['namespace_path'] === '' ? 'root' : d['namespace_path'],
|
||||
non_entity_tokens: d['counts']['non_entity_tokens'],
|
||||
|
@ -95,7 +95,7 @@ export default class HistoryComponent extends Component {
|
|||
|
||||
// Get the namespace by matching the path from the namespace list
|
||||
getNamespace(path) {
|
||||
return this.args.model.activity.byNamespace.find(ns => {
|
||||
return this.args.model.activity.byNamespace.find((ns) => {
|
||||
if (path === 'root') {
|
||||
return ns.namespace_path === '';
|
||||
}
|
||||
|
|
|
@ -139,7 +139,7 @@ export default Component.extend({
|
|||
const isUpload = this.model.uploadPemBundle;
|
||||
model
|
||||
.save({ adapterOptions: { method } })
|
||||
.then(m => {
|
||||
.then((m) => {
|
||||
if (method === 'setSignedIntermediate' || isUpload) {
|
||||
this.send('refresh');
|
||||
this.flashMessages.success('The certificate for this backend has been updated.');
|
||||
|
|
|
@ -44,7 +44,7 @@ export default Component.extend({
|
|||
.save({
|
||||
adapterOptions: {
|
||||
method: section,
|
||||
fields: get(config, `${section}Attrs`).map(attr => attr.name),
|
||||
fields: get(config, `${section}Attrs`).map((attr) => attr.name),
|
||||
},
|
||||
})
|
||||
.then(() => {
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
import Component from '@ember/component';
|
||||
|
||||
export default Component.extend({});
|
|
@ -1,3 +0,0 @@
|
|||
import Component from '@ember/component';
|
||||
|
||||
export default Component.extend({});
|
|
@ -1,3 +0,0 @@
|
|||
import Component from '@ember/component';
|
||||
|
||||
export default Component.extend({});
|
|
@ -4,7 +4,7 @@ import { computed } from '@ember/object';
|
|||
import columnify from 'columnify';
|
||||
|
||||
export function stringifyObjectValues(data) {
|
||||
Object.keys(data).forEach(item => {
|
||||
Object.keys(data).forEach((item) => {
|
||||
let val = data[item];
|
||||
if (typeof val !== 'string') {
|
||||
val = JSON.stringify(val);
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
import Component from '@ember/component';
|
||||
|
||||
export default Component.extend({});
|
|
@ -45,7 +45,7 @@ export default Component.extend({
|
|||
let serviceArgs;
|
||||
|
||||
if (
|
||||
executeUICommand(command, args => this.logAndOutput(args), {
|
||||
executeUICommand(command, (args) => this.logAndOutput(args), {
|
||||
api: () => this.routeToExplore.perform(command),
|
||||
clearall: () => service.clearLog(true),
|
||||
clear: () => service.clearLog(),
|
||||
|
@ -134,7 +134,7 @@ export default Component.extend({
|
|||
}),
|
||||
|
||||
shiftCommandIndex(keyCode) {
|
||||
this.console.shiftCommandIndex(keyCode, val => {
|
||||
this.console.shiftCommandIndex(keyCode, (val) => {
|
||||
this.set('inputValue', val);
|
||||
});
|
||||
},
|
||||
|
|
|
@ -6,7 +6,7 @@ import { action } from '@ember/object';
|
|||
const LIST_ROOT_ROUTE = 'vault.cluster.secrets.backend.list-root';
|
||||
const SHOW_ROUTE = 'vault.cluster.secrets.backend.show';
|
||||
|
||||
const getErrorMessage = errors => {
|
||||
const getErrorMessage = (errors) => {
|
||||
let errorMessage = errors?.join('. ') || 'Something went wrong. Check the Vault logs for more information.';
|
||||
if (errorMessage.indexOf('failed to verify') >= 0) {
|
||||
errorMessage =
|
||||
|
@ -69,7 +69,7 @@ export default class DatabaseConnectionEdit extends Component {
|
|||
.then(() => {
|
||||
this.showSaveModal = true;
|
||||
})
|
||||
.catch(e => {
|
||||
.catch((e) => {
|
||||
const errorMessage = getErrorMessage(e.errors);
|
||||
this.flashMessages.danger(errorMessage);
|
||||
});
|
||||
|
@ -91,7 +91,7 @@ export default class DatabaseConnectionEdit extends Component {
|
|||
this.flashMessages.success(`Successfully rotated root credentials for connection "${name}"`);
|
||||
this.transitionToRoute(SHOW_ROUTE, name);
|
||||
})
|
||||
.catch(e => {
|
||||
.catch((e) => {
|
||||
this.flashMessages.danger(`Error rotating root credentials: ${e.errors}`);
|
||||
this.transitionToRoute(SHOW_ROUTE, name);
|
||||
});
|
||||
|
@ -107,7 +107,7 @@ export default class DatabaseConnectionEdit extends Component {
|
|||
.then(() => {
|
||||
this.transitionToRoute(SHOW_ROUTE, secretId);
|
||||
})
|
||||
.catch(e => {
|
||||
.catch((e) => {
|
||||
const errorMessage = getErrorMessage(e.errors);
|
||||
this.flashMessages.danger(errorMessage);
|
||||
});
|
||||
|
@ -133,7 +133,7 @@ export default class DatabaseConnectionEdit extends Component {
|
|||
// TODO: Why isn't the confirmAction closing?
|
||||
this.flashMessages.success('Successfully reset connection');
|
||||
})
|
||||
.catch(e => {
|
||||
.catch((e) => {
|
||||
const errorMessage = getErrorMessage(e.errors);
|
||||
this.flashMessages.danger(errorMessage);
|
||||
});
|
||||
|
@ -147,7 +147,7 @@ export default class DatabaseConnectionEdit extends Component {
|
|||
// TODO: Why isn't the confirmAction closing?
|
||||
this.flashMessages.success('Successfully rotated credentials');
|
||||
})
|
||||
.catch(e => {
|
||||
.catch((e) => {
|
||||
const errorMessage = getErrorMessage(e.errors);
|
||||
this.flashMessages.danger(errorMessage);
|
||||
});
|
||||
|
|
|
@ -49,7 +49,7 @@ export default class DatabaseRoleEdit extends Component {
|
|||
}
|
||||
return this.store
|
||||
.queryRecord('database/connection', { id: dbs[0], backend })
|
||||
.then(record => record.plugin_name)
|
||||
.then((record) => record.plugin_name)
|
||||
.catch(() => null);
|
||||
}
|
||||
|
||||
|
@ -73,7 +73,7 @@ export default class DatabaseRoleEdit extends Component {
|
|||
console.debug(e);
|
||||
}
|
||||
})
|
||||
.catch(e => {
|
||||
.catch((e) => {
|
||||
this.flashMessages.danger(e.errors?.join('. '));
|
||||
});
|
||||
}
|
||||
|
@ -100,7 +100,7 @@ export default class DatabaseRoleEdit extends Component {
|
|||
console.debug(e);
|
||||
}
|
||||
})
|
||||
.catch(e => {
|
||||
.catch((e) => {
|
||||
const errorMessage = e.errors?.join('. ') || e.message;
|
||||
this.flashMessages.danger(
|
||||
errorMessage || 'Could not save the role. Please check Vault logs for more information.'
|
||||
|
|
|
@ -20,7 +20,7 @@ export default class DatabaseRoleSettingForm extends Component {
|
|||
get settingFields() {
|
||||
if (!this.args.roleType) return null;
|
||||
let dbValidFields = getRoleFields(this.args.roleType);
|
||||
return this.args.attrs.filter(a => {
|
||||
return this.args.attrs.filter((a) => {
|
||||
return dbValidFields.includes(a.name);
|
||||
});
|
||||
}
|
||||
|
@ -30,7 +30,7 @@ export default class DatabaseRoleSettingForm extends Component {
|
|||
const plugin = this.args.dbType;
|
||||
if (!type) return null;
|
||||
let dbValidFields = getStatementFields(type, plugin);
|
||||
return this.args.attrs.filter(a => {
|
||||
return this.args.attrs.filter((a) => {
|
||||
return dbValidFields.includes(a.name);
|
||||
});
|
||||
}
|
||||
|
|
|
@ -35,14 +35,14 @@ export default class DiffVersionSelector extends Component {
|
|||
let string = `["${this.args.model.engineId}", "${this.args.model.id}", "${this.args.model.currentVersion}"]`;
|
||||
return this.adapter
|
||||
.querySecretDataByVersion(string)
|
||||
.then(response => response.data)
|
||||
.then((response) => response.data)
|
||||
.catch(() => null);
|
||||
}
|
||||
get rightSideDataInit() {
|
||||
let string = `["${this.args.model.engineId}", "${this.args.model.id}", "${this.rightSideVersionInit}"]`;
|
||||
return this.adapter
|
||||
.querySecretDataByVersion(string)
|
||||
.then(response => response.data)
|
||||
.then((response) => response.data)
|
||||
.catch(() => null);
|
||||
}
|
||||
get rightSideVersionInit() {
|
||||
|
|
|
@ -1,15 +0,0 @@
|
|||
/**
|
||||
* @module FormFieldGroupsLoop
|
||||
* FormFieldGroupsLoop components are used to show optional form fields, generally when setting up a secret engine.
|
||||
*
|
||||
* @example
|
||||
* ```js
|
||||
* <FormFieldGroupsLoop @model={{model}} @mode={{mode}}/>
|
||||
* ```
|
||||
* @param {object} model - the data model of the parent component
|
||||
* @param {object} model - the mode: create show or edit.
|
||||
*/
|
||||
|
||||
import Component from '@glimmer/component';
|
||||
|
||||
export default class FormFieldGroupsLoop extends Component {}
|
|
@ -59,6 +59,7 @@ export default Component.extend({
|
|||
},
|
||||
|
||||
didReceiveAttrs() {
|
||||
this._super();
|
||||
if (this.wizard.featureState === 'displayRole') {
|
||||
this.wizard.transitionFeatureMachine(this.wizard.featureState, 'CONTINUE', this.backendType);
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ import { inject as service } from '@ember/service';
|
|||
import Component from '@ember/component';
|
||||
import { computed, set } from '@ember/object';
|
||||
import { task } from 'ember-concurrency';
|
||||
import { waitFor } from '@ember/test-waiters';
|
||||
|
||||
/**
|
||||
* @module GeneratedItem
|
||||
|
@ -29,7 +30,8 @@ export default Component.extend({
|
|||
props: computed('model', function () {
|
||||
return this.model.serialize();
|
||||
}),
|
||||
saveModel: task(function*() {
|
||||
saveModel: task(
|
||||
waitFor(function* () {
|
||||
try {
|
||||
yield this.model.save();
|
||||
} catch (err) {
|
||||
|
@ -42,16 +44,17 @@ export default Component.extend({
|
|||
}
|
||||
this.router.transitionTo('vault.cluster.access.method.item.list').followRedirects();
|
||||
this.flashMessages.success(`Successfully saved ${this.itemType} ${this.model.id}.`);
|
||||
}).withTestWaiter(),
|
||||
})
|
||||
),
|
||||
init() {
|
||||
this._super(...arguments);
|
||||
this.set('validationMessages', {});
|
||||
if (this.mode === 'edit') {
|
||||
// For validation to work in edit mode,
|
||||
// reconstruct the model values from field group
|
||||
this.model.fieldGroups.forEach(element => {
|
||||
this.model.fieldGroups.forEach((element) => {
|
||||
if (element.default) {
|
||||
element.default.forEach(attr => {
|
||||
element.default.forEach((attr) => {
|
||||
let fieldValue = attr.options && attr.options.fieldValue;
|
||||
if (fieldValue) {
|
||||
this.model[attr.name] = this.model[fieldValue];
|
||||
|
|
|
@ -32,7 +32,7 @@ export default Component.extend({
|
|||
this.onSuccess();
|
||||
this.flashMessages.success(this.successMessage(...messageArgs));
|
||||
})
|
||||
.catch(e => {
|
||||
.catch((e) => {
|
||||
this.onError(...messageArgs);
|
||||
this.flashMessages.success(this.errorMessage(e, ...messageArgs));
|
||||
});
|
||||
|
|
|
@ -3,6 +3,7 @@ import Component from '@ember/component';
|
|||
import { computed } from '@ember/object';
|
||||
import { task } from 'ember-concurrency';
|
||||
import { humanize } from 'vault/helpers/humanize';
|
||||
import { waitFor } from '@ember/test-waiters';
|
||||
|
||||
export default Component.extend({
|
||||
flashMessages: service(),
|
||||
|
@ -49,7 +50,8 @@ export default Component.extend({
|
|||
return `Successfully ${action} ${typeDisplay}.`;
|
||||
},
|
||||
|
||||
save: task(function*() {
|
||||
save: task(
|
||||
waitFor(function* () {
|
||||
let model = this.model;
|
||||
let message = this.getMessage(model);
|
||||
|
||||
|
@ -62,10 +64,10 @@ export default Component.extend({
|
|||
this.flashMessages.success(message);
|
||||
yield this.onSave({ saveType: 'save', model });
|
||||
})
|
||||
.drop()
|
||||
.withTestWaiter(),
|
||||
).drop(),
|
||||
|
||||
willDestroy() {
|
||||
this._super(...arguments);
|
||||
let model = this.model;
|
||||
if (!model) return;
|
||||
if ((model.get('isDirty') && !model.isDestroyed) || !model.isDestroying) {
|
||||
|
|
|
@ -13,7 +13,7 @@ export default Component.extend({
|
|||
.then(() => {
|
||||
this.flashMessages.success(`Successfully enabled entity: ${model.id}`);
|
||||
})
|
||||
.catch(e => {
|
||||
.catch((e) => {
|
||||
this.flashMessages.success(
|
||||
`There was a problem enabling the entity: ${model.id} - ${e.errors.join(' ') || e.message}`
|
||||
);
|
||||
|
|
|
@ -20,7 +20,7 @@ export default Component.extend({
|
|||
|
||||
init() {
|
||||
this._super(...arguments);
|
||||
this.store.findAll('auth-method').then(methods => {
|
||||
this.store.findAll('auth-method').then((methods) => {
|
||||
this.set('authMethods', methods);
|
||||
this.set('aliasMountAccessor', methods.get('firstObject.accessor'));
|
||||
});
|
||||
|
|
|
@ -23,7 +23,7 @@ import { allFeatures } from 'vault/helpers/all-features';
|
|||
*/
|
||||
export default class LicenseInfoComponent extends Component {
|
||||
get featuresInfo() {
|
||||
return allFeatures().map(feature => {
|
||||
return allFeatures().map((feature) => {
|
||||
let active = this.args.features.includes(feature);
|
||||
if (active && feature === 'Performance Standby') {
|
||||
let count = this.args.performanceStandbyCount;
|
||||
|
|
|
@ -5,6 +5,7 @@ import Component from '@ember/component';
|
|||
import { task } from 'ember-concurrency';
|
||||
import { methods } from 'vault/helpers/mountable-auth-methods';
|
||||
import { engines, KMIP, TRANSFORM } from 'vault/helpers/mountable-secret-engines';
|
||||
import { waitFor } from '@ember/test-waiters';
|
||||
|
||||
const METHODS = methods();
|
||||
const ENGINES = engines();
|
||||
|
@ -74,6 +75,7 @@ export default Component.extend({
|
|||
}),
|
||||
|
||||
willDestroy() {
|
||||
this._super(...arguments);
|
||||
// if unsaved, we want to unload so it doesn't show up in the auth mount list
|
||||
this.mountModel.rollbackAttributes();
|
||||
},
|
||||
|
@ -90,7 +92,8 @@ export default Component.extend({
|
|||
}
|
||||
},
|
||||
|
||||
mountBackend: task(function*() {
|
||||
mountBackend: task(
|
||||
waitFor(function* () {
|
||||
const mountModel = this.mountModel;
|
||||
const { type, path } = mountModel;
|
||||
let capabilities = null;
|
||||
|
@ -142,8 +145,7 @@ export default Component.extend({
|
|||
yield this.onMountSuccess(type, path);
|
||||
return;
|
||||
})
|
||||
.drop()
|
||||
.withTestWaiter(),
|
||||
).drop(),
|
||||
|
||||
actions: {
|
||||
onKeyUp(name, value) {
|
||||
|
|
|
@ -27,7 +27,7 @@ export default class OidcConsentBlockComponent extends Component {
|
|||
buildUrl(urlString, params) {
|
||||
try {
|
||||
let url = new URL(urlString);
|
||||
Object.keys(params).forEach(key => {
|
||||
Object.keys(params).forEach((key) => {
|
||||
if (params[key] && validParameters.includes(key)) {
|
||||
url.searchParams.append(key, params[key]);
|
||||
}
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
import Component from '@ember/component';
|
||||
import { set } from '@ember/object';
|
||||
import { task } from 'ember-concurrency';
|
||||
import { waitFor } from '@ember/test-waiters';
|
||||
|
||||
const BASE_64_REGEX = /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gi;
|
||||
|
||||
export default Component.extend({
|
||||
|
@ -41,7 +43,8 @@ export default Component.extend({
|
|||
reader.readAsDataURL(file);
|
||||
},
|
||||
|
||||
setPGPKey: task(function*(dataURL, filename) {
|
||||
setPGPKey: task(
|
||||
waitFor(function* (dataURL, filename) {
|
||||
const b64File = dataURL.split(',')[1].trim();
|
||||
const decoded = atob(b64File).trim();
|
||||
|
||||
|
@ -51,7 +54,8 @@ export default Component.extend({
|
|||
// the original as it was only encoded when we used `readAsDataURL`.
|
||||
const fileData = decoded.match(BASE_64_REGEX) ? decoded : b64File;
|
||||
yield this.onChange(this.index, { value: fileData, fileName: filename });
|
||||
}).withTestWaiter(),
|
||||
})
|
||||
),
|
||||
|
||||
actions: {
|
||||
pickedFile(e) {
|
||||
|
|
|
@ -34,7 +34,7 @@ export default Component.extend({
|
|||
list = [...this.listData, ...this.newList(this.listLength - this.listData.length)];
|
||||
}
|
||||
this.set('listData', list || this.listData);
|
||||
this.onDataUpdate((list || this.listData).compact().map(k => k.value));
|
||||
this.onDataUpdate((list || this.listData).compact().map((k) => k.value));
|
||||
},
|
||||
|
||||
newList(length) {
|
||||
|
@ -47,7 +47,7 @@ export default Component.extend({
|
|||
setKey(index, key) {
|
||||
let { listData } = this;
|
||||
listData.splice(index, 1, key);
|
||||
this.onDataUpdate(listData.compact().map(k => k.value));
|
||||
this.onDataUpdate(listData.compact().map((k) => k.value));
|
||||
},
|
||||
},
|
||||
});
|
||||
|
|
|
@ -1,18 +1,26 @@
|
|||
<div class="field">
|
||||
<div class="regex-label-wrapper">
|
||||
<div class="regex-label">
|
||||
<label for="{{@attr.name}}" class="is-label">
|
||||
<label for={{@attr.name}} class="is-label">
|
||||
{{@labelString}}
|
||||
{{#if @attr.options.helpText}}
|
||||
{{#info-tooltip}}
|
||||
<InfoTooltip>
|
||||
<span data-test-help-text>
|
||||
{{@attr.options.helpText}}
|
||||
</span>
|
||||
{{/info-tooltip}}
|
||||
</InfoTooltip>
|
||||
{{/if}}
|
||||
</label>
|
||||
{{#if @attr.options.subText}}
|
||||
<p class="sub-text">{{@attr.options.subText}} {{#if @attr.options.docLink}}<a href="{{@attr.options.docLink}}" target="_blank" rel="noopener noreferrer">See our documentation</a> for help.{{/if}}</p>
|
||||
<p class="sub-text">
|
||||
{{@attr.options.subText}}
|
||||
{{#if @attr.options.docLink}}
|
||||
<a href={{@attr.options.docLink}} target="_blank" rel="noopener noreferrer">
|
||||
See our documentation
|
||||
</a>
|
||||
for help.
|
||||
{{/if}}
|
||||
</p>
|
||||
{{/if}}
|
||||
</div>
|
||||
<div>
|
||||
|
@ -32,14 +40,14 @@
|
|||
data-test-input={{@attr.name}}
|
||||
autocomplete="off"
|
||||
spellcheck="false"
|
||||
{{on 'change' @onChange}}
|
||||
{{on "change" @onChange}}
|
||||
value={{@value}}
|
||||
class="input"
|
||||
/>
|
||||
</div>
|
||||
{{#if this.showTestValue}}
|
||||
<div data-test-regex-validator-test-string>
|
||||
<label for="{{@attr.name}}" class="is-label">
|
||||
<label for={{@attr.name}} class="is-label">
|
||||
Test string
|
||||
</label>
|
||||
<input
|
||||
|
@ -48,8 +56,9 @@
|
|||
autocomplete="off"
|
||||
spellcheck="false"
|
||||
value={{this.testValue}}
|
||||
{{on 'change' this.updateTestValue}}
|
||||
class="input {{if this.regexError 'has-error'}}" />
|
||||
{{on "change" this.updateTestValue}}
|
||||
class="input {{if this.regexError "has-error"}}"
|
||||
/>
|
||||
|
||||
{{#if (and this.testValue @value)}}
|
||||
<div data-test-regex-validation-message>
|
||||
|
@ -65,4 +74,3 @@
|
|||
{{/if}}
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
|
|
|
@ -28,9 +28,8 @@ import ControlGroupError from 'vault/lib/control-group-error';
|
|||
import Ember from 'ember';
|
||||
import keys from 'vault/lib/keycodes';
|
||||
|
||||
import { action } from '@ember/object';
|
||||
import { action, set } from '@ember/object';
|
||||
import { inject as service } from '@ember/service';
|
||||
import { set } from '@ember/object';
|
||||
import { tracked } from '@glimmer/tracking';
|
||||
|
||||
import { isBlank, isNone } from '@ember/utils';
|
||||
|
@ -66,7 +65,7 @@ export default class SecretCreateOrUpdate extends Component {
|
|||
let adapter = this.store.adapterFor('secret-v2');
|
||||
let type = { modelName: 'secret-v2' };
|
||||
let query = { backend: this.args.model.backend };
|
||||
adapter.query(this.store, type, query).then(result => {
|
||||
adapter.query(this.store, type, query).then((result) => {
|
||||
this.secretPaths = result.data.keys;
|
||||
});
|
||||
}
|
||||
|
@ -143,7 +142,7 @@ export default class SecretCreateOrUpdate extends Component {
|
|||
.then(() => {
|
||||
this.saveComplete(successCallback, key);
|
||||
})
|
||||
.catch(e => {
|
||||
.catch((e) => {
|
||||
// when mode is not create the metadata error is handled in secret-edit-metadata
|
||||
if (this.args.mode === 'create') {
|
||||
this.error = e.errors.join(' ');
|
||||
|
@ -155,7 +154,7 @@ export default class SecretCreateOrUpdate extends Component {
|
|||
}
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
.catch((error) => {
|
||||
if (error instanceof ControlGroupError) {
|
||||
let errorMessage = this.controlGroup.logFromError(error);
|
||||
this.error = errorMessage.content;
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/* eslint ember/no-computed-properties-in-native-classes: 'warn' */
|
||||
import Ember from 'ember';
|
||||
import { inject as service } from '@ember/service';
|
||||
import Component from '@glimmer/component';
|
||||
|
@ -6,7 +7,7 @@ import { action } from '@ember/object';
|
|||
import { alias } from '@ember/object/computed';
|
||||
import { maybeQueryRecord } from 'vault/macros/maybe-query-record';
|
||||
|
||||
const getErrorMessage = errors => {
|
||||
const getErrorMessage = (errors) => {
|
||||
let errorMessage = errors?.join('. ') || 'Something went wrong. Check the Vault logs for more information.';
|
||||
return errorMessage;
|
||||
};
|
||||
|
@ -19,7 +20,7 @@ export default class SecretDeleteMenu extends Component {
|
|||
|
||||
@maybeQueryRecord(
|
||||
'capabilities',
|
||||
context => {
|
||||
(context) => {
|
||||
if (!context.args || !context.args.modelForData || !context.args.modelForData.id) return;
|
||||
let [backend, id] = JSON.parse(context.args.modelForData.id);
|
||||
return {
|
||||
|
@ -33,7 +34,7 @@ export default class SecretDeleteMenu extends Component {
|
|||
|
||||
@maybeQueryRecord(
|
||||
'capabilities',
|
||||
context => {
|
||||
(context) => {
|
||||
if (!context.args || !context.args.modelForData || !context.args.modelForData.id) return;
|
||||
let [backend, id] = JSON.parse(context.args.modelForData.id);
|
||||
return {
|
||||
|
@ -47,7 +48,7 @@ export default class SecretDeleteMenu extends Component {
|
|||
|
||||
@maybeQueryRecord(
|
||||
'capabilities',
|
||||
context => {
|
||||
(context) => {
|
||||
if (!context.args.model || !context.args.model.engine || !context.args.model.id) return;
|
||||
let backend = context.args.model.engine.id;
|
||||
let id = context.args.model.id;
|
||||
|
@ -64,7 +65,7 @@ export default class SecretDeleteMenu extends Component {
|
|||
|
||||
@maybeQueryRecord(
|
||||
'capabilities',
|
||||
context => {
|
||||
(context) => {
|
||||
if (!context.args.model || context.args.mode === 'create') {
|
||||
return;
|
||||
}
|
||||
|
@ -85,7 +86,7 @@ export default class SecretDeleteMenu extends Component {
|
|||
|
||||
@maybeQueryRecord(
|
||||
'capabilities',
|
||||
context => {
|
||||
(context) => {
|
||||
if (!context.args.model || context.args.mode === 'create') {
|
||||
return;
|
||||
}
|
||||
|
@ -136,7 +137,7 @@ export default class SecretDeleteMenu extends Component {
|
|||
return this.store
|
||||
.adapterFor('secret-v2-version')
|
||||
.v2DeleteOperation(this.store, this.args.modelForData.id, deleteType, currentVersionForNoReadMetadata)
|
||||
.then(resp => {
|
||||
.then((resp) => {
|
||||
if (Ember.testing) {
|
||||
this.showDeleteModal = false;
|
||||
// we don't want a refresh otherwise test loop will rerun in a loop
|
||||
|
|
|
@ -16,9 +16,8 @@
|
|||
*/
|
||||
|
||||
import Component from '@glimmer/component';
|
||||
import { action } from '@ember/object';
|
||||
import { action, set } from '@ember/object';
|
||||
import { inject as service } from '@ember/service';
|
||||
import { set } from '@ember/object';
|
||||
import { tracked } from '@glimmer/tracking';
|
||||
|
||||
export default class SecretEditMetadata extends Component {
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
* @param {object} wrappedData - when copy the data it's the token of the secret returned.
|
||||
* @param {object} editActions - actions passed from parent to child
|
||||
*/
|
||||
|
||||
/* eslint ember/no-computed-properties-in-native-classes: 'warn' */
|
||||
import Component from '@glimmer/component';
|
||||
import { action } from '@ember/object';
|
||||
import { not } from '@ember/object/computed';
|
||||
|
@ -75,7 +75,7 @@ export default class SecretEditToolbar extends Component {
|
|||
this.store
|
||||
.adapterFor('secret-v2-version')
|
||||
.queryRecord(this.args.modelForData.id, { wrapTTL: 1800 })
|
||||
.then(resp => {
|
||||
.then((resp) => {
|
||||
this.wrappedData = resp.wrap_info.token;
|
||||
this.flashMessages.success('Secret Successfully Wrapped!');
|
||||
})
|
||||
|
@ -93,7 +93,7 @@ export default class SecretEditToolbar extends Component {
|
|||
id: this.args.modelForData.id,
|
||||
wrapTTL: 1800,
|
||||
})
|
||||
.then(resp => {
|
||||
.then((resp) => {
|
||||
this.wrappedData = resp.wrap_info.token;
|
||||
this.flashMessages.success('Secret Successfully Wrapped!');
|
||||
})
|
||||
|
|
|
@ -73,7 +73,7 @@ export default Component.extend(FocusOnInsertMixin, WithNavToNearestAncestor, {
|
|||
|
||||
checkSecretCapabilities: maybeQueryRecord(
|
||||
'capabilities',
|
||||
context => {
|
||||
(context) => {
|
||||
if (!context.model || context.mode === 'create') {
|
||||
return;
|
||||
}
|
||||
|
@ -94,7 +94,7 @@ export default Component.extend(FocusOnInsertMixin, WithNavToNearestAncestor, {
|
|||
|
||||
checkMetadataCapabilities: maybeQueryRecord(
|
||||
'capabilities',
|
||||
context => {
|
||||
(context) => {
|
||||
if (!context.model || !context.isV2) {
|
||||
return;
|
||||
}
|
||||
|
@ -137,7 +137,11 @@ export default Component.extend(FocusOnInsertMixin, WithNavToNearestAncestor, {
|
|||
|
||||
showAdvancedMode: or('secretDataIsAdvanced', 'preferAdvancedEdit'),
|
||||
|
||||
isWriteWithoutRead: computed('model.failedServerRead', 'modelForData.failedServerRead', 'isV2', function() {
|
||||
isWriteWithoutRead: computed(
|
||||
'model.failedServerRead',
|
||||
'modelForData.failedServerRead',
|
||||
'isV2',
|
||||
function () {
|
||||
if (!this.model) return;
|
||||
// if the version couldn't be read from the server
|
||||
if (this.isV2 && this.modelForData.failedServerRead) {
|
||||
|
@ -148,7 +152,8 @@ export default Component.extend(FocusOnInsertMixin, WithNavToNearestAncestor, {
|
|||
return true;
|
||||
}
|
||||
return false;
|
||||
}),
|
||||
}
|
||||
),
|
||||
|
||||
actions: {
|
||||
refresh() {
|
||||
|
|
|
@ -39,7 +39,7 @@ export default class SecretListHeaderTab extends Component {
|
|||
let checkCapabilities = function (object) {
|
||||
let array = [];
|
||||
// we only want to look at the canList, canCreate and canUpdate on the capabilities record
|
||||
capabilitiesArray.forEach(item => {
|
||||
capabilitiesArray.forEach((item) => {
|
||||
// object is sometimes null
|
||||
if (object) {
|
||||
array.push(object[item]);
|
||||
|
@ -47,7 +47,7 @@ export default class SecretListHeaderTab extends Component {
|
|||
});
|
||||
return array;
|
||||
};
|
||||
let checker = arr => arr.every(item => !item); // same things as listing every item as !item && !item, etc.
|
||||
let checker = (arr) => arr.every((item) => !item); // same things as listing every item as !item && !item, etc.
|
||||
// For now only check capabilities for the Database Secrets Engine
|
||||
if (this.args.displayName === 'Database') {
|
||||
let peekRecordRoles = this.store.peekRecord('capabilities', 'database/roles/');
|
||||
|
|
|
@ -41,7 +41,7 @@ export default class DatabaseListItem extends Component {
|
|||
.then(() => {
|
||||
this.flashMessages.success(`Success: ${id} connection was reset`);
|
||||
})
|
||||
.catch(e => {
|
||||
.catch((e) => {
|
||||
this.flashMessages.danger(e.errors);
|
||||
});
|
||||
}
|
||||
|
@ -54,7 +54,7 @@ export default class DatabaseListItem extends Component {
|
|||
.then(() => {
|
||||
this.flashMessages.success(`Success: ${id} connection was rotated`);
|
||||
})
|
||||
.catch(e => {
|
||||
.catch((e) => {
|
||||
this.flashMessages.danger(e.errors);
|
||||
});
|
||||
}
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
import Component from '@glimmer/component';
|
||||
import { set } from '@ember/object';
|
||||
import { action } from '@ember/object';
|
||||
import { set, action } from '@ember/object';
|
||||
import { tracked } from '@glimmer/tracking';
|
||||
import { guidFor } from '@ember/object/internals';
|
||||
|
||||
|
|
|
@ -4,11 +4,12 @@ import { inject as service } from '@ember/service';
|
|||
import Component from '@ember/component';
|
||||
import { setProperties, computed, set } from '@ember/object';
|
||||
import { addSeconds, parseISO } from 'date-fns';
|
||||
import { A } from '@ember/array';
|
||||
|
||||
const DEFAULTS = {
|
||||
token: null,
|
||||
rewrap_token: null,
|
||||
errors: [],
|
||||
errors: A(),
|
||||
wrap_info: null,
|
||||
creation_time: null,
|
||||
creation_ttl: null,
|
||||
|
@ -127,7 +128,10 @@ export default Component.extend(DEFAULTS, {
|
|||
this.store
|
||||
.adapterFor('tools')
|
||||
.toolAction(action, data, { wrapTTL })
|
||||
.then(resp => this.handleSuccess(resp, action), (...errArgs) => this.handleError(...errArgs));
|
||||
.then(
|
||||
(resp) => this.handleSuccess(resp, action),
|
||||
(...errArgs) => this.handleError(...errArgs)
|
||||
);
|
||||
},
|
||||
|
||||
onClear() {
|
||||
|
|
|
@ -71,7 +71,7 @@ export default Component.extend(FocusOnInsertMixin, {
|
|||
.then(() => {
|
||||
successCallback(model);
|
||||
})
|
||||
.catch(e => {
|
||||
.catch((e) => {
|
||||
model.set('displayErrors', e.errors);
|
||||
throw e;
|
||||
});
|
||||
|
|
|
@ -11,7 +11,7 @@ export default TransformBase.extend({
|
|||
handleUpdateTransformations(updateTransformations, roleId, type = 'update') {
|
||||
if (!updateTransformations) return;
|
||||
const backend = this.model.backend;
|
||||
const promises = updateTransformations.map(transform => {
|
||||
const promises = updateTransformations.map((transform) => {
|
||||
return this.store
|
||||
.queryRecord('transform', {
|
||||
backend,
|
||||
|
@ -30,17 +30,17 @@ export default TransformBase.extend({
|
|||
allowed_roles: roles,
|
||||
});
|
||||
|
||||
return transformation.save().catch(e => {
|
||||
return transformation.save().catch((e) => {
|
||||
return { errorStatus: e.httpStatus, ...transform };
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Promise.all(promises).then(res => {
|
||||
let hasError = res.find(r => !!r.errorStatus);
|
||||
Promise.all(promises).then((res) => {
|
||||
let hasError = res.find((r) => !!r.errorStatus);
|
||||
if (hasError) {
|
||||
let errorAdding = res.find(r => r.errorStatus === 403 && r.action === 'ADD');
|
||||
let errorRemoving = res.find(r => r.errorStatus === 403 && r.action === 'REMOVE');
|
||||
let errorAdding = res.find((r) => r.errorStatus === 403 && r.action === 'ADD');
|
||||
let errorRemoving = res.find((r) => r.errorStatus === 403 && r.action === 'REMOVE');
|
||||
|
||||
let message =
|
||||
'The edits to this role were successful, but allowed_roles for its transformations was not edited due to a lack of permissions.';
|
||||
|
@ -72,7 +72,7 @@ export default TransformBase.extend({
|
|||
|
||||
if (!this.initialTransformations) {
|
||||
this.handleUpdateTransformations(
|
||||
newModelTransformations.map(t => ({
|
||||
newModelTransformations.map((t) => ({
|
||||
id: t,
|
||||
action: 'ADD',
|
||||
})),
|
||||
|
@ -83,7 +83,7 @@ export default TransformBase.extend({
|
|||
}
|
||||
|
||||
const updateTransformations = [...newModelTransformations, ...this.initialTransformations]
|
||||
.map(t => {
|
||||
.map((t) => {
|
||||
if (this.initialTransformations.indexOf(t) < 0) {
|
||||
return {
|
||||
id: t,
|
||||
|
@ -98,7 +98,7 @@ export default TransformBase.extend({
|
|||
}
|
||||
return null;
|
||||
})
|
||||
.filter(t => !!t);
|
||||
.filter((t) => !!t);
|
||||
this.handleUpdateTransformations(updateTransformations, roleId);
|
||||
});
|
||||
},
|
||||
|
@ -106,7 +106,7 @@ export default TransformBase.extend({
|
|||
delete() {
|
||||
const roleId = this.model?.id;
|
||||
const roleTransformations = this.model?.transformations || [];
|
||||
const updateTransformations = roleTransformations.map(t => ({
|
||||
const updateTransformations = roleTransformations.map((t) => ({
|
||||
id: t,
|
||||
action: 'REMOVE',
|
||||
}));
|
||||
|
|
|
@ -8,7 +8,7 @@ export default TransformBase.extend({
|
|||
}
|
||||
|
||||
let { type, allowed_roles, tweak_source, name } = this.model;
|
||||
let wildCardRole = allowed_roles.find(role => role.includes('*'));
|
||||
let wildCardRole = allowed_roles.find((role) => role.includes('*'));
|
||||
|
||||
// values to be returned
|
||||
let role = '<choose a role>';
|
||||
|
|
|
@ -15,7 +15,7 @@ export default TransformBase.extend({
|
|||
backend,
|
||||
id: role.id,
|
||||
})
|
||||
.then(roleStore => {
|
||||
.then((roleStore) => {
|
||||
let transformations = roleStore.transformations;
|
||||
if (role.action === 'ADD') {
|
||||
transformations = addToList(transformations, transformationId);
|
||||
|
@ -26,14 +26,14 @@ export default TransformBase.extend({
|
|||
backend,
|
||||
transformations,
|
||||
});
|
||||
return roleStore.save().catch(e => {
|
||||
return roleStore.save().catch((e) => {
|
||||
return {
|
||||
errorStatus: e.httpStatus,
|
||||
...role,
|
||||
};
|
||||
});
|
||||
})
|
||||
.catch(e => {
|
||||
.catch((e) => {
|
||||
if (e.httpStatus !== 403 && role.action === 'ADD') {
|
||||
// If role doesn't yet exist, create it with this transformation attached
|
||||
var newRole = this.store.createRecord('transform/role', {
|
||||
|
@ -42,7 +42,7 @@ export default TransformBase.extend({
|
|||
transformations: [transformationId],
|
||||
backend,
|
||||
});
|
||||
return newRole.save().catch(e => {
|
||||
return newRole.save().catch((e) => {
|
||||
return {
|
||||
errorStatus: e.httpStatus,
|
||||
...role,
|
||||
|
@ -61,15 +61,15 @@ export default TransformBase.extend({
|
|||
handleUpdateRoles(updateRoles, transformationId) {
|
||||
if (!updateRoles) return;
|
||||
const backend = this.model.backend;
|
||||
const promises = updateRoles.map(r => this.updateOrCreateRole(r, transformationId, backend));
|
||||
const promises = updateRoles.map((r) => this.updateOrCreateRole(r, transformationId, backend));
|
||||
|
||||
Promise.all(promises).then(results => {
|
||||
let hasError = results.find(role => !!role.errorStatus);
|
||||
Promise.all(promises).then((results) => {
|
||||
let hasError = results.find((role) => !!role.errorStatus);
|
||||
|
||||
if (hasError) {
|
||||
let message =
|
||||
'The edits to this transformation were successful, but transformations for its roles was not edited due to a lack of permissions.';
|
||||
if (results.find(e => !!e.errorStatus && e.errorStatus !== 403)) {
|
||||
if (results.find((e) => !!e.errorStatus && e.errorStatus !== 403)) {
|
||||
// if the errors weren't all due to permissions show generic message
|
||||
// eg. trying to update a role with empty array as transformations
|
||||
message = `You've edited the allowed_roles for this transformation. However, the corresponding edits to some roles' transformations were not made`;
|
||||
|
@ -99,8 +99,8 @@ export default TransformBase.extend({
|
|||
const initialRoles = this.initialRoles || [];
|
||||
|
||||
const updateRoles = [...newModelRoles, ...initialRoles]
|
||||
.filter(r => !this.isWildcard(r)) // CBS TODO: expand wildcards into included roles instead
|
||||
.map(role => {
|
||||
.filter((r) => !this.isWildcard(r)) // CBS TODO: expand wildcards into included roles instead
|
||||
.map((role) => {
|
||||
if (initialRoles.indexOf(role) < 0) {
|
||||
return {
|
||||
id: role,
|
||||
|
@ -115,7 +115,7 @@ export default TransformBase.extend({
|
|||
}
|
||||
return null;
|
||||
})
|
||||
.filter(r => !!r);
|
||||
.filter((r) => !!r);
|
||||
this.handleUpdateRoles(updateRoles, transformationId);
|
||||
});
|
||||
},
|
||||
|
|
|
@ -134,7 +134,7 @@ export default Component.extend(TRANSIT_PARAMS, {
|
|||
}
|
||||
|
||||
if (paramsToKeep) {
|
||||
paramsToKeep.forEach(param => delete params[param]);
|
||||
paramsToKeep.forEach((param) => delete params[param]);
|
||||
}
|
||||
//resets params still left in the object to defaults
|
||||
this.clearErrors();
|
||||
|
@ -170,8 +170,10 @@ export default Component.extend(TRANSIT_PARAMS, {
|
|||
if (options.wrapTTL) {
|
||||
props = assign({}, props, { wrappedToken: resp.wrap_info.token });
|
||||
}
|
||||
if (!this.isDestroyed && !this.isDestroying) {
|
||||
this.toggleProperty('isModalActive');
|
||||
this.setProperties(props);
|
||||
}
|
||||
if (action === 'rotate') {
|
||||
this.onRefresh();
|
||||
}
|
||||
|
@ -204,7 +206,7 @@ export default Component.extend(TRANSIT_PARAMS, {
|
|||
|
||||
clearParams(params) {
|
||||
const arr = Array.isArray(params) ? params : [params];
|
||||
arr.forEach(param => this.set(param, null));
|
||||
arr.forEach((param) => this.set(param, null));
|
||||
},
|
||||
|
||||
toggleModal(successMessage) {
|
||||
|
@ -235,7 +237,7 @@ export default Component.extend(TRANSIT_PARAMS, {
|
|||
.adapterFor('transit-key')
|
||||
.keyAction(action, { backend, id, payload }, options)
|
||||
.then(
|
||||
resp => this.handleSuccess(resp, options, action),
|
||||
(resp) => this.handleSuccess(resp, options, action),
|
||||
(...errArgs) => this.handleError(...errArgs)
|
||||
);
|
||||
},
|
||||
|
|
|
@ -32,7 +32,11 @@ export default Component.extend({
|
|||
completedFeatures: computed('wizard.currentMachine', function () {
|
||||
return this.wizard.getCompletedFeatures();
|
||||
}),
|
||||
currentFeatureProgress: computed('currentMachine', 'featureMachineHistory.[]', 'tutorialState', function() {
|
||||
currentFeatureProgress: computed(
|
||||
'currentMachine',
|
||||
'featureMachineHistory.[]',
|
||||
'tutorialState',
|
||||
function () {
|
||||
if (this.tutorialState.includes('active.feature')) {
|
||||
let totalSteps = FEATURE_MACHINE_STEPS[this.currentMachine];
|
||||
if (this.currentMachine === 'secrets') {
|
||||
|
@ -56,7 +60,8 @@ export default Component.extend({
|
|||
};
|
||||
}
|
||||
return null;
|
||||
}),
|
||||
}
|
||||
),
|
||||
currentTutorialProgress: computed('tutorialState', function () {
|
||||
if (this.tutorialState.includes('init.active')) {
|
||||
let currentStepName = this.tutorialState.split('.')[2];
|
||||
|
@ -85,10 +90,10 @@ export default Component.extend({
|
|||
});
|
||||
} else {
|
||||
if (this.currentFeatureProgress) {
|
||||
this.completedFeatures.forEach(feature => {
|
||||
this.completedFeatures.forEach((feature) => {
|
||||
bar.push({ style: htmlSafe('width:100%;'), completed: true, feature: feature, showIcon: true });
|
||||
});
|
||||
this.wizard.featureList.forEach(feature => {
|
||||
this.wizard.featureList.forEach((feature) => {
|
||||
if (feature === this.currentMachine) {
|
||||
bar.push({
|
||||
style: htmlSafe(`width:${this.currentFeatureProgress.percentage}%;`),
|
||||
|
|
|
@ -17,7 +17,7 @@ export default Component.extend({
|
|||
|
||||
maybeHideFeatures() {
|
||||
let features = this.allFeatures;
|
||||
features.forEach(feat => {
|
||||
features.forEach((feat) => {
|
||||
feat.disabled = this.doesNotHavePermission(feat.requiredPermissions);
|
||||
});
|
||||
|
||||
|
@ -34,7 +34,7 @@ export default Component.extend({
|
|||
// 'example/path': ['capability'],
|
||||
// 'second/example/path': ['update', 'sudo'],
|
||||
// }
|
||||
return !Object.keys(requiredPermissions).every(path => {
|
||||
return !Object.keys(requiredPermissions).every((path) => {
|
||||
return this.permissions.hasPermission(path, requiredPermissions[path]);
|
||||
});
|
||||
},
|
||||
|
@ -49,7 +49,7 @@ export default Component.extend({
|
|||
return time;
|
||||
}),
|
||||
selectProgress: computed('selectedFeatures', function () {
|
||||
let bar = this.selectedFeatures.map(feature => {
|
||||
let bar = this.selectedFeatures.map((feature) => {
|
||||
return { style: htmlSafe('width:0%;'), completed: false, showIcon: true, feature: feature };
|
||||
});
|
||||
if (bar.length === 0) {
|
||||
|
|
|
@ -36,14 +36,14 @@ export default Component.extend({
|
|||
}),
|
||||
mountName: computed('currentMachine', 'mountSubtype', function () {
|
||||
if (this.currentMachine === 'secrets') {
|
||||
var secret = engines().find(engine => {
|
||||
var secret = engines().find((engine) => {
|
||||
return engine.type === this.mountSubtype;
|
||||
});
|
||||
if (secret) {
|
||||
return secret.displayName;
|
||||
}
|
||||
} else {
|
||||
var auth = methods().find(method => {
|
||||
var auth = methods().find((method) => {
|
||||
return method.type === this.mountSubtype;
|
||||
});
|
||||
if (auth) {
|
||||
|
|
|
@ -15,7 +15,7 @@ export default Controller.extend(ListController, {
|
|||
this.send('reload');
|
||||
this.flashMessages.success(`Successfully deleted ${type}: ${id}`);
|
||||
})
|
||||
.catch(e => {
|
||||
.catch((e) => {
|
||||
this.flashMessages.success(
|
||||
`There was a problem deleting ${type}: ${id} - ${e.errors.join(' ') || e.message}`
|
||||
);
|
||||
|
@ -33,7 +33,7 @@ export default Controller.extend(ListController, {
|
|||
.then(() => {
|
||||
this.flashMessages.success(`Successfully ${action[0]} ${type}: ${id}`);
|
||||
})
|
||||
.catch(e => {
|
||||
.catch((e) => {
|
||||
this.flashMessages.success(
|
||||
`There was a problem ${action[1]} ${type}: ${id} - ${e.errors.join(' ') || e.message}`
|
||||
);
|
||||
|
|
|
@ -51,7 +51,7 @@ export default Controller.extend(ListController, {
|
|||
this.flashMessages.success(`All of the leases under ${prefix} will be revoked.`);
|
||||
});
|
||||
})
|
||||
.catch(e => {
|
||||
.catch((e) => {
|
||||
const errString = e.errors.join('.');
|
||||
this.flashMessages.danger(
|
||||
`There was an error attempting to revoke the prefix: ${prefix}. ${errString}.`
|
||||
|
|
|
@ -36,7 +36,7 @@ export default Controller.extend({
|
|||
flash.success(`The lease ${model.id} was successfully renewed.`);
|
||||
});
|
||||
})
|
||||
.catch(e => {
|
||||
.catch((e) => {
|
||||
const errString = e.errors.join('.');
|
||||
flash.danger(`There was an error renewing the lease: ${errString}`);
|
||||
});
|
||||
|
|
|
@ -78,7 +78,10 @@ export default Controller.extend(DEFAULTS, {
|
|||
store
|
||||
.adapterFor('cluster')
|
||||
.initCluster(data)
|
||||
.then(resp => this.initSuccess(resp), (...errArgs) => this.initError(...errArgs));
|
||||
.then(
|
||||
(resp) => this.initSuccess(resp),
|
||||
(...errArgs) => this.initError(...errArgs)
|
||||
);
|
||||
},
|
||||
|
||||
setKeys(data) {
|
||||
|
|
|
@ -62,7 +62,7 @@ export default Controller.extend({
|
|||
this.wizard.transitionFeatureMachine('delete', 'CONTINUE', policyType);
|
||||
}
|
||||
})
|
||||
.catch(e => {
|
||||
.catch((e) => {
|
||||
let errors = e.errors ? e.errors.join('') : e.message;
|
||||
flash.danger(
|
||||
`There was an error deleting the ${policyType.toUpperCase()} policy "${name}": ${errors}.`
|
||||
|
|
|
@ -29,7 +29,7 @@ export default Controller.extend(ListController, BackendCrumbMixin, WithNavToNea
|
|||
this.set('loading-' + item.id, true);
|
||||
backend
|
||||
.saveZeroAddressConfig()
|
||||
.catch(e => {
|
||||
.catch((e) => {
|
||||
item.set('zeroAddress', false);
|
||||
this.flashMessages.danger(e.message);
|
||||
})
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue