consul/ui/packages/consul-ui/app/components/empty-state
hashicorp-copywrite[bot] 5fb9df1640
[COMPLIANCE] License changes (#18443)
* Adding explicit MPL license for sub-package

This directory and its subdirectories (packages) contain files licensed with the MPLv2 `LICENSE` file in this directory and are intentionally licensed separately from the BSL `LICENSE` file at the root of this repository.

* Adding explicit MPL license for sub-package

This directory and its subdirectories (packages) contain files licensed with the MPLv2 `LICENSE` file in this directory and are intentionally licensed separately from the BSL `LICENSE` file at the root of this repository.

* Updating the license from MPL to Business Source License

Going forward, this project will be licensed under the Business Source License v1.1. Please see our blog post for more details at <Blog URL>, FAQ at www.hashicorp.com/licensing-faq, and details of the license at www.hashicorp.com/bsl.

* add missing license headers

* Update copyright file headers to BUSL-1.1

* Update copyright file headers to BUSL-1.1

* Update copyright file headers to BUSL-1.1

* Update copyright file headers to BUSL-1.1

* Update copyright file headers to BUSL-1.1

* Update copyright file headers to BUSL-1.1

* Update copyright file headers to BUSL-1.1

* Update copyright file headers to BUSL-1.1

* Update copyright file headers to BUSL-1.1

* Update copyright file headers to BUSL-1.1

* Update copyright file headers to BUSL-1.1

* Update copyright file headers to BUSL-1.1

* Update copyright file headers to BUSL-1.1

* Update copyright file headers to BUSL-1.1

* Update copyright file headers to BUSL-1.1

---------

Co-authored-by: hashicorp-copywrite[bot] <110428419+hashicorp-copywrite[bot]@users.noreply.github.com>
2023-08-11 09:12:13 -04:00
..
README.mdx [UI] CC-4031: change from Action, a and button to hds::Button (#16251) 2023-02-22 13:05:15 -08: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
index.scss [COMPLIANCE] License changes (#18443) 2023-08-11 09:12:13 -04:00
layout.scss [COMPLIANCE] License changes (#18443) 2023-08-11 09:12:13 -04:00
pageobject.js [COMPLIANCE] License changes (#18443) 2023-08-11 09:12:13 -04:00
skin.scss [COMPLIANCE] License changes (#18443) 2023-08-11 09:12:13 -04:00

README.mdx

---
class: ember
---
# EmptyState

Consul UIs default 'empty state' used for when we retrive an empty result set,
whether that set is successful or erroneous. This is mainly used via the
`ErrorState` component, so also consider using that directly instead of this
component if dealing with errors.

## Arguments

| Argument | Type | Default | Description |
| --- | --- | --- | --- |
| `login` | `Function` | `undefined` | A login action to call when the login button is pressed (if not provided no login button will be shown  |

Icons are controlled via a `status-xxx` class. `xxx` should be some sort of
3 digit error code, special icons are used for `404` and `403`, otherwise a
generic icon will be used. To add any further special icons please add to the
component's `skin` file.

If the `@login` attribute is provided, a button will be shown directly
underneath the body text clicking on which will fire the provided `@login`
function.

```hbs preview-template
<EmptyState
  class="status-404"
  @login={{noop}}
>
  <BlockSlot @name="header">
    <h2>
      Header
    </h2>
  </BlockSlot>
  <BlockSlot @name="subheader">
    <h3>
      Subheader
    </h3>
  </BlockSlot>
  <BlockSlot @name="body">
    <p>
      Body text
    </p>
  </BlockSlot>
  <BlockSlot @name="actions">
    <li>
      <Hds::Link::Standalone
        @text='Documentation on namespaces'
        @href="{{env 'CONSUL_DOCS_URL'}}/commands/namespace"
        @icon='docs-link'
        @iconPosition='trailing'
        @size='small'
      />
    </li>
    <li>
      <Hds::Link::Standalone
        @text='Read the guide'
        @href="{{env 'CONSUL_DOCS_LEARN_URL'}}/consul/namespaces/secure-namespaces"
        @icon='learn-link'
        @iconPosition='trailing'
        @size='small'
      />
    </li>
  </BlockSlot>
</EmptyState>
```

The component has four slots for specifying header, subheader, body and
'actions', although the component will show a minimal empty slot if only the
body slot is specified:

```hbs preview-template
<EmptyState>
  <BlockSlot @name="body">
    <p>
      Minimal text
    </p>
  </BlockSlot>
</EmptyState>
```