From 46b5b99f5f4c97f76f3f064118cf1615b7466ef4 Mon Sep 17 00:00:00 2001 From: Matthew Irish Date: Thu, 11 Oct 2018 12:17:47 -0500 Subject: [PATCH] create version from old versions uses that data in the edit page --- ui/app/controllers/vault/cluster/secrets/backend/edit.js | 5 +++++ ui/app/routes/vault/cluster/secrets/backend/edit.js | 8 +++++++- ui/app/templates/components/secret-edit.hbs | 8 ++++++-- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/ui/app/controllers/vault/cluster/secrets/backend/edit.js b/ui/app/controllers/vault/cluster/secrets/backend/edit.js index 47bbcfa66..0b6356741 100644 --- a/ui/app/controllers/vault/cluster/secrets/backend/edit.js +++ b/ui/app/controllers/vault/cluster/secrets/backend/edit.js @@ -3,6 +3,11 @@ import BackendCrumbMixin from 'vault/mixins/backend-crumb'; export default Controller.extend(BackendCrumbMixin, { backendController: controller('vault.cluster.secrets.backend'), + queryParams: ['version'], + version: '', + reset() { + this.set('version', ''); + }, actions: { refresh: function() { // closure actions don't bubble to routes, diff --git a/ui/app/routes/vault/cluster/secrets/backend/edit.js b/ui/app/routes/vault/cluster/secrets/backend/edit.js index 69b9f2e0b..1f4f74734 100644 --- a/ui/app/routes/vault/cluster/secrets/backend/edit.js +++ b/ui/app/routes/vault/cluster/secrets/backend/edit.js @@ -1,3 +1,9 @@ import EditBase from './secret-edit'; -export default EditBase.extend(); +export default EditBase.extend({ + queryParams: { + version: { + refreshModel: true, + }, + }, +}); diff --git a/ui/app/templates/components/secret-edit.hbs b/ui/app/templates/components/secret-edit.hbs index 655721183..97adb5c73 100644 --- a/ui/app/templates/components/secret-edit.hbs +++ b/ui/app/templates/components/secret-edit.hbs @@ -55,11 +55,15 @@ {{#if (and (eq mode 'show') canEdit)}}
- Edit Secret + {{#if isV2}} + Create new version + {{else}} + Edit Secret + {{/if}}
{{/if}}