open-consul/ui/packages/consul-lock-sessions/app/components/consul/lock-session/notifications
Ronald 6bcb98ea71
Add UI copyright headers files (#16614)
* Add copyright headers to UI files

* Ensure copywrite file ignores external libs
2023-03-14 09:18:55 -04:00
..
README.mdx ui: upgrade ember composable helper (#13394) 2022-06-08 16:07:51 +01:00
index.hbs Add UI copyright headers files (#16614) 2023-03-14 09:18:55 -04:00

README.mdx

<!-- START component-docs:@tagName -->
# Consul::LockSession::Notifications
<!-- END component-docs:@tagName -->

<!-- START component-docs:@description-->
A Notification component specifically for LockSessions.
<!-- END component-docs:@description -->


```hbs preview-template
<figure>

  <figcaption>
    Provide a widget for to change the @type
  </figcaption>

  <select
    onchange={{action (mut this.type) value="target.value"}}
  >
    <option>kv</option>
    <option>success</option>
    <option>error</option>
  </select>
</figure>

<figure>

  <figcaption>
    Use the component
  </figcaption>

  <Consul::LockSession::Notifications
    @type={{if (includes this.type (array 'success' 'error')) 'remove' 'kv'}}
    @error={{if (eq this.type 'error') (hash
      status="403"
      detail=""
    ) undefined }}
  />

</figure>
```

## Arguments

<!-- START component-docs:@args -->
| Argument | Type              | Default | Description                                        |
| :-------- | :--------------- | :------ | :------------------------------------------------- |
| type      | "remove" \| "kv" |         | The type of Notification to use                    |
| error     | error            |         | Consul UI shaped error only used for `remove` type |

<!-- END component-docs:@args -->