add warning if you're creating a new version with old versions data
This commit is contained in:
parent
50f9687424
commit
e5a70cb9db
|
@ -10,11 +10,20 @@
|
|||
{{/if}}
|
||||
|
||||
{{#if @showAdvancedMode}}
|
||||
<JsonEditor
|
||||
@value={{@codemirrorString}}
|
||||
@valueUpdated={{@editActions.codemirrorUpdated}}
|
||||
@onFocusOut={{@editActions.formatJSON}}
|
||||
/>
|
||||
<div class="form-section">
|
||||
<label class="title is-5">
|
||||
{{#if isV2}}
|
||||
Version Data
|
||||
{{else}}
|
||||
Secret Data
|
||||
{{/if}}
|
||||
</label>
|
||||
<JsonEditor
|
||||
@value={{@codemirrorString}}
|
||||
@valueUpdated={{@editActions.codemirrorUpdated}}
|
||||
@onFocusOut={{@editActions.formatJSON}}
|
||||
/>
|
||||
</div>
|
||||
{{else}}
|
||||
<div class="form-section">
|
||||
<label class="title is-5">
|
||||
|
|
|
@ -2,22 +2,29 @@
|
|||
<div class="box is-sideless is-fullwidth is-marginless is-paddingless">
|
||||
<MessageError @model={{model}} @errorMessage={{error}} />
|
||||
<NamespaceReminder @mode="edit" @noun="secret" />
|
||||
<SecretEditDisplay
|
||||
@showAdvancedMode={{showAdvancedMode}}
|
||||
@codemirrorString={{codemirrorString}}
|
||||
@secretData={{secretData}}
|
||||
@isV2={{isV2}}
|
||||
@canEditV2Secret={{canEditV2Secret}}
|
||||
@model={{model}}
|
||||
@editActions={{hash
|
||||
codemirrorUpdated=(action "codemirrorUpdated")
|
||||
formatJSON=(action "formatJSON")
|
||||
handleKeyDown=(action "handleKeyDown")
|
||||
handleChange=(action "handleChange")
|
||||
deleteRow=(action "deleteRow")
|
||||
addRow=(action "addRow")
|
||||
}}
|
||||
/>
|
||||
{{#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
|
||||
@showAdvancedMode={{showAdvancedMode}}
|
||||
@codemirrorString={{codemirrorString}}
|
||||
@secretData={{secretData}}
|
||||
@isV2={{isV2}}
|
||||
@canEditV2Secret={{canEditV2Secret}}
|
||||
@model={{model}}
|
||||
@editActions={{hash
|
||||
codemirrorUpdated=(action "codemirrorUpdated")
|
||||
formatJSON=(action "formatJSON")
|
||||
handleKeyDown=(action "handleKeyDown")
|
||||
handleChange=(action "handleChange")
|
||||
deleteRow=(action "deleteRow")
|
||||
addRow=(action "addRow")
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
<div class="field is-grouped is-grouped-split is-fullwidth box is-bottomless">
|
||||
<div class="field is-grouped">
|
||||
|
@ -35,6 +42,7 @@
|
|||
mode="show"
|
||||
secret=model.id
|
||||
class="button"
|
||||
queryParams=(query-params version=this.modelForData.version)
|
||||
}}
|
||||
Cancel
|
||||
{{/secret-link}}
|
||||
|
|
Loading…
Reference in New Issue