Refactor hds side nav to hds app side nav and header (#3032)
* refactor: 💡 use hds app header and app side nav * style: 💄 fix dark-mode colors for side nav and app header * style: 💄 cleanup * style: 💄 simplify selector * refactor: 💡 move util (param finder) to core addon * refactor: 💡 move scope picker to core addon * refactor: 💡 use hds header and app side nav in ui/desktop * refactor: 💡 clean up ui/desktop files * refactor: 💡 remove uneeded header components * refactor: 💡 remove uneeded global layout * Add missing copyright headers * style: 💄 adjust foreground and background colors to fix contras * style: 💄 remove uneeded stylelint disables * style: 💄 fix dark mode styling in desktop ui * refactor: 💡 readd user-select style * test: 💍 fix tests + e2e tests for admin and desktop UIs * refactor: 💡 clean up uneeded main elements and fix color link * Add missing copyright headers * fix: 🐛 e2e test selectors for ui/desktop * style: 💄 revert link color change * refactor: 💡 remove hds override * fix: 🐛 scope dropdown for desktop * fix: 🐛 max-height to desktop scope dropdown * Add missing copyright headers * chore: 🤖 update lockfile due to webpack update
This commit is contained in:
1 parent
aaabfbe54d
commit
b1b49edb39
94 files changed
+784
-1178
No files matched your search
File renamed without changes.
+1
-1
@@ -3,4 +3,4 @@
|
||||
* SPDX-License-Identifier: BUSL-1.1
|
||||
*/
|
||||
|
||||
export { default } from 'rose/components/rose/header';
|
||||
export { default } from 'core/utils/param-value-finder';
|
||||
@@ -0,0 +1,55 @@
|
||||
/**
|
||||
* Copyright IBM Corp. 2021, 2026
|
||||
* SPDX-License-Identifier: BUSL-1.1
|
||||
*/
|
||||
|
||||
import { module, test } from 'qunit';
|
||||
import { setupTest } from 'ember-qunit';
|
||||
import { paramValueFinder } from 'core/utils/param-value-finder';
|
||||
|
||||
module('Unit | Utility | param-value-finder', function (hooks) {
|
||||
setupTest(hooks);
|
||||
|
||||
test('returns empty array when null or empty routeInfo object is used', function (assert) {
|
||||
let result = paramValueFinder('scopes', null);
|
||||
|
||||
assert.deepEqual(result, []);
|
||||
|
||||
result = paramValueFinder('scopes', {});
|
||||
|
||||
assert.deepEqual(result, []);
|
||||
});
|
||||
|
||||
test('returns correct array when routeInfo object is used', function (assert) {
|
||||
// Route being tested is '/scopes'
|
||||
const application = { localName: 'application', params: {}, parent: null };
|
||||
const scopes = { localName: 'scopes', params: {}, parent: application };
|
||||
const scopesIndex = {
|
||||
localName: 'index',
|
||||
name: 'scopes.index',
|
||||
parent: scopes,
|
||||
};
|
||||
let result = paramValueFinder('scopes', scopesIndex.parent);
|
||||
|
||||
assert.deepEqual(result, []);
|
||||
|
||||
// Route being tested is '/scopes/global/auth-methods'
|
||||
const scope = {
|
||||
localName: 'scope',
|
||||
params: { scope_id: 'global' },
|
||||
parent: scopes,
|
||||
};
|
||||
const authMethods = {
|
||||
localName: 'auth-methods',
|
||||
params: {},
|
||||
parent: scope,
|
||||
};
|
||||
const authMethodsIndex = {
|
||||
localName: 'index',
|
||||
name: 'scopes.scope.auth-methods.index',
|
||||
parent: authMethods,
|
||||
};
|
||||
result = paramValueFinder('scopes', authMethodsIndex.parent);
|
||||
assert.deepEqual(result, ['global']);
|
||||
});
|
||||
});
|
||||
@@ -1,24 +0,0 @@
|
||||
{{!
|
||||
Copyright IBM Corp. 2021, 2026
|
||||
SPDX-License-Identifier: BUSL-1.1
|
||||
}}
|
||||
|
||||
<LinkTo
|
||||
...attributes
|
||||
class='rose-header-brand'
|
||||
title={{@text}}
|
||||
@route={{if @route @route 'index'}}
|
||||
>
|
||||
|
||||
{{#if @logo}}
|
||||
{{inline-svg @logo}}
|
||||
{{/if}}
|
||||
|
||||
{{#if @text}}
|
||||
<Hds::Text::Display
|
||||
@tag='h1'
|
||||
class='rose-header-brand-text'
|
||||
>{{@text}}</Hds::Text::Display>
|
||||
{{/if}}
|
||||
|
||||
</LinkTo>
|
||||
@@ -1,14 +0,0 @@
|
||||
{{!
|
||||
Copyright IBM Corp. 2021, 2026
|
||||
SPDX-License-Identifier: BUSL-1.1
|
||||
}}
|
||||
|
||||
<div ...attributes class='rose-header'>
|
||||
{{yield
|
||||
(hash
|
||||
brand=(component 'rose/header/brand')
|
||||
utilities=(component 'rose/header/utilities')
|
||||
nav=(component 'rose/header/nav')
|
||||
)
|
||||
}}
|
||||
</div>
|
||||
@@ -1,8 +0,0 @@
|
||||
{{!
|
||||
Copyright IBM Corp. 2021, 2026
|
||||
SPDX-License-Identifier: BUSL-1.1
|
||||
}}
|
||||
|
||||
<nav class='rose-header-nav' aria-label='header-nav'>
|
||||
{{yield}}
|
||||
</nav>
|
||||
@@ -1,8 +0,0 @@
|
||||
{{!
|
||||
Copyright IBM Corp. 2021, 2026
|
||||
SPDX-License-Identifier: BUSL-1.1
|
||||
}}
|
||||
|
||||
<div class='rose-header-utilities'>
|
||||
{{yield}}
|
||||
</div>
|
||||
@@ -1,16 +0,0 @@
|
||||
{{!
|
||||
Copyright IBM Corp. 2021, 2026
|
||||
SPDX-License-Identifier: BUSL-1.1
|
||||
}}
|
||||
|
||||
<section ...attributes class='rose-layout-global'>
|
||||
{{yield
|
||||
(hash
|
||||
header=(component
|
||||
'rose/anonymous' tagName='header' class='rose-layout-global-header'
|
||||
)
|
||||
body=(component 'rose/anonymous' class='rose-layout-global-body')
|
||||
footer=(component 'rose/anonymous' class='rose-layout-global-footer')
|
||||
)
|
||||
}}
|
||||
</section>
|
||||
@@ -47,41 +47,8 @@ form {
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: This is a temporary hack to fix an issue causing weird whitespace
|
||||
// and scrollbars from an accessible class in HDS. We have to use !important
|
||||
// as they already forced it with !important and we can't override it otherwise
|
||||
.sr-only {
|
||||
position: unset !important;
|
||||
}
|
||||
|
||||
.hds-dropdown {
|
||||
.hds-dropdown-toggle-icon {
|
||||
color: inherit;
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: This is a temporary fix that ensures changing the color theme won't alter the dropdown colors.
|
||||
.app-frame-sidebar-style-overrides .side-nav-style-overrides {
|
||||
.hds-button:not(
|
||||
.hds-dropdown__content *,
|
||||
.ember-basic-dropdown-content *,
|
||||
.hds-dialog-primitive__wrapper *
|
||||
),
|
||||
button[class*='hds-dropdown-toggle']:not(
|
||||
.hds-dropdown__content *,
|
||||
.ember-basic-dropdown-content *,
|
||||
.hds-dialog-primitive__wrapper *
|
||||
) {
|
||||
background: var(--token-side-nav-color-surface-primary);
|
||||
border-color: var(--token-app-side-nav-color-foreground-faint);
|
||||
|
||||
&:hover {
|
||||
background: var(--token-side-nav-color-surface-interactive-hover);
|
||||
}
|
||||
|
||||
&:active,
|
||||
&:focus {
|
||||
background: var(--token-side-nav-color-surface-primary);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -259,4 +259,27 @@
|
||||
--token-form-toggle-base-surface-color-default: var(
|
||||
--token-color-palette-neutral-100
|
||||
); /* the toggle has a different base surface color, compared to the other controls */
|
||||
|
||||
// Hds app side nav color-mappings
|
||||
--token-app-side-nav-color-foreground-primary: var(
|
||||
--token-color-palette-neutral-600
|
||||
);
|
||||
--token-app-side-nav-color-surface-primary: var(
|
||||
--token-color-palette-neutral-0
|
||||
);
|
||||
--token-app-side-nav-wrapper-border-color: var(
|
||||
--token-color-palette-neutral-200
|
||||
);
|
||||
--token-app-side-nav-color-foreground-strong: var(
|
||||
--token-color-palette-neutral-600
|
||||
);
|
||||
--token-app-side-nav-color-foreground-faint: var(
|
||||
--token-color-palette-neutral-500
|
||||
);
|
||||
--token-app-side-nav-color-surface-interactive-hover: var(
|
||||
--token-color-palette-neutral-50
|
||||
);
|
||||
--token-app-side-nav-color-surface-interactive-active: var(
|
||||
--token-color-palette-neutral-100
|
||||
);
|
||||
}
|
||||
@@ -132,11 +132,86 @@
|
||||
}
|
||||
}
|
||||
|
||||
@mixin dark-mode-button-override {
|
||||
/* stylelint-disable selector-class-pattern */
|
||||
.hds-app-frame:has(
|
||||
.hds-app-side-nav--is-mobile.hds-app-side-nav--is-not-minimized
|
||||
) {
|
||||
.hds-button,
|
||||
.hds-dropdown-toggle-button,
|
||||
.hds-dropdown-toggle-icon,
|
||||
.hds-app-header__home-link {
|
||||
color: var(--token-color-palette-neutral-200);
|
||||
background-color: var(--token-color-palette-neutral-50);
|
||||
border-color: var(--token-color-palette-neutral-100);
|
||||
}
|
||||
}
|
||||
/* stylelint-enable selector-class-pattern */
|
||||
}
|
||||
|
||||
@mixin dark-mode-app-header-override {
|
||||
.app-header-dark-mode-overrides {
|
||||
color: var(--token-color-palette-neutral-700);
|
||||
background: var(--token-color-palette-neutral-0);
|
||||
border-bottom-color: var(--token-color-palette-neutral-100);
|
||||
|
||||
/* stylelint-disable selector-class-pattern */
|
||||
.home-link-color-override,
|
||||
.hds-app-header__actions {
|
||||
background-color: var(--token-color-palette-neutral-0);
|
||||
}
|
||||
|
||||
.dropdown-toggle-color-override,
|
||||
.hds-app-header__menu-button {
|
||||
background: var(--token-color-palette-neutral-0);
|
||||
border-color: var(--token-color-palette-neutral-100);
|
||||
|
||||
&:hover {
|
||||
background: var(--token-color-palette-neutral-50);
|
||||
}
|
||||
|
||||
&:active,
|
||||
&:focus {
|
||||
background: var(--token-color-palette-neutral-0);
|
||||
}
|
||||
}
|
||||
/* stylelint-enable selector-class-pattern */
|
||||
}
|
||||
}
|
||||
|
||||
@mixin dark-mode-app-side-nav-override {
|
||||
.side-nav-dark-mode-overrides {
|
||||
/* stylelint-disable selector-class-pattern */
|
||||
.hds-app-side-nav__overlay {
|
||||
background-color: var(--token-color-palette-neutral-50);
|
||||
}
|
||||
|
||||
.hds-app-side-nav__list-title {
|
||||
color: var(--token-color-palette-neutral-300);
|
||||
}
|
||||
|
||||
.hds-app-side-nav__list-item-link.active {
|
||||
&::after {
|
||||
background-color: var(--token-color-palette-blue-400);
|
||||
}
|
||||
|
||||
.hds-app-side-nav__list-item-icon-leading,
|
||||
.hds-app-side-nav__list-item-text {
|
||||
color: var(--token-color-palette-blue-400);
|
||||
}
|
||||
}
|
||||
/* stylelint-enable selector-class-pattern */
|
||||
}
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
.ember-application:not(.rose-theme-light) {
|
||||
@include dark-mode;
|
||||
@include dark-mode-modal-override;
|
||||
@include dark-mode-ember-dropdown-override;
|
||||
@include dark-mode-app-header-override;
|
||||
@include dark-mode-app-side-nav-override;
|
||||
@include dark-mode-button-override;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -144,4 +219,7 @@
|
||||
@include dark-mode;
|
||||
@include dark-mode-modal-override;
|
||||
@include dark-mode-ember-dropdown-override;
|
||||
@include dark-mode-app-header-override;
|
||||
@include dark-mode-app-side-nav-override;
|
||||
@include dark-mode-button-override;
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
/**
|
||||
* Copyright IBM Corp. 2021, 2026
|
||||
* SPDX-License-Identifier: BUSL-1.1
|
||||
*/
|
||||
|
||||
export { default } from 'rose/components/rose/header/brand';
|
||||
@@ -1,6 +0,0 @@
|
||||
/**
|
||||
* Copyright IBM Corp. 2021, 2026
|
||||
* SPDX-License-Identifier: BUSL-1.1
|
||||
*/
|
||||
|
||||
export { default } from 'rose/components/rose/header/nav';
|
||||
@@ -1,6 +0,0 @@
|
||||
/**
|
||||
* Copyright IBM Corp. 2021, 2026
|
||||
* SPDX-License-Identifier: BUSL-1.1
|
||||
*/
|
||||
|
||||
export { default } from 'rose/components/rose/header/utilities';
|
||||
@@ -1,6 +0,0 @@
|
||||
/**
|
||||
* Copyright IBM Corp. 2021, 2026
|
||||
* SPDX-License-Identifier: BUSL-1.1
|
||||
*/
|
||||
|
||||
export { default } from 'rose/components/rose/layout/global';
|
||||
@@ -8,7 +8,6 @@
|
||||
@use 'code-editor';
|
||||
@use 'form';
|
||||
@use 'frame';
|
||||
@use 'header';
|
||||
@use 'layout';
|
||||
@use 'list';
|
||||
@use 'metadata-list';
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
/**
|
||||
* Copyright IBM Corp. 2021, 2026
|
||||
* SPDX-License-Identifier: BUSL-1.1
|
||||
*/
|
||||
|
||||
@use '../../variables/sizing';
|
||||
@use '../../utilities/type';
|
||||
|
||||
.rose-header-brand {
|
||||
grid-area: brand;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
color: var(--white);
|
||||
text-decoration: none;
|
||||
padding: 0 10px;
|
||||
margin: 10px;
|
||||
|
||||
svg {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.rose-header-brand-text {
|
||||
@include type.type(m);
|
||||
|
||||
font-weight: var(--token-typography-font-weight-regular);
|
||||
margin: 0;
|
||||
margin-left: sizing.rems(s);
|
||||
white-space: nowrap;
|
||||
position: absolute;
|
||||
top: -1000px;
|
||||
left: -1000px;
|
||||
opacity: 0;
|
||||
width: 1px;
|
||||
height: 1px;
|
||||
}
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
/**
|
||||
* Copyright IBM Corp. 2021, 2026
|
||||
* SPDX-License-Identifier: BUSL-1.1
|
||||
*/
|
||||
|
||||
.rose-header {
|
||||
// Temporary fix: This header component will be retired upon integrating HDS side nav for desktop.
|
||||
.header-dropdown-button-override > button {
|
||||
background: var(--black);
|
||||
border: none;
|
||||
color: var(--white);
|
||||
}
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
/**
|
||||
* Copyright IBM Corp. 2021, 2026
|
||||
* SPDX-License-Identifier: BUSL-1.1
|
||||
*/
|
||||
|
||||
@use '../../variables/sizing';
|
||||
@use '../../variables/media';
|
||||
@use '../../utilities/type';
|
||||
|
||||
@use 'brand';
|
||||
@use 'nav';
|
||||
@use 'utilities';
|
||||
@use 'dropdown';
|
||||
|
||||
.rose-header {
|
||||
--box-shadow-light: none;
|
||||
--box-shadow-dark: inset 0 -#{sizing.rems(xxxxs)} 0 var(--ui-border-subtler-1);
|
||||
--box-shadow: var(--box-shadow-light);
|
||||
|
||||
display: grid;
|
||||
grid-template-areas: 'brand nav utilities';
|
||||
grid-template-columns: 0.01fr auto 1fr;
|
||||
background: var(--black);
|
||||
box-shadow: var(--box-shadow);
|
||||
|
||||
.ember-application.rose-theme-light & {
|
||||
--box-shadow: var(--box-shadow-light);
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
--box-shadow: var(--box-shadow-dark);
|
||||
}
|
||||
|
||||
.ember-application.rose-theme-dark & {
|
||||
--box-shadow: var(--box-shadow-dark);
|
||||
}
|
||||
}
|
||||
|
||||
@media (width <= (media.width(small))) {
|
||||
.rose-header {
|
||||
grid-template-columns: 1fr 3fr;
|
||||
grid-template-areas:
|
||||
'brand utilities'
|
||||
'nav nav';
|
||||
padding-bottom: 0;
|
||||
}
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
/**
|
||||
* Copyright IBM Corp. 2021, 2026
|
||||
* SPDX-License-Identifier: BUSL-1.1
|
||||
*/
|
||||
|
||||
@use '../../variables/sizing';
|
||||
@use '../../variables/media';
|
||||
|
||||
.rose-header-nav {
|
||||
grid-area: nav;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
margin-right: sizing.rems(s);
|
||||
|
||||
@media (width <= (media.width(small))) {
|
||||
padding: 0 20px;
|
||||
background: var(--ui-header-subtler);
|
||||
}
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
/**
|
||||
* Copyright IBM Corp. 2021, 2026
|
||||
* SPDX-License-Identifier: BUSL-1.1
|
||||
*/
|
||||
|
||||
@use '../../variables/sizing';
|
||||
|
||||
.rose-header-utilities {
|
||||
grid-area: utilities;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
flex-direction: row-reverse;
|
||||
align-items: center;
|
||||
margin-right: sizing.rems(s);
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
/**
|
||||
* Copyright IBM Corp. 2021, 2026
|
||||
* SPDX-License-Identifier: BUSL-1.1
|
||||
*/
|
||||
|
||||
.rose-layout-global {
|
||||
min-height: 100vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
.rose-layout-global-body {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,6 @@
|
||||
* SPDX-License-Identifier: BUSL-1.1
|
||||
*/
|
||||
|
||||
@use 'global';
|
||||
@use 'sidebar';
|
||||
@use 'page';
|
||||
@use 'centered';
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
.rose-layout-page-header {
|
||||
grid-area: header;
|
||||
margin-bottom: sizing.rems(s);
|
||||
margin-top: sizing.rems(l);
|
||||
|
||||
h1 {
|
||||
display: flex;
|
||||
|
||||
@@ -1,56 +0,0 @@
|
||||
/**
|
||||
* Copyright IBM Corp. 2021, 2026
|
||||
* SPDX-License-Identifier: BUSL-1.1
|
||||
*/
|
||||
|
||||
import { module, test } from 'qunit';
|
||||
import { setupRenderingTest } from 'ember-qunit';
|
||||
import { render, find } from '@ember/test-helpers';
|
||||
import { hbs } from 'ember-cli-htmlbars';
|
||||
|
||||
module('Integration | Component | rose/header', function (hooks) {
|
||||
setupRenderingTest(hooks);
|
||||
|
||||
test('it renders', async function (assert) {
|
||||
await render(hbs`<Rose::Header />`);
|
||||
assert.ok(find('.rose-header'));
|
||||
});
|
||||
|
||||
test('it renders with brand', async function (assert) {
|
||||
await render(hbs`<Rose::Header as |header| >
|
||||
<header.brand></header.brand>
|
||||
</Rose::Header>`);
|
||||
assert.ok(find('.rose-header-brand'));
|
||||
assert.notOk(find('.rose-header-nav'));
|
||||
assert.notOk(find('.rose-header-utilities'));
|
||||
});
|
||||
|
||||
test('it renders with nav', async function (assert) {
|
||||
await render(hbs`<Rose::Header as |header| >
|
||||
<header.nav />
|
||||
</Rose::Header>`);
|
||||
assert.ok(find('.rose-header-nav'));
|
||||
assert.notOk(find('.rose-header-brand'));
|
||||
assert.notOk(find('.rose-header-utilities'));
|
||||
});
|
||||
|
||||
test('it renders with utilities', async function (assert) {
|
||||
await render(hbs`<Rose::Header as |header| >
|
||||
<header.utilities />
|
||||
</Rose::Header>`);
|
||||
assert.notOk(find('.rose-header-brand'));
|
||||
assert.notOk(find('.rose-header-nav'));
|
||||
assert.ok(find('.rose-header-utilities'));
|
||||
});
|
||||
|
||||
test('it renders the hds dropdown within header utilities', async function (assert) {
|
||||
await render(hbs`<Rose::Header as |header| >
|
||||
<header.utilities>
|
||||
<Hds::Dropdown as |D|>
|
||||
<D.ToggleButton @text="Menu" />
|
||||
</Hds::Dropdown>
|
||||
</header.utilities>
|
||||
</Rose::Header>`);
|
||||
assert.ok(find('.hds-dropdown'));
|
||||
});
|
||||
});
|
||||
@@ -1,25 +0,0 @@
|
||||
/**
|
||||
* Copyright IBM Corp. 2021, 2026
|
||||
* SPDX-License-Identifier: BUSL-1.1
|
||||
*/
|
||||
|
||||
import { module, test } from 'qunit';
|
||||
import { setupRenderingTest } from 'ember-qunit';
|
||||
import { render, find } from '@ember/test-helpers';
|
||||
import { hbs } from 'ember-cli-htmlbars';
|
||||
|
||||
module('Integration | Component | rose/header/brand', function (hooks) {
|
||||
setupRenderingTest(hooks);
|
||||
|
||||
test('it renders', async function (assert) {
|
||||
await render(hbs`
|
||||
<Rose::Header::Brand @logo="logo" @text="Product Name" />
|
||||
`);
|
||||
assert.ok(find('.rose-header-brand'));
|
||||
assert.ok(find('.rose-header-brand svg'));
|
||||
assert.strictEqual(
|
||||
find('.rose-header-brand-text').textContent.trim(),
|
||||
'Product Name',
|
||||
);
|
||||
});
|
||||
});
|
||||
@@ -1,18 +0,0 @@
|
||||
/**
|
||||
* Copyright IBM Corp. 2021, 2026
|
||||
* SPDX-License-Identifier: BUSL-1.1
|
||||
*/
|
||||
|
||||
import { module, test } from 'qunit';
|
||||
import { setupRenderingTest } from 'ember-qunit';
|
||||
import { render, find } from '@ember/test-helpers';
|
||||
import { hbs } from 'ember-cli-htmlbars';
|
||||
|
||||
module('Integration | Component | rose/header/nav', function (hooks) {
|
||||
setupRenderingTest(hooks);
|
||||
|
||||
test('it renders', async function (assert) {
|
||||
await render(hbs`<Rose::Header::nav />`);
|
||||
assert.ok(find('.rose-header-nav'));
|
||||
});
|
||||
});
|
||||
@@ -1,18 +0,0 @@
|
||||
/**
|
||||
* Copyright IBM Corp. 2021, 2026
|
||||
* SPDX-License-Identifier: BUSL-1.1
|
||||
*/
|
||||
|
||||
import { module, test } from 'qunit';
|
||||
import { setupRenderingTest } from 'ember-qunit';
|
||||
import { render, find } from '@ember/test-helpers';
|
||||
import { hbs } from 'ember-cli-htmlbars';
|
||||
|
||||
module('Integration | Component | rose/header/utilities', function (hooks) {
|
||||
setupRenderingTest(hooks);
|
||||
|
||||
test('it renders', async function (assert) {
|
||||
await render(hbs`<Rose::Header::Utilities />`);
|
||||
assert.ok(find('.rose-header-utilities'));
|
||||
});
|
||||
});
|
||||
@@ -1,45 +0,0 @@
|
||||
/**
|
||||
* Copyright IBM Corp. 2021, 2026
|
||||
* SPDX-License-Identifier: BUSL-1.1
|
||||
*/
|
||||
|
||||
import { module, test } from 'qunit';
|
||||
import { setupRenderingTest } from 'ember-qunit';
|
||||
import { render, find } from '@ember/test-helpers';
|
||||
import { hbs } from 'ember-cli-htmlbars';
|
||||
|
||||
module('Integration | Component | rose/layout/global', function (hooks) {
|
||||
setupRenderingTest(hooks);
|
||||
|
||||
test('it renders', async function (assert) {
|
||||
await render(hbs`<Rose::Layout::Global />`);
|
||||
assert.ok(find('section'));
|
||||
assert.ok(find('.rose-layout-global'));
|
||||
});
|
||||
|
||||
test('it renders with attributes', async function (assert) {
|
||||
await render(hbs`<Rose::Layout::Global id="global"/>`);
|
||||
assert.ok(find('#global'));
|
||||
});
|
||||
|
||||
test('it renders with header', async function (assert) {
|
||||
await render(hbs`<Rose::Layout::Global as |layout|>
|
||||
<layout.header />
|
||||
</Rose::Layout::Global>`);
|
||||
assert.ok(find('.rose-layout-global-header'));
|
||||
});
|
||||
|
||||
test('it renders with body', async function (assert) {
|
||||
await render(hbs`<Rose::Layout::Global as |layout|>
|
||||
<layout.body />
|
||||
</Rose::Layout::Global>`);
|
||||
assert.ok(find('.rose-layout-global-body'));
|
||||
});
|
||||
|
||||
test('it renders with footer', async function (assert) {
|
||||
await render(hbs`<Rose::Layout::Global as |layout|>
|
||||
<layout.footer />
|
||||
</Rose::Layout::Global>`);
|
||||
assert.ok(find('.rose-layout-global-footer'));
|
||||
});
|
||||
});
|
||||
@@ -16,7 +16,7 @@ export class AuthMethodsPage extends BaseResourcePage {
|
||||
async createPasswordAuthMethod() {
|
||||
const authMethodName = 'Auth Method ' + nanoid();
|
||||
await this.page
|
||||
.getByRole('navigation', { name: 'Application local navigation' })
|
||||
.getByRole('navigation', { name: 'Primary' })
|
||||
.getByRole('link', { name: 'Auth Methods' })
|
||||
.click();
|
||||
await this.page.getByRole('button', { name: 'New', exact: true }).click();
|
||||
@@ -43,7 +43,7 @@ export class AuthMethodsPage extends BaseResourcePage {
|
||||
async createOidcAuthMethod(issuer, clientId, clientSecret, boundaryAddr) {
|
||||
const authMethodName = 'Auth Method ' + nanoid();
|
||||
await this.page
|
||||
.getByRole('navigation', { name: 'Application local navigation' })
|
||||
.getByRole('navigation', { name: 'Primary' })
|
||||
.getByRole('link', { name: 'Auth Methods' })
|
||||
.click();
|
||||
await this.page.getByRole('button', { name: 'New', exact: true }).click();
|
||||
@@ -130,7 +130,7 @@ export class AuthMethodsPage extends BaseResourcePage {
|
||||
*/
|
||||
async makeAuthMethodPrimary() {
|
||||
await this.page
|
||||
.getByRole('navigation', { name: 'Application local navigation' })
|
||||
.getByRole('navigation', { name: 'Primary' })
|
||||
.getByRole('link', { name: 'Auth Methods' })
|
||||
.click();
|
||||
await this.page.getByLabel('Manage').click();
|
||||
|
||||
@@ -17,7 +17,7 @@ export class CredentialStoresPage extends BaseResourcePage {
|
||||
async createStaticCredentialStore() {
|
||||
const credentialStoreName = 'Credential Store ' + nanoid();
|
||||
await this.page
|
||||
.getByRole('navigation', { name: 'Application local navigation' })
|
||||
.getByRole('navigation', { name: 'Primary' })
|
||||
.getByRole('link', { name: 'Credential Stores' })
|
||||
.click();
|
||||
await this.page.getByRole('link', { name: 'New', exact: true }).click();
|
||||
@@ -47,7 +47,7 @@ export class CredentialStoresPage extends BaseResourcePage {
|
||||
async createVaultCredentialStore(vaultAddr, clientToken) {
|
||||
const credentialStoreName = 'Credential Store ' + nanoid();
|
||||
await this.page
|
||||
.getByRole('navigation', { name: 'Application local navigation' })
|
||||
.getByRole('navigation', { name: 'Primary' })
|
||||
.getByRole('link', { name: 'Credential Stores' })
|
||||
.click();
|
||||
await this.page.getByRole('link', { name: 'New', exact: true }).click();
|
||||
@@ -84,7 +84,7 @@ export class CredentialStoresPage extends BaseResourcePage {
|
||||
) {
|
||||
const credentialStoreName = 'Credential Store ' + nanoid();
|
||||
await this.page
|
||||
.getByRole('navigation', { name: 'Application local navigation' })
|
||||
.getByRole('navigation', { name: 'Primary' })
|
||||
.getByRole('link', { name: 'Credential Stores' })
|
||||
.click();
|
||||
await this.page.getByRole('link', { name: 'New', exact: true }).click();
|
||||
|
||||
@@ -16,7 +16,7 @@ export class GroupsPage extends BaseResourcePage {
|
||||
async createGroup() {
|
||||
const groupName = 'Group ' + nanoid();
|
||||
await this.page
|
||||
.getByRole('navigation', { name: 'Application local navigation' })
|
||||
.getByRole('navigation', { name: 'Primary' })
|
||||
.getByRole('link', { name: 'Groups' })
|
||||
.click();
|
||||
await this.page.getByRole('link', { name: 'New', exact: true }).click();
|
||||
|
||||
@@ -16,7 +16,7 @@ export class HostCatalogsPage extends BaseResourcePage {
|
||||
async createHostCatalog() {
|
||||
const hostCatalogName = 'Host Catalog ' + nanoid();
|
||||
await this.page
|
||||
.getByRole('navigation', { name: 'Application local navigation' })
|
||||
.getByRole('navigation', { name: 'Primary' })
|
||||
.getByRole('link', { name: 'Host Catalogs' })
|
||||
.click();
|
||||
await expect(
|
||||
|
||||
@@ -18,9 +18,7 @@ export class LoginPage extends BaseResourcePage {
|
||||
await this.page.getByLabel('Password', { exact: true }).fill(password);
|
||||
await this.page.getByRole('button', { name: 'Sign In' }).click();
|
||||
await expect(
|
||||
this.page.getByRole('navigation', {
|
||||
name: 'Application local navigation',
|
||||
}),
|
||||
this.page.getByRole('navigation', { name: 'Primary' }),
|
||||
).toBeVisible();
|
||||
await expect(this.page.getByText(loginName)).toBeEnabled();
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ export class OrgsPage extends BaseResourcePage {
|
||||
async createOrg() {
|
||||
const orgName = 'Org ' + nanoid();
|
||||
await this.page
|
||||
.getByRole('navigation', { name: 'Application local navigation' })
|
||||
.getByRole('navigation', { name: 'Primary' })
|
||||
.getByRole('link', { name: 'Orgs' })
|
||||
.click();
|
||||
await this.page.getByRole('link', { name: 'New Org' }).click();
|
||||
|
||||
@@ -16,7 +16,7 @@ export class ProjectsPage extends BaseResourcePage {
|
||||
async createProject() {
|
||||
const projectName = 'Project ' + nanoid();
|
||||
await this.page
|
||||
.getByRole('navigation', { name: 'Application local navigation' })
|
||||
.getByRole('navigation', { name: 'Primary' })
|
||||
.getByRole('link', { name: 'Projects' })
|
||||
.click();
|
||||
await this.page.getByRole('link', { name: 'New', exact: true }).click();
|
||||
|
||||
@@ -21,7 +21,7 @@ export class RolesPage extends BaseResourcePage {
|
||||
const roleName = 'Role ' + nanoid();
|
||||
|
||||
await this.page
|
||||
.getByRole('navigation', { name: 'Application local navigation' })
|
||||
.getByRole('navigation', { name: 'Primary' })
|
||||
.getByRole('link', { name: 'Roles' })
|
||||
.click();
|
||||
await this.page.getByRole('link', { name: 'New Role' }).click();
|
||||
|
||||
@@ -14,7 +14,7 @@ export class SessionsPage extends BasePage {
|
||||
*/
|
||||
async waitForSessionToBeVisible(targetName) {
|
||||
await this.page
|
||||
.getByRole('navigation', { name: 'Application local navigation' })
|
||||
.getByRole('navigation', { name: 'Primary' })
|
||||
.getByRole('link', { name: 'Sessions' })
|
||||
.click();
|
||||
let i = 0;
|
||||
|
||||
@@ -37,7 +37,7 @@ export class TargetsPage extends BaseResourcePage {
|
||||
}
|
||||
|
||||
await this.page
|
||||
.getByRole('navigation', { name: 'Application local navigation' })
|
||||
.getByRole('navigation', { name: 'Primary' })
|
||||
.getByRole('link', { name: 'Targets' })
|
||||
.click();
|
||||
await this.page.getByRole('link', { name: 'New', exact: true }).click();
|
||||
@@ -187,7 +187,7 @@ export class TargetsPage extends BaseResourcePage {
|
||||
*/
|
||||
async addBrokeredCredentialsToTarget(targetName, credentialName) {
|
||||
await this.page
|
||||
.getByRole('navigation', { name: 'Application local navigation' })
|
||||
.getByRole('navigation', { name: 'Primary' })
|
||||
.getByRole('link', { name: 'Targets' })
|
||||
.click();
|
||||
await expect(
|
||||
@@ -235,7 +235,7 @@ export class TargetsPage extends BaseResourcePage {
|
||||
*/
|
||||
async addInjectedCredentialsToTarget(targetName, credentialName) {
|
||||
await this.page
|
||||
.getByRole('navigation', { name: 'Application local navigation' })
|
||||
.getByRole('navigation', { name: 'Primary' })
|
||||
.getByRole('link', { name: 'Targets' })
|
||||
.click();
|
||||
await expect(
|
||||
|
||||
@@ -16,7 +16,7 @@ export class UsersPage extends BaseResourcePage {
|
||||
async createUser() {
|
||||
const userName = 'User ' + nanoid();
|
||||
await this.page
|
||||
.getByRole('navigation', { name: 'Application local navigation' })
|
||||
.getByRole('navigation', { name: 'Primary' })
|
||||
.getByRole('link', { name: 'Users' })
|
||||
.click();
|
||||
await this.page.getByRole('link', { name: 'New', exact: true }).click();
|
||||
|
||||
@@ -93,7 +93,7 @@ test.describe('Aliases (Enterprise)', () => {
|
||||
|
||||
// Clear destination from alias
|
||||
await page
|
||||
.getByRole('navigation', { name: 'Application local navigation' })
|
||||
.getByRole('navigation', { name: 'Primary' })
|
||||
.getByRole('link', { name: 'Targets' })
|
||||
.click();
|
||||
await page.getByRole('link', { name: targetName }).click();
|
||||
@@ -285,7 +285,7 @@ test.describe('Aliases (Enterprise)', () => {
|
||||
const aliasesPage = new AliasesPage(page);
|
||||
await aliasesPage.createAliasForTarget(alias, targetId);
|
||||
await page
|
||||
.getByRole('navigation', { name: 'Application local navigation' })
|
||||
.getByRole('navigation', { name: 'Primary' })
|
||||
.getByRole('link', { name: 'Orgs' })
|
||||
.click();
|
||||
await page.getByRole('link', { name: orgName }).click();
|
||||
|
||||
@@ -75,7 +75,7 @@ test.describe('Aliases', () => {
|
||||
|
||||
// Clear destination from alias
|
||||
await page
|
||||
.getByRole('navigation', { name: 'Application local navigation' })
|
||||
.getByRole('navigation', { name: 'Primary' })
|
||||
.getByRole('link', { name: 'Targets' })
|
||||
.click();
|
||||
await page.getByRole('link', { name: targetName }).click();
|
||||
|
||||
@@ -52,7 +52,7 @@ test(
|
||||
const orgsPage = new OrgsPage(page);
|
||||
orgName = await orgsPage.createOrg();
|
||||
await page
|
||||
.getByRole('navigation', { name: 'Application local navigation' })
|
||||
.getByRole('navigation', { name: 'Primary' })
|
||||
.getByRole('link', { name: 'Auth Methods' })
|
||||
.click();
|
||||
await expect(
|
||||
@@ -194,7 +194,7 @@ test(
|
||||
// View the LDAP account and verify account attributes
|
||||
await page.getByRole('link', { name: orgName }).click();
|
||||
await page
|
||||
.getByRole('navigation', { name: 'Application local navigation' })
|
||||
.getByRole('navigation', { name: 'Primary' })
|
||||
.getByRole('link', { name: 'Auth Methods' })
|
||||
.click();
|
||||
await page.getByRole('link', { name: ldapAuthMethodName }).click();
|
||||
@@ -283,7 +283,7 @@ test(
|
||||
|
||||
// View the User account and verify attributes
|
||||
await page
|
||||
.getByRole('navigation', { name: 'Application local navigation' })
|
||||
.getByRole('navigation', { name: 'Primary' })
|
||||
.getByRole('link', { name: 'Users' })
|
||||
.click();
|
||||
await page.getByRole('link', { name: userName }).click();
|
||||
|
||||
@@ -147,7 +147,7 @@ test(
|
||||
.getByText(orgName),
|
||||
).toBeVisible();
|
||||
await page
|
||||
.getByRole('navigation', { name: 'Application local navigation' })
|
||||
.getByRole('navigation', { name: 'Primary' })
|
||||
.getByRole('link', { name: 'Auth Methods' })
|
||||
.click();
|
||||
await page.getByRole('link', { name: oidcAuthMethodName }).click();
|
||||
@@ -236,7 +236,7 @@ test(
|
||||
|
||||
// View the User account and verify attributes
|
||||
await page
|
||||
.getByRole('navigation', { name: 'Application local navigation' })
|
||||
.getByRole('navigation', { name: 'Primary' })
|
||||
.getByRole('link', { name: 'Users' })
|
||||
.click();
|
||||
await page
|
||||
|
||||
@@ -75,7 +75,7 @@ test(
|
||||
|
||||
// Set a new password on the account
|
||||
await page
|
||||
.getByRole('navigation', { name: 'Application local navigation' })
|
||||
.getByRole('navigation', { name: 'Primary' })
|
||||
.getByRole('link', { name: 'Orgs' })
|
||||
.click();
|
||||
await page.getByRole('link', { name: orgName }).click();
|
||||
@@ -85,7 +85,7 @@ test(
|
||||
.getByText(orgName),
|
||||
).toBeVisible();
|
||||
await page
|
||||
.getByRole('navigation', { name: 'Application local navigation' })
|
||||
.getByRole('navigation', { name: 'Primary' })
|
||||
.getByRole('link', { name: 'Auth Methods' })
|
||||
.click();
|
||||
await page.getByRole('link', { name: authMethodName }).click();
|
||||
|
||||
@@ -49,7 +49,7 @@ test.describe('AWS', () => {
|
||||
// Create host catalog
|
||||
const hostCatalogName = 'Host Catalog ' + nanoid();
|
||||
await page
|
||||
.getByRole('navigation', { name: 'Application local navigation' })
|
||||
.getByRole('navigation', { name: 'Primary' })
|
||||
.getByRole('link', { name: 'Host Catalogs' })
|
||||
.click();
|
||||
await page.getByRole('link', { name: 'New', exact: true }).click();
|
||||
@@ -167,7 +167,7 @@ test.describe('AWS', () => {
|
||||
await hostCatalogsPage.createHostCatalog();
|
||||
const newHostSetName = await hostCatalogsPage.createHostSet();
|
||||
await page
|
||||
.getByRole('navigation', { name: 'Application local navigation' })
|
||||
.getByRole('navigation', { name: 'Primary' })
|
||||
.getByRole('link', { name: 'Targets' })
|
||||
.click();
|
||||
await page.getByRole('link', { name: targetName }).click();
|
||||
|
||||
@@ -49,7 +49,7 @@ test.describe('AWS', () => {
|
||||
// Create host catalog
|
||||
const hostCatalogName = 'Host Catalog ' + nanoid();
|
||||
await page
|
||||
.getByRole('navigation', { name: 'Application local navigation' })
|
||||
.getByRole('navigation', { name: 'Primary' })
|
||||
.getByRole('link', { name: 'Host Catalogs' })
|
||||
.click();
|
||||
await page.getByRole('link', { name: 'New', exact: true }).click();
|
||||
@@ -166,7 +166,7 @@ test.describe('AWS', () => {
|
||||
await hostCatalogsPage.createHostCatalog();
|
||||
const newHostSetName = await hostCatalogsPage.createHostSet();
|
||||
await page
|
||||
.getByRole('navigation', { name: 'Application local navigation' })
|
||||
.getByRole('navigation', { name: 'Primary' })
|
||||
.getByRole('link', { name: 'Targets' })
|
||||
.click();
|
||||
await page.getByRole('link', { name: targetName }).click();
|
||||
|
||||
@@ -42,7 +42,7 @@ test(
|
||||
|
||||
// Navigate to orgs page when done
|
||||
await page
|
||||
.getByRole('navigation', { name: 'Application local navigation' })
|
||||
.getByRole('navigation', { name: 'Primary' })
|
||||
.getByRole('link', { name: 'Orgs' })
|
||||
.click();
|
||||
await expect(page.getByRole('heading', { name: 'Orgs' })).toBeVisible();
|
||||
|
||||
@@ -48,7 +48,7 @@ test(
|
||||
await page.getByRole('link', { name: org.name }).click();
|
||||
await page.getByRole('link', { name: project.name }).click();
|
||||
await page
|
||||
.getByRole('navigation', { name: 'Application local navigation' })
|
||||
.getByRole('navigation', { name: 'Primary' })
|
||||
.getByRole('link', { name: 'Targets' })
|
||||
.click();
|
||||
await expect(page.getByRole('heading', { name: 'Targets' })).toBeVisible();
|
||||
|
||||
@@ -160,7 +160,7 @@ test(
|
||||
.getByRole('link', { name: 'Back to Global', exact: true })
|
||||
.click();
|
||||
await page
|
||||
.getByRole('navigation', { name: 'Application local navigation' })
|
||||
.getByRole('navigation', { name: 'Primary' })
|
||||
.getByRole('link', { name: 'Session Recordings', exact: true })
|
||||
.click();
|
||||
await page
|
||||
|
||||
@@ -168,7 +168,7 @@ test(
|
||||
.getByRole('link', { name: 'Back to Global', exact: true })
|
||||
.click();
|
||||
await page
|
||||
.getByRole('navigation', { name: 'Application local navigation' })
|
||||
.getByRole('navigation', { name: 'Primary' })
|
||||
.getByRole('link', { name: 'Session Recordings', exact: true })
|
||||
.click();
|
||||
await page
|
||||
|
||||
@@ -49,7 +49,7 @@ test(
|
||||
|
||||
// Create another host set
|
||||
await page
|
||||
.getByRole('navigation', { name: 'Application local navigation' })
|
||||
.getByRole('navigation', { name: 'Primary' })
|
||||
.getByRole('link', { name: 'Host Catalogs' })
|
||||
.click();
|
||||
await page.getByRole('link', { name: hostCatalogName }).click();
|
||||
|
||||
@@ -14,7 +14,7 @@ test(
|
||||
|
||||
await page.goto('/');
|
||||
await page
|
||||
.getByRole('navigation', { name: 'Application local navigation' })
|
||||
.getByRole('navigation', { name: 'Primary' })
|
||||
.getByRole('link', { name: 'Workers' })
|
||||
.click();
|
||||
await page.getByRole('link', { name: 'New', exact: true }).click();
|
||||
|
||||
@@ -17,7 +17,7 @@ test(
|
||||
|
||||
await page.goto('/');
|
||||
await page
|
||||
.getByRole('navigation', { name: 'Application local navigation' })
|
||||
.getByRole('navigation', { name: 'Primary' })
|
||||
.getByRole('link', { name: 'Workers' })
|
||||
.click();
|
||||
await expect(
|
||||
@@ -102,7 +102,7 @@ test(
|
||||
|
||||
// Check tag in worker dialog
|
||||
await page
|
||||
.getByRole('navigation', { name: 'Application local navigation' })
|
||||
.getByRole('navigation', { name: 'Primary' })
|
||||
.getByRole('link', { name: 'Workers' })
|
||||
.click();
|
||||
await expect(
|
||||
|
||||
@@ -14,7 +14,7 @@ test(
|
||||
|
||||
await page.goto('/');
|
||||
await page
|
||||
.getByRole('navigation', { name: 'Application local navigation' })
|
||||
.getByRole('navigation', { name: 'Primary' })
|
||||
.getByRole('link', { name: 'Workers' })
|
||||
.click();
|
||||
await page.getByRole('link', { name: 'New', exact: true }).click();
|
||||
|
||||
@@ -50,7 +50,9 @@ test.describe('Scope tests', () => {
|
||||
test('Shows the filtered targets based on selected scope', async ({
|
||||
authedPage,
|
||||
}) => {
|
||||
const headerNavLocator = authedPage.getByLabel('header-nav');
|
||||
const headerNavLocator = authedPage.locator(
|
||||
'header .app-header__global-actions',
|
||||
);
|
||||
await expect(headerNavLocator).toBeVisible();
|
||||
await expect(
|
||||
headerNavLocator.locator('.hds-dropdown-toggle-button'),
|
||||
@@ -64,7 +66,7 @@ test.describe('Scope tests', () => {
|
||||
).toBeVisible();
|
||||
|
||||
await headerNavLocator.click();
|
||||
const orgAHeaderNavLink = authedPage.getByRole('link', {
|
||||
const orgAHeaderNavLink = authedPage.getByRole('option', {
|
||||
name: orgA.name,
|
||||
});
|
||||
await orgAHeaderNavLink.click();
|
||||
@@ -79,7 +81,7 @@ test.describe('Scope tests', () => {
|
||||
authedPage.getByRole('link', { name: targetB.name }),
|
||||
).toBeHidden();
|
||||
|
||||
const orgBHeaderNavLink = authedPage.getByRole('link', {
|
||||
const orgBHeaderNavLink = authedPage.getByRole('option', {
|
||||
name: orgB.name,
|
||||
});
|
||||
await expect(orgBHeaderNavLink).toBeVisible();
|
||||
|
||||
Generated
+3
@@ -991,6 +991,9 @@ importers:
|
||||
'@xterm/xterm':
|
||||
specifier: ^5.5.0
|
||||
version: 5.5.0
|
||||
ember-a11y-refocus:
|
||||
specifier: ^5.0.0
|
||||
version: 5.1.0(@babel/core@7.27.1)(ember-source@5.12.0(@glimmer/component@2.0.0)(@glint/template@1.5.2)(rsvp@4.8.5)(webpack@5.104.1(esbuild@0.25.9)))
|
||||
ember-inflector:
|
||||
specifier: ^6.0.0
|
||||
version: 6.0.0(@babel/core@7.27.1)
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
{{!
|
||||
Copyright IBM Corp. 2021, 2026
|
||||
SPDX-License-Identifier: BUSL-1.1
|
||||
}}
|
||||
|
||||
<Hds::Dropdown @enableCollisionDetection={{true}} as |dd|>
|
||||
<dd.ToggleButton
|
||||
@text={{if
|
||||
this.scope.org.isGlobal
|
||||
(t 'titles.global')
|
||||
this.scope.org.displayName
|
||||
}}
|
||||
@icon={{if this.scope.org.isGlobal 'globe' 'org'}}
|
||||
@color='secondary'
|
||||
/>
|
||||
{{#if this.session.data.authenticated.isGlobal}}
|
||||
<dd.Interactive @route='scopes.scope' @model='global'>
|
||||
{{t 'titles.global'}}
|
||||
</dd.Interactive>
|
||||
{{/if}}
|
||||
{{#each this.scope.orgsList as |org|}}
|
||||
<dd.Interactive @route='scopes.scope' @model={{org.id}}>
|
||||
{{org.displayName}}
|
||||
</dd.Interactive>
|
||||
{{/each}}
|
||||
</Hds::Dropdown>
|
||||
|
||||
{{#if this.scope.project}}
|
||||
<Hds::Dropdown as |dd|>
|
||||
<dd.ToggleButton
|
||||
@icon='grid'
|
||||
@text={{this.scope.project.displayName}}
|
||||
@color='secondary'
|
||||
/>
|
||||
{{#each this.scope.projectsList as |project|}}
|
||||
<dd.Interactive @route='scopes.scope' @model={{project.id}}>
|
||||
{{project.displayName}}
|
||||
</dd.Interactive>
|
||||
{{/each}}
|
||||
</Hds::Dropdown>
|
||||
{{/if}}
|
||||
@@ -1,14 +0,0 @@
|
||||
/**
|
||||
* Copyright IBM Corp. 2021, 2026
|
||||
* SPDX-License-Identifier: BUSL-1.1
|
||||
*/
|
||||
|
||||
import Component from '@glimmer/component';
|
||||
import { service } from '@ember/service';
|
||||
|
||||
export default class HeaderNavComponent extends Component {
|
||||
// =services
|
||||
|
||||
@service session;
|
||||
@service scope;
|
||||
}
|
||||
@@ -4,18 +4,18 @@
|
||||
}}
|
||||
|
||||
<Hds::Dropdown
|
||||
class='scope-picker'
|
||||
@enableCollisionDetection={{true}}
|
||||
@matchToggleWidth={{true}}
|
||||
{{! HDS provided class to automatically fade in/out }}
|
||||
class='hds-side-nav-hide-when-minimized scope-picker'
|
||||
data-test-side-nav-scope-dropdown
|
||||
@listPosition='bottom-left'
|
||||
data-test-header-scope-dropdown
|
||||
...attributes
|
||||
as |D|
|
||||
>
|
||||
{{#let this.currentScope as |scope|}}
|
||||
<D.ToggleButton
|
||||
@text={{scope.name}}
|
||||
@icon={{scope.icon}}
|
||||
class='scope-picker__toggle-button'
|
||||
class='dropdown-toggle-color-override'
|
||||
/>
|
||||
{{/let}}
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import Component from '@glimmer/component';
|
||||
import { inject as service } from '@ember/service';
|
||||
import orderBy from 'lodash/orderBy';
|
||||
|
||||
export default class ScopePickerIndexComponent extends Component {
|
||||
export default class ScopePickerComponent extends Component {
|
||||
// =services
|
||||
|
||||
@service intl;
|
||||
|
||||
@@ -9,7 +9,7 @@ import { getOwner } from '@ember/application';
|
||||
import { action } from '@ember/object';
|
||||
import { loading } from 'ember-loading';
|
||||
import { defaultValidator } from 'ember-a11y-refocus';
|
||||
import { paramValueFinder } from 'admin/utils/param-value-finder';
|
||||
import { paramValueFinder } from 'core/utils/param-value-finder';
|
||||
|
||||
const THEMES = [
|
||||
{
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
import Route from '@ember/routing/route';
|
||||
import { service } from '@ember/service';
|
||||
import { paramValueFinder } from 'admin/utils/param-value-finder';
|
||||
import { paramValueFinder } from 'core/utils/param-value-finder';
|
||||
|
||||
export default class ScopesScopeAuthMethodsAuthMethodRoute extends Route {
|
||||
// =services
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
import Route from '@ember/routing/route';
|
||||
import { service } from '@ember/service';
|
||||
import { paramValueFinder } from 'admin/utils/param-value-finder';
|
||||
import { paramValueFinder } from 'core/utils/param-value-finder';
|
||||
|
||||
export default class ScopesScopeCredentialStoresCredentialStoreRoute extends Route {
|
||||
// =services
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
import Route from '@ember/routing/route';
|
||||
import { service } from '@ember/service';
|
||||
import { paramValueFinder } from 'admin/utils/param-value-finder';
|
||||
import { paramValueFinder } from 'core/utils/param-value-finder';
|
||||
|
||||
export default class ScopesScopeHostCatalogsHostCatalogRoute extends Route {
|
||||
// =services
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
import Route from '@ember/routing/route';
|
||||
import { service } from '@ember/service';
|
||||
import { paramValueFinder } from 'admin/utils/param-value-finder';
|
||||
import { paramValueFinder } from 'core/utils/param-value-finder';
|
||||
|
||||
export default class ScopesScopeHostCatalogsHostCatalogHostSetsHostSetRoute extends Route {
|
||||
// =services
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
import Route from '@ember/routing/route';
|
||||
import { service } from '@ember/service';
|
||||
import { paramValueFinder } from 'admin/utils/param-value-finder';
|
||||
import { paramValueFinder } from 'core/utils/param-value-finder';
|
||||
|
||||
export default class ScopesScopeSessionRecordingsSessionRecordingRoute extends Route {
|
||||
// =services
|
||||
|
||||
@@ -11,12 +11,6 @@
|
||||
@use 'notify';
|
||||
@use 'asciinema-player/dist/bundle/asciinema-player.css';
|
||||
|
||||
.rose-layout-global {
|
||||
.rose-layout-global-body {
|
||||
justify-content: center;
|
||||
}
|
||||
}
|
||||
|
||||
.rose-layout-centered {
|
||||
> .rose-layout-page {
|
||||
width: sizing.rems(l) * 18;
|
||||
@@ -89,14 +83,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
[class*='session-status-'] {
|
||||
color: var(--ui-gray-subtler-2);
|
||||
}
|
||||
|
||||
.session-status-active {
|
||||
color: var(--success);
|
||||
}
|
||||
|
||||
.nowrap {
|
||||
white-space: nowrap;
|
||||
}
|
||||
@@ -1005,18 +991,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
// scope picker
|
||||
.scope-picker {
|
||||
&__toggle-button {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
li:has(.indentation),
|
||||
li.indentation {
|
||||
margin-left: 1.5rem;
|
||||
}
|
||||
}
|
||||
|
||||
// dropdown checkbox list
|
||||
.dropdown-checkbox-list {
|
||||
margin-bottom: 1rem;
|
||||
@@ -1027,6 +1001,14 @@
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
// Scope picker in global header
|
||||
.scope-picker {
|
||||
li:has(.indentation),
|
||||
li.indentation {
|
||||
margin-left: 1.5rem;
|
||||
}
|
||||
}
|
||||
|
||||
// User menu dropdown in global side nav
|
||||
.user-menu-dropdown {
|
||||
max-width: 125px;
|
||||
|
||||
@@ -5,151 +5,160 @@
|
||||
|
||||
{{page-title (app-name)}}
|
||||
|
||||
<Hds::AppFrame @hasHeader={{false}} @hasSidebar={{this.showSideNav}} as |Frame|>
|
||||
<Frame.Sidebar class='app-frame-sidebar-style-overrides'>
|
||||
<Hds::SideNav
|
||||
<Hds::AppFrame
|
||||
@hasHeader={{this.showSideNav}}
|
||||
@hasSidebar={{this.showSideNav}}
|
||||
as |Frame|
|
||||
>
|
||||
<Frame.Header>
|
||||
<Hds::AppHeader
|
||||
@a11yRefocusRouteChangeValidator={{this.customRouteChangeValidator}}
|
||||
class='side-nav-style-overrides'
|
||||
class='app-header-dark-mode-overrides'
|
||||
>
|
||||
<:header>
|
||||
<Hds::SideNav::Header>
|
||||
<:logo>
|
||||
<Hds::SideNav::Header::HomeLink
|
||||
@icon='boundary'
|
||||
@color='var(--token-color-boundary-brand)'
|
||||
@ariaLabel={{(app-name)}}
|
||||
@route='index'
|
||||
/>
|
||||
</:logo>
|
||||
<:actions>
|
||||
{{#if (feature-flag 'dev-edition-toggle')}}
|
||||
<Hds::Dropdown @enableCollisionDetection={{true}} as |dd|>
|
||||
<dd.ToggleIcon
|
||||
@icon='layers'
|
||||
@text={{t
|
||||
'titles.feature-edition'
|
||||
edition=this.featureEdition.edition
|
||||
}}
|
||||
data-test-dev-edition-toggle
|
||||
/>
|
||||
<:logo>
|
||||
<Hds::AppHeader::HomeLink
|
||||
@icon='boundary'
|
||||
@color='var(--token-color-boundary-brand)'
|
||||
@text={{(app-name)}}
|
||||
@route='index'
|
||||
class='home-link-color-override'
|
||||
/>
|
||||
</:logo>
|
||||
|
||||
<dd.Title @text={{t 'actions.toggle-feature-edition'}} />
|
||||
{{#each this.featureEdition.editions as |edition|}}
|
||||
<dd.Radio
|
||||
@value={{edition}}
|
||||
checked={{eq this.featureEdition.edition edition}}
|
||||
{{on 'change' (fn this.toggleEdition edition)}}
|
||||
>
|
||||
{{edition}}
|
||||
</dd.Radio>
|
||||
{{/each}}
|
||||
<dd.Separator />
|
||||
|
||||
<dd.Title @text={{t 'actions.toggle-licensed-features'}} />
|
||||
{{#each this.featureEdition.licensedFeatures as |feature|}}
|
||||
<dd.Checkbox
|
||||
@value={{feature}}
|
||||
checked={{feature-flag feature}}
|
||||
{{on 'change' (fn this.toggleFeature feature)}}
|
||||
>
|
||||
{{feature}}
|
||||
</dd.Checkbox>
|
||||
|
||||
{{/each}}
|
||||
<dd.Separator />
|
||||
<dd.Title @text={{t 'actions.manage-db'}} />
|
||||
<dd.Interactive
|
||||
@icon='save'
|
||||
@isLoading={{(is-loading)}}
|
||||
{{on 'click' this.downloadDatabase}}
|
||||
>
|
||||
{{t 'actions.download-db'}}
|
||||
</dd.Interactive>
|
||||
<dd.Interactive @icon='trash' {{on 'click' this.clearDatabase}}>
|
||||
{{t 'actions.clear-db'}}
|
||||
</dd.Interactive>
|
||||
</Hds::Dropdown>
|
||||
{{/if}}
|
||||
|
||||
{{#if this.session.username}}
|
||||
<Hds::Dropdown
|
||||
@enableCollisionDetection={{true}}
|
||||
class='user-menu-dropdown'
|
||||
data-test-side-nav-user-dropdown
|
||||
as |dd|
|
||||
>
|
||||
<dd.ToggleButton
|
||||
@icon='user'
|
||||
@text={{this.session.username}}
|
||||
{{hds-tooltip this.session.username}}
|
||||
class='user-menu-dropdown__toggle-button'
|
||||
/>
|
||||
<dd.Title @text={{t 'titles.authenticated'}} />
|
||||
<dd.Description @text={{this.session.username}} />
|
||||
<dd.Separator />
|
||||
|
||||
<dd.Interactive @route='account.change-password'>{{t
|
||||
'actions.change-password'
|
||||
}}</dd.Interactive>
|
||||
<dd.Separator />
|
||||
|
||||
<dd.Interactive {{on 'click' this.invalidateSession}}>{{t
|
||||
'actions.deauthenticate'
|
||||
}}</dd.Interactive>
|
||||
<dd.Separator />
|
||||
|
||||
<dd.Title @text={{t 'actions.toggle-color-theme'}} />
|
||||
{{#each this.themes as |theme|}}
|
||||
<dd.Radio
|
||||
@value={{theme.value}}
|
||||
checked={{eq this.session.data.theme theme.value}}
|
||||
{{on 'change' (fn this.toggleTheme theme.value)}}
|
||||
>
|
||||
{{t (concat 'themes.' theme.label)}}
|
||||
</dd.Radio>
|
||||
{{/each}}
|
||||
</Hds::Dropdown>
|
||||
{{else}}
|
||||
<Hds::Dropdown
|
||||
@enableCollisionDetection={{true}}
|
||||
data-test-side-nav-user-dropdown
|
||||
as |dd|
|
||||
>
|
||||
<dd.ToggleIcon @icon='user' @text={{t 'titles.user-menu'}} />
|
||||
<dd.Interactive @route='account.change-password'>{{t
|
||||
'actions.change-password'
|
||||
}}</dd.Interactive>
|
||||
<dd.Separator />
|
||||
|
||||
<dd.Interactive {{on 'click' this.invalidateSession}}>{{t
|
||||
'actions.deauthenticate'
|
||||
}}</dd.Interactive>
|
||||
<dd.Separator />
|
||||
|
||||
<dd.Title @text={{t 'actions.toggle-color-theme'}} />
|
||||
{{#each this.themes as |theme|}}
|
||||
<dd.Radio
|
||||
@value={{theme.value}}
|
||||
checked={{eq this.session.data.theme theme.value}}
|
||||
{{on 'change' (fn this.toggleTheme theme.value)}}
|
||||
>
|
||||
{{t (concat 'themes.' theme.label)}}
|
||||
</dd.Radio>
|
||||
{{/each}}
|
||||
</Hds::Dropdown>
|
||||
{{/if}}
|
||||
</:actions>
|
||||
</Hds::SideNav::Header>
|
||||
</:header>
|
||||
|
||||
<:body>
|
||||
<Hds::SideNav::Portal::Target />
|
||||
</:body>
|
||||
|
||||
<:footer>
|
||||
<:globalActions>
|
||||
<ScopePicker />
|
||||
</:footer>
|
||||
</Hds::SideNav>
|
||||
</:globalActions>
|
||||
|
||||
<:utilityActions>
|
||||
{{#if (feature-flag 'dev-edition-toggle')}}
|
||||
<Hds::Dropdown @enableCollisionDetection={{true}} as |dd|>
|
||||
<dd.ToggleIcon
|
||||
@icon='layers'
|
||||
@text={{t
|
||||
'titles.feature-edition'
|
||||
edition=this.featureEdition.edition
|
||||
}}
|
||||
class='dropdown-toggle-color-override'
|
||||
data-test-dev-edition-toggle
|
||||
/>
|
||||
<dd.Title @text={{t 'actions.toggle-feature-edition'}} />
|
||||
{{#each this.featureEdition.editions as |edition|}}
|
||||
<dd.Radio
|
||||
@value={{edition}}
|
||||
checked={{eq this.featureEdition.edition edition}}
|
||||
{{on 'change' (fn this.toggleEdition edition)}}
|
||||
>
|
||||
{{edition}}
|
||||
</dd.Radio>
|
||||
{{/each}}
|
||||
<dd.Separator />
|
||||
|
||||
<dd.Title @text={{t 'actions.toggle-licensed-features'}} />
|
||||
{{#each this.featureEdition.licensedFeatures as |feature|}}
|
||||
<dd.Checkbox
|
||||
@value={{feature}}
|
||||
checked={{feature-flag feature}}
|
||||
{{on 'change' (fn this.toggleFeature feature)}}
|
||||
>
|
||||
{{feature}}
|
||||
</dd.Checkbox>
|
||||
{{/each}}
|
||||
<dd.Separator />
|
||||
|
||||
<dd.Title @text={{t 'actions.manage-db'}} />
|
||||
<dd.Interactive
|
||||
@icon='save'
|
||||
@isLoading={{(is-loading)}}
|
||||
{{on 'click' this.downloadDatabase}}
|
||||
>
|
||||
{{t 'actions.download-db'}}
|
||||
</dd.Interactive>
|
||||
<dd.Interactive @icon='trash' {{on 'click' this.clearDatabase}}>
|
||||
{{t 'actions.clear-db'}}
|
||||
</dd.Interactive>
|
||||
</Hds::Dropdown>
|
||||
{{/if}}
|
||||
|
||||
{{#if this.session.username}}
|
||||
<Hds::Dropdown
|
||||
@enableCollisionDetection={{true}}
|
||||
class='user-menu-dropdown'
|
||||
data-test-header-user-dropdown
|
||||
as |dd|
|
||||
>
|
||||
<dd.ToggleButton
|
||||
@icon='user'
|
||||
@text={{this.session.username}}
|
||||
{{hds-tooltip this.session.username}}
|
||||
class='user-menu-dropdown__toggle-button dropdown-toggle-color-override'
|
||||
/>
|
||||
<dd.Title @text={{t 'titles.authenticated'}} />
|
||||
<dd.Description @text={{this.session.username}} />
|
||||
<dd.Separator />
|
||||
|
||||
<dd.Interactive @route='account.change-password'>{{t
|
||||
'actions.change-password'
|
||||
}}</dd.Interactive>
|
||||
<dd.Separator />
|
||||
|
||||
<dd.Interactive {{on 'click' this.invalidateSession}}>{{t
|
||||
'actions.deauthenticate'
|
||||
}}</dd.Interactive>
|
||||
<dd.Separator />
|
||||
|
||||
<dd.Title @text={{t 'actions.toggle-color-theme'}} />
|
||||
{{#each this.themes as |theme|}}
|
||||
<dd.Radio
|
||||
@value={{theme.value}}
|
||||
checked={{eq this.session.data.theme theme.value}}
|
||||
{{on 'change' (fn this.toggleTheme theme.value)}}
|
||||
>
|
||||
{{t (concat 'themes.' theme.label)}}
|
||||
</dd.Radio>
|
||||
{{/each}}
|
||||
</Hds::Dropdown>
|
||||
{{else}}
|
||||
<Hds::Dropdown
|
||||
@enableCollisionDetection={{true}}
|
||||
data-test-header-user-dropdown
|
||||
as |dd|
|
||||
>
|
||||
<dd.ToggleIcon
|
||||
@icon='user'
|
||||
@text={{t 'titles.user-menu'}}
|
||||
class='dropdown-toggle-color-override'
|
||||
/>
|
||||
<dd.Interactive @route='account.change-password'>{{t
|
||||
'actions.change-password'
|
||||
}}</dd.Interactive>
|
||||
<dd.Separator />
|
||||
|
||||
<dd.Interactive {{on 'click' this.invalidateSession}}>{{t
|
||||
'actions.deauthenticate'
|
||||
}}</dd.Interactive>
|
||||
<dd.Separator />
|
||||
|
||||
<dd.Title @text={{t 'actions.toggle-color-theme'}} />
|
||||
{{#each this.themes as |theme|}}
|
||||
<dd.Radio
|
||||
@value={{theme.value}}
|
||||
checked={{eq this.session.data.theme theme.value}}
|
||||
{{on 'change' (fn this.toggleTheme theme.value)}}
|
||||
>
|
||||
{{t (concat 'themes.' theme.label)}}
|
||||
</dd.Radio>
|
||||
{{/each}}
|
||||
</Hds::Dropdown>
|
||||
{{/if}}
|
||||
</:utilityActions>
|
||||
|
||||
</Hds::AppHeader>
|
||||
</Frame.Header>
|
||||
|
||||
<Frame.Sidebar>
|
||||
<Hds::AppSideNav>
|
||||
<Hds::AppSideNav::Portal::Target />
|
||||
</Hds::AppSideNav>
|
||||
</Frame.Sidebar>
|
||||
|
||||
<Frame.Main>
|
||||
|
||||
@@ -5,11 +5,9 @@
|
||||
|
||||
{{page-title (t 'auth.titles.flow-success')}}
|
||||
|
||||
<main>
|
||||
<Rose::Layout::Centered>
|
||||
<Hds::Alert @type='page' @color='success' as |A|>
|
||||
<A.Title>{{t 'auth.titles.flow-success'}}</A.Title>
|
||||
<A.Description>{{t 'auth.descriptions.flow-success'}}</A.Description>
|
||||
</Hds::Alert>
|
||||
</Rose::Layout::Centered>
|
||||
</main>
|
||||
<Rose::Layout::Centered>
|
||||
<Hds::Alert @type='page' @color='success' as |A|>
|
||||
<A.Title>{{t 'auth.titles.flow-success'}}</A.Title>
|
||||
<A.Description>{{t 'auth.descriptions.flow-success'}}</A.Description>
|
||||
</Hds::Alert>
|
||||
</Rose::Layout::Centered>
|
||||
@@ -5,14 +5,12 @@
|
||||
|
||||
{{page-title (t 'auth.titles.flow-error')}}
|
||||
|
||||
<main>
|
||||
<Rose::Layout::Centered>
|
||||
<Hds::Alert @type='page' @color='critical' as |A|>
|
||||
<A.Title>{{t 'auth.titles.flow-error'}}</A.Title>
|
||||
<A.Description>
|
||||
{{t 'auth.descriptions.flow-error'}}
|
||||
<Hds::Copy::Snippet @textToCopy={{@model}} @color='secondary' />
|
||||
</A.Description>
|
||||
</Hds::Alert>
|
||||
</Rose::Layout::Centered>
|
||||
</main>
|
||||
<Rose::Layout::Centered>
|
||||
<Hds::Alert @type='page' @color='critical' as |A|>
|
||||
<A.Title>{{t 'auth.titles.flow-error'}}</A.Title>
|
||||
<A.Description>
|
||||
{{t 'auth.descriptions.flow-error'}}
|
||||
<Hds::Copy::Snippet @textToCopy={{@model}} @color='secondary' />
|
||||
</A.Description>
|
||||
</Hds::Alert>
|
||||
</Rose::Layout::Centered>
|
||||
@@ -33,7 +33,11 @@
|
||||
/>
|
||||
{{/if}}
|
||||
|
||||
<Hds::SideNav::Portal as |Nav|>
|
||||
<Hds::AppSideNav::Portal
|
||||
@ariaLabel='Primary'
|
||||
class='side-nav-dark-mode-overrides'
|
||||
as |Nav|
|
||||
>
|
||||
{{#if @model.isGlobal}}
|
||||
<Nav.Title>{{t 'titles.scope-level' scope=(t 'titles.global')}}</Nav.Title>
|
||||
|
||||
@@ -243,6 +247,5 @@
|
||||
@route='scopes.scope.edit'
|
||||
/>
|
||||
{{/if}}
|
||||
</Hds::SideNav::Portal>
|
||||
|
||||
</Hds::AppSideNav::Portal>
|
||||
{{outlet}}
|
||||
@@ -57,7 +57,7 @@ module('Acceptance | accounts | change password', function (hooks) {
|
||||
|
||||
await visit(urls.orgScope);
|
||||
|
||||
await click(commonSelectors.SIDEBAR_USER_DROPDOWN);
|
||||
await click(commonSelectors.HEADER_USER_DROPDOWN);
|
||||
await click(commonSelectors.HREF(urls.changePassword));
|
||||
|
||||
assert.strictEqual(currentURL(), urls.changePassword);
|
||||
@@ -150,7 +150,7 @@ module('Acceptance | accounts | change password', function (hooks) {
|
||||
});
|
||||
await visit(urls.orgScope);
|
||||
|
||||
await click(commonSelectors.SIDEBAR_USER_DROPDOWN);
|
||||
await click(commonSelectors.HEADER_USER_DROPDOWN);
|
||||
await click(commonSelectors.HREF(urls.changePassword));
|
||||
await fillIn(
|
||||
selectors.FIELD_CURRENT_PASSWORD,
|
||||
|
||||
@@ -379,7 +379,7 @@ module('Acceptance | authentication', function (hooks) {
|
||||
assert.notOk(getRootElement().classList.contains('rose-theme-dark'));
|
||||
|
||||
// open dropdown
|
||||
await click(commonSelectors.SIDEBAR_USER_DROPDOWN);
|
||||
await click(commonSelectors.HEADER_USER_DROPDOWN);
|
||||
|
||||
// toggle system default
|
||||
await click(commonSelectors.TOGGLE_THEME_DEFAULT);
|
||||
|
||||
@@ -133,12 +133,12 @@ module('Acceptance | scopes', function (hooks) {
|
||||
|
||||
assert.strictEqual(currentURL(), urls.globalScope);
|
||||
|
||||
await click(commonSelectors.SIDEBAR_SCOPE_DROPDOWN);
|
||||
await click(commonSelectors.SIDEBAR_SCOPE_LINK(urls.orgScope));
|
||||
await click(commonSelectors.HEADER_SCOPE_DROPDOWN);
|
||||
await click(commonSelectors.HEADER_SCOPE_LINK(urls.orgScope));
|
||||
assert.strictEqual(currentURL(), urls.orgScopes);
|
||||
|
||||
await click(commonSelectors.SIDEBAR_SCOPE_DROPDOWN);
|
||||
await click(commonSelectors.SIDEBAR_SCOPE_LINK(urls.org2Scope));
|
||||
await click(commonSelectors.HEADER_SCOPE_DROPDOWN);
|
||||
await click(commonSelectors.HEADER_SCOPE_LINK(urls.org2Scope));
|
||||
|
||||
assert.strictEqual(currentURL(), urls.org2Scopes);
|
||||
});
|
||||
@@ -167,8 +167,8 @@ module('Acceptance | scopes', function (hooks) {
|
||||
|
||||
assert.strictEqual(currentURL(), urls.projectTargets);
|
||||
|
||||
await click(commonSelectors.SIDEBAR_SCOPE_DROPDOWN);
|
||||
await click(commonSelectors.SIDEBAR_SCOPE_LINK(urls.project2Scope));
|
||||
await click(commonSelectors.HEADER_SCOPE_DROPDOWN);
|
||||
await click(commonSelectors.HEADER_SCOPE_LINK(urls.project2Scope));
|
||||
|
||||
assert.strictEqual(currentURL(), urls.project2Targets);
|
||||
});
|
||||
|
||||
@@ -44,21 +44,18 @@ export const PAGE_MESSAGE_LINK =
|
||||
export const HREF = (url) => `[href="${url}"]`;
|
||||
|
||||
export const SIDEBAR_NAV_LINK = (url) =>
|
||||
`.hds-side-nav__content a[href="${url}"]`;
|
||||
export const SIDEBAR_NAV_CONTENT = '.hds-side-nav__content';
|
||||
export const SIDEBAR_USER_DROPDOWN =
|
||||
'[data-test-side-nav-user-dropdown] button';
|
||||
export const SIDEBAR_SCOPE_DROPDOWN =
|
||||
'[data-test-side-nav-scope-dropdown] button';
|
||||
export const SIDEBAR_SCOPE_LINK = (url) =>
|
||||
`[data-test-side-nav-scope-dropdown] a[href="${url}"]`;
|
||||
`.hds-app-side-nav__list a[href="${url}"]`;
|
||||
export const SIDEBAR_NAV_CONTENT = '.hds-app-side-nav__list';
|
||||
export const HEADER_USER_DROPDOWN = '[data-test-header-user-dropdown] button';
|
||||
export const HEADER_SCOPE_DROPDOWN = '[data-test-header-scope-dropdown] button';
|
||||
export const HEADER_SCOPE_LINK = (url) =>
|
||||
`[data-test-header-scope-dropdown] a[href="${url}"]`;
|
||||
export const TOGGLE_THEME_DEFAULT =
|
||||
'[data-test-side-nav-user-dropdown] [value=system-default-theme]';
|
||||
'[data-test-header-user-dropdown] [value=system-default-theme]';
|
||||
export const TOGGLE_THEME_LIGHT =
|
||||
'[data-test-side-nav-user-dropdown] [value=light]';
|
||||
'[data-test-header-user-dropdown] [value=light]';
|
||||
export const TOGGLE_THEME_DARK =
|
||||
'[data-test-side-nav-user-dropdown] [value=dark]';
|
||||
|
||||
'[data-test-header-user-dropdown] [value=dark]';
|
||||
export const ALERT_TOAST = '[data-test-toast-notification]';
|
||||
export const ALERT_TOAST_BODY =
|
||||
'[data-test-toast-notification] .hds-alert__description';
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*/
|
||||
|
||||
import { module, test } from 'qunit';
|
||||
import { setupRenderingTest } from 'admin/tests/helpers';
|
||||
import { setupRenderingTest } from 'ember-qunit';
|
||||
import { render } from '@ember/test-helpers';
|
||||
import { hbs } from 'ember-cli-htmlbars';
|
||||
import { click } from '@ember/test-helpers';
|
||||
@@ -12,7 +12,7 @@ import { setupMirage } from 'admin/tests/helpers/mirage';
|
||||
import { setupIntl } from 'ember-intl/test-support';
|
||||
import { setupSqlite } from 'api/test-support/helpers/sqlite';
|
||||
|
||||
module('Integration | Component | scope-picker/index', function (hooks) {
|
||||
module('Integration | Component | scope-picker', function (hooks) {
|
||||
setupRenderingTest(hooks);
|
||||
setupMirage(hooks);
|
||||
setupIntl(hooks, 'en-us');
|
||||
@@ -27,7 +27,8 @@ module('Integration | Component | scope-picker/index', function (hooks) {
|
||||
const PROJECT_ADD_MORE_TEXT =
|
||||
'[data-test-scope-picker-project-and-more-text]';
|
||||
const PROJECT_LIST_COUNT = '[data-test-scope-picker-project-count]';
|
||||
const SELECTED_SCOPE_CHECK = (id) => `[href="/scopes/${id}"] .hds-icon-check`;
|
||||
const SELECTED_SCOPE_CHECK =
|
||||
'.hds-dropdown-list-item--variant-checkmark-selected .hds-text';
|
||||
|
||||
let global;
|
||||
let scopeService;
|
||||
@@ -195,7 +196,7 @@ module('Integration | Component | scope-picker/index', function (hooks) {
|
||||
|
||||
assert.dom(SCOPE_PICKER_DROPDOWN).hasText('Global');
|
||||
assert.dom(SCOPE_PICKER_DROPDOWN_ICON).hasClass('hds-icon-globe');
|
||||
assert.dom(SELECTED_SCOPE_CHECK('global')).isVisible();
|
||||
assert.dom(SELECTED_SCOPE_CHECK).hasText('Global');
|
||||
});
|
||||
|
||||
test('it renders correct dropdown button text and icon when selected scope is org type', async function (assert) {
|
||||
@@ -215,7 +216,7 @@ module('Integration | Component | scope-picker/index', function (hooks) {
|
||||
|
||||
assert.dom(SCOPE_PICKER_DROPDOWN).hasText(scopeService.org.displayName);
|
||||
assert.dom(SCOPE_PICKER_DROPDOWN_ICON).hasClass('hds-icon-org');
|
||||
assert.dom(SELECTED_SCOPE_CHECK(scopeService.org.id)).isVisible();
|
||||
assert.dom(SELECTED_SCOPE_CHECK).hasText(scopeService.org.displayName);
|
||||
});
|
||||
|
||||
test('it renders correct dropdown button text and icon when selected scope is project type', async function (assert) {
|
||||
@@ -229,7 +230,6 @@ module('Integration | Component | scope-picker/index', function (hooks) {
|
||||
});
|
||||
query.filters.scope_id = [{ equals: org.id }];
|
||||
const projects = await store.query('scope', { scope_id: org.id, query });
|
||||
scopeService.org = global;
|
||||
scopeService.project = projects[0];
|
||||
query.filters.scope_id = [{ equals: 'global' }];
|
||||
scopeService.orgsList = await store.query('scope', {
|
||||
@@ -243,6 +243,6 @@ module('Integration | Component | scope-picker/index', function (hooks) {
|
||||
|
||||
assert.dom(SCOPE_PICKER_DROPDOWN).hasText(scopeService.project.displayName);
|
||||
assert.dom(SCOPE_PICKER_DROPDOWN_ICON).hasClass('hds-icon-grid');
|
||||
assert.dom(SELECTED_SCOPE_CHECK(scopeService.project.id)).isVisible();
|
||||
assert.dom(SELECTED_SCOPE_CHECK).hasText(scopeService.project.displayName);
|
||||
});
|
||||
});
|
||||
@@ -1,39 +0,0 @@
|
||||
/**
|
||||
* Copyright IBM Corp. 2021, 2026
|
||||
* SPDX-License-Identifier: BUSL-1.1
|
||||
*/
|
||||
|
||||
import { module, test } from 'qunit';
|
||||
import { setupTest } from 'ember-qunit';
|
||||
import { paramValueFinder } from 'admin/utils/param-value-finder';
|
||||
|
||||
module('Unit | Utility | param-value-finder', function (hooks) {
|
||||
setupTest(hooks);
|
||||
|
||||
let router;
|
||||
|
||||
hooks.beforeEach(function () {
|
||||
router = this.owner.lookup('service:router');
|
||||
});
|
||||
|
||||
test('returns empty array when null or empty routeInfo object is used', function (assert) {
|
||||
let result = paramValueFinder('scopes', null);
|
||||
|
||||
assert.deepEqual(result, []);
|
||||
|
||||
result = paramValueFinder('scopes', {});
|
||||
|
||||
assert.deepEqual(result, []);
|
||||
});
|
||||
|
||||
test('returns correct array when routeInfo object is used', function (assert) {
|
||||
let routeInfo = router.recognize('/scopes');
|
||||
let result = paramValueFinder('scopes', routeInfo.parent);
|
||||
|
||||
assert.deepEqual(result, []);
|
||||
|
||||
routeInfo = router.recognize('/scopes/global/auth-methods');
|
||||
result = paramValueFinder('scopes', routeInfo.parent);
|
||||
assert.deepEqual(result, ['global']);
|
||||
});
|
||||
});
|
||||
@@ -8,6 +8,8 @@ import { service } from '@ember/service';
|
||||
import { getOwner } from '@ember/application';
|
||||
import { action } from '@ember/object';
|
||||
import { tracked } from '@glimmer/tracking';
|
||||
import { defaultValidator } from 'ember-a11y-refocus';
|
||||
import { paramValueFinder } from 'core/utils/param-value-finder';
|
||||
|
||||
export default class ApplicationController extends Controller {
|
||||
// =services
|
||||
@@ -17,6 +19,9 @@ export default class ApplicationController extends Controller {
|
||||
@service ipc;
|
||||
@service session;
|
||||
@service('browser/window') window;
|
||||
@service router;
|
||||
@service scope;
|
||||
@service intl;
|
||||
|
||||
// =attributes
|
||||
|
||||
@@ -34,6 +39,30 @@ export default class ApplicationController extends Controller {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns display name and icon for current scope.
|
||||
* @type {object}
|
||||
*/
|
||||
get currentScope() {
|
||||
if (this.scope.org.isOrg) {
|
||||
return { name: this.scope.org.displayName, icon: 'org' };
|
||||
} else {
|
||||
return { name: this.intl.t('titles.global'), icon: 'globe' };
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Shows side navigation only for routes nested under a scope
|
||||
* and if user has been authenticated.
|
||||
* @type {boolean}
|
||||
*/
|
||||
get showSideNav() {
|
||||
return (
|
||||
this.router.currentRouteName.startsWith('scopes.scope') &&
|
||||
this.session.isAuthenticated
|
||||
);
|
||||
}
|
||||
|
||||
// =actions
|
||||
|
||||
/**
|
||||
@@ -128,4 +157,29 @@ export default class ApplicationController extends Controller {
|
||||
super.willDestroy(...arguments);
|
||||
this.removeOnAppQuitListener?.();
|
||||
}
|
||||
|
||||
/**
|
||||
* Add custom route change validation to prevent refocus when
|
||||
* user is attempting to search, filter, or sort.
|
||||
* @param {object} transition
|
||||
* @returns {boolean}
|
||||
*/
|
||||
customRouteChangeValidator(transition) {
|
||||
if (!transition.to || !transition.from) {
|
||||
return true;
|
||||
}
|
||||
if (transition.to.name === transition.from.name) {
|
||||
const toParams = paramValueFinder(
|
||||
transition.to.localName,
|
||||
transition.to.parent,
|
||||
);
|
||||
const fromParams = paramValueFinder(
|
||||
transition.from.localName,
|
||||
transition.from.parent,
|
||||
);
|
||||
// Return false to prevent refocus when routes have equivalent dynamic segments (params).
|
||||
return JSON.stringify(toParams) !== JSON.stringify(fromParams);
|
||||
}
|
||||
return defaultValidator(transition);
|
||||
}
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
/**
|
||||
* Copyright IBM Corp. 2021, 2026
|
||||
* SPDX-License-Identifier: BUSL-1.1
|
||||
*/
|
||||
|
||||
import Controller from '@ember/controller';
|
||||
import { service } from '@ember/service';
|
||||
|
||||
export default class ScopesScopeController extends Controller {
|
||||
// =services
|
||||
|
||||
@service session;
|
||||
}
|
||||
@@ -53,12 +53,12 @@ export default class ScopesScopeRoute extends Route {
|
||||
*/
|
||||
async afterModel(model) {
|
||||
// First, load orgs and, if necessary, projects
|
||||
let orgs, projects;
|
||||
let orgs;
|
||||
orgs = await this.store
|
||||
.query('scope', { scope_id: 'global' })
|
||||
.catch(() => new TrackedArray([]));
|
||||
if (model.isProject) {
|
||||
projects = await this.store.query('scope', { scope_id: model.scopeID });
|
||||
await this.store.query('scope', { scope_id: model.scopeID });
|
||||
}
|
||||
// Then pull out the "selected" scopes, if relevant
|
||||
let selectedOrg, selectedProject;
|
||||
@@ -70,16 +70,6 @@ export default class ScopesScopeRoute extends Route {
|
||||
// Update the scope service with the current scope(s);
|
||||
this.scope.org = selectedOrg;
|
||||
this.scope.project = selectedProject;
|
||||
this.scopes = { orgs, projects, selectedOrg, selectedProject };
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds the scopes hash to the controller context (see `afterModel`).
|
||||
* @param {Controller} controller
|
||||
*/
|
||||
setupController(controller) {
|
||||
super.setupController(...arguments);
|
||||
const scopes = this.scopes;
|
||||
controller.setProperties({ scopes });
|
||||
this.scope.orgsList = orgs;
|
||||
}
|
||||
}
|
||||
+42
-113
@@ -24,34 +24,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This section enables scrolling within the sidebar columns separately,
|
||||
* rather than the whole viewport. This ensures the sidebar and application
|
||||
* header remain visible when scrolling.
|
||||
*/
|
||||
.rose-layout-global {
|
||||
max-height: 100vh;
|
||||
|
||||
.rose-layout-global-body {
|
||||
max-height: 100vh;
|
||||
overflow: auto;
|
||||
|
||||
main {
|
||||
/** This overrides the main defined within Rose.
|
||||
* HDS has this set to 1.5rem top/bottom 3rem left/right. HDS assumes the usage of breadcrumbs
|
||||
* but the DC have no breadcrumbs, so we will keep it at 3rem all around.
|
||||
*/
|
||||
padding: 3rem;
|
||||
flex-grow: 1;
|
||||
}
|
||||
}
|
||||
|
||||
.rose-layout-sidebar-sidebar,
|
||||
.rose-layout-sidebar-body {
|
||||
overflow-y: auto;
|
||||
}
|
||||
}
|
||||
|
||||
.rose-nav-sidebar {
|
||||
margin-top: sizing.rems(xxl);
|
||||
|
||||
@@ -74,95 +46,11 @@
|
||||
}
|
||||
}
|
||||
|
||||
.rose-header {
|
||||
-webkit-app-region: drag;
|
||||
min-height: sizing.rems(l) * 2;
|
||||
position: relative;
|
||||
-webkit-user-select: none;
|
||||
|
||||
.rose-header-brand,
|
||||
.rose-header-nav,
|
||||
.rose-header-utilities button {
|
||||
-webkit-app-region: no-drag;
|
||||
}
|
||||
|
||||
&.header-cushion {
|
||||
padding-left: sizing.rems(l) * 3;
|
||||
}
|
||||
|
||||
.button-window-minimize,
|
||||
.button-window-fullscreen,
|
||||
.button-window-close {
|
||||
background: transparent;
|
||||
border: transparent;
|
||||
color: var(--white);
|
||||
margin: sizing.rems(xs);
|
||||
}
|
||||
|
||||
.button-window-close {
|
||||
&:hover {
|
||||
background: var(--failure);
|
||||
}
|
||||
}
|
||||
|
||||
.button-window-minimize,
|
||||
.button-window-fullscreen {
|
||||
&:hover {
|
||||
background: var(--white);
|
||||
color: var(--black);
|
||||
}
|
||||
}
|
||||
|
||||
.logotype {
|
||||
display: none;
|
||||
}
|
||||
|
||||
&.loading {
|
||||
&::after {
|
||||
animation: gradient 1s linear infinite;
|
||||
background: repeating-linear-gradient(
|
||||
to right,
|
||||
var(--subtle),
|
||||
var(--subtle),
|
||||
var(--info),
|
||||
var(--subtle),
|
||||
var(--subtle)
|
||||
);
|
||||
background-position: -100% 0;
|
||||
background-size: 200% auto;
|
||||
content: ' ';
|
||||
height: 3px;
|
||||
left: 0;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 100%;
|
||||
|
||||
@keyframes gradient {
|
||||
0% {
|
||||
background-position: -100% 0;
|
||||
}
|
||||
|
||||
100% {
|
||||
background-position: -200% 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[class*='session-status-'] {
|
||||
color: var(--ui-gray-subtler-2);
|
||||
}
|
||||
|
||||
.nowrap {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.branded-card {
|
||||
border: 1px solid var(--ui-border-subtler-1);
|
||||
border-radius: var(--token-border-radius-x-small);
|
||||
margin: 0 auto;
|
||||
margin-top: sizing.rems(l) * 1.25;
|
||||
margin-top: sizing.rems(xl) * 1.5;
|
||||
padding: (sizing.rems(l) * 4) (sizing.rems(l) * 3) (sizing.rems(l) * 2)
|
||||
(sizing.rems(l) * 3);
|
||||
position: relative;
|
||||
@@ -424,3 +312,44 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.app-header {
|
||||
-webkit-app-region: drag;
|
||||
user-select: none;
|
||||
|
||||
&.header-cushion {
|
||||
padding-left: sizing.rems(l) * 4;
|
||||
}
|
||||
|
||||
&__logo,
|
||||
&__global-actions,
|
||||
&__utility-actions,
|
||||
.hds-app-header__menu-button {
|
||||
-webkit-app-region: no-drag;
|
||||
}
|
||||
|
||||
.hds-app-header__utility-actions {
|
||||
.button-window-minimize,
|
||||
.button-window-fullscreen,
|
||||
.button-window-close {
|
||||
background: transparent;
|
||||
border: transparent;
|
||||
color: var(--white);
|
||||
margin: sizing.rems(xs);
|
||||
}
|
||||
|
||||
.button-window-close {
|
||||
&:hover {
|
||||
background: var(--failure);
|
||||
}
|
||||
}
|
||||
|
||||
.button-window-minimize,
|
||||
.button-window-fullscreen {
|
||||
&:hover {
|
||||
background: var(--white);
|
||||
color: var(--black);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,55 +5,76 @@
|
||||
|
||||
{{page-title (app-name)}}
|
||||
|
||||
<Rose::Layout::Global as |layout|>
|
||||
|
||||
<layout.header>
|
||||
<Rose::Header
|
||||
class='{{if (is-loading) " loading"}}
|
||||
{{if this.hasMacOSChrome " header-cushion"}}'
|
||||
as |header|
|
||||
<Hds::AppFrame @hasHeader={{true}} @hasSidebar={{this.showSideNav}} as |Frame|>
|
||||
<Frame.Header>
|
||||
<Hds::AppHeader
|
||||
class='app-header
|
||||
{{if this.hasMacOSChrome " header-cushion"}}
|
||||
app-header-dark-mode-overrides'
|
||||
@a11yRefocusRouteChangeValidator={{this.customRouteChangeValidator}}
|
||||
>
|
||||
<header.brand @logo='logo-app' @text={{(app-name)}} />
|
||||
<:logo>
|
||||
<Hds::AppHeader::HomeLink
|
||||
@icon='boundary'
|
||||
@color='var(--token-color-boundary-brand)'
|
||||
@text={{(app-name)}}
|
||||
@route='index'
|
||||
class='app-header__logo home-link-color-override'
|
||||
/>
|
||||
</:logo>
|
||||
|
||||
<header.nav>
|
||||
<div id='header-nav'></div>
|
||||
</header.nav>
|
||||
<:globalActions>
|
||||
{{#if this.session.isAuthenticated}}
|
||||
<Hds::Dropdown
|
||||
class='app-header__global-actions'
|
||||
@enableCollisionDetection={{true}}
|
||||
@listPosition='bottom-left'
|
||||
@height='20rem'
|
||||
data-test-header-scope-dropdown
|
||||
as |D|
|
||||
>
|
||||
{{#let this.currentScope as |scope|}}
|
||||
<D.ToggleButton
|
||||
@text={{scope.name}}
|
||||
@icon={{scope.icon}}
|
||||
class='dropdown-toggle-color-override'
|
||||
/>
|
||||
{{/let}}
|
||||
|
||||
<header.utilities>
|
||||
{{#if this.showWindowActions}}
|
||||
<Hds::Button
|
||||
{{on 'click' this.close}}
|
||||
class='button-window-close'
|
||||
title={{t 'actions.close'}}
|
||||
@text={{t 'actions.close'}}
|
||||
@icon='x'
|
||||
@isIconOnly={{true}}
|
||||
/>
|
||||
<Hds::Button
|
||||
{{on 'click' this.toggleFullScreen}}
|
||||
class='button-window-fullscreen'
|
||||
title={{t 'actions.fullscreen'}}
|
||||
@text={{t 'actions.fullscreen'}}
|
||||
@icon='square'
|
||||
@isIconOnly={{true}}
|
||||
@color='secondary'
|
||||
/>
|
||||
<Hds::Button
|
||||
{{on 'click' this.minimize}}
|
||||
class='button-window-minimize'
|
||||
title={{t 'actions.minimize'}}
|
||||
@text={{t 'actions.minimize'}}
|
||||
@icon='minus'
|
||||
@isIconOnly={{true}}
|
||||
@color='secondary'
|
||||
/>
|
||||
<D.Checkmark
|
||||
@icon='globe'
|
||||
@route='scopes.scope'
|
||||
@model='global'
|
||||
@selected={{this.scope.org.isGlobal}}
|
||||
>
|
||||
{{t 'titles.global'}}
|
||||
</D.Checkmark>
|
||||
|
||||
{{#if this.scope.orgsList}}
|
||||
<D.Separator />
|
||||
{{/if}}
|
||||
|
||||
{{#each this.scope.orgsList as |org|}}
|
||||
<D.Checkmark
|
||||
@icon='org'
|
||||
@route='scopes.scope'
|
||||
@model={{org.id}}
|
||||
@selected={{eq this.scope.org.id org.id}}
|
||||
>
|
||||
{{org.displayName}}
|
||||
</D.Checkmark>
|
||||
{{/each}}
|
||||
</Hds::Dropdown>
|
||||
{{/if}}
|
||||
</:globalActions>
|
||||
|
||||
<:utilityActions>
|
||||
{{#if this.session.username}}
|
||||
<Hds::Dropdown class='header-dropdown-button-override' as |dd|>
|
||||
<Hds::Dropdown class='app-header__utility-actions' as |dd|>
|
||||
<dd.ToggleButton
|
||||
@icon='user-circle'
|
||||
@text={{this.session.username}}
|
||||
class='dropdown-toggle-color-override'
|
||||
/>
|
||||
<dd.Interactive
|
||||
data-test-nav-signout-btn
|
||||
@@ -62,9 +83,13 @@
|
||||
{{t 'actions.deauthenticate'}}
|
||||
</dd.Interactive>
|
||||
</Hds::Dropdown>
|
||||
{{else}}
|
||||
<Hds::Dropdown class='header-dropdown-button-override' as |dd|>
|
||||
<dd.ToggleIcon @icon='user-circle' @text={{t 'titles.user-menu'}} />
|
||||
{{else if this.session.isAuthenticated}}
|
||||
<Hds::Dropdown as |dd|>
|
||||
<dd.ToggleIcon
|
||||
@icon='user-circle'
|
||||
@text={{t 'titles.user-menu'}}
|
||||
class='dropdown-toggle-color-override'
|
||||
/>
|
||||
<dd.Interactive
|
||||
data-test-nav-signout-btn
|
||||
{{on 'click' this.showModalOrLogout}}
|
||||
@@ -74,15 +99,49 @@
|
||||
</Hds::Dropdown>
|
||||
{{/if}}
|
||||
|
||||
</header.utilities>
|
||||
</Rose::Header>
|
||||
</layout.header>
|
||||
{{#if this.showWindowActions}}
|
||||
<Hds::Button
|
||||
{{on 'click' this.minimize}}
|
||||
class='app-header__utility-actions button-window-minimize'
|
||||
title={{t 'actions.minimize'}}
|
||||
@text={{t 'actions.minimize'}}
|
||||
@icon='minus'
|
||||
@isIconOnly={{true}}
|
||||
@color='secondary'
|
||||
/>
|
||||
<Hds::Button
|
||||
{{on 'click' this.toggleFullScreen}}
|
||||
class='app-header__utility-actions button-window-fullscreen'
|
||||
title={{t 'actions.fullscreen'}}
|
||||
@text={{t 'actions.fullscreen'}}
|
||||
@icon='square'
|
||||
@isIconOnly={{true}}
|
||||
@color='secondary'
|
||||
/>
|
||||
<Hds::Button
|
||||
{{on 'click' this.close}}
|
||||
class='app-header__utility-actions button-window-close'
|
||||
title={{t 'actions.close'}}
|
||||
@text={{t 'actions.close'}}
|
||||
@icon='x'
|
||||
@isIconOnly={{true}}
|
||||
/>
|
||||
{{/if}}
|
||||
</:utilityActions>
|
||||
|
||||
<layout.body>
|
||||
</Hds::AppHeader>
|
||||
</Frame.Header>
|
||||
|
||||
<Frame.Sidebar>
|
||||
<Hds::AppSideNav>
|
||||
<Hds::AppSideNav::Portal::Target />
|
||||
</Hds::AppSideNav>
|
||||
</Frame.Sidebar>
|
||||
|
||||
<Frame.Main>
|
||||
{{outlet}}
|
||||
</layout.body>
|
||||
|
||||
</Rose::Layout::Global>
|
||||
</Frame.Main>
|
||||
</Hds::AppFrame>
|
||||
|
||||
{{#if this.flashMessages.queue}}
|
||||
<div class='ember-notify-cn'>
|
||||
|
||||
@@ -3,41 +3,39 @@
|
||||
SPDX-License-Identifier: BUSL-1.1
|
||||
}}
|
||||
|
||||
<main>
|
||||
<BrandedCard
|
||||
@title={{t 'titles.welcome-to-boundary'}}
|
||||
@description={{t 'descriptions.cluster-url-initialization'}}
|
||||
<BrandedCard
|
||||
@title={{t 'titles.welcome-to-boundary'}}
|
||||
@description={{t 'descriptions.cluster-url-initialization'}}
|
||||
>
|
||||
<Rose::Form
|
||||
class='full-width'
|
||||
@onSubmit={{fn this.setClusterUrl this.clusterUrl}}
|
||||
@cancel={{false}}
|
||||
@disabled={{(is-loading)}}
|
||||
as |form|
|
||||
>
|
||||
<Rose::Form
|
||||
class='full-width'
|
||||
@onSubmit={{fn this.setClusterUrl this.clusterUrl}}
|
||||
@cancel={{false}}
|
||||
@disabled={{(is-loading)}}
|
||||
as |form|
|
||||
|
||||
{{! template-lint-disable no-autofocus-attribute }}
|
||||
<Hds::Form::TextInput::Field
|
||||
name='host'
|
||||
@value={{this.clusterUrl}}
|
||||
autofocus
|
||||
{{on 'input' (set-from-event this 'clusterUrl')}}
|
||||
as |F|
|
||||
>
|
||||
<F.Label>{{t 'form.cluster-url.label'}}</F.Label>
|
||||
<F.HelperText>{{t 'form.cluster-url.description'}}</F.HelperText>
|
||||
</Hds::Form::TextInput::Field>
|
||||
|
||||
{{! template-lint-disable no-autofocus-attribute }}
|
||||
<Hds::Form::TextInput::Field
|
||||
name='host'
|
||||
@value={{this.clusterUrl}}
|
||||
autofocus
|
||||
{{on 'input' (set-from-event this 'clusterUrl')}}
|
||||
as |F|
|
||||
>
|
||||
<F.Label>{{t 'form.cluster-url.label'}}</F.Label>
|
||||
<F.HelperText>{{t 'form.cluster-url.description'}}</F.HelperText>
|
||||
</Hds::Form::TextInput::Field>
|
||||
|
||||
<form.actions>
|
||||
<:actions>
|
||||
<Hds::Button
|
||||
@text={{t 'actions.submit'}}
|
||||
@isFullWidth={{true}}
|
||||
disabled={{form.disabled}}
|
||||
type='submit'
|
||||
/>
|
||||
</:actions>
|
||||
</form.actions>
|
||||
</Rose::Form>
|
||||
</BrandedCard>
|
||||
</main>
|
||||
<form.actions>
|
||||
<:actions>
|
||||
<Hds::Button
|
||||
@text={{t 'actions.submit'}}
|
||||
@isFullWidth={{true}}
|
||||
disabled={{form.disabled}}
|
||||
type='submit'
|
||||
/>
|
||||
</:actions>
|
||||
</form.actions>
|
||||
</Rose::Form>
|
||||
</BrandedCard>
|
||||
@@ -5,18 +5,14 @@
|
||||
|
||||
{{page-title (t 'errors.generic.title')}}
|
||||
|
||||
<main>
|
||||
<Rose::Layout::Centered>
|
||||
<Error::Message @docLink={{doc-url 'support-page'}} />
|
||||
</Rose::Layout::Centered>
|
||||
|
||||
<Rose::Layout::Centered>
|
||||
<Error::Message @docLink={{doc-url 'support-page'}} />
|
||||
</Rose::Layout::Centered>
|
||||
|
||||
<Rose::Layout::Centered>
|
||||
<Hds::Button
|
||||
@color='primary'
|
||||
@text={{t 'actions.disconnect'}}
|
||||
{{on 'click' this.appUtilities.disconnect}}
|
||||
/>
|
||||
</Rose::Layout::Centered>
|
||||
|
||||
</main>
|
||||
<Rose::Layout::Centered>
|
||||
<Hds::Button
|
||||
@color='primary'
|
||||
@text={{t 'actions.disconnect'}}
|
||||
{{on 'click' this.appUtilities.disconnect}}
|
||||
/>
|
||||
</Rose::Layout::Centered>
|
||||
@@ -3,31 +3,4 @@
|
||||
SPDX-License-Identifier: BUSL-1.1
|
||||
}}
|
||||
|
||||
{{outlet}}
|
||||
|
||||
{{#if this.session.isAuthenticated}}
|
||||
<EmberWormhole @to='header-nav'>
|
||||
<Hds::Dropdown
|
||||
class='header-dropdown-button-override'
|
||||
@enableCollisionDetection={{true}}
|
||||
as |dd|
|
||||
>
|
||||
<dd.ToggleButton
|
||||
@text={{this.scopes.selectedOrg.displayName}}
|
||||
@icon={{if this.scopes.selectedOrg.isGlobal 'globe' 'org'}}
|
||||
@color='secondary'
|
||||
/>
|
||||
<dd.Interactive @route='scopes.scope' @model='global'>
|
||||
{{t 'titles.global'}}
|
||||
</dd.Interactive>
|
||||
{{#if this.scopes.orgs.length}}
|
||||
<dd.Separator />
|
||||
{{/if}}
|
||||
{{#each this.scopes.orgs as |scope|}}
|
||||
<dd.Interactive @route='scopes.scope' @model={{scope.id}}>
|
||||
{{scope.displayName}}
|
||||
</dd.Interactive>
|
||||
{{/each}}
|
||||
</Hds::Dropdown>
|
||||
</EmberWormhole>
|
||||
{{/if}}
|
||||
{{outlet}}
|
||||
@@ -5,76 +5,72 @@
|
||||
|
||||
{{page-title (t 'actions.authenticate')}}
|
||||
|
||||
<main>
|
||||
{{#if this.isOIDCRoute}}
|
||||
{{outlet}}
|
||||
{{else}}
|
||||
<BrandedCard
|
||||
@title={{t 'actions.authenticate'}}
|
||||
@description={{t
|
||||
'auth.descriptions.authenticating-with-org'
|
||||
name=@model.scope.displayName
|
||||
}}
|
||||
>
|
||||
{{#if this.isOIDCRoute}}
|
||||
{{outlet}}
|
||||
{{else}}
|
||||
<BrandedCard
|
||||
@title={{t 'actions.authenticate'}}
|
||||
@description={{t
|
||||
'auth.descriptions.authenticating-with-org'
|
||||
name=@model.scope.displayName
|
||||
}}
|
||||
>
|
||||
|
||||
<Hds::Dropdown @listPosition='bottom-left' as |dd|>
|
||||
<dd.ToggleButton
|
||||
@text={{t 'actions.choose-different-org'}}
|
||||
@icon='org'
|
||||
@color='secondary'
|
||||
/>
|
||||
<dd.Interactive {{on 'click' (fn this.selectScope 'global' dd.close)}}>
|
||||
{{t 'titles.global'}}
|
||||
<Hds::Dropdown @listPosition='bottom-left' as |dd|>
|
||||
<dd.ToggleButton
|
||||
@text={{t 'actions.choose-different-org'}}
|
||||
@icon='org'
|
||||
@color='secondary'
|
||||
/>
|
||||
<dd.Interactive {{on 'click' (fn this.selectScope 'global' dd.close)}}>
|
||||
{{t 'titles.global'}}
|
||||
</dd.Interactive>
|
||||
{{#each this.sortedScopes as |scope|}}
|
||||
<dd.Interactive {{on 'click' (fn this.selectScope scope.id dd.close)}}>
|
||||
{{scope.displayName}}
|
||||
</dd.Interactive>
|
||||
{{#each this.sortedScopes as |scope|}}
|
||||
<dd.Interactive
|
||||
{{on 'click' (fn this.selectScope scope.id dd.close)}}
|
||||
>
|
||||
{{scope.displayName}}
|
||||
</dd.Interactive>
|
||||
{{/each}}
|
||||
</Hds::Dropdown>
|
||||
{{/each}}
|
||||
</Hds::Dropdown>
|
||||
|
||||
<Rose::Nav::Tabs as |nav|>
|
||||
{{#each @model.authMethods as |authMethod|}}
|
||||
<nav.link
|
||||
@route='scopes.scope.authenticate.method'
|
||||
@model={{authMethod.id}}
|
||||
>
|
||||
{{#if authMethod.name}}
|
||||
{{authMethod.name}}
|
||||
{{else}}
|
||||
{{t (concat 'resources.auth-method.types.' authMethod.type)}}
|
||||
{{/if}}
|
||||
</nav.link>
|
||||
{{/each}}
|
||||
</Rose::Nav::Tabs>
|
||||
<Rose::Nav::Tabs as |nav|>
|
||||
{{#each @model.authMethods as |authMethod|}}
|
||||
<nav.link
|
||||
@route='scopes.scope.authenticate.method'
|
||||
@model={{authMethod.id}}
|
||||
>
|
||||
{{#if authMethod.name}}
|
||||
{{authMethod.name}}
|
||||
{{else}}
|
||||
{{t (concat 'resources.auth-method.types.' authMethod.type)}}
|
||||
{{/if}}
|
||||
</nav.link>
|
||||
{{/each}}
|
||||
</Rose::Nav::Tabs>
|
||||
|
||||
{{#if @model.authMethods}}
|
||||
{{outlet}}
|
||||
{{else}}
|
||||
<Rose::Layout::Centered>
|
||||
<Hds::ApplicationState data-test-no-auth-methods as |A|>
|
||||
<A.Header
|
||||
@icon='alert-circle'
|
||||
@title={{t 'resources.auth-method.messages.none.title'}}
|
||||
/>
|
||||
<A.Body
|
||||
@text={{t 'resources.auth-method.messages.none.description'}}
|
||||
/>
|
||||
</Hds::ApplicationState>
|
||||
</Rose::Layout::Centered>
|
||||
{{/if}}
|
||||
<Hds::Text::Body @tag='p' class='change-origin'>
|
||||
{{t 'cluster-url.connected-to'}}:
|
||||
<Hds::Text::Code>
|
||||
{{this.clusterUrl}}
|
||||
</Hds::Text::Code>
|
||||
<br />
|
||||
<LinkTo @route='cluster-url'>
|
||||
{{t 'actions.change-cluster-url'}}
|
||||
</LinkTo>
|
||||
</Hds::Text::Body>
|
||||
</BrandedCard>
|
||||
{{/if}}
|
||||
</main>
|
||||
{{#if @model.authMethods}}
|
||||
{{outlet}}
|
||||
{{else}}
|
||||
<Rose::Layout::Centered>
|
||||
<Hds::ApplicationState data-test-no-auth-methods as |A|>
|
||||
<A.Header
|
||||
@icon='alert-circle'
|
||||
@title={{t 'resources.auth-method.messages.none.title'}}
|
||||
/>
|
||||
<A.Body
|
||||
@text={{t 'resources.auth-method.messages.none.description'}}
|
||||
/>
|
||||
</Hds::ApplicationState>
|
||||
</Rose::Layout::Centered>
|
||||
{{/if}}
|
||||
<Hds::Text::Body @tag='p' class='change-origin'>
|
||||
{{t 'cluster-url.connected-to'}}:
|
||||
<Hds::Text::Code>
|
||||
{{this.clusterUrl}}
|
||||
</Hds::Text::Code>
|
||||
<br />
|
||||
<LinkTo @route='cluster-url'>
|
||||
{{t 'actions.change-cluster-url'}}
|
||||
</LinkTo>
|
||||
</Hds::Text::Body>
|
||||
</BrandedCard>
|
||||
{{/if}}
|
||||
@@ -3,28 +3,26 @@
|
||||
SPDX-License-Identifier: BUSL-1.1
|
||||
}}
|
||||
|
||||
<Rose::Layout::Sidebar as |sidebarLayout|>
|
||||
<sidebarLayout.sidebar>
|
||||
<Rose::Nav::Sidebar as |nav|>
|
||||
<nav.link @route='scopes.scope.projects.targets'>
|
||||
<Hds::Icon @name='crosshair' @isInline={{true}} />
|
||||
{{t 'resources.target.title_plural'}}
|
||||
</nav.link>
|
||||
<Hds::AppSideNav::Portal
|
||||
@ariaLabel='Primary'
|
||||
class='side-nav-dark-mode-overrides'
|
||||
as |Nav|
|
||||
>
|
||||
<Nav.Link
|
||||
@icon='crosshair'
|
||||
@text={{t 'resources.target.title_plural'}}
|
||||
@route='scopes.scope.projects.targets'
|
||||
/>
|
||||
<Nav.Link
|
||||
@icon='entry-point'
|
||||
@text={{t 'resources.session.title_plural'}}
|
||||
@route='scopes.scope.projects.sessions'
|
||||
/>
|
||||
<Nav.Link
|
||||
@icon='settings'
|
||||
@text={{t 'titles.settings'}}
|
||||
@route='scopes.scope.projects.settings'
|
||||
/>
|
||||
</Hds::AppSideNav::Portal>
|
||||
|
||||
<nav.link @route='scopes.scope.projects.sessions'>
|
||||
<Hds::Icon @name='entry-point' @isInline={{true}} />
|
||||
{{t 'resources.session.title_plural'}}
|
||||
</nav.link>
|
||||
<nav.link @route='scopes.scope.projects.settings'>
|
||||
<Hds::Icon @name='settings' @isInline={{true}} />
|
||||
{{t 'titles.settings'}}
|
||||
</nav.link>
|
||||
</Rose::Nav::Sidebar>
|
||||
</sidebarLayout.sidebar>
|
||||
|
||||
<sidebarLayout.body>
|
||||
<main>
|
||||
{{outlet}}
|
||||
</main>
|
||||
</sidebarLayout.body>
|
||||
</Rose::Layout::Sidebar>
|
||||
{{outlet}}
|
||||
@@ -46,6 +46,7 @@
|
||||
"@xterm/addon-canvas": "^0.7.0",
|
||||
"@xterm/addon-fit": "^0.10.0",
|
||||
"@xterm/xterm": "^5.5.0",
|
||||
"ember-a11y-refocus": "^5.0.0",
|
||||
"ember-inflector": "^6.0.0",
|
||||
"ember-named-blocks-polyfill": "^0.2.5",
|
||||
"lodash": "^4.17.23",
|
||||
|
||||
@@ -67,7 +67,7 @@ module('Acceptance | Application', function (hooks) {
|
||||
stubs.ipcService.withArgs('hasMacOSChrome').returns(true);
|
||||
await visit(urls.clusterUrl);
|
||||
assert.ok(
|
||||
find('.rose-header.header-cushion'),
|
||||
find('.app-header.header-cushion'),
|
||||
'Adds header padding around native window actions',
|
||||
);
|
||||
});
|
||||
@@ -77,7 +77,7 @@ module('Acceptance | Application', function (hooks) {
|
||||
stubs.ipcService.withArgs('hasMacOSChrome').returns(false);
|
||||
await visit(urls.clusterUrl);
|
||||
assert.notOk(
|
||||
find('.rose-header.header-cushion'),
|
||||
find('.app-header.header-cushion'),
|
||||
'Does not add header padding around native window actions',
|
||||
);
|
||||
});
|
||||
|
||||
@@ -69,8 +69,7 @@ module('Acceptance | authentication', function (hooks) {
|
||||
const MODAL_CLOSE_SESSIONS = '[data-test-close-sessions-modal]';
|
||||
const MODAL_CONFIRM_BTN = '.hds-modal__footer .hds-button--color-primary';
|
||||
const MODAL_CANCEL_BTN = '.hds-modal__footer .hds-button--color-secondary';
|
||||
const HEADER_DROPDOWN_BTN =
|
||||
'.rose-header-utilities .header-dropdown-button-override button';
|
||||
const HEADER_DROPDOWN_BTN = '.app-header__utility-actions button';
|
||||
|
||||
const setDefaultClusterUrl = (test) => {
|
||||
const windowOrigin = window.location.origin;
|
||||
|
||||
@@ -542,8 +542,10 @@ module('Acceptance | projects | sessions | index', function (hooks) {
|
||||
.isVisible();
|
||||
|
||||
// change scope in app header
|
||||
await click('.rose-header-nav .hds-dropdown-toggle-button');
|
||||
await click('.rose-header-nav .hds-dropdown-list-item:nth-of-type(4) a');
|
||||
await click('[data-test-header-scope-dropdown] button');
|
||||
await click(
|
||||
`[data-test-header-scope-dropdown] a[href="${urls.scopes.org2}"]`,
|
||||
);
|
||||
// navigate to back sessions
|
||||
await click(`[href="${urls.sessions2}"]`);
|
||||
|
||||
|
||||
@@ -602,8 +602,10 @@ module('Acceptance | projects | targets | index', function (hooks) {
|
||||
.dom(`[data-test-target-project-id="${instances.scopes.project2.id}"]`)
|
||||
.exists();
|
||||
|
||||
await click('.rose-header-nav .hds-dropdown-toggle-button');
|
||||
await click('.rose-header-nav .hds-dropdown-list-item:nth-of-type(3) a');
|
||||
await click('[data-test-header-scope-dropdown] button');
|
||||
await click(
|
||||
`[data-test-header-scope-dropdown] a[href="${urls.scopes.org}"]`,
|
||||
);
|
||||
|
||||
assert
|
||||
.dom(`[data-test-target-project-id="${instances.scopes.project.id}"]`)
|
||||
|
||||
@@ -258,17 +258,23 @@ module('Acceptance | scopes', function (hooks) {
|
||||
);
|
||||
await visit(urls.targets);
|
||||
|
||||
await click('.rose-header-nav .hds-dropdown-toggle-button');
|
||||
|
||||
await click('.rose-header-nav .hds-dropdown-list-item:nth-of-type(3) a');
|
||||
await click('[data-test-header-scope-dropdown] button');
|
||||
await click(
|
||||
`[data-test-header-scope-dropdown] a[href="${urls.scopes.org}"]`,
|
||||
);
|
||||
|
||||
assert.strictEqual(currentURL(), urls.targets);
|
||||
|
||||
await click('.rose-header-nav .hds-dropdown-list-item:nth-of-type(4) a');
|
||||
await click(
|
||||
`[data-test-header-scope-dropdown] a[href="${urls.scopes.org2}"]`,
|
||||
);
|
||||
|
||||
assert.strictEqual(currentURL(), urls.org2Targets);
|
||||
|
||||
await click('.rose-header-nav .hds-dropdown-list-item:nth-of-type(1) a');
|
||||
await click('[data-test-header-scope-dropdown] button');
|
||||
await click(
|
||||
`[data-test-header-scope-dropdown] a[href="${urls.scopes.global}"]`,
|
||||
);
|
||||
|
||||
assert.strictEqual(currentURL(), urls.globalTargets);
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user