From 4e72d18dd4e187f5784a4b090b838f2ad0532815 Mon Sep 17 00:00:00 2001 From: kenia Date: Tue, 27 Jul 2021 16:20:36 -0400 Subject: [PATCH 1/4] Fix dropdown option duplications --- .../app/components/consul/intention/form/fieldsets/index.hbs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/packages/consul-ui/app/components/consul/intention/form/fieldsets/index.hbs b/ui/packages/consul-ui/app/components/consul/intention/form/fieldsets/index.hbs index e19be3d50087..a6402d9e33ff 100644 --- a/ui/packages/consul-ui/app/components/consul/intention/form/fieldsets/index.hbs +++ b/ui/packages/consul-ui/app/components/consul/intention/form/fieldsets/index.hbs @@ -39,7 +39,7 @@ @buildSuggestion={{action "createNewLabel" "Use a Consul Namespace called '{{term}}'"}} @showCreateWhen={{action "isUnique" nspaces}} @onCreate={{action onchange "SourceNS"}} - @onChange={{action onchange "SourceNS"}} as |nspace|> + @onChange={{action (mut SourceNS)}} as |nspace|> {{#if (eq nspace.Name '*') }} * (All Namespaces) {{else}} @@ -88,7 +88,7 @@ @buildSuggestion={{action "createNewLabel" "Use a future Consul Namespace called '{{term}}'"}} @showCreateWhen={{action "isUnique" nspaces}} @onCreate={{action onchange "DestinationNS"}} - @onChange={{action onchange "DestinationNS"}} as |nspace|> + @onChange={{action (mut DestinationNS)}} as |nspace|> {{#if (eq nspace.Name '*') }} * (All Namespaces) {{else}} From b6acfdd447f42947ef8cfdb97a967a86fd42ca79 Mon Sep 17 00:00:00 2001 From: kenia Date: Tue, 27 Jul 2021 16:41:43 -0400 Subject: [PATCH 2/4] Add changelog --- .changelog/10706.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .changelog/10706.txt diff --git a/.changelog/10706.txt b/.changelog/10706.txt new file mode 100644 index 000000000000..350abe5a7b10 --- /dev/null +++ b/.changelog/10706.txt @@ -0,0 +1,3 @@ +```release-note:bug +ui: Fix dropdown option duplication in the new intentions form +``` \ No newline at end of file From 4a23c2356b42b2a2904ee6c8decd79c128d44a8a Mon Sep 17 00:00:00 2001 From: kenia Date: Tue, 27 Jul 2021 17:00:15 -0400 Subject: [PATCH 3/4] Refactor helper --- .../app/components/consul/intention/form/fieldsets/index.hbs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/packages/consul-ui/app/components/consul/intention/form/fieldsets/index.hbs b/ui/packages/consul-ui/app/components/consul/intention/form/fieldsets/index.hbs index a6402d9e33ff..9af32e4c2d75 100644 --- a/ui/packages/consul-ui/app/components/consul/intention/form/fieldsets/index.hbs +++ b/ui/packages/consul-ui/app/components/consul/intention/form/fieldsets/index.hbs @@ -39,7 +39,7 @@ @buildSuggestion={{action "createNewLabel" "Use a Consul Namespace called '{{term}}'"}} @showCreateWhen={{action "isUnique" nspaces}} @onCreate={{action onchange "SourceNS"}} - @onChange={{action (mut SourceNS)}} as |nspace|> + @onChange={{fn (mut SourceNS)}} as |nspace|> {{#if (eq nspace.Name '*') }} * (All Namespaces) {{else}} @@ -88,7 +88,7 @@ @buildSuggestion={{action "createNewLabel" "Use a future Consul Namespace called '{{term}}'"}} @showCreateWhen={{action "isUnique" nspaces}} @onCreate={{action onchange "DestinationNS"}} - @onChange={{action (mut DestinationNS)}} as |nspace|> + @onChange={{fn (mut DestinationNS)}} as |nspace|> {{#if (eq nspace.Name '*') }} * (All Namespaces) {{else}} From 0c841f30c578e0539543b76ffe38856f875a51f1 Mon Sep 17 00:00:00 2001 From: kenia Date: Tue, 27 Jul 2021 17:16:22 -0400 Subject: [PATCH 4/4] Refactor --- .../app/components/consul/intention/form/fieldsets/index.hbs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/packages/consul-ui/app/components/consul/intention/form/fieldsets/index.hbs b/ui/packages/consul-ui/app/components/consul/intention/form/fieldsets/index.hbs index 9af32e4c2d75..d08a786c7d2a 100644 --- a/ui/packages/consul-ui/app/components/consul/intention/form/fieldsets/index.hbs +++ b/ui/packages/consul-ui/app/components/consul/intention/form/fieldsets/index.hbs @@ -39,7 +39,7 @@ @buildSuggestion={{action "createNewLabel" "Use a Consul Namespace called '{{term}}'"}} @showCreateWhen={{action "isUnique" nspaces}} @onCreate={{action onchange "SourceNS"}} - @onChange={{fn (mut SourceNS)}} as |nspace|> + @onChange={{fn (mut this.SourceNS)}} as |nspace|> {{#if (eq nspace.Name '*') }} * (All Namespaces) {{else}} @@ -88,7 +88,7 @@ @buildSuggestion={{action "createNewLabel" "Use a future Consul Namespace called '{{term}}'"}} @showCreateWhen={{action "isUnique" nspaces}} @onCreate={{action onchange "DestinationNS"}} - @onChange={{fn (mut DestinationNS)}} as |nspace|> + @onChange={{fn (mut this.DestinationNS)}} as |nspace|> {{#if (eq nspace.Name '*') }} * (All Namespaces) {{else}}