feat: 🎸 Update scope dropdown in login to show current scope (#3308)
* feat: 🎸 Update scope dropdown in login to show current scope * test: 💍 Update e2e tests
This commit is contained in:
1 parent
b9517e0233
commit
576fef9f8a
7 files changed
+32
-25
No files matched your search
@@ -30,7 +30,6 @@ copy-error-detail-to-clipboard: Copy error detail to clipboard
|
|||||||
authenticate: Sign In
|
authenticate: Sign In
|
||||||
deauthenticate: Sign Out
|
deauthenticate: Sign Out
|
||||||
choose-org: Choose Scope
|
choose-org: Choose Scope
|
||||||
choose-different-org: Choose a different scope
|
|
||||||
add-host-set: Create Host Set
|
add-host-set: Create Host Set
|
||||||
add-host: Create Host
|
add-host: Create Host
|
||||||
add-principals: Add Principals
|
add-principals: Add Principals
|
||||||
|
|||||||
@@ -174,8 +174,8 @@ test(
|
|||||||
// Log in using ldap account
|
// Log in using ldap account
|
||||||
await loginPage.logout(adminLoginName);
|
await loginPage.logout(adminLoginName);
|
||||||
|
|
||||||
await page.getByText('Choose a different scope').click();
|
await page.getByRole('button', { name: /global/i }).click();
|
||||||
await page.getByRole('link', { name: orgName }).click();
|
await page.getByRole('option', { name: orgName }).click();
|
||||||
await page.getByRole('link', { name: ldapAuthMethodName }).click();
|
await page.getByRole('link', { name: ldapAuthMethodName }).click();
|
||||||
await loginPage.login(ldapUserName, ldapUserPassword);
|
await loginPage.login(ldapUserName, ldapUserPassword);
|
||||||
await expect(
|
await expect(
|
||||||
|
|||||||
@@ -129,8 +129,8 @@ test(
|
|||||||
|
|
||||||
// Log in using oidc account
|
// Log in using oidc account
|
||||||
await loginPage.logout(adminLoginName);
|
await loginPage.logout(adminLoginName);
|
||||||
await page.getByText('Choose a different scope').click();
|
await page.getByRole('button', { name: /global/i }).click();
|
||||||
await page.getByRole('link', { name: orgName }).click();
|
await page.getByRole('option', { name: orgName }).click();
|
||||||
await page.getByRole('link', { name: oidcAuthMethodName }).click();
|
await page.getByRole('link', { name: oidcAuthMethodName }).click();
|
||||||
const pagePromise = context.waitForEvent('page');
|
const pagePromise = context.waitForEvent('page');
|
||||||
await page.getByRole('button', { name: 'Sign In' }).click();
|
await page.getByRole('button', { name: 'Sign In' }).click();
|
||||||
|
|||||||
@@ -58,8 +58,8 @@ test(
|
|||||||
|
|
||||||
// Log in using new account
|
// Log in using new account
|
||||||
await loginPage.logout(adminLoginName);
|
await loginPage.logout(adminLoginName);
|
||||||
await page.getByText('Choose a different scope').click();
|
await page.getByRole('button', { name: /global/i }).click();
|
||||||
await page.getByRole('link', { name: orgName }).click();
|
await page.getByRole('option', { name: orgName }).click();
|
||||||
await page.getByRole('link', { name: authMethodName }).click();
|
await page.getByRole('link', { name: authMethodName }).click();
|
||||||
|
|
||||||
await loginPage.login(username, password);
|
await loginPage.login(username, password);
|
||||||
@@ -97,8 +97,8 @@ test(
|
|||||||
// Log in using new password
|
// Log in using new password
|
||||||
await loginPage.logout(adminLoginName);
|
await loginPage.logout(adminLoginName);
|
||||||
|
|
||||||
await page.getByText('Choose a different scope').click();
|
await page.getByRole('button', { name: /global/i }).click();
|
||||||
await page.getByRole('link', { name: orgName }).click();
|
await page.getByRole('option', { name: orgName }).click();
|
||||||
await page.getByRole('link', { name: authMethodName }).click();
|
await page.getByRole('link', { name: authMethodName }).click();
|
||||||
await loginPage.login(username, newPassword);
|
await loginPage.login(username, newPassword);
|
||||||
await expect(
|
await expect(
|
||||||
|
|||||||
@@ -52,8 +52,8 @@ test(
|
|||||||
|
|
||||||
// Log in using new account
|
// Log in using new account
|
||||||
await page.reload();
|
await page.reload();
|
||||||
await page.getByText('Choose a different scope').click();
|
await page.getByRole('button', { name: /global/i }).click();
|
||||||
await page.getByRole('link', { name: org.name }).click();
|
await page.getByRole('option', { name: org.name }).click();
|
||||||
await page.getByRole('link', { name: authMethod.name }).click();
|
await page.getByRole('link', { name: authMethod.name }).click();
|
||||||
const loginPage = new LoginPage(page);
|
const loginPage = new LoginPage(page);
|
||||||
await loginPage.login(username, password);
|
await loginPage.login(username, password);
|
||||||
@@ -79,8 +79,8 @@ test(
|
|||||||
|
|
||||||
// Confirm user cannot log in with old password
|
// Confirm user cannot log in with old password
|
||||||
await loginPage.logout(username);
|
await loginPage.logout(username);
|
||||||
await page.getByText('Choose a different scope').click();
|
await page.getByRole('button', { name: /global/i }).click();
|
||||||
await page.getByRole('link', { name: org.name }).click();
|
await page.getByRole('option', { name: org.name }).click();
|
||||||
await page.getByRole('link', { name: authMethod.name }).click();
|
await page.getByRole('link', { name: authMethod.name }).click();
|
||||||
await page.getByLabel('Login Name').fill(username);
|
await page.getByLabel('Login Name').fill(username);
|
||||||
await page.getByLabel('Password', { exact: true }).fill(password);
|
await page.getByLabel('Password', { exact: true }).fill(password);
|
||||||
|
|||||||
@@ -28,23 +28,25 @@
|
|||||||
|
|
||||||
<Hds::Dropdown @listPosition='bottom-left' as |dd|>
|
<Hds::Dropdown @listPosition='bottom-left' as |dd|>
|
||||||
<dd.ToggleButton
|
<dd.ToggleButton
|
||||||
@text={{t 'actions.choose-different-org'}}
|
@text={{@model.scope.displayName}}
|
||||||
@icon='org'
|
@icon={{if (eq @model.scope.id 'global') 'globe' 'org'}}
|
||||||
@color='secondary'
|
@color='secondary'
|
||||||
/>
|
/>
|
||||||
<dd.Interactive
|
<dd.Checkmark
|
||||||
@route='scopes.scope.authenticate'
|
@route='scopes.scope.authenticate'
|
||||||
@model='global'
|
@model='global'
|
||||||
|
@selected={{eq @model.scope.id 'global'}}
|
||||||
>
|
>
|
||||||
{{t 'titles.global'}}
|
{{t 'titles.global'}}
|
||||||
</dd.Interactive>
|
</dd.Checkmark>
|
||||||
{{#each this.sortedScopes as |scope|}}
|
{{#each this.sortedScopes as |scope|}}
|
||||||
<dd.Interactive
|
<dd.Checkmark
|
||||||
@route='scopes.scope.authenticate'
|
@route='scopes.scope.authenticate'
|
||||||
@model={{scope.id}}
|
@model={{scope.id}}
|
||||||
|
@selected={{eq @model.scope.id scope.id}}
|
||||||
>
|
>
|
||||||
{{scope.displayName}}
|
{{scope.displayName}}
|
||||||
</dd.Interactive>
|
</dd.Checkmark>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
</Hds::Dropdown>
|
</Hds::Dropdown>
|
||||||
<Hds::Separator />
|
<Hds::Separator />
|
||||||
|
|||||||
@@ -18,17 +18,23 @@
|
|||||||
|
|
||||||
<Hds::Dropdown @listPosition='bottom-left' as |dd|>
|
<Hds::Dropdown @listPosition='bottom-left' as |dd|>
|
||||||
<dd.ToggleButton
|
<dd.ToggleButton
|
||||||
@text={{t 'actions.choose-different-org'}}
|
@text={{@model.scope.displayName}}
|
||||||
@icon='org'
|
@icon={{if (eq @model.scope.id 'global') 'globe' 'org'}}
|
||||||
@color='secondary'
|
@color='secondary'
|
||||||
/>
|
/>
|
||||||
<dd.Interactive {{on 'click' (fn this.selectScope 'global' dd.close)}}>
|
<dd.Checkmark
|
||||||
|
@selected={{eq @model.scope.id 'global'}}
|
||||||
|
{{on 'click' (fn this.selectScope 'global' dd.close)}}
|
||||||
|
>
|
||||||
{{t 'titles.global'}}
|
{{t 'titles.global'}}
|
||||||
</dd.Interactive>
|
</dd.Checkmark>
|
||||||
{{#each this.sortedScopes as |scope|}}
|
{{#each this.sortedScopes as |scope|}}
|
||||||
<dd.Interactive {{on 'click' (fn this.selectScope scope.id dd.close)}}>
|
<dd.Checkmark
|
||||||
|
@selected={{eq @model.scope.id scope.id}}
|
||||||
|
{{on 'click' (fn this.selectScope scope.id dd.close)}}
|
||||||
|
>
|
||||||
{{scope.displayName}}
|
{{scope.displayName}}
|
||||||
</dd.Interactive>
|
</dd.Checkmark>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
</Hds::Dropdown>
|
</Hds::Dropdown>
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user