-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: convert notification banner to text if accounts url is not set #362
fix: convert notification banner to text if accounts url is not set #362
Conversation
Thanks for the pull request, @asadali145! What's next?Please work through the following steps to get your changes ready for engineering review: 🔘 Get product approvalIf you haven't already, check this list to see if your contribution needs to go through the product review process.
🔘 Provide contextTo help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:
🔘 Get a green buildIf one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green. 🔘 Let us know that your PR is ready for review:Who will review my changes?This repository is currently maintained by Where can I find more information?If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources:
When can I expect my changes to be merged?Our goal is to get community contributions seen and reviewed as efficiently as possible. However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:
💡 As a result it may take up to several weeks or months to complete a review and merge your PR. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #362 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 111 111
Lines 1082 1088 +6
Branches 159 165 +6
=========================================
+ Hits 1082 1088 +6 ☔ View full report in Codecov by Sentry. |
8d3709e
to
011c6fe
Compare
</Hyperlink> | ||
{ | ||
isEmpty(getConfig().ACCOUNT_SETTINGS_URL) ? ( | ||
<FormattedMessage {...messages.notificationsBannerLinkMessage} /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It feels a little odd to me to have the notificationsBannerLinkMessage
only be a link sometimes. I think it makes more sense to have 2 (technically 3) fully independent strings:
infoMessage
+notificationsBannerLinkMessage
when we have anACCOUNT_SETTINGS_URL
- Something else entirely when we do not have an
ACCOUNT_SETTINGS_URL
Another option that may be simpler would just be renaming notificationsBannerLinkMessage
to notificationsBannerPreferencesCenterMessage
.
@sarina which option we choose feels a little like a product question to me. Should I tag someone to get a product opinion? If not I'd be happy to merge this with the rename to notificationsBannerPreferencesCenterMessage
as that feels like a smaller change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well for i18n you should embed the URL within the phrase, not concat them, if that's what you're suggesting.
I think the easiest is to rename the message. I think there's a separate DEPR for removing this banner altogether.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good to me!
@asadali145 - if notificationsBannerLinkMessage
is renamed to notificationsBannerPreferencesCenterMessage
this PR will look ready to merge to me!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@brian-smith-tcril thanks for the review. PR is ready.
@@ -1,4 +1,5 @@ | |||
import React from 'react'; | |||
import { isEmpty } from 'lodash'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we know all the possible "empty" values that getConfig().ACCOUNT_SETTINGS_URL
returns? I'd prefer we avoid adding a lodash
dependency to this file if possible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I have replaced the lodash check with the values check. Could you please have another look?
Also, Just a reminder that we have another CTA banner removal PR that's pending for review #347.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for updating the logic not not require lodash
!
@brian-smith-tcril Could you please merge this? |
@asadali145 it looks like this PR needs a rebase as branch protections require it not be out-of-date with the base branch. Would you be able to update it? Once that's done I can hit the merge button. |
a448045
to
b014d97
Compare
@brian-smith-tcril Thank you, I just rebased and the checks are passing. |
…penedx#362) * fix: convert banner to text if ACCOUNT_SETTINGS_URL is not set * refactor: refactoring * refactor: rename notificationsBannerLinkMessage to notificationsBannerPreferencesCenterMessage * refactor: remove lodash usage * refactor: remove lodash usage
Description
The notification banner is always visible and cannot be dismissed. If ACCOUNT_SETTINGS_URL is not set, it redirects to
<ora_grading>/notifications
, which is not a valid URL.This PR displays text instead of a link when the ACCOUNT_SETTINGS_URL is not set.
Screenshots
Before:
After (If ACCOUNT_SETTINGS_URL is not set):
After (If ACCOUNT_SETTINGS_URL is set):