open-consul/ui/packages/consul-partitions/app/components/consul/partition/selector
John Cowen 6e23f5a14c
ui: When certain menus are selected reset either nspace/partition (#11479)
For our dc, nspace and partition 'bucket' menus, sometimes when selecting one 'bucket' we need to reset a different 'bucket' back to the one that your token has by default (or the default if not). For example when switching to a different partition whilst you are in a non-default namespace of another partition, we need to switch you to the token default namespace of the partition you are switching to.
2021-11-17 15:59:26 +00:00
..
README.mdx ui: Adds initial CRUD for partitions (#11188) 2021-10-08 16:29:30 +01:00
index.hbs ui: When certain menus are selected reset either nspace/partition (#11479) 2021-11-17 15:59:26 +00:00

README.mdx

# Consul::Partition::Selector

A conditional, autoloading, menu component specifically for making it easy to select partitions.

Please note: 

- Currently at least, you must add this inside of a `<ul>` element.
- For the moment, make sure you have enabled partitions using developer debug
  cookies.

```hbs preview-template
<ul>
  <Consul::Partition::Selector
    @dc={{hash
      Name='dc-1'
    }}
    @nspace='default'
    @partition='default'
    @partitions={{or this.partitions (array)}}
    @onchange={{action (mut this.partitions) value="data"}}
  />
</ul>
```


## Arguments

| Argument/Attribute | Type | Default | Description |
| --- | --- | --- | --- |
| `dc` | `object` |  | The current datacenter |
| `nspace` | `string` |  | The name of the current namespace |
| `partition` | `string` |  | The name of the current partition |
| `partitions` | `array` |  | A list of partition models/objects to use for the selector |
| `onchange` | `function` |  | An event handler, for when partitions are loaded. You probably want to update `@partitions` using this. |

## See

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

---