-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Hide CampaignView buttons that shouldn't be there in campaign editor #7830
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 introduced in this pull request enhance the conditional rendering logic within the Changes
Possibly related PRs
Suggested reviewers
Warning Rate limit exceeded@nwinter has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 12 minutes and 26 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. Warning There were issues while running some tools. Please review the errors and either fix the tool’s configuration or disable the tool if it’s a critical failure. 🔧 eslint
warning eslint@8.57.1: This version is no longer supported. Please see https://eslint.org/version-support for other options. 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.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (1)
app/views/play/CampaignView.js (1)
2139-2140
: Consider using a constant for the campaign slug.While the logic is correct, consider extracting 'game-dev-hoc' into a named constant to improve maintainability and prevent typos.
- return this.campaign?.get('slug') === 'game-dev-hoc' && !this.editorMode + const GAME_DEV_HOC_CAMPAIGN = 'game-dev-hoc' + return this.campaign?.get('slug') === GAME_DEV_HOC_CAMPAIGN && !this.editorMode
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (2)
app/templates/play/campaign-view.pug
(2 hunks)app/views/play/CampaignView.js
(4 hunks)
🔇 Additional comments (7)
app/templates/play/campaign-view.pug (2)
293-296
: LGTM: Conditional rendering of Roblox level container
The implementation follows the established pattern of using view.shouldShow()
for conditional rendering and maintains consistent styling with other level containers.
377-378
: LGTM: Consistent implementation of Roblox button
The Roblox button is properly integrated into the game controls section, following the same conditional rendering pattern and button styling as other control buttons.
app/views/play/CampaignView.js (5)
2073-2074
: LGTM: Junior level visibility logic is correct.
The condition appropriately restricts junior level visibility to home users while excluding editor mode.
2123-2124
: LGTM: Videos visibility logic is correct.
The condition correctly restricts video visibility to students enrolled in the Introduction to Computer Science course while excluding editor mode.
2158-2159
: LGTM: Roblox level visibility logic is correct.
The condition appropriately uses userQualifiesForRobloxModal() to determine visibility while excluding editor mode.
2161-2163
: LGTM: Roblox button visibility logic is correct.
The condition appropriately restricts button visibility to non-library users while excluding editor mode.
2166-2167
: LGTM: Hackstack visibility logic is correct.
The condition appropriately restricts visibility to beta users who are not library users while excluding editor mode.
Summary by CodeRabbit
New Features
Improvements
Bug Fixes