Files
threshold-ui/ui/admin/app/templates/scopes/scope/authenticate.hbs
T
Cameron Perera d2d332b7d1 refactor: 💡 only show scopes with auth methods at authenticate (#2129)
* refactor: 💡 only show scopes with auth methods at authenticate

✅ Closes: https://hashicorp.atlassian.net/browse/ICU-2355

* test: 💍 verify scopes with no auth methods are hidden

when authenticating

✅ Closes: https://hashicorp.atlassian.net/browse/ICU-2355

* refactor: 💡 update logic for fetching scopes and auth methods

✅ Closes: https://hashicorp.atlassian.net/browse/ICU-2355

* refactor: 💡 PR feedback changes

✅ Closes: https://hashicorp.atlassian.net/browse/ICU-2355

* refactor: 💡 added unless block back to template

✅ Closes: https://hashicorp.atlassian.net/browse/ICU-2355

* refactor: 💡 update admin authenticate route and template

✅ Closes: https://hashicorp.atlassian.net/browse/ICU-2355

* test: 💍 add test for orgs with no auth methods admin ui

✅ Closes: https://hashicorp.atlassian.net/browse/ICU-2355
2024-02-08 10:01:20 -06:00

82 lines
2.3 KiB
Handlebars

{{!
Copyright (c) HashiCorp, Inc.
SPDX-License-Identifier: MPL-2.0
}}
{{page-title (t 'actions.authenticate')}}
<Rose::Layout::Centered>
<Rose::Layout::Page as |page|>
<page.body>
<Rose::Frame>
<:header>
<h2>{{t 'actions.authenticate'}}</h2>
</:header>
<:body>
<p>{{t
'auth.descriptions.authenticating-with-org'
name=@model.scope.displayName
}}</p>
<Rose::Dropdown
@text={{t 'actions.choose-different-org'}}
@icon='flight-icons/svg/org-16'
as |dropdown|
>
<dropdown.link @route='scopes.scope.authenticate' @model='global'>
{{t 'titles.global'}}
</dropdown.link>
{{#each this.sortedScopes as |scope|}}
<dropdown.link
@route='scopes.scope.authenticate'
@model={{scope.id}}
>
{{scope.displayName}}
</dropdown.link>
{{/each}}
</Rose::Dropdown>
<Rose::Separator />
<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}}
{{/if}}
{{#unless @model.authMethods}}
<Rose::Layout::Centered>
<Rose::Message
@title={{t 'resources.auth-method.messages.none.title'}}
@icon='flight-icons/svg/alert-circle-16'
as |message|
>
<message.description>
{{t 'resources.auth-method.messages.none.description'}}
</message.description>
</Rose::Message>
</Rose::Layout::Centered>
{{/unless}}
</:body>
</Rose::Frame>
</page.body>
</Rose::Layout::Page>
</Rose::Layout::Centered>