feat: improve strings, challenges, and template readiness

This commit is contained in:
Mo Bitar
2020-09-23 22:33:33 -05:00
parent 825ec6bcbb
commit b3e5ca340d
21 changed files with 48 additions and 74 deletions

View File

@@ -1,15 +1,15 @@
.sk-modal-background(ng-click="ctrl.cancel()")
.challenge-modal.sk-modal-content
.challenge-modal.sk-modal-content(ng-if='ctrl.templateReady')
.sn-component
.sk-panel
.sk-panel-header
.sk-panel-header-title {{ctrl.modalTitle}}
.sk-panel-header-title {{ctrl.challenge.modalTitle}}
.sk-panel-content
.sk-panel-section
.sk-p.sk-panel-row.centered.prompt
strong {{ctrl.state.title}}
.sk-p.sk-panel-row.centered.subprompt(ng-if='ctrl.state.subtitle')
| {{ctrl.state.subtitle}}
strong {{ctrl.challenge.heading}}
.sk-p.sk-panel-row.centered.subprompt(ng-if='ctrl.challenge.subheading')
| {{ctrl.challenge.subheading}}
.sk-panel-section
div(ng-repeat="prompt in ctrl.state.prompts track by prompt.id")
.sk-panel-row

View File

@@ -12,8 +12,6 @@ import { WebDirective } from '@/types';
import { confirmDialog } from '@/services/alertService';
import {
STRING_SIGN_OUT_CONFIRMATION,
STRING_STORAGE_UPDATE,
STRING_AUTHENTICATION_REQUIRED,
} from '@/strings';
type InputValue = {
@@ -32,8 +30,6 @@ type ChallengeModalState = {
showForgotPasscodeLink: boolean,
processingPrompts: ChallengePrompt[],
hasAccount: boolean,
title: string,
subtitle: string
}
class ChallengeModalCtrl extends PureViewCtrl<{}, ChallengeModalState> {
@@ -93,8 +89,6 @@ class ChallengeModalCtrl extends PureViewCtrl<{}, ChallengeModalState> {
forgotPasscode: false,
showForgotPasscodeLink,
hasAccount: this.application.hasAccount(),
title: this.challenge.title,
subtitle: this.challenge.subtitle,
processingPrompts: []
});
this.application.addChallengeObserver(
@@ -137,14 +131,6 @@ class ChallengeModalCtrl extends PureViewCtrl<{}, ChallengeModalState> {
});
}
get modalTitle(): string {
if (this.challenge.reason === ChallengeReason.Migration) {
return STRING_STORAGE_UPDATE;
} else {
return STRING_AUTHENTICATION_REQUIRED;
}
}
async destroyLocalData() {
if (await confirmDialog({
text: STRING_SIGN_OUT_CONFIRMATION,