UI - guard page redesign (#4779)

* add NavHeader component
* use NavHeader in SplashPage component and application.hbs
* let download button take a block
* add RadialProgress component
* use RadialProgress in ShamirFlow component
* style up the RadialProgress component
* update ember-basic-dropdown, ember-basic-dropdown-hover
* rework operation token generation workflow
* directly depend on ember-maybe-in-element
This commit is contained in:
Matthew Irish
2018-06-26 16:35:47 -05:00
committed by GitHub
parent 70664da044
commit c8b64523ee
62 changed files with 1172 additions and 526 deletions

View File

@@ -9,6 +9,8 @@ const DEFAULTS = {
errors: [],
threshold: null,
progress: null,
pgp_key: null,
haveSavedPGPKey: false,
started: false,
generateWithPGP: false,
pgpKeyFile: { value: '' },
@@ -32,7 +34,7 @@ export default Component.extend(DEFAULTS, {
return this._super(...arguments);
},
onShamirSuccess: _ => _,
onShamirSuccess() {},
// can be overridden w/an attr
isComplete(data) {
return data.complete === true;
@@ -76,6 +78,28 @@ export default Component.extend(DEFAULTS, {
}
},
generateStep: computed('generateWithPGP', 'haveSavedPGPKey', 'otp', 'pgp_key', function() {
let { generateWithPGP, otp, pgp_key, haveSavedPGPKey } = this.getProperties(
'generateWithPGP',
'otp',
'pgp_key',
'haveSavedPGPKey'
);
if (!generateWithPGP && !pgp_key && !otp) {
return 'chooseMethod';
}
if (otp) {
return 'beginGenerationWithOTP';
}
if (generateWithPGP) {
if (pgp_key && haveSavedPGPKey) {
return 'beginGenerationWithPGP';
} else {
return 'providePGPKey';
}
}
}),
extractData(data) {
const isGenerate = this.get('generateAction');
const hasStarted = this.get('started');
@@ -113,6 +137,12 @@ export default Component.extend(DEFAULTS, {
},
actions: {
reset() {
this.reset();
this.set('encoded_token', null);
this.set('otp', null);
},
onSubmit(data) {
if (!data.key) {
return;
@@ -135,8 +165,10 @@ export default Component.extend(DEFAULTS, {
this.set('pgpKeyFile', keyFile);
},
clearToken() {
this.set('encoded_token', null);
savePGPKey() {
if (this.get('pgp_key')) {
this.set('haveSavedPGPKey', true);
}
},
},
});