ui: Disable setting wildcard partitions for intentions (#11804)
This commit is contained in:
parent
ca04a62702
commit
b8888fc0f2
|
@ -0,0 +1,4 @@
|
|||
```release-note:bugfix
|
||||
ui: Don't offer to save an intention with a source/destinatiojn wildcard
|
||||
partition
|
||||
```
|
|
@ -63,11 +63,7 @@
|
|||
@showCreateWhen={{action "isUnique" partitions}}
|
||||
@onCreate={{action onchange "SourcePartition"}}
|
||||
@onChange={{action onchange "SourcePartition"}} as |partition|>
|
||||
{{#if (eq partition.Name '*') }}
|
||||
* (All Partitions)
|
||||
{{else}}
|
||||
{{partition.Name}}
|
||||
{{/if}}
|
||||
{{partition.Name}}
|
||||
</PowerSelectWithCreate>
|
||||
{{#if create}}
|
||||
<em>Search for an existing partition, or enter any Partition name.</em>
|
||||
|
@ -136,11 +132,7 @@
|
|||
@showCreateWhen={{action "isUnique" partitions}}
|
||||
@onCreate={{action onchange "DestinationPartition"}}
|
||||
@onChange={{action onchange "DestinationPartition"}} as |partition|>
|
||||
{{#if (eq partition.Name '*') }}
|
||||
* (All Partitions)
|
||||
{{else}}
|
||||
{{partition.Name}}
|
||||
{{/if}}
|
||||
{{partition.Name}}
|
||||
</PowerSelectWithCreate>
|
||||
{{#if create}}
|
||||
<em>For the destination, you may choose any partition for which you have access.</em>
|
||||
|
|
|
@ -122,10 +122,9 @@ export default class ConsulIntentionForm extends Component {
|
|||
@action
|
||||
createPartitions(item, e) {
|
||||
// Partitions in the menus should:
|
||||
// 1. Include an 'All Partitions' option
|
||||
// 1. NOT include an 'All Partitions' option
|
||||
// 2. Include the current SourcePartition and DestinationPartition incase they don't exist yet
|
||||
let items = e.data.toArray().sort((a, b) => a.Name.localeCompare(b.Name));
|
||||
items = [{ Name: '*' }].concat(items);
|
||||
let source = items.findBy('Name', item.SourcePartition);
|
||||
if (!source) {
|
||||
source = { Name: item.SourcePartition };
|
||||
|
|
|
@ -69,7 +69,7 @@ export default class IntentionRepository extends RepositoryService {
|
|||
let item;
|
||||
if (params.id === '') {
|
||||
const defaultNspace = this.env.var('CONSUL_NSPACES_ENABLED') ? '*' : 'default';
|
||||
const defaultPartition = this.env.var('CONSUL_PARTITIONS_ENABLED') ? '*' : 'default';
|
||||
const defaultPartition = 'default';
|
||||
item = await this.create({
|
||||
SourceNS: params.nspace || defaultNspace,
|
||||
DestinationNS: params.nspace || defaultNspace,
|
||||
|
|
Loading…
Reference in New Issue