consul/ui/packages/consul-ui/app/components/auth-dialog
Tyler Wendlandt e5948e8eb4
CC-5545: Side Nav (#19342)
* Initial work for sidenav

* Use HDS::Text

* Add resolution for ember-element-helper

* WIP dc selector

* Update HCP Home link

* DC selector

* Hook up remaining selectors

* Fix settings and tutorial links

* Remove comments

* Remove skip-links

* Replace auth with new dropdown

* Use href-to helper for sidenav links

* Changelog

* Add description to NavSelector

* Wrap version in footer and role

* Fix login tests

* Add data-test selectors for namespaces

* Fix datacenter disclosure menu test

* Stop rendering auth dialog if acls are disabled

* Update disabled selector state and token selector

* Fix logic in ACL selector

* Fix HCP Home integration test

* Remove toggling the sidenav in tests

* Add sidenav to eng docs

* Re-add debug navigation for eng docs

* Remove ember-in-viewport

* Remove unused styles

* Upgrade @hashicorp/design-system-componentseee

* Add translations for side-nav

* Only show back to hcp link if url is present

* Disable responsive due to a11y-dialog issue
2023-11-06 08:18:48 -07:00
..
README.mdx CC-5545: Side Nav (#19342) 2023-11-06 08:18:48 -07:00
chart.xstate.js [COMPLIANCE] License changes (#18443) 2023-08-11 09:12:13 -04:00
index.hbs [COMPLIANCE] License changes (#18443) 2023-08-11 09:12:13 -04:00
index.js [COMPLIANCE] License changes (#18443) 2023-08-11 09:12:13 -04:00

README.mdx

# AuthDialog

A component to help orchestrate a login/logout flow.

```hbs preview-template
<AuthDialog
  @src={{uri 'settings://consul:token'}}
  @sink={{uri 'settings://consul:token'}}
  @onchange={{action (noop)}}
>
  <:unauthorized as |api|>
    <AuthForm
      @onsubmit={{action api.login value="data"}}
    />
  </:unauthorized>
  <:authorized as |api|>
    <button
      {{on 'click' (fn api.logout)}}
    >
      Logout
    </button>
  </:authorized>
</AuthDialog>
```

## Arguments

| Argument | Type | Default | Description |
| --- | --- | --- | --- |
| `onchange` | `Function` | | An action to fire when the users token has changed (logged in/logged out/token changed) |
| `src` | `URI` | | DataSource URI used to retrive/watch for changes on the users token |
| `sink` | `URI` | | DataSink URI used to save the users token to |

## Exports

| Name | Type | Description |
| --- | --- | --- |
| `login` | `Function` | Login with a specified token |
| `logout` | `Function` | Logout (delete token) |
| `token` | `Token` | The current token itself |

## Slots

| Name  | Description |
| --- | --- |
| `unauthorized` | This slot is only rendered when the user doesn't have a token |
| `authorized`   | This slot is only rendered when the user has a token.|

## See

- [Component Source Code](./index.js)
- [Template Source Code](./index.hbs)

---