add warning if you're creating a new version with old versions data

This commit is contained in:
Matthew Irish 2018-10-17 16:49:11 -05:00
parent 50f9687424
commit e5a70cb9db
2 changed files with 38 additions and 21 deletions

View file

@ -10,11 +10,20 @@
{{/if}} {{/if}}
{{#if @showAdvancedMode}} {{#if @showAdvancedMode}}
<div class="form-section">
<label class="title is-5">
{{#if isV2}}
Version Data
{{else}}
Secret Data
{{/if}}
</label>
<JsonEditor <JsonEditor
@value={{@codemirrorString}} @value={{@codemirrorString}}
@valueUpdated={{@editActions.codemirrorUpdated}} @valueUpdated={{@editActions.codemirrorUpdated}}
@onFocusOut={{@editActions.formatJSON}} @onFocusOut={{@editActions.formatJSON}}
/> />
</div>
{{else}} {{else}}
<div class="form-section"> <div class="form-section">
<label class="title is-5"> <label class="title is-5">

View file

@ -2,6 +2,13 @@
<div class="box is-sideless is-fullwidth is-marginless is-paddingless"> <div class="box is-sideless is-fullwidth is-marginless is-paddingless">
<MessageError @model={{model}} @errorMessage={{error}} /> <MessageError @model={{model}} @errorMessage={{error}} />
<NamespaceReminder @mode="edit" @noun="secret" /> <NamespaceReminder @mode="edit" @noun="secret" />
{{#if (not-eq model.selectedVersion.version model.currentVersion)}}
<div class="form-section">
<MessageInPage @type="warning" @class="is-marginless">
You are creating a new version based on data from Version {{model.selectedVersion.version}}. The current version for <code>{{model.id}}</code> is Version {{model.currentVersion}}.
</MessageInPage>
</div>
{{/if}}
<SecretEditDisplay <SecretEditDisplay
@showAdvancedMode={{showAdvancedMode}} @showAdvancedMode={{showAdvancedMode}}
@codemirrorString={{codemirrorString}} @codemirrorString={{codemirrorString}}
@ -35,6 +42,7 @@
mode="show" mode="show"
secret=model.id secret=model.id
class="button" class="button"
queryParams=(query-params version=this.modelForData.version)
}} }}
Cancel Cancel
{{/secret-link}} {{/secret-link}}