-
Notifications
You must be signed in to change notification settings - Fork 4.1k
ENG-1057 - Improve modal experience #7707
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
Conversation
WalkthroughThe changes primarily enhance the modal management system within the application. Modals are now prioritized based on their importance, with logic updated to control their visibility depending on user interactions with promotions. The Changes
Assessment against linked issues
Possibly related PRs
Poem
Recent review detailsConfiguration used: CodeRabbit UI Files selected for processing (2)
Files skipped from review as they are similar to previous changes (2)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Great work!!!
expect(user.shouldSeePromotion()).toBe(true) | ||
}) | ||
|
||
it('returns false if promotion has been seen', function () { |
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.
what happens for the users who have value true or false set instead of date?
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.
@mrfinch tests pushed for legacy boolean values!
b92d1b2
to
3c6aaad
Compare
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.
Actionable comments posted: 1
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- test/app/models/User.spec.js (1 hunks)
Additional context used
Biome
test/app/models/User.spec.js
[error] 90-90: Don't focus the test.
The 'only' method is often used for debugging or during implementation. It should be removed before deploying to production.
Consider removing 'only' to ensure all tests are executed.
Unsafe fix: Remove focus from test.(lint/suspicious/noFocusedTests)
Additional comments not posted (7)
test/app/models/User.spec.js (7)
10-16
: LGTM!The test cases for experience functions look good. They cover the expected behavior and edge cases.
18-25
: LGTM!The test cases for level calculation look good. They cover the expected behavior and edge cases.
27-54
: LGTM!The test cases for user email subscriptions look good. They cover the expected behavior and edge cases.
56-72
: LGTM!The test cases for user validation look good. They cover the expected behavior and edge cases.
74-88
: LGTM!The test cases for
inEU
function look good. They cover the expected behavior and edge cases.
101-114
: Test cases for legacy promotion values look good.The test cases cover the scenarios mentioned in the past review comment about handling users with legacy
true
orfalse
values for promotions. The behavior looks correct.
116-135
: LGTM!The test cases for checking the last seen promotion date look good. They cover the expected behavior and edge cases.
test/app/models/User.spec.js
Outdated
}) | ||
}) | ||
|
||
fdescribe('shouldSeePromotion', function () { |
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.
Remove the focus from the test block.
The use of fdescribe
is not recommended as it focuses only on this test block and skips others. This could lead to other test blocks being skipped, which may cause issues to go unnoticed.
Apply this diff to remove the focus:
-fdescribe('shouldSeePromotion', function () {
+describe('shouldSeePromotion', function () {
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
fdescribe('shouldSeePromotion', function () { | |
describe('shouldSeePromotion', function () { |
Tools
Biome
[error] 90-90: Don't focus the test.
The 'only' method is often used for debugging or during implementation. It should be removed before deploying to production.
Consider removing 'only' to ensure all tests are executed.
Unsafe fix: Remove focus from test.(lint/suspicious/noFocusedTests)
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.
@adamkecskes can you change the fdescribe to describe?
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.
Seems like the humans are having a chat. I'll hop back into my burrow for now. If you need me again, just tag @coderabbitai in a new comment, and I'll come hopping out!
test/app/models/User.spec.js
Outdated
}) | ||
}) | ||
|
||
fdescribe('shouldSeePromotion', function () { |
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.
@adamkecskes can you change the fdescribe to describe?
app/schemas/models/user.js
Outdated
'hackstack-beta-release-modal': { type: 'boolean' }, | ||
'curriculum-sidebar-promotion-modal': { type: 'boolean' }, | ||
'hp-junior-modal': { type: 'boolean' } | ||
'hackstack-beta-release-modal': c.date(), |
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.
unless we are planning to backfill data, user.save might start to fail. Good idea to keep both boolean and date
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.
@mrfinch fixed.
<ModalDyanmicContent
has a new prop:priority<number>
. The modal with higher prio will be shown first.Summary by CodeRabbit
Release Notes
New Features
Bug Fixes
Tests
Documentation