Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: misc UX fixes #833

Merged
merged 4 commits into from
Dec 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,9 @@
Key safely:
</div>
<div class="instructions-caption">
<b class="agree-text no-select"
>I understand the consequences and have<br />
stored my secret key in 2 other places</b
>
<b class="agree-text no-select">
I have shared my secret key with a colleague
</b>
</div>
<div ng-form name="acknowledgementForm">
<input
Expand All @@ -72,7 +71,7 @@
name="acknowledgementInput"
type="text"
autocomplete="off"
placeholder="I understand the consequences and have stored my secret key in 2 other places"
placeholder="I have shared my secret key with a colleague"
ng-paste="$event.preventDefault()"
ng-model="inputAcknowledgement"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ const createTempSettings = (myform) => {
let tempForm = {}
SETTINGS_PATH.forEach((path) => set(tempForm, path, get(myform, path)))
tempForm.mode = 'edit'
if (Array.isArray(tempForm.emails)) {
tempForm.emails = tempForm.emails.join(', ')
}
return tempForm
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,7 @@ function verifySecretKeyDirective(FormSgSdk) {
.toLowerCase()
.replace(/\./g, '')
.replace(/ +/g, ' ')
.trim() !==
'i understand the consequences and have stored my secret key in 2 other places'
.trim() !== 'i have shared my secret key with a colleague'
)
//Allow regardless of whether user types in upper / lowercase, ignore full stops and multiple spaces
}
Expand All @@ -86,9 +85,7 @@ function verifySecretKeyDirective(FormSgSdk) {
}

const encryptionKey = createEncryptionKey($scope.publicKey, secretKey)
if (encryptionKey !== null) {
Toastr.success('Verified!')
} else {
if (!encryptionKey) {
Toastr.error(getErrorMessage('invalid-key'))
}
$scope.callback({ encryptionKey })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,11 @@
<div class="alert-msg">
<span class="alert-content">
<b>Ways to safekeep</b>
<a
(<a
translate-attr="{ href: 'LINKS.GUIDE.SECRET_KEY_SAFEKEEPING' }"
target="_blank"
>(guide)</a
>
>guide</a
>)
<ul>
<li>
<a
Expand Down
2 changes: 1 addition & 1 deletion tests/end-to-end/helpers/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,7 @@ async function addSettings(t, formOptions, captchaEnabled, webhookUrl) {
.typeText(activateFormModal.secretKeyInput, formOptions.secretKey)
.typeText(
activateFormModal.acknowledgementInput,
'I understand the consequences and have stored my secret key in 2 other places',
'I have shared my secret key with a colleague',
)
.click(activateFormModal.activateFormBtn)
} else if (formOptions.authType !== 'NIL') {
Expand Down