Skip to content

Commit

Permalink
fix(storefront): BCTHEME-806 Password complexity error message does n…
Browse files Browse the repository at this point in the history
…ot reflect the requirements set in the store settings
  • Loading branch information
jordanarldt committed Oct 27, 2021
1 parent 74b4671 commit 883bc44
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 24 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## Draft
- Fixed password complexity error not displaying the complexity rules set in the store settings [#2117](https://github.com/bigcommerce/cornerstone/pull/2117)

## 6.1.0 (09-03-2021)
- Fixed images placeholder on hero carousel shifted on mobile when slide has content. [#2112](https://github.com/bigcommerce/cornerstone/pull/2112)
Expand Down
4 changes: 2 additions & 2 deletions assets/js/theme/account.js
Original file line number Diff line number Diff line change
Expand Up @@ -347,15 +347,15 @@ export default class Account extends PageManager {
}

if ($passwordElement && $password2Element) {
const { password: enterPassword, password_match: matchPassword, invalid_password: invalidPassword } = this.validationDictionary;
const { password: enterPassword, password_match: matchPassword } = this.validationDictionary;
editValidator.remove(passwordSelector);
editValidator.remove(password2Selector);
Validators.setPasswordValidation(
editValidator,
passwordSelector,
password2Selector,
this.passwordRequirements,
createPasswordValidationErrorTextObject(enterPassword, enterPassword, matchPassword, invalidPassword),
createPasswordValidationErrorTextObject(enterPassword, enterPassword, matchPassword, this.passwordRequirements.error),
true,
);
}
Expand Down
8 changes: 4 additions & 4 deletions assets/js/theme/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,15 +89,15 @@ export default class Auth extends PageManager {
}

registerNewPasswordValidation() {
const { password: enterPassword, password_match: matchPassword, invalid_password: invalidPassword } = this.validationDictionary;
const { password: enterPassword, password_match: matchPassword } = this.validationDictionary;
const newPasswordForm = '.new-password-form';
const newPasswordValidator = nod({
submit: $(`${newPasswordForm} input[type="submit"]`),
tap: announceInputErrorMessage,
});
const passwordSelector = $(`${newPasswordForm} input[name="password"]`);
const password2Selector = $(`${newPasswordForm} input[name="password_confirm"]`);
const errorTextMessages = createPasswordValidationErrorTextObject(enterPassword, enterPassword, matchPassword, invalidPassword);
const errorTextMessages = createPasswordValidationErrorTextObject(enterPassword, enterPassword, matchPassword, this.passwordRequirements.error);
Validators.setPasswordValidation(
newPasswordValidator,
passwordSelector,
Expand Down Expand Up @@ -157,7 +157,7 @@ export default class Auth extends PageManager {
}

if ($passwordElement && $password2Element) {
const { password: enterPassword, password_match: matchPassword, invalid_password: invalidPassword } = this.validationDictionary;
const { password: enterPassword, password_match: matchPassword } = this.validationDictionary;

createAccountValidator.remove(passwordSelector);
createAccountValidator.remove(password2Selector);
Expand All @@ -166,7 +166,7 @@ export default class Auth extends PageManager {
passwordSelector,
password2Selector,
this.passwordRequirements,
createPasswordValidationErrorTextObject(enterPassword, enterPassword, matchPassword, invalidPassword),
createPasswordValidationErrorTextObject(enterPassword, enterPassword, matchPassword, this.passwordRequirements.error),
);
}

Expand Down
5 changes: 3 additions & 2 deletions assets/js/theme/global/quick-search.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ export default function () {
}
};

// stagger searching for 200ms after last input
// stagger searching for 1200ms after last input
const debounceWaitTime = 1200;
const doSearch = _.debounce((searchQuery) => {
utils.api.search.search(searchQuery, { template: 'search/quick-results' }, (err, response) => {
if (err) {
Expand Down Expand Up @@ -62,7 +63,7 @@ export default function () {
}, 100);
}
});
}, 200);
}, debounceWaitTime);

utils.hooks.on('search-quick', (event, currentTarget) => {
const searchQuery = $(currentTarget).val();
Expand Down
7 changes: 3 additions & 4 deletions assets/scss/components/stencil/productView/_productView.scss
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
@include lazy-loaded-img;
/* Object-fit polyfill */
font-family: "object-fit: contain;";
max-height: 100%;
height: 100%;
object-fit: contain;
width: 100%;
}
Expand Down Expand Up @@ -98,8 +98,7 @@

.productView-thumbnail {
@include grid-column(3);
padding-left: spacing("quarter");
padding-right: spacing("quarter");
padding: spacing("quarter");
text-align: center;

@include breakpoint("large") {
Expand All @@ -110,7 +109,7 @@
.productView-thumbnail-link {
border: container("border");
box-sizing: content-box;
display: inline-flex;
display: flex;
height: 67px;
justify-content: center;
max-width: 75px;
Expand Down
14 changes: 2 additions & 12 deletions assets/scss/layouts/footer/_footer.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
// 1. To enable the grid's display: inline-block; to work properly, we need to
// remove the white-space that it creates between columns with font-size: 0;
// 2. Re-set the font-size that was reduced to 0 in point 1 for children.
// 3. Fix for text flickers on windows devices
//
// -----------------------------------------------------------------------------

Expand All @@ -17,6 +18,7 @@
border-top: container("border");
padding: spacing("double") 0;
position: relative;
transform: translateZ(0); // 3
}

.footer-title-sr-only {
Expand Down Expand Up @@ -167,18 +169,6 @@
}
}

.footer-geotrust-ssl-seal {
@include breakpoint("small") {
bottom: 0;
position: absolute;
right: 16px;
}

table {
margin: auto;
}
}

.footer-newsletter-summary {
text-align: left;
}
5 changes: 5 additions & 0 deletions templates/components/cart/additional-checkout-buttons.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{{#if cart.additional_checkout_buttons}}
{{#each cart.additional_checkout_buttons}}
{{{this}}}
{{/each}}
{{/if}}

0 comments on commit 883bc44

Please sign in to comment.