diff --git a/client/coral-admin/src/actions/install.js b/client/coral-admin/src/actions/install.js index 122ffdc4a..33cefab63 100644 --- a/client/coral-admin/src/actions/install.js +++ b/client/coral-admin/src/actions/install.js @@ -66,6 +66,28 @@ const validation = (formData, dispatch, next) => { return; } + // Confirm Validation + const prefixLength = 'confirm'.length; + const confirm = validKeys + .filter((name) => { + if (!name.startsWith('confirm')) { + return false; + } + + // Check that 'confirmX' equals 'X'. + const other = name.substr(prefixLength, 1).toLowerCase() + name.substr(prefixLength + 1); + const cond = formData[other] !== formData[name]; + if (cond) { + dispatch(addError(name, errorMsj[name])); + } + return cond; + }); + + if (confirm.length) { + dispatch(hasError()); + return; + } + dispatch(clearErrors()); next(); }; diff --git a/client/coral-admin/src/routes/Install/components/Steps/CreateYourAccount.js b/client/coral-admin/src/routes/Install/components/Steps/CreateYourAccount.js index c5d334610..2a5b87e5f 100644 --- a/client/coral-admin/src/routes/Install/components/Steps/CreateYourAccount.js +++ b/client/coral-admin/src/routes/Install/components/Steps/CreateYourAccount.js @@ -48,7 +48,7 @@ const InitialStep = (props) => { label={t('install.create.confirm_password')} onChange={handleUserChange} showErrors={install.showErrors} - errorMsg={install.errors.confirm_password} + errorMsg={install.errors.confirmPassword} /> { diff --git a/client/coral-admin/src/routes/Moderation/components/Comment.js b/client/coral-admin/src/routes/Moderation/components/Comment.js index 9b0477472..3c5e535b2 100644 --- a/client/coral-admin/src/routes/Moderation/components/Comment.js +++ b/client/coral-admin/src/routes/Moderation/components/Comment.js @@ -54,7 +54,7 @@ class Comment extends React.Component { // currently the highlighter plugin does not support out of the box. const searchWords = [...suspectWords, ...bannedWords] .filter((w) => { - return new RegExp(`(^|\\s)${w}(\\s|$)`).test(comment.body); + return new RegExp(`(^|\\s)${w}(\\s|$)`, 'i').test(comment.body); }) .concat(linkText);