-
Notifications
You must be signed in to change notification settings - Fork 13
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
refactor: move UpgradePrompt component to new location #2565
Conversation
WalkthroughThe pull request involves a comprehensive restructuring of the Changes
Possibly related PRs
Poem
🪧 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 (
|
Codecov ReportAll modified and coverable lines are covered by tests ✅ ✅ All tests successful. No failed tests found. Additional details and impacted files📢 Thoughts on this report? Let us know! |
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
Plan: Pro
📒 Files selected for processing (6)
app/components/course-page/course-stage-step/inaccessible-community-solutions-list.hbs
(1 hunks)app/components/course-page/upgrade-prompt.hbs
(1 hunks)app/components/course-page/upgrade-prompt.ts
(2 hunks)app/components/upgrade-modal.hbs
(1 hunks)app/components/upgrade-modal.ts
(1 hunks)app/templates/course/stage/instructions.hbs
(1 hunks)
✅ Files skipped from review due to trivial changes (1)
- app/components/upgrade-modal.ts
🧰 Additional context used
🪛 GitHub Actions: Test
app/components/course-page/upgrade-prompt.ts
[error] 104-104: Property 'syncCurrentUser' does not exist on type 'AuthenticatorService'. Did you mean 'currentUser'?
🔇 Additional comments (6)
app/components/upgrade-modal.hbs (1)
8-8
: LGTM! Component namespace updated correctly.The component path has been updated to reflect its new location while maintaining the same functionality.
app/components/course-page/course-stage-step/inaccessible-community-solutions-list.hbs (1)
18-18
: LGTM! Component namespace updated correctly.The component path has been updated to reflect its new location while maintaining the same functionality.
app/components/course-page/upgrade-prompt.hbs (1)
14-14
: LGTM! Loading state variable renamed for better clarity.The loading state variable has been renamed from
isLoadingRegionalDiscount
toisLoadingDiscounts
to better reflect its purpose of handling both regional and active discounts.app/components/course-page/upgrade-prompt.ts (2)
63-63
: LGTM! Loading state variable renamed for better clarity.The tracked property has been renamed from
isLoadingRegionalDiscount
toisLoadingDiscounts
to better reflect its purpose.
111-111
: LGTM! Component registry updated correctly.The component registry has been updated to reflect its new location.
app/templates/course/stage/instructions.hbs (1)
8-8
: LGTM! Component path updated correctly.The component path has been updated from
CoursePage::CourseStageStep::UpgradePrompt
toCoursePage::UpgradePrompt
while maintaining all parameters, which aligns with the PR's objective of moving the component to improve code organization.Let's verify that the component is properly registered at its new location:
✅ Verification successful
Component migration verified successfully ✓
The component exists at its new location (
app/components/course-page/upgrade-prompt
) and all references to the old path have been properly updated.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the UpgradePrompt component registration and references # Check if the component exists at the new location fd "upgrade-prompt" app/components/course-page # Verify no lingering references to the old path exist rg -l "CourseStageStep::UpgradePrompt" app/Length of output: 181
await this.authenticator.syncCurrentUser(); | ||
this.isLoadingDiscounts = false; |
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.
Fix TypeScript error: syncCurrentUser
method doesn't exist.
The pipeline failure indicates that the syncCurrentUser
method doesn't exist on the AuthenticatorService
type. This needs to be fixed before the PR can be merged.
Consider one of these solutions:
- If the method exists but is not typed:
- await this.authenticator.syncCurrentUser();
+ await (this.authenticator as any).syncCurrentUser();
- If you meant to use a different method:
- await this.authenticator.syncCurrentUser();
+ // Use the correct method from AuthenticatorService
- If this is a new method:
Add the method definition toAuthenticatorService
:
// In AuthenticatorService:
async syncCurrentUser(): Promise<void> {
// Implementation
}
🧰 Tools
🪛 GitHub Actions: Test
[error] 104-104: Property 'syncCurrentUser' does not exist on type 'AuthenticatorService'. Did you mean 'currentUser'?
Moves the UpgradePrompt component from the course-stage-step directory to the course-page directory. This change improves the organization of components by grouping related files together, enhancing maintainability and clarity in the codebase.
Comments out the call to sync the current user in the handleDidInsert method. This change improves performance by preventing unnecessary user synchronization while fetching regional discounts.
d818028
to
35cf9ee
Compare
Moves the UpgradePrompt component from the course-stage-step
directory to the course-page directory. This change improves
the organization of components by grouping related files
together, enhancing maintainability and clarity in the codebase.
Summary by CodeRabbit
Refactor
UpgradePrompt
to a higher-level namespace.isLoadingDiscounts
).Chores