FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Fix "undefined" Tooltip Messages by aaronskiba · Pull Request #3364 · DMPRoadmap/roadmap · GitHub

Repository navigation

Fix "undefined" Tooltip Messages - #3364

Merged
gjacob24 merged 3 commits into
developmentfrom
aaron/issues/3361
Apr 8, 2024
Merged

gjacob24 merged 3 commits into
developmentfrom
aaron/issues/3361

Conversation

Copy link
Copy Markdown
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 linked an issue Jan 24, 2024 that may be closed by this pull request
aaronskiba requested a review from gjacob24 February 26, 2024 16:21

gjacob24 commented Mar 6, 2024

Copy link
Copy Markdown
Contributor

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!

Copy link
Copy Markdown
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.

Copy link
Copy Markdown
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.

gjacob24 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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

Copy link
Copy Markdown
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. :)

Copy link
Copy Markdown
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 merged commit 7bef45f into development Apr 8, 2024
gjacob24 deleted the aaron/issues/3361 branch April 8, 2024 16:37
benjaminfaure mentioned this pull request Apr 9, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in 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


Back | FazBrowse Home | New Git URL