mirror of
https://github.com/hashicorp/vault.git
synced 2026-05-28 04:10:44 -04:00
pr comments
This commit is contained in:
parent
1ee2b2b049
commit
f62f6dbb95
6 changed files with 24 additions and 15 deletions
|
|
@ -1,7 +1,7 @@
|
|||
```release-note:feature
|
||||
**Custom login settings**: Adding new components to be able to view and delete custom login rules
|
||||
**Custom login settings**: Adding view to list and delete custom login rules
|
||||
```
|
||||
|
||||
```release-note:change
|
||||
ui/navbar: 'Custom messages' renamed to 'System Messages'
|
||||
ui: 'Custom messages' renamed to 'System Messages'
|
||||
```
|
||||
|
|
@ -122,15 +122,16 @@
|
|||
<Nav.Title data-test-sidebar-nav-heading="Settings">Settings</Nav.Title>
|
||||
<Nav.Link
|
||||
@route="vault.cluster.config-ui.messages"
|
||||
{{! formally called 'Custom Messages' }}
|
||||
{{! formerly called 'Custom Messages' }}
|
||||
@text="System Messages"
|
||||
data-test-sidebar-nav-link="System Messages"
|
||||
/>
|
||||
{{! TODO: wrap this with permission check }}
|
||||
<Nav.Link
|
||||
@route="vault.cluster.config-ui.login-settings"
|
||||
@text="UI Login Rules"
|
||||
data-test-sidebar-nav-link="UI Login Rules"
|
||||
/>
|
||||
{{#if this.isRootNamespace}}
|
||||
<Nav.Link
|
||||
@route="vault.cluster.config-ui.login-settings"
|
||||
@text="UI Login Rules"
|
||||
data-test-sidebar-nav-link="UI Login Rules"
|
||||
/>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
</Hds::SideNav::Portal>
|
||||
|
|
@ -2,6 +2,7 @@
|
|||
Copyright (c) HashiCorp, Inc.
|
||||
SPDX-License-Identifier: BUSL-1.1
|
||||
}}
|
||||
|
||||
{{#if @rule}}
|
||||
<PageHeader as |p|>
|
||||
<p.top>
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@
|
|||
@message="Login rules can be used to select default and back up login methods and customize which methods display in the web UI login form. Available to be created via the CLI or HTTP API."
|
||||
>
|
||||
{{! TODO: update href with tutorial link }}
|
||||
<Hds::Link::Standalone @icon="arrow-right" @iconPosition="trailing" @text="Learn more" @href="/" />
|
||||
{{! <Hds::Link::Standalone @icon="arrow-right" @iconPosition="trailing" @text="Learn more" @href="/" /> }}
|
||||
</EmptyState>
|
||||
{{/if}}
|
||||
|
||||
|
|
|
|||
|
|
@ -28,6 +28,9 @@ export default class LoginSettingsRuleDetailsRoute extends Route {
|
|||
setupController(controller, resolvedModel) {
|
||||
super.setupController(controller, resolvedModel);
|
||||
|
||||
controller.breadcrumbs = [{ label: 'UI login rules', route: 'login-settings' }, { label: '' }];
|
||||
controller.breadcrumbs = [
|
||||
{ label: 'UI login rules', route: 'login-settings' },
|
||||
{ label: resolvedModel.rule.name },
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,8 +20,8 @@ module('Acceptance | Enterprise | config-ui/login-settings', function (hooks) {
|
|||
|
||||
// create login rules
|
||||
await runCmd([
|
||||
'write sys/config/ui/login/default-auth/testRule backup_auth_types=[] default_auth_type=okta disable_inheritance=false namespace=ns1',
|
||||
'write sys/config/ui/login/default-auth/testRule2 backup_auth_types=[] default_auth_type=ldap disable_inheritance=true namespace=ns2',
|
||||
`write sys/config/ui/login/default-auth/testRule backup_auth_types=userpass default_auth_type=okta disable_inheritance=false namespace=ns1`,
|
||||
'write sys/config/ui/login/default-auth/testRule2 backup_auth_types=oidc default_auth_type=ldap disable_inheritance=true namespace=ns2',
|
||||
]);
|
||||
});
|
||||
|
||||
|
|
@ -39,6 +39,9 @@ module('Acceptance | Enterprise | config-ui/login-settings', function (hooks) {
|
|||
|
||||
// verify fetched rules are rendered in list
|
||||
assert.dom('.linked-block-item').exists({ count: 2 });
|
||||
// verify rule data namespaces render
|
||||
assert.dom('[data-test-rule-path="ns1/"]').exists();
|
||||
assert.dom('[data-test-rule-path="ns2/"]').exists();
|
||||
});
|
||||
|
||||
test('delete rule from list view', async function (assert) {
|
||||
|
|
@ -53,6 +56,7 @@ module('Acceptance | Enterprise | config-ui/login-settings', function (hooks) {
|
|||
|
||||
// verify success message from deletion
|
||||
assert.dom(GENERAL.latestFlashContent).includesText('Successfully deleted rule testRule.');
|
||||
assert.dom('[data-test-rule-name="testRule"]').doesNotExist();
|
||||
});
|
||||
|
||||
test('navigate to rule details page and renders rule data', async function (assert) {
|
||||
|
|
@ -70,9 +74,9 @@ module('Acceptance | Enterprise | config-ui/login-settings', function (hooks) {
|
|||
);
|
||||
|
||||
// verify fetched rule data is rendered
|
||||
assert.dom(GENERAL.infoRowLabel('Name')).exists();
|
||||
assert.dom(GENERAL.infoRowValue('Name')).hasText('testRule');
|
||||
assert.dom(GENERAL.infoRowLabel('Namespace')).exists();
|
||||
assert.dom(GENERAL.infoRowValue('Namespace')).hasText('ns1/');
|
||||
assert.dom(GENERAL.infoRowValue('Backup methods')).hasText('userpass');
|
||||
assert.dom(GENERAL.infoRowValue('Inheritance')).hasText('true');
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue