From d9a23b87272b663ccd5f205710fb53566607f531 Mon Sep 17 00:00:00 2001 From: Vitalii Shpital <46756926+VitaliiShpital@users.noreply.github.com> Date: Fri, 29 Nov 2019 14:52:21 +0200 Subject: [PATCH] web/satellite: password strength implemented on register page (#3669) --- .../src/components/common/HeaderlessInput.vue | 10 + .../src/views/register/RegisterArea.vue | 14 +- .../passwordStrength/PasswordStrength.vue | 260 ++++++++++++++++++ .../src/views/register/registerArea.html | 16 +- .../static/images/register/StrengthVector.svg | 3 + 5 files changed, 291 insertions(+), 12 deletions(-) create mode 100644 web/satellite/src/views/register/passwordStrength/PasswordStrength.vue create mode 100644 web/satellite/static/images/register/StrengthVector.svg diff --git a/web/satellite/src/components/common/HeaderlessInput.vue b/web/satellite/src/components/common/HeaderlessInput.vue index 389173c6b..447080a57 100644 --- a/web/satellite/src/components/common/HeaderlessInput.vue +++ b/web/satellite/src/components/common/HeaderlessInput.vue @@ -17,6 +17,8 @@ :placeholder="placeholder" :type="type" :style="style.inputStyle" + @focus="showPasswordStrength" + @blur="hidePasswordStrength" /> this.maxSymbols) { diff --git a/web/satellite/src/views/register/RegisterArea.vue b/web/satellite/src/views/register/RegisterArea.vue index 4af61ec57..e2914d94c 100644 --- a/web/satellite/src/views/register/RegisterArea.vue +++ b/web/satellite/src/views/register/RegisterArea.vue @@ -8,7 +8,6 @@ import { Component, Vue } from 'vue-property-decorator'; import HeaderlessInput from '@/components/common/HeaderlessInput.vue'; import RegistrationSuccessPopup from '@/components/common/RegistrationSuccessPopup.vue'; -import VInfo from '@/components/common/VInfo.vue'; import AuthIcon from '@/../static/images/AuthImage.svg'; import InfoIcon from '@/../static/images/info.svg'; @@ -21,15 +20,16 @@ import { APP_STATE_ACTIONS } from '@/utils/constants/actionNames'; import { LOADING_CLASSES } from '@/utils/constants/classConstants'; import { LocalData } from '@/utils/localData'; import { validateEmail, validatePassword } from '@/utils/validation'; +import PasswordStrength from '@/views/register/passwordStrength/PasswordStrength.vue'; @Component({ components: { HeaderlessInput, RegistrationSuccessPopup, - VInfo, AuthIcon, LogoIcon, InfoIcon, + PasswordStrength, }, }) export default class RegisterArea extends Vue { @@ -55,6 +55,8 @@ export default class RegisterArea extends Vue { private readonly auth: AuthHttpApi = new AuthHttpApi(); + public isPasswordStrengthShown: boolean = false; + async mounted(): Promise { if (this.$route.query.token) { this.secret = this.$route.query.token.toString(); @@ -77,6 +79,14 @@ export default class RegisterArea extends Vue { } } + public showPasswordStrength(): void { + this.isPasswordStrengthShown = true; + } + + public hidePasswordStrength(): void { + this.isPasswordStrengthShown = false; + } + public async onCreateClick(): Promise { if (this.isLoading) { return; diff --git a/web/satellite/src/views/register/passwordStrength/PasswordStrength.vue b/web/satellite/src/views/register/passwordStrength/PasswordStrength.vue new file mode 100644 index 000000000..778cfe9ca --- /dev/null +++ b/web/satellite/src/views/register/passwordStrength/PasswordStrength.vue @@ -0,0 +1,260 @@ +// Copyright (C) 2019 Storj Labs, Inc. +// See LICENSE for copying information. + + + + + + diff --git a/web/satellite/src/views/register/registerArea.html b/web/satellite/src/views/register/registerArea.html index 9a1064b95..aaefbe9f2 100644 --- a/web/satellite/src/views/register/registerArea.html +++ b/web/satellite/src/views/register/registerArea.html @@ -53,12 +53,13 @@ width="100%" height="46px" is-password="true" + @showPasswordStrength="showPasswordStrength" + @hidePasswordStrength="hidePasswordStrength" + /> + - - -
- - -
diff --git a/web/satellite/static/images/register/StrengthVector.svg b/web/satellite/static/images/register/StrengthVector.svg new file mode 100644 index 000000000..cb64eb8e9 --- /dev/null +++ b/web/satellite/static/images/register/StrengthVector.svg @@ -0,0 +1,3 @@ + + +