{{#each @model.fields as |attr|}}
+ {{!-- ARG TODO add validation for custom metadata and potentially change look of the field. --}}
{{!-- Angel turn into seperate component --}}
@@ -305,7 +305,6 @@
From f311c18e94884bb854375150ed95b57d6df6f382 Mon Sep 17 00:00:00 2001
From: Angel Garbarino
Date: Tue, 27 Jul 2021 16:09:13 -0600
Subject: [PATCH 03/40] setting up things
---
ui/app/components/kv-object-editor.js | 6 ++-
ui/app/models/secret-v2.js | 3 ++
ui/app/styles/core/box.scss | 17 ++++++++-
.../templates/components/kv-object-editor.hbs | 9 ++++-
.../components/secret-edit-metadata.hbs | 38 +++++++++++++------
.../addon/templates/components/form-field.hbs | 29 +++++++-------
6 files changed, 74 insertions(+), 28 deletions(-)
diff --git a/ui/app/components/kv-object-editor.js b/ui/app/components/kv-object-editor.js
index a8da4b35c343..fc8b8e820aea 100644
--- a/ui/app/components/kv-object-editor.js
+++ b/ui/app/components/kv-object-editor.js
@@ -4,15 +4,19 @@ import Component from '@ember/component';
import { computed } from '@ember/object';
import { guidFor } from '@ember/object/internals';
import KVObject from 'vault/lib/kv-object';
+// ARG TODO add documentation here
export default Component.extend({
'data-test-component': 'kv-object-editor',
- classNames: ['field', 'form-section'],
+ classNames: ['field'],
+ classNameBindings: ['formSection:form-section'],
+ formSection: true,
// public API
// Ember Object to mutate
value: null,
label: null,
helpText: null,
+ subText: null,
// onChange will be called with the changed Value
onChange() {},
diff --git a/ui/app/models/secret-v2.js b/ui/app/models/secret-v2.js
index fb939ed14e3b..fea16e3be581 100644
--- a/ui/app/models/secret-v2.js
+++ b/ui/app/models/secret-v2.js
@@ -40,10 +40,13 @@ export default Model.extend(KeyMixin, Validations, {
oldestVersion: attr('number'),
customMetadata: attr('object', {
editType: 'kv',
+ subText: 'An optional set of informational key-value pairs that will be stored with all secret versions.',
}),
maxVersions: attr('number', {
defaultValue: 10,
label: 'Maximum Number of Versions',
+ subText:
+ 'The number of versions to keep per key. Once the number of keys exceeds the maximum number set here, the oldest version will be permanently deleted.',
}),
casRequired: attr('boolean', {
defaultValue: false,
diff --git a/ui/app/styles/core/box.scss b/ui/app/styles/core/box.scss
index 277c55ed3507..fc7cec98cfce 100644
--- a/ui/app/styles/core/box.scss
+++ b/ui/app/styles/core/box.scss
@@ -1,5 +1,16 @@
.box {
box-shadow: 0 0 0 1px rgba($grey-dark, 0.3);
+
+ .title {
+ &.has-padding-top {
+ padding-top: $spacing-m;
+ }
+ }
+ p {
+ &.has-padding-bottom {
+ padding-bottom: $spacing-s;
+ }
+ }
}
.box.is-fullwidth {
padding-left: 0;
@@ -20,7 +31,11 @@
.box.is-rounded {
border-radius: 3px;
}
-
.box.no-top-shadow {
box-shadow: inset 0 -1px 0 0 rgba($black, 0.1);
}
+.box.has-container {
+ box-shadow: 0 4px 4px rgba($black, 0.25);
+ border: 1px solid #bac1cc;
+ padding: $spacing-l;
+}
diff --git a/ui/app/templates/components/kv-object-editor.hbs b/ui/app/templates/components/kv-object-editor.hbs
index 3d1bb75bc38f..74d3062d2bd9 100644
--- a/ui/app/templates/components/kv-object-editor.hbs
+++ b/ui/app/templates/components/kv-object-editor.hbs
@@ -1,12 +1,17 @@
{{#if label}}
-
{{!-- metadata inputs --}}
-
+
\ No newline at end of file
From 83af67b17ae0da5e79a906950f51924620d2bd9d Mon Sep 17 00:00:00 2001
From: Angel Garbarino
Date: Mon, 9 Aug 2021 10:45:23 -0600
Subject: [PATCH 12/40] create new version work
---
ui/app/components/secret-edit.js | 1 -
...play.hbs => secret-create-new-version.hbs} | 35 ++++---------------
.../components/secret-edit-metadata.hbs | 11 +++---
ui/app/templates/components/secret-edit.hbs | 18 +++++++++-
4 files changed, 30 insertions(+), 35 deletions(-)
rename ui/app/templates/components/{secret-edit-display.hbs => secret-create-new-version.hbs} (79%)
diff --git a/ui/app/components/secret-edit.js b/ui/app/components/secret-edit.js
index a909b6ceab46..e8a56e72f009 100644
--- a/ui/app/components/secret-edit.js
+++ b/ui/app/components/secret-edit.js
@@ -376,7 +376,6 @@ export default Component.extend(FocusOnInsertMixin, WithNavToNearestAncestor, {
}
this.persistKey(() => {
- debugger;
this.transitionToRoute(SHOW_ROUTE, this.model.path || this.model.id);
});
},
diff --git a/ui/app/templates/components/secret-edit-display.hbs b/ui/app/templates/components/secret-create-new-version.hbs
similarity index 79%
rename from ui/app/templates/components/secret-edit-display.hbs
rename to ui/app/templates/components/secret-create-new-version.hbs
index 40bf257e39ed..fd4e54676d6c 100644
--- a/ui/app/templates/components/secret-edit-display.hbs
+++ b/ui/app/templates/components/secret-create-new-version.hbs
@@ -1,21 +1,6 @@
-{{#if (and (or @model.isNew @canEditV2Secret) @isV2 (not @model.failedServerRead))}}
-
-{{/if}}
-
-{{#if @showWriteWithoutReadWarning}}
+{{!-- ARG TODO test these --}}
+{{!-- ARG TODO not using canEditV2Secret and feel like I should be somewhere --}}
+{{!-- {{#if @showWriteWithoutReadWarning}}
{{#if (and @isV2 @model.failedServerRead)}}
{{/if}}
-{{/if}}
+{{/if}} --}}
{{#if @showAdvancedMode}}
@@ -53,9 +38,9 @@
{{#if isV2}}
- Version data
+ Version data
{{else}}
- Secret data
+ Secret data
{{/if}}
{{#each @secretData as |secret index|}}
@@ -102,14 +87,6 @@
{{/if}}
- {{#if @validationMessages.key}}
-
- {{/if}}
{{/each}}
{{/if}}
diff --git a/ui/app/templates/components/secret-edit-metadata.hbs b/ui/app/templates/components/secret-edit-metadata.hbs
index 8f32ce6f064b..be14391c2a76 100644
--- a/ui/app/templates/components/secret-edit-metadata.hbs
+++ b/ui/app/templates/components/secret-edit-metadata.hbs
@@ -1,6 +1,6 @@
{{!-- ARG TODO add empty state if no access --}}