* refactor: 💡 remove rose::notification in favor of hds ✅ Closes: https://hashicorp.atlassian.net/browse/ICU-15634
164 lines
5.0 KiB
Handlebars
164 lines
5.0 KiB
Handlebars
{{!
|
|
Copyright (c) HashiCorp, Inc.
|
|
SPDX-License-Identifier: BUSL-1.1
|
|
}}
|
|
|
|
{{page-title (app-name)}}
|
|
|
|
<Rose::Layout::Global as |layout|>
|
|
|
|
<layout.header>
|
|
<Rose::Header class={{if (is-loading) ' loading'}} as |header|>
|
|
<header.brand @logo='logo-app' @text={{(app-name)}} />
|
|
|
|
{{#if this.session.isAuthenticated}}
|
|
<header.nav>
|
|
<HeaderNav />
|
|
</header.nav>
|
|
|
|
<header.utilities as |utilities|>
|
|
<utilities.dropdown
|
|
@text={{this.session.data.authenticated.username}}
|
|
@icon='flight-icons/svg/user-circle-16'
|
|
as |dropdown|
|
|
>
|
|
<dropdown.link @route='account.change-password'>
|
|
{{t 'actions.change-password'}}
|
|
</dropdown.link>
|
|
<dropdown.separator />
|
|
|
|
<dropdown.button {{on 'click' this.invalidateSession}}>
|
|
{{t 'actions.deauthenticate'}}
|
|
</dropdown.button>
|
|
|
|
<dropdown.separator />
|
|
|
|
<dropdown.section @title={{t 'actions.toggle-color-theme'}}>
|
|
<Hds::Form::Radio::Group
|
|
@name='theme'
|
|
class='dropdown-radio-btn'
|
|
as |G|
|
|
>
|
|
{{#each this.themes as |theme|}}
|
|
<G.RadioField
|
|
@value={{theme.value}}
|
|
checked={{eq this.session.data.theme theme.value}}
|
|
{{on 'change' (fn this.toggleTheme theme.value)}}
|
|
as |F|
|
|
>
|
|
<F.Label>{{t (concat 'themes.' theme.label)}}</F.Label>
|
|
</G.RadioField>
|
|
{{/each}}
|
|
</Hds::Form::Radio::Group>
|
|
</dropdown.section>
|
|
|
|
</utilities.dropdown>
|
|
|
|
{{#if (feature-flag 'dev-edition-toggle')}}
|
|
<utilities.dropdown
|
|
data-test-dev-edition-toggle
|
|
@text={{t
|
|
'titles.feature-edition'
|
|
edition=this.featureEdition.edition
|
|
}}
|
|
@icon='flight-icons/svg/layers-16'
|
|
as |dropdown|
|
|
>
|
|
<dropdown.section @title={{t 'actions.toggle-feature-edition'}}>
|
|
<Hds::Form::Radio::Group
|
|
@name='edition'
|
|
class='dropdown-radio-btn'
|
|
as |G|
|
|
>
|
|
{{#each this.featureEdition.editions as |edition|}}
|
|
<G.RadioField
|
|
@value={{edition}}
|
|
checked={{eq this.featureEdition.edition edition}}
|
|
{{on 'change' (fn this.toggleEdition edition)}}
|
|
as |F|
|
|
>
|
|
<F.Label>{{edition}}</F.Label>
|
|
</G.RadioField>
|
|
{{/each}}
|
|
</Hds::Form::Radio::Group>
|
|
|
|
</dropdown.section>
|
|
<dropdown.separator />
|
|
<dropdown.section @title={{t 'actions.toggle-licensed-features'}}>
|
|
<Rose::Form as |form|>
|
|
{{#each this.featureEdition.licensedFeatures as |feature|}}
|
|
<dropdown.item>
|
|
<form.checkbox
|
|
@label={{feature}}
|
|
@checked={{feature-flag feature}}
|
|
@onChange={{fn this.toggleFeature feature}}
|
|
/>
|
|
</dropdown.item>
|
|
{{/each}}
|
|
</Rose::Form>
|
|
</dropdown.section>
|
|
</utilities.dropdown>
|
|
{{/if}}
|
|
|
|
</header.utilities>
|
|
|
|
{{/if}}
|
|
|
|
</Rose::Header>
|
|
</layout.header>
|
|
|
|
<layout.body>
|
|
{{outlet}}
|
|
</layout.body>
|
|
|
|
</Rose::Layout::Global>
|
|
|
|
{{#if this.flashMessages.queue}}
|
|
<div class='ember-notify-cn'>
|
|
{{#each this.flashMessages.queue as |flash|}}
|
|
<div class='ember-notify-show ember-notify'>
|
|
<Hds::Toast
|
|
@color={{map-type-to-color flash.notificationType}}
|
|
@onDismiss={{fn flash.dismiss flash}}
|
|
data-test-toast-notification
|
|
as |T|
|
|
>
|
|
<T.Title>{{t (concat 'states.' flash.notificationType)}}</T.Title>
|
|
<T.Description>{{flash.message}}</T.Description>
|
|
</Hds::Toast>
|
|
</div>
|
|
{{/each}}
|
|
</div>
|
|
{{/if}}
|
|
|
|
<PendingConfirmations as |confirmation accept deny|>
|
|
<Rose::Dialog
|
|
@heading={{if
|
|
confirmation.options.title
|
|
(t confirmation.options.title)
|
|
(t 'actions.confirm')
|
|
}}
|
|
@dismissButtonText={{t 'actions.cancel'}}
|
|
@icon='flight-icons/svg/alert-triangle-16'
|
|
@style='warning'
|
|
@modal={{true}}
|
|
@dismiss={{deny}}
|
|
as |dialog|
|
|
>
|
|
<dialog.body>
|
|
<p>{{confirmation.text}}</p>
|
|
</dialog.body>
|
|
<dialog.footer>
|
|
<Rose::Button @style='primary' {{on 'click' accept}}>
|
|
{{if
|
|
confirmation.options.confirm
|
|
(t confirmation.options.confirm)
|
|
(t 'actions.ok')
|
|
}}
|
|
</Rose::Button>
|
|
<Rose::Button @style='secondary' {{on 'click' deny}}>
|
|
{{t 'actions.cancel'}}
|
|
</Rose::Button>
|
|
</dialog.footer>
|
|
</Rose::Dialog>
|
|
</PendingConfirmations> |