From d1afbf4b924c82eb9ea3da3154160bdb617c397b Mon Sep 17 00:00:00 2001 From: Sabe Jones Date: Thu, 31 Oct 2019 13:16:09 -0500 Subject: [PATCH] Revert "Minimum password length + Static Pages fixes (#11474)" This reverts commit e1d30eec98f43dcdcc52293f11002d41e08ee683. --- .../user/auth/POST-register_local.test.js | 18 ----- .../auth/PUT-user_update_password.test.js | 14 ---- website/client/src/assets/scss/button.scss | 22 ++---- website/client/src/assets/scss/form.scss | 17 ----- .../client/src/components/auth/authForm.vue | 43 +----------- .../components/auth/registerLoginReset.vue | 61 ++++------------ website/client/src/components/static/home.vue | 69 +++++++------------ .../src/components/static/staticWrapper.vue | 64 +++++++++-------- website/common/locales/en/front.json | 1 - website/common/script/constants.js | 2 - website/common/script/index.js | 2 - website/server/controllers/api-v3/auth.js | 4 -- website/server/libs/auth/index.js | 5 -- 13 files changed, 80 insertions(+), 242 deletions(-) diff --git a/test/api/v3/integration/user/auth/POST-register_local.test.js b/test/api/v3/integration/user/auth/POST-register_local.test.js index e435d77dd0..896e20a0c0 100644 --- a/test/api/v3/integration/user/auth/POST-register_local.test.js +++ b/test/api/v3/integration/user/auth/POST-register_local.test.js @@ -326,24 +326,6 @@ describe('POST /user/auth/local/register', () => { }); }); - it('requires minimum length for the password', async () => { - const username = generateRandomUserName(); - const email = `${username}@example.com`; - const password = '1234567'; - const confirmPassword = '1234567'; - - await expect(api.post('/user/auth/local/register', { - username, - email, - password, - confirmPassword, - })).to.eventually.be.rejected.and.eql({ - code: 400, - error: 'BadRequest', - message: t('invalidReqParams'), - }); - }); - it('requires a username', async () => { const email = `${generateRandomUserName()}@example.com`; const password = 'password'; diff --git a/test/api/v3/integration/user/auth/PUT-user_update_password.test.js b/test/api/v3/integration/user/auth/PUT-user_update_password.test.js index 94fbd4f3e2..a46eb0f916 100644 --- a/test/api/v3/integration/user/auth/PUT-user_update_password.test.js +++ b/test/api/v3/integration/user/auth/PUT-user_update_password.test.js @@ -82,20 +82,6 @@ describe('PUT /user/auth/update-password', async () => { }); }); - it('returns an error when newPassword is too short', async () => { - const body = { - password, - newPassword: '1234567', - confirmPassword: '1234567', - }; - - await expect(user.put(ENDPOINT, body)).to.eventually.be.rejected.and.eql({ - code: 400, - error: 'BadRequest', - message: t('invalidReqParams'), - }); - }); - it('returns an error when confirmPassword is missing', async () => { const body = { password, diff --git a/website/client/src/assets/scss/button.scss b/website/client/src/assets/scss/button.scss index 0a2220a215..bc649e1dc5 100644 --- a/website/client/src/assets/scss/button.scss +++ b/website/client/src/assets/scss/button.scss @@ -20,7 +20,7 @@ @include btn-focus-hover-shadow(); } - &:hover:not(.btn-flat):not(.disabled):not(:disabled) { + &:hover:not(.btn-flat):not(.disabled) { @include btn-focus-hover-shadow(); border-color: transparent; } @@ -49,7 +49,7 @@ background: $purple-200; } - &:hover:not(:disabled):not(.disabled), &:active:not(:disabled):not(.disabled), &.active:not(:disabled):not(.disabled), &:focus:not(:disabled):not(.disabled) { + &:hover:not(:disabled), &:active, &.active, &:focus { background: #5d3b9c !important; color: $white; } @@ -59,7 +59,7 @@ color: $gray-50; background: $white !important; - &:hover:not(:disabled):not(.disabled), &:active:not(:disabled):not(.disabled), &.active:not(:disabled):not(.disabled), &:focus:not(:disabled):not(.disabled) { + &:hover:not(:disabled):not(.disabled), &:active, &.active, &:focus { color: $purple-200 !important; } @@ -80,7 +80,7 @@ background: $green-100; } - &:hover:not(:disabled):not(.disabled), &:active:not(:disabled):not(.disabled), &.active:not(:disabled):not(.disabled) { + &:hover:not(:disabled), &:active, &.active { background: $green-50; } } @@ -96,12 +96,8 @@ background: $blue-50; } - &:hover:not(:disabled):not(.disabled) { - background-color: $blue-100; - } - - &:active:not(:disabled):not(.disabled), &.active:not(:disabled):not(.disabled) { - background: $blue-50; + &:hover:not(:disabled), &:active, &.active { + background: $blue-100; } } @@ -112,11 +108,7 @@ background: $red-50; } - &:hover:not(:disabled):not(.disabled) { - background: $red-100; - } - - &:active:not(:disabled):not(.disabled), &.active:not(:disabled):not(.disabled) { + &:hover:not(:disabled), &:active, &.active { background: $red-100; } } diff --git a/website/client/src/assets/scss/form.scss b/website/client/src/assets/scss/form.scss index 2e5934f5d5..78b7e5397a 100644 --- a/website/client/src/assets/scss/form.scss +++ b/website/client/src/assets/scss/form.scss @@ -65,7 +65,6 @@ input, textarea, input.form-control, textarea.form-control { padding-right: 40px; background-image: url(~@/assets/svg/for-css/alert.svg); background-size: 16px 16px; - border-color: $red-100 !important; } } @@ -277,19 +276,3 @@ $bg-disabled-control: #34303a; .toggle-switch-container.no-margin { margin-top: 0 !important; } - - - -// Disable default style Firefox for invalid elements. -// Selectors taken from view-source:resource://gre-resources/forms.css on Firefox -:not(output):-moz-ui-invalid { - box-shadow: none; -} - -:not(output):-moz-ui-invalid:-moz-focusring { - box-shadow: none; -} - -output:-moz-ui-invalid { - color: inherit; -} diff --git a/website/client/src/components/auth/authForm.vue b/website/client/src/components/auth/authForm.vue index 993ed9cb10..7d3fa83e7d 100644 --- a/website/client/src/components/auth/authForm.vue +++ b/website/client/src/components/auth/authForm.vue @@ -46,13 +46,6 @@ :placeholder="$t('usernamePlaceholder')" :class="{'input-valid': usernameValid, 'input-invalid': usernameInvalid}" > -
- {{ issue }} -
-
- {{ $t('minPasswordLength') }} -
-
- {{ $t('passwordConfirmationMatch') }} -
@@ -220,7 +194,7 @@ import hello from 'hellojs'; import debounce from 'lodash/debounce'; import isEmail from 'validator/lib/isEmail'; import { setUpAxios } from '@/libs/auth'; -import { MINIMUM_PASSWORD_LENGTH } from '@/../../common/script/constants'; + import facebookSquareIcon from '@/assets/svg/facebook-square.svg'; import googleIcon from '@/assets/svg/google.svg'; @@ -249,7 +223,6 @@ export default { return isEmail(this.email); }, emailInvalid () { - if (this.email.length <= 3) return false; return !this.emailValid; }, usernameValid () { @@ -257,23 +230,13 @@ export default { return this.usernameIssues.length === 0; }, usernameInvalid () { - if (this.username.length < 1) return false; return !this.usernameValid; }, - passwordValid () { - if (this.password.length <= 0) return false; - return this.password.length >= MINIMUM_PASSWORD_LENGTH; - }, - passwordInvalid () { - if (this.password.length <= 0) return false; - return this.password.length < MINIMUM_PASSWORD_LENGTH; - }, passwordConfirmValid () { if (this.passwordConfirm.length <= 3) return false; return this.passwordConfirm === this.password; }, passwordConfirmInvalid () { - if (this.passwordConfirm.length <= 3) return false; return !this.passwordConfirmValid; }, }, diff --git a/website/client/src/components/auth/registerLoginReset.vue b/website/client/src/components/auth/registerLoginReset.vue index 9074a36a32..e76d1a902d 100644 --- a/website/client/src/components/auth/registerLoginReset.vue +++ b/website/client/src/components/auth/registerLoginReset.vue @@ -6,7 +6,8 @@
@@ -68,7 +69,7 @@ -
- {{ $t('minPasswordLength') }} -
-
- {{ $t('passwordConfirmationMatch') }} -
- - +
@@ -800,7 +796,6 @@ import lifehacker from '@/assets/images/home/lifehacker.svg'; import makeuseof from '@/assets/images/home/make-use-of.svg'; import thenewyorktimes from '@/assets/images/home/the-new-york-times.svg'; import * as Analytics from '@/libs/analytics'; -import { MINIMUM_PASSWORD_LENGTH } from '@/../../common/script/constants'; export default { data () { @@ -849,14 +844,6 @@ export default { if (this.username.length < 1) return false; return !this.usernameValid; }, - passwordValid () { - if (this.password.length <= 0) return false; - return this.password.length >= MINIMUM_PASSWORD_LENGTH; - }, - passwordInvalid () { - if (this.password.length <= 0) return false; - return this.password.length < MINIMUM_PASSWORD_LENGTH; - }, passwordConfirmValid () { if (this.passwordConfirm.length <= 3) return false; return this.passwordConfirm === this.password; @@ -865,12 +852,6 @@ export default { if (this.passwordConfirm.length <= 3) return false; return this.passwordConfirm !== this.password; }, - signupFormInvalid () { - return this.usernameInvalid - || this.emailInvalid - || this.passwordInvalid - || this.passwordConfirmInvalid; - }, }, watch: { username () { diff --git a/website/client/src/components/static/staticWrapper.vue b/website/client/src/components/static/staticWrapper.vue index 922a33e840..89cb9fb77c 100644 --- a/website/client/src/components/static/staticWrapper.vue +++ b/website/client/src/components/static/staticWrapper.vue @@ -85,6 +85,10 @@ } } + #bottom-wrap.purple-4 { + background-color: #271b3d; + } + #purple-footer { background-color: #271b3d; @@ -111,6 +115,33 @@ } } + #bottom-wrap { + padding-top: 10em; + } + + #bottom-background { + position: relative; + + .seamless_mountains_demo_repeat { + background-image: url('~@/assets/images/auth/seamless_mountains_demo.png'); + background-repeat: repeat-x; + width: 100%; + height: 300px; + position: absolute; + z-index: 0; + bottom: 0; + } + + .midground_foreground_extended2 { + background-image: url('~@/assets/images/auth/midground_foreground_extended2.png'); + position: relative; + width: 1500px; + max-width: 100%; + height: 150px; + margin: 0 auto; + } + } + .static-wrapper { .container-fluid { margin: 5em 2em 2em 2em; @@ -140,39 +171,6 @@ } - -