diff --git a/changelog/30592.txt b/changelog/30592.txt index 846695456e..daec2b89e4 100644 --- a/changelog/30592.txt +++ b/changelog/30592.txt @@ -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' ``` \ No newline at end of file diff --git a/ui/app/components/sidebar/nav/cluster.hbs b/ui/app/components/sidebar/nav/cluster.hbs index 07d602a084..590ef55121 100644 --- a/ui/app/components/sidebar/nav/cluster.hbs +++ b/ui/app/components/sidebar/nav/cluster.hbs @@ -122,15 +122,16 @@ Settings - {{! TODO: wrap this with permission check }} - + {{#if this.isRootNamespace}} + + {{/if}} {{/if}} \ No newline at end of file diff --git a/ui/lib/config-ui/addon/components/login-settings/page/details.hbs b/ui/lib/config-ui/addon/components/login-settings/page/details.hbs index d096f7def0..4d146f3e53 100644 --- a/ui/lib/config-ui/addon/components/login-settings/page/details.hbs +++ b/ui/lib/config-ui/addon/components/login-settings/page/details.hbs @@ -2,6 +2,7 @@ Copyright (c) HashiCorp, Inc. SPDX-License-Identifier: BUSL-1.1 }} + {{#if @rule}} diff --git a/ui/lib/config-ui/addon/components/login-settings/page/list.hbs b/ui/lib/config-ui/addon/components/login-settings/page/list.hbs index 69dc8cdd8b..c8fb3a2dd4 100644 --- a/ui/lib/config-ui/addon/components/login-settings/page/list.hbs +++ b/ui/lib/config-ui/addon/components/login-settings/page/list.hbs @@ -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 }} - + {{! }} {{/if}} diff --git a/ui/lib/config-ui/addon/routes/login-settings/rule/details.js b/ui/lib/config-ui/addon/routes/login-settings/rule/details.js index 710509bbb6..338f0f8afc 100644 --- a/ui/lib/config-ui/addon/routes/login-settings/rule/details.js +++ b/ui/lib/config-ui/addon/routes/login-settings/rule/details.js @@ -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 }, + ]; } } diff --git a/ui/tests/acceptance/config-ui/login-settings-test.js b/ui/tests/acceptance/config-ui/login-settings-test.js index 09fb8047d1..f5c9fa8d28 100644 --- a/ui/tests/acceptance/config-ui/login-settings-test.js +++ b/ui/tests/acceptance/config-ui/login-settings-test.js @@ -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'); }); });