Skip to content

Commit

Permalink
Feature: Duplicate Secrets (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
jcrowthe committed Aug 14, 2017
1 parent 2fcf747 commit e7f9076
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions app/elements/secret-item.html
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@
}
paper-button {
border: 2px solid #4496ff;
padding: 0px;
height: 34px;
margin-top: 7px;
color: #308aff;
Expand Down Expand Up @@ -219,6 +218,7 @@ <h2 style="white-space: pre;">{{currentName}}</h2>
<template is="dom-if" if="{{!createMode}}">
<paper-button on-tap="_confirmDelete">Delete</paper-button>
<paper-button on-tap="_updateKey">Update</paper-button>
<paper-button on-tap="_duplicateSecret">Duplicate</paper-button>
</template>
<div class="flex"></div>
<paper-toggle-button class="toggle" checked="{{hideValues}}" disabled="{{hideValuesDisabled}}" style="padding-right: 30px">Hide Values</paper-toggle-button>
Expand Down Expand Up @@ -425,8 +425,10 @@ <h2 style="white-space: pre;">{{currentName}}</h2>
this.capabilitiesURL = app.url + 'v1/sys/capabilities-self';
this.url = app.url + 'v1';
this.currentName = '';
this.data = {};
this.selected = 0;
if (!this.duplicate) {
this.data = {};
this.selected = 0;
}
this.moveDisabled = true;
this.$.json.checked = false;
this.showRaw = false;
Expand All @@ -446,14 +448,15 @@ <h2 style="white-space: pre;">{{currentName}}</h2>
this.hideValues = false;
this.currentName = 'New Secret';
this.newLocation = 'secret/';
this.data = {'':''};
if (!this.duplicate) this.data = {'':''};
} else {
this.createMode = false;
this.newLocation = this.location;
this.loading = true;
this.$.getSecret.generateRequest();
}
}
this.duplicate = false;
},
_watchMoveRequest: function(request) {
if (Object.keys(this.moveRequest).length) {
Expand Down Expand Up @@ -529,6 +532,10 @@ <h2 style="white-space: pre;">{{currentName}}</h2>
}
}
},
_duplicateSecret: function() {
this.duplicate = true;
page('#!/create');
},
// ---------- Success ----------
_getSuccess: function(e) {
this.loading = false;
Expand Down

0 comments on commit e7f9076

Please sign in to comment.