open-consul/ui/packages/consul-lock-sessions/app/components/consul/lock-session/notifications
Michael Klein f58fca2048
ui: upgrade ember composable helper (#13394)
Upgrade ember-composable-helpers to version 5.x. This version contains the pick-helper which makes composition in the template layer easier with Octane.

{{!-- this is usually hard to do with Octane --}}
<input {{on "input" (pick "target.value" this.updateText)}} .../>
Version 5.x also fixes a regression with sort-by that according to @johncowen was the reason why the version was pinned to 4.0.0 at the moment.

Version 5 of ember-composable-helpers removes the contains-helper in favor of includes which I changed all occurences for.
2022-06-08 16:07:51 +01:00
..
README.mdx ui: upgrade ember composable helper (#13394) 2022-06-08 16:07:51 +01:00
index.hbs

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 -->