Skip to content
New issue

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

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

Already on GitHub? # to your account

Fix "undefined" Tooltip Messages #3364

Merged
merged 3 commits into from
Apr 8, 2024
Merged

Fix "undefined" Tooltip Messages #3364

merged 3 commits into from
Apr 8, 2024

Conversation

aaronskiba
Copy link
Contributor

Fixes #3361

Changes proposed in this PR:

  • Prior to this change, asterisk was evaluating to undefined. Moving getConstant('REQUIRED_FIELD_TEXT') inside of the requiredField.js jQuery callback ensures that REQUIRED_FIELD_TEXT will be loaded before getConstant() attempts to retrieve it.
  • The constant, VALIDATION_MESSAGE_PASSWORDS_MATCH was previously removed (here). However, this PR puts the constant back, because getConstant('VALIDATION_MESSAGE_PASSWORDS_MATCH') is executed in passwordHelper.js.

@aaronskiba aaronskiba linked an issue Jan 24, 2024 that may be closed by this pull request
@aaronskiba aaronskiba requested a review from gjacob24 February 26, 2024 16:21
@gjacob24
Copy link
Contributor

gjacob24 commented Mar 6, 2024

Hi @aaronskiba I have a question about where the constant VALIDATION_MESSAGE_PASSWORDS_MATCH is used in the code. I presume it's when you reset your password but I see a different message when I try to save mismatched passwords. Can you tell me how to test if the constant is used as expected please? Thanks!

@aaronskiba
Copy link
Contributor Author

Hi @aaronskiba I have a question about where the constant VALIDATION_MESSAGE_PASSWORDS_MATCH is used in the code. I presume it's when you reset your password but I see a different message when I try to save mismatched passwords. Can you tell me how to test if the constant is used as expected please? Thanks!

Hi @gjacob24,

Sorry for slow reply on this one. Also, this constant is a bit tricky to test locally, but here's one way.

  1. On the sign-in page, click the Forgot password? link.
  2. Enter an email that exists within your local db, and click send.
  3. No email will be sent to you. However, you can find a link within the terminal. Here's what mine looks like:
  <p>
    Hello super_admin@example.com
  </p>
  <p>
    Someone has requested a link to change your DMPRoadmap password. You can do this through the link below.
  </p>
  <p><a href="http://Aarons-Mac-mini/users/password/edit?reset_password_token=XpnsHx1Hwkqgx1yZzRbq">Change my password</a></p>
  1. Replace the host with 127.0.0.1:300 and navigate to that link (e.g. 127.0.0.1:3000/users/password/edit?reset_password_token=XpnsHx1Hwkqgx1yZzRbq)
  2. Enter mismatching passwords and click 'Save'. The The passwords must match. message should render.

@gjacob24
Copy link
Contributor

Hi @aaronskiba, thank you for explaining how to test the second one. Glad I asked because I noticed this page needed some polishing after the Bootstrap upgrade.
Anyway, I have tested both your code changes now. It works as expected and can be merged.

Copy link
Contributor

@gjacob24 gjacob24 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both code changes work as expected. This PR can be merged into the development branch for the upcoming release.

@aaronskiba
Copy link
Contributor Author

Both code changes work as expected. This PR can be merged into the development branch for the upcoming release.

Great to hear, thank you. Also, I finally added/committed a changelog entry for this one as well. :)

@gjacob24
Copy link
Contributor

Great to hear, thank you. Also, I finally added/committed a changelog entry for this one as well. :)

Great, ok. I was going to suggest adding change log entries together in one commit for your PRs but I guess this is better. Thanks!

Prior to this commit, requiredField.js was calling getConstant('REQUIRED_FIELD_TEXT') before the constant was loaded to constants.js. As a result, `asterisk` was evaluating to `undefined`.
getConstant('VALIDATION_MESSAGE_PASSWORDS_MATCH') still exists in passwordhelper.js

Was previously removed here: portagenetwork@33a6058
@gjacob24 gjacob24 merged commit 7bef45f into development Apr 8, 2024
9 checks passed
@gjacob24 gjacob24 deleted the aaron/issues/3361 branch April 8, 2024 16:37
@benjaminfaure benjaminfaure mentioned this pull request Apr 9, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

constants.js Returning Undefined For Some Keys
2 participants