Merge branch 'main' into toolbar
This commit is contained in:
73 files changed
+1060
-740
No files matched your search
@@ -12,8 +12,5 @@ insert_final_newline = true
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
[*.hbs]
|
||||
insert_final_newline = false
|
||||
|
||||
[*.{diff,md}]
|
||||
trim_trailing_whitespace = false
|
||||
@@ -55,5 +55,10 @@ module.exports = {
|
||||
'node/no-unpublished-require': 'off',
|
||||
},
|
||||
},
|
||||
{
|
||||
// Test files:
|
||||
files: ['tests/**/*-test.{js,ts}'],
|
||||
extends: ['plugin:qunit/recommended'],
|
||||
},
|
||||
],
|
||||
};
|
||||
@@ -81,7 +81,7 @@
|
||||
@label={{t 'form.disable_discovered_config_validation.label'}}
|
||||
@helperText={{t 'form.disable_discovered_config_validation.help'}}
|
||||
@checked={{@model.attributes.disable_discovered_config_validation}}
|
||||
onChange={{fn
|
||||
@onChange={{fn
|
||||
(mut @model.attributes.disable_discovered_config_validation)
|
||||
(if @model.attributes.disable_discovered_config_validation false true)
|
||||
}}
|
||||
|
||||
@@ -145,7 +145,7 @@
|
||||
@label={{t 'resources.credential-store.form.tls_skip_verify.label'}}
|
||||
@helperText={{t 'resources.credential-store.form.tls_skip_verify.help'}}
|
||||
@checked={{@model.attributes.tls_skip_verify}}
|
||||
onChange={{fn
|
||||
@onChange={{fn
|
||||
(mut @model.attributes.tls_skip_verify)
|
||||
(if @model.attributes.tls_skip_verify false true)
|
||||
}}
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
<row.headerCell>
|
||||
<form.checkbox
|
||||
@label={{user.displayName}}
|
||||
onChange={{fn this.toggleMember user}}
|
||||
@onChange={{fn this.toggleMember user}}
|
||||
/>
|
||||
{{#if user.accountName}}
|
||||
{{!
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
<form.checkbox
|
||||
@label={{host.id}}
|
||||
@description={{host.description}}
|
||||
onChange={{fn this.toggleHost host}}
|
||||
@onChange={{fn this.toggleHost host}}
|
||||
/>
|
||||
</row.cell>
|
||||
<row.cell>{{host.name}}</row.cell>
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
<row.headerCell>
|
||||
<form.checkbox
|
||||
@label={{principal.displayName}}
|
||||
onChange={{fn this.togglePrincipal principal}}
|
||||
@onChange={{fn this.togglePrincipal principal}}
|
||||
/>
|
||||
{{#if principal.accountName}}
|
||||
{{!
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
<form.checkbox
|
||||
@label={{credentialLibrary.id}}
|
||||
@description={{credentialLibrary.description}}
|
||||
onChange={{fn this.toggleCredentialLibrary credentialLibrary}}
|
||||
@onChange={{fn this.toggleCredentialLibrary credentialLibrary}}
|
||||
/>
|
||||
</row.headerCell>
|
||||
<row.cell>{{credentialLibrary.name}}</row.cell>
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
<form.checkbox
|
||||
@label={{hostSet.id}}
|
||||
@description={{hostSet.description}}
|
||||
onChange={{fn this.toggleHostSet hostSet}}
|
||||
@onChange={{fn this.toggleHostSet hostSet}}
|
||||
/>
|
||||
</row.cell>
|
||||
<row.cell>{{hostSet.name}}</row.cell>
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
<form.checkbox
|
||||
@label={{account.id}}
|
||||
@description={{account.description}}
|
||||
onChange={{fn this.toggleAccount account}}
|
||||
@onChange={{fn this.toggleAccount account}}
|
||||
/>
|
||||
</row.cell>
|
||||
<row.cell>{{account.accountName}}</row.cell>
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
"ember-a11y-testing": "^4.2.0",
|
||||
"ember-auto-import": "^1.12.0",
|
||||
"ember-breadcrumbs": "^0.2.3",
|
||||
"ember-cli": "~3.28.0",
|
||||
"ember-cli": "~3.28.3",
|
||||
"ember-cli-app-version": "^5.0.0",
|
||||
"ember-cli-babel": "^7.26.6",
|
||||
"ember-cli-code-coverage": "^1.0.3",
|
||||
@@ -63,7 +63,6 @@
|
||||
"ember-cli-sri": "^2.1.1",
|
||||
"ember-cli-template-lint": "^2.0.2",
|
||||
"ember-cli-terser": "^4.0.2",
|
||||
"ember-cli-update": "^0.54.6",
|
||||
"ember-concurrency": "^1.3.0",
|
||||
"ember-exam": "^6.1.0",
|
||||
"ember-export-application-global": "^2.0.1",
|
||||
@@ -75,7 +74,7 @@
|
||||
"ember-page-title": "^6.2.2",
|
||||
"ember-qunit": "^5.1.4",
|
||||
"ember-resolver": "^8.0.3",
|
||||
"ember-source": "~3.24.0",
|
||||
"ember-source": "~3.28.4",
|
||||
"ember-template-lint": "^3.7.0",
|
||||
"ember-template-lint-plugin-prettier": "^2.0.0",
|
||||
"eslint": "^7.32.0",
|
||||
@@ -83,6 +82,7 @@
|
||||
"eslint-plugin-ember": "^10.5.4",
|
||||
"eslint-plugin-node": "^11.1.0",
|
||||
"eslint-plugin-prettier": "^4.0.0",
|
||||
"eslint-plugin-qunit": "^6.2.0",
|
||||
"faker": "^5.5.3",
|
||||
"loader.js": "^4.7.0",
|
||||
"npm-run-all": "^4.1.5",
|
||||
@@ -95,7 +95,7 @@
|
||||
"sinon": "^11.1.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10 <=15"
|
||||
"node": ">=12 <=17"
|
||||
},
|
||||
"ember": {
|
||||
"edition": "octane"
|
||||
|
||||
@@ -150,12 +150,12 @@ module('Acceptance | accounts | create', function (hooks) {
|
||||
await fillIn('[name="name"]', 'new account');
|
||||
await click('form [type="submit"]');
|
||||
await a11yAudit();
|
||||
assert.ok(
|
||||
find('[role="alert"]').textContent.trim(),
|
||||
assert.equal(
|
||||
find('.rose-notification-body').textContent.trim(),
|
||||
'The request was invalid.',
|
||||
'Displays primary error message.'
|
||||
);
|
||||
assert.ok(
|
||||
assert.equal(
|
||||
find('.rose-form-error-message').textContent.trim(),
|
||||
'Name is required.',
|
||||
'Displays field-level errors.'
|
||||
|
||||
@@ -93,8 +93,8 @@ module('Acceptance | accounts | delete', function (hooks) {
|
||||
await visit(urls.account);
|
||||
await click('.rose-layout-page-actions .rose-dropdown-button-danger');
|
||||
await a11yAudit();
|
||||
assert.ok(
|
||||
find('[role="alert"]').textContent.trim(),
|
||||
assert.equal(
|
||||
find('.rose-notification-body').textContent.trim(),
|
||||
'Oops.',
|
||||
'Displays primary error message.'
|
||||
);
|
||||
|
||||
@@ -100,13 +100,13 @@ module('Acceptance | accounts | set password', function (hooks) {
|
||||
// NOTE: since set password is a tabbed route with easy navigation away
|
||||
// from the form, and the form does not directly operate on a model instance,
|
||||
// a "cancel" flow doesn't make much sense. Disabling for now.
|
||||
// test('can cancel setting new password', async function (assert) {
|
||||
// assert.expect(1);
|
||||
// await visit(urls.setPassword);
|
||||
// await fillIn('[name="password"]', 'update password');
|
||||
// await click('form button:not([type="submit"])');
|
||||
// assert.notOk(find('[name="password"]').textContent.trim());
|
||||
// });
|
||||
test.skip('can cancel setting new password', async function (assert) {
|
||||
assert.expect(1);
|
||||
await visit(urls.setPassword);
|
||||
await fillIn('[name="password"]', 'update password');
|
||||
await click('form button:not([type="submit"])');
|
||||
assert.notOk(find('[name="password"]').textContent.trim());
|
||||
});
|
||||
|
||||
test('errors are displayed when setting password fails', async function (assert) {
|
||||
assert.expect(1);
|
||||
|
||||
@@ -103,8 +103,8 @@ module('Acceptance | accounts | update', function (hooks) {
|
||||
await fillIn('[name="name"]', 'save account');
|
||||
await click('form [type="submit"]');
|
||||
await a11yAudit();
|
||||
assert.ok(
|
||||
find('[role="alert"]').textContent.trim(),
|
||||
assert.equal(
|
||||
find('.rose-notification-body').textContent.trim(),
|
||||
'Oops.',
|
||||
'Displays primary error message.'
|
||||
);
|
||||
@@ -136,12 +136,12 @@ module('Acceptance | accounts | update', function (hooks) {
|
||||
await fillIn('[name="name"]', 'existing account');
|
||||
await click('form [type="submit"]');
|
||||
await a11yAudit();
|
||||
assert.ok(
|
||||
find('[role="alert"]').textContent.trim(),
|
||||
assert.equal(
|
||||
find('.rose-notification-body').textContent.trim(),
|
||||
'The request was invalid.',
|
||||
'Displays primary error message.'
|
||||
);
|
||||
assert.ok(
|
||||
assert.equal(
|
||||
find('.rose-form-error-message').textContent.trim(),
|
||||
'Name is required.',
|
||||
'Displays field-level errors.'
|
||||
|
||||
@@ -72,8 +72,8 @@ module('Acceptance | auth methods | delete', function (hooks) {
|
||||
await visit(urls.authMethod);
|
||||
await click('.rose-layout-page-actions .rose-dropdown-button-danger');
|
||||
await a11yAudit();
|
||||
assert.ok(
|
||||
find('[role="alert"]').textContent.trim(),
|
||||
assert.equal(
|
||||
find('.rose-notification-body').textContent.trim(),
|
||||
'Oops.',
|
||||
'Displays primary error message.'
|
||||
);
|
||||
|
||||
@@ -102,38 +102,38 @@ module('Acceptance | auth methods | oidc', function (hooks) {
|
||||
});
|
||||
|
||||
// FIXME: How to mock just one request routed to /auth-methods and let everything else passthrough?
|
||||
// test('errors are displayed when state update fails', async function (assert) {
|
||||
// assert.expect(2);
|
||||
// this.server.post('/auth-methods/:idMethod', (_, request) => {
|
||||
// // Only respond to state update with error
|
||||
// if (request.params.idMethod.match(/(change-state)/i)) {
|
||||
// return new Response(
|
||||
// 400,
|
||||
// {},
|
||||
// {
|
||||
// status: 400,
|
||||
// code: 'error',
|
||||
// message: 'Sorry!',
|
||||
// }
|
||||
// );
|
||||
// }
|
||||
// return request;
|
||||
// });
|
||||
// const newState = 'inactive';
|
||||
// await visit(urls.authMethod);
|
||||
// await click('.rose-layout-page-actions .rose-dropdown-trigger');
|
||||
// await click(`.rose-dropdown[open] input[value="${newState}"]`);
|
||||
// // debugger;
|
||||
// const authMethod = this.server.db.authMethods.find(instances.authMethod.id);
|
||||
// assert.notEqual(
|
||||
// newState,
|
||||
// authMethod.attributes.state,
|
||||
// 'Auth method state is not be updated.'
|
||||
// );
|
||||
// assert.ok(
|
||||
// find('[role="alert"]').textContent.trim(),
|
||||
// 'Sorry!',
|
||||
// 'Displays error message.'
|
||||
// );
|
||||
// });
|
||||
test.skip('errors are displayed when state update fails', async function (assert) {
|
||||
assert.expect(2);
|
||||
this.server.post('/auth-methods/:idMethod', (_, request) => {
|
||||
// Only respond to state update with error
|
||||
if (request.params.idMethod.match(/(change-state)/i)) {
|
||||
return new Response(
|
||||
400,
|
||||
{},
|
||||
{
|
||||
status: 400,
|
||||
code: 'error',
|
||||
message: 'Sorry!',
|
||||
}
|
||||
);
|
||||
}
|
||||
return request;
|
||||
});
|
||||
const newState = 'inactive';
|
||||
await visit(urls.authMethod);
|
||||
await click('.rose-layout-page-actions .rose-dropdown-trigger');
|
||||
await click(`.rose-dropdown[open] input[value="${newState}"]`);
|
||||
// debugger;
|
||||
const authMethod = this.server.db.authMethods.find(instances.authMethod.id);
|
||||
assert.notEqual(
|
||||
newState,
|
||||
authMethod.attributes.state,
|
||||
'Auth method state is not be updated.'
|
||||
);
|
||||
assert.ok(
|
||||
find('.rose-notification-body').textContent.trim(),
|
||||
'Sorry!',
|
||||
'Displays error message.'
|
||||
);
|
||||
});
|
||||
});
|
||||
@@ -102,50 +102,12 @@ module('Acceptance | auth methods | update', function (hooks) {
|
||||
await fillIn('[name="name"]', 'existing auth method');
|
||||
await click('form [type="submit"]');
|
||||
await a11yAudit();
|
||||
assert.ok(
|
||||
find('[role="alert"]').textContent.trim(),
|
||||
assert.equal(
|
||||
find('.rose-notification-body').textContent.trim(),
|
||||
'The request was invalid.',
|
||||
'Displays primary error message.'
|
||||
);
|
||||
assert.ok(
|
||||
find('.rose-form-error-message').textContent.trim(),
|
||||
'Name is required.',
|
||||
'Displays field-level errors.'
|
||||
);
|
||||
});
|
||||
|
||||
test('saving an existing auth method with invalid fields displays error messages', async function (assert) {
|
||||
assert.expect(2);
|
||||
this.server.patch('/auth-methods/:id', () => {
|
||||
return new Response(
|
||||
400,
|
||||
{},
|
||||
{
|
||||
status: 400,
|
||||
code: 'invalid_argument',
|
||||
message: 'The request was invalid.',
|
||||
details: {
|
||||
request_fields: [
|
||||
{
|
||||
name: 'name',
|
||||
description: 'Name is required.',
|
||||
},
|
||||
],
|
||||
},
|
||||
}
|
||||
);
|
||||
});
|
||||
await visit(urls.authMethod);
|
||||
await click('form [type="button"]', 'Activate edit mode');
|
||||
await fillIn('[name="name"]', 'existing auth method');
|
||||
await click('form [type="submit"]');
|
||||
await a11yAudit();
|
||||
assert.ok(
|
||||
find('[role="alert"]').textContent.trim(),
|
||||
'The request was invalid.',
|
||||
'Displays primary error message.'
|
||||
);
|
||||
assert.ok(
|
||||
assert.equal(
|
||||
find('.rose-form-error-message').textContent.trim(),
|
||||
'Name is required.',
|
||||
'Displays field-level errors.'
|
||||
|
||||
@@ -5,7 +5,7 @@ import {
|
||||
fillIn,
|
||||
click,
|
||||
find,
|
||||
//findAll,
|
||||
findAll,
|
||||
getRootElement,
|
||||
//setupOnerror,
|
||||
} from '@ember/test-helpers';
|
||||
@@ -300,23 +300,23 @@ module('Acceptance | authentication', function (hooks) {
|
||||
// This test is disabled because it is no longer relevant. On deauth,
|
||||
// the page is reloaded. If the user was viewing a route requiring
|
||||
// authentication, they will be redirected accordingly.
|
||||
// test('deauthentication redirects to first global authenticate method', async function (assert) {
|
||||
// assert.expect(3);
|
||||
// await visit(authMethodAuthenticateURL);
|
||||
// await fillIn('[name="identification"]', 'test');
|
||||
// await fillIn('[name="password"]', 'test');
|
||||
// await click('[type="submit"]');
|
||||
// assert.ok(currentSession().isAuthenticated);
|
||||
// // Open header utilities dropdown
|
||||
// await click('.rose-header-utilities .rose-dropdown summary');
|
||||
// // Find and click on last element in dropdown - should be deauthenticate button
|
||||
// const menu = findAll(
|
||||
// '.rose-header-utilities .rose-dropdown .rose-dropdown-content button'
|
||||
// );
|
||||
// await click(menu[menu.length - 1]);
|
||||
// assert.notOk(currentSession().isAuthenticated);
|
||||
// assert.equal(currentURL(), authMethodGlobalAuthenticateURL);
|
||||
// });
|
||||
test.skip('deauthentication redirects to first global authenticate method', async function (assert) {
|
||||
assert.expect(3);
|
||||
await visit(authMethodAuthenticateURL);
|
||||
await fillIn('[name="identification"]', 'test');
|
||||
await fillIn('[name="password"]', 'test');
|
||||
await click('[type="submit"]');
|
||||
assert.ok(currentSession().isAuthenticated);
|
||||
// Open header utilities dropdown
|
||||
await click('.rose-header-utilities .rose-dropdown summary');
|
||||
// Find and click on last element in dropdown - should be deauthenticate button
|
||||
const menu = findAll(
|
||||
'.rose-header-utilities .rose-dropdown .rose-dropdown-content button'
|
||||
);
|
||||
await click(menu[menu.length - 1]);
|
||||
assert.notOk(currentSession().isAuthenticated);
|
||||
assert.equal(currentURL(), authMethodGlobalAuthenticateURL);
|
||||
});
|
||||
|
||||
test('401 responses result in deauthentication', async function (assert) {
|
||||
assert.expect(2);
|
||||
|
||||
@@ -109,12 +109,12 @@ module('Acceptance | groups | create', function (hooks) {
|
||||
await visit(urls.newGroup);
|
||||
await fillIn('[name="name"]', 'group name');
|
||||
await click('[type="submit"]');
|
||||
assert.ok(
|
||||
find('[role="alert"]').textContent.trim(),
|
||||
assert.equal(
|
||||
find('.rose-notification-body').textContent.trim(),
|
||||
'The request was invalid.',
|
||||
'Displays primary error message.'
|
||||
);
|
||||
assert.ok(
|
||||
assert.equal(
|
||||
find('.rose-form-error-message').textContent.trim(),
|
||||
'Name is required.',
|
||||
'Displays field-level errors.'
|
||||
|
||||
@@ -76,8 +76,8 @@ module('Acceptance | groups | delete', function (hooks) {
|
||||
});
|
||||
await visit(urls.group);
|
||||
await click('.rose-layout-page-actions .rose-dropdown-button-danger');
|
||||
assert.ok(
|
||||
find('[role="alert"]').textContent.trim(),
|
||||
assert.equal(
|
||||
find('.rose-notification-body').textContent.trim(),
|
||||
'Oops.',
|
||||
'Displays primary error message.'
|
||||
);
|
||||
|
||||
@@ -95,12 +95,12 @@ module('Acceptance | groups | update', function (hooks) {
|
||||
await click('form [type="button"]', 'Activate edit mode');
|
||||
await fillIn('[name="name"]', 'random string');
|
||||
await click('[type="submit"]');
|
||||
assert.ok(
|
||||
find('[role="alert"]').textContent.trim(),
|
||||
assert.equal(
|
||||
find('.rose-notification-body').textContent.trim(),
|
||||
'The request was invalid.',
|
||||
'Displays primary error message.'
|
||||
);
|
||||
assert.ok(
|
||||
assert.equal(
|
||||
find('.rose-form-error-message').textContent.trim(),
|
||||
'Name is required.',
|
||||
'Displays field-level errors.'
|
||||
|
||||
@@ -88,8 +88,8 @@ module('Acceptance | roles | delete', function (hooks) {
|
||||
});
|
||||
await visit(urls.role);
|
||||
await click('.rose-layout-page-actions .rose-dropdown-button-danger');
|
||||
assert.ok(
|
||||
find('[role="alert"]').textContent.trim(),
|
||||
assert.equal(
|
||||
find('.rose-notification-body').textContent.trim(),
|
||||
'Oops.',
|
||||
'Displays primary error message.'
|
||||
);
|
||||
|
||||
@@ -107,12 +107,12 @@ module('Acceptance | roles | update', function (hooks) {
|
||||
await click('form [type="button"]', 'Activate edit mode');
|
||||
await fillIn('[name="name"]', 'random string');
|
||||
await click('[type="submit"]');
|
||||
assert.ok(
|
||||
find('[role="alert"]').textContent.trim(),
|
||||
assert.equal(
|
||||
find('.rose-notification-body').textContent.trim(),
|
||||
'The request was invalid.',
|
||||
'Displays primary error message.'
|
||||
);
|
||||
assert.ok(
|
||||
assert.equal(
|
||||
find('.rose-form-error-message').textContent.trim(),
|
||||
'Name is required.',
|
||||
'Displays field-level errors.'
|
||||
|
||||
@@ -97,12 +97,12 @@ module('Acceptance | users | create', function (hooks) {
|
||||
await visit(newUserURL);
|
||||
await fillIn('[name="name"]', 'User name');
|
||||
await click('[type="submit"]');
|
||||
assert.ok(
|
||||
find('[role="alert"]').textContent.trim(),
|
||||
assert.equal(
|
||||
find('.rose-notification-body').textContent.trim(),
|
||||
'The request was invalid.',
|
||||
'Displays primary error message.'
|
||||
);
|
||||
assert.ok(
|
||||
assert.equal(
|
||||
find('.rose-form-error-message').textContent.trim(),
|
||||
'Name is required.',
|
||||
'Displays field-level errors.'
|
||||
|
||||
@@ -77,8 +77,8 @@ module('Acceptance | users | delete', function (hooks) {
|
||||
});
|
||||
await visit(userURL);
|
||||
await click('.rose-layout-page-actions .rose-dropdown-button-danger');
|
||||
assert.ok(
|
||||
find('[role="alert"]').textContent.trim(),
|
||||
assert.equal(
|
||||
find('.rose-notification-body').textContent.trim(),
|
||||
'Oops.',
|
||||
'Displays primary error message.'
|
||||
);
|
||||
|
||||
@@ -96,12 +96,12 @@ module('Acceptance | users | update', function (hooks) {
|
||||
await click('form [type="button"]', 'Activate edit mode');
|
||||
await fillIn('[name="name"]', 'User name');
|
||||
await click('[type="submit"]');
|
||||
assert.ok(
|
||||
find('[role="alert"]').textContent.trim(),
|
||||
assert.equal(
|
||||
find('.rose-notification-body').textContent.trim(),
|
||||
'The request was invalid.',
|
||||
'Displays primary error message.'
|
||||
);
|
||||
assert.ok(
|
||||
assert.equal(
|
||||
find('.rose-form-error-message').textContent.trim(),
|
||||
'Name is required.',
|
||||
'Displays field-level errors.'
|
||||
|
||||
Reference in new issue
Block a user