From cdb8a35501aee4a04f03f8bbaefb0c2efc8bfb3a Mon Sep 17 00:00:00 2001 From: John Cowen Date: Wed, 19 Jan 2022 10:09:25 +0000 Subject: [PATCH] ui: Fixup KV folder creation then further creation within that folder (#12081) The fix here is two fold: - We shouldn't be providing the DataSource (which loads the data) with an id when we are creating from within a folder (in the buggy code we are providing the parentKey of the new KV you are creating) - Being able to provide an empty id to the DataSource/KV repository and that repository responding with a newly created object is more towards the "new way of doing forms", therefore the corresponding code to return a newly created ember-data object. As we changed the actual bug in point 1 here, we need to make sure the repository responds with an empty object when the request id is empty. --- .changelog/12081.txt | 3 +++ .../app/components/consul/kv/form/index.hbs | 2 +- .../consul-ui/app/services/repository/kv.js | 15 +++++++++--- .../consul-ui/app/templates/dc/kv/edit.hbs | 2 +- .../tests/acceptance/dc/kvs/create.feature | 24 +++++++++++++++++++ 5 files changed, 41 insertions(+), 5 deletions(-) create mode 100644 .changelog/12081.txt diff --git a/.changelog/12081.txt b/.changelog/12081.txt new file mode 100644 index 0000000000..18f26276d4 --- /dev/null +++ b/.changelog/12081.txt @@ -0,0 +1,3 @@ +```release-note:bug +ui: Fixed a bug with creating multiple nested KVs in one interaction +``` diff --git a/ui/packages/consul-ui/app/components/consul/kv/form/index.hbs b/ui/packages/consul-ui/app/components/consul/kv/form/index.hbs index 9b8f366e37..8ca9d738a5 100644 --- a/ui/packages/consul-ui/app/components/consul/kv/form/index.hbs +++ b/ui/packages/consul-ui/app/components/consul/kv/form/index.hbs @@ -18,7 +18,7 @@ {{disabled (or disabld api.disabled)}} > {{#if api.isCreate}} -