refactor: Break @calcom/app-store/components into individual component files#23637
refactor: Break @calcom/app-store/components into individual component files#23637
@calcom/app-store/components into individual component files#23637Conversation
Walkthrough
Possibly related PRs
✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
| @@ -1,19 +0,0 @@ | |||
| import dynamic from "next/dynamic"; | |||
There was a problem hiding this comment.
Confirmed that this file isn't being consumed anywhere
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
@calcom/app-store/components into individual component files
There was a problem hiding this comment.
Actionable comments posted: 3
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
packages/features/apps/components/AppCard.tsx (1)
141-169: Enforce teams-plan gating in InstallAppButton
TheteamsPlanRequiredprop is never consumed—InstallAppButtonjust forwards it toInstallAppButtonWithoutPlanCheck, which ignores it. Add plan-checking logic inpackages/app-store/InstallAppButton.tsx(or guard callers) to block installs when the user’s plan doesn’t meetteamsPlanRequired.
🧹 Nitpick comments (6)
apps/web/components/getting-started/components/AppConnectionItem.tsx (1)
111-115: Harden cookie write (encode value + Secure when HTTPS).Prevents issues with special chars and enforces Secure on production.
- document.cookie = `return-to=${window.location.href};path=/;max-age=3600;SameSite=Lax`; + const secure = window.location.protocol === "https:" ? ";Secure" : ""; + document.cookie = `return-to=${encodeURIComponent( + window.location.href + )};path=/;max-age=3600;SameSite=Lax${secure}`;packages/features/apps/components/AppList.tsx (1)
67-70: Localize toast message.Follow repo i18n guideline for user-facing text.
- showToast("Default app updated successfully", "success"); + showToast(t("default_app_updated_successfully"), "success");packages/features/calendars/AdditionalCalendarSelector.tsx (1)
29-34: Localize “Add new calendars” option label.Avoid hardcoded strings in UI.
- options.push({ - label: "Add new calendars", + options.push({ + label: t("add_new_calendars"),packages/features/apps/components/AppCard.tsx (2)
94-95: Localize alt text.Per TSX localization guideline, avoid raw strings; translate “Logo”.
- alt={`${app.name} Logo`} + alt={`${app.name} ${t("logo")}`}
190-191: Localize “Template” badge text.Use
t()instead of a raw string.- <span className="bg-error rounded-md px-2 py-1 text-sm font-normal text-red-800">Template</span> + <span className="bg-error rounded-md px-2 py-1 text-sm font-normal text-red-800">{t("template")}</span>packages/app-store/InstallAppButton.tsx (1)
16-20: Avoid unnecessary wrapper div when no class provided.Reduce DOM depth by returning the child directly if
wrapperClassNameis falsy.- return ( - <div className={props.wrapperClassName}> - <InstallAppButtonWithoutPlanCheck {...props} /> - </div> - ); + return props.wrapperClassName ? ( + <div className={props.wrapperClassName}> + <InstallAppButtonWithoutPlanCheck {...props} /> + </div> + ) : ( + <InstallAppButtonWithoutPlanCheck {...props} /> + );
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (10)
apps/web/components/apps/AppPage.tsx(1 hunks)apps/web/components/apps/CalendarListContainer.tsx(1 hunks)apps/web/components/getting-started/components/AppConnectionItem.tsx(1 hunks)packages/app-store/AppDependencyComponent.tsx(0 hunks)packages/app-store/InstallAppButton.tsx(1 hunks)packages/app-store/InstallAppButtonWithoutPlanCheck.tsx(1 hunks)packages/app-store/_components/OmniInstallAppButton.tsx(1 hunks)packages/features/apps/components/AppCard.tsx(1 hunks)packages/features/apps/components/AppList.tsx(1 hunks)packages/features/calendars/AdditionalCalendarSelector.tsx(1 hunks)
💤 Files with no reviewable changes (1)
- packages/app-store/AppDependencyComponent.tsx
✅ Files skipped from review due to trivial changes (2)
- apps/web/components/apps/CalendarListContainer.tsx
- apps/web/components/apps/AppPage.tsx
🧰 Additional context used
📓 Path-based instructions (3)
**/*.tsx
📄 CodeRabbit inference engine (.cursor/rules/review.mdc)
Always use
t()for text localization in frontend code; direct text embedding should trigger a warning
Files:
packages/features/calendars/AdditionalCalendarSelector.tsxpackages/app-store/InstallAppButton.tsxpackages/features/apps/components/AppList.tsxpackages/app-store/_components/OmniInstallAppButton.tsxpackages/app-store/InstallAppButtonWithoutPlanCheck.tsxpackages/features/apps/components/AppCard.tsxapps/web/components/getting-started/components/AppConnectionItem.tsx
**/*.{ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/review.mdc)
Flag excessive Day.js use in performance-critical code; prefer native Date or Day.js
.utc()in hot paths like loops
Files:
packages/features/calendars/AdditionalCalendarSelector.tsxpackages/app-store/InstallAppButton.tsxpackages/features/apps/components/AppList.tsxpackages/app-store/_components/OmniInstallAppButton.tsxpackages/app-store/InstallAppButtonWithoutPlanCheck.tsxpackages/features/apps/components/AppCard.tsxapps/web/components/getting-started/components/AppConnectionItem.tsx
**/*.{ts,tsx,js,jsx}
⚙️ CodeRabbit configuration file
Flag default exports and encourage named exports. Named exports provide better tree-shaking, easier refactoring, and clearer imports. Exempt main components like pages, layouts, and components that serve as the primary export of a module.
Files:
packages/features/calendars/AdditionalCalendarSelector.tsxpackages/app-store/InstallAppButton.tsxpackages/features/apps/components/AppList.tsxpackages/app-store/_components/OmniInstallAppButton.tsxpackages/app-store/InstallAppButtonWithoutPlanCheck.tsxpackages/features/apps/components/AppCard.tsxapps/web/components/getting-started/components/AppConnectionItem.tsx
🧬 Code graph analysis (2)
packages/app-store/InstallAppButton.tsx (2)
packages/app-store/types.d.ts (1)
InstallAppButtonProps(37-47)packages/app-store/InstallAppButtonWithoutPlanCheck.tsx (1)
InstallAppButtonWithoutPlanCheck(11-41)
packages/app-store/InstallAppButtonWithoutPlanCheck.tsx (2)
packages/app-store/types.d.ts (1)
InstallAppButtonProps(37-47)packages/app-store/apps.browser.generated.tsx (1)
InstallAppButtonMap(7-12)
⏰ Context from checks skipped due to timeout of 180000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Install dependencies / Yarn install & cache
🔇 Additional comments (5)
apps/web/components/getting-started/components/AppConnectionItem.tsx (1)
4-4: Import path update looks good.packages/features/apps/components/AppList.tsx (1)
3-3: Import path consolidation to @calcom/app-store/InstallAppButton is correct.packages/app-store/_components/OmniInstallAppButton.tsx (1)
8-8: Switched to central InstallAppButton import — LGTM.packages/features/calendars/AdditionalCalendarSelector.tsx (1)
3-3: Import path migration looks correct.packages/features/apps/components/AppCard.tsx (1)
6-6: No lingering old imports detected; changes approved
Ripgrep search returned no matches for@calcom/app-store/components. All imports updated.
E2E results are ready! |
What does this PR do?
@calcom/app-store/componentsfile and rather extracts the components into individual filesResult
Mandatory Tasks (DO NOT REMOVE)
How should this be tested?