diff --git a/changelog/12663.txt b/changelog/12663.txt new file mode 100644 index 0000000000000..aab6e380b178f --- /dev/null +++ b/changelog/12663.txt @@ -0,0 +1,3 @@ +```release-note:improvement +ui: Add creation time to KV 2 version history and version view +``` diff --git a/ui/app/styles/components/info-table-row.scss b/ui/app/styles/components/info-table-row.scss index 6c12508273094..39902603e1e74 100644 --- a/ui/app/styles/components/info-table-row.scss +++ b/ui/app/styles/components/info-table-row.scss @@ -35,6 +35,10 @@ .helper-text { font-weight: normal; } + &.justify-right { + display: flex; + justify-content: right; + } } .hs-icon { diff --git a/ui/app/styles/components/list-item-row.scss b/ui/app/styles/components/list-item-row.scss index bdcf2f3c6927e..2558358990b05 100644 --- a/ui/app/styles/components/list-item-row.scss +++ b/ui/app/styles/components/list-item-row.scss @@ -8,6 +8,14 @@ .ember-basic-dropdown-trigger { display: inline-block; } + + .center-inside-row { + width: 50%; + margin-left: auto; + font-size: $size-8; + font-weight: $font-weight-semibold; + color: $ui-gray-500; + } } a.list-item-row, diff --git a/ui/app/styles/components/tool-tip.scss b/ui/app/styles/components/tool-tip.scss index c36584c8758c7..392f898da13b9 100644 --- a/ui/app/styles/components/tool-tip.scss +++ b/ui/app/styles/components/tool-tip.scss @@ -23,6 +23,9 @@ &.ember-basic-dropdown-content--above.ember-basic-dropdown--transitioning-out { animation: drop-fade-below 0.15s reverse; } + &.smaller-font { + font-size: $size-8; + } } .ember-basic-dropdown-content--left.tool-tip { diff --git a/ui/app/templates/components/secret-form-show.hbs b/ui/app/templates/components/secret-form-show.hbs index 543c3c192aef1..3f0c3eb7682d1 100644 --- a/ui/app/templates/components/secret-form-show.hbs +++ b/ui/app/templates/components/secret-form-show.hbs @@ -47,6 +47,18 @@
Value
+
+ + + Version created {{date-format @modelForData.createdTime 'MMM dd, yyyy hh:mm a'}} + + +
+ {{@modelForData.createdTime}} +
+
+
+
{{#if @modelForData.secretKeyAndValue}} diff --git a/ui/app/templates/vault/cluster/secrets/backend/versions.hbs b/ui/app/templates/vault/cluster/secrets/backend/versions.hbs index ea0c579620fb9..f5d9cbb5bbaec 100644 --- a/ui/app/templates/vault/cluster/secrets/backend/versions.hbs +++ b/ui/app/templates/vault/cluster/secrets/backend/versions.hbs @@ -27,7 +27,7 @@
- + Version {{list.item.version}}
{{#if (eq list.item.version model.currentVersion)}} @@ -50,7 +50,19 @@ Destroyed
- {{/if}} + {{/if}} +
+ + + Created {{date-format list.item.createdTime 'MMM dd, yyyy hh:mm a'}} + + +
+ {{list.item.createdTime}} +
+
+
+
diff --git a/ui/tests/acceptance/secrets/backend/kv/secret-test.js b/ui/tests/acceptance/secrets/backend/kv/secret-test.js index e83b380cc6a7a..0f827f0a1c736 100644 --- a/ui/tests/acceptance/secrets/backend/kv/secret-test.js +++ b/ui/tests/acceptance/secrets/backend/kv/secret-test.js @@ -226,6 +226,8 @@ module('Acceptance | secrets/secret/create', function(hooks) { test('it navigates to version history and to a specific version', async function(assert) { const path = `kv-path-${new Date().getTime()}`; + let today = new Date(); + let month = today.toString().split(' ')[1]; await listPage.visitRoot({ backend: 'secret' }); await settled(); await listPage.create(); @@ -233,11 +235,13 @@ module('Acceptance | secrets/secret/create', function(hooks) { await editPage.createSecret(path, 'foo', 'bar'); await click('[data-test-popup-menu-trigger="version"]'); await settled(); + assert.dom('[ data-test-created-time]').includesText(month, 'created time shows todays month'); + await click('[data-test-version-history]'); await settled(); assert .dom('[data-test-list-item-content]') - .hasText('Version 1 Current', 'shows version one data on the version history as current'); + .includesText('Version 1 Current', 'shows version one data on the version history as current'); assert.dom('[data-test-list-item-content]').exists({ count: 1 }, 'renders a single version'); await click('.linked-block');