SANDBOX-1769 | feature: disable integrations in the UI#59
SANDBOX-1769 | feature: disable integrations in the UI#59MikelAlejoBR wants to merge 3 commits intocodeready-toolchain:masterfrom
Conversation
There are times when we want to disable certain faulty integrations in the UI, so that we can prevent customers from accessing them and having a bad experience. These changes read the new "disabledIntegrations" from the registration service to hide the integrations that are disabled. Assisted-by: Cursor with claude-4.6-opus-max-thinking SANDBOX-1769
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 48 minutes and 52 seconds. ⌛ 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. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
WalkthroughAdds propagation and consumption of an optional Changes
Sequence DiagramsequenceDiagram
participant Backend as Backend Service
participant Provider as SandboxProvider
participant Context as SandboxContext
participant Grid as SandboxCatalogGrid
Backend->>Provider: getUIConfig()
rect rgba(200,200,255,0.5)
Provider->>Provider: parse response\nextract disabledIntegrations\nnormalize or set []
end
Provider->>Context: update context value (disabledIntegrations)
Grid->>Context: useSandboxContext() → read disabledIntegrations
rect rgba(200,255,200,0.5)
Grid->>Grid: useMemo filter productData\ncreate enabledProducts
Grid->>Grid: render enabledProducts (or return null if loading)
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@plugins/sandbox/src/components/SandboxCatalog/SandboxCatalogGrid.tsx`:
- Around line 27-34: enabledProducts is set to [] while loading
(disabledIntegrations === undefined) which causes
useGreenCorners(enabledProducts) to get an empty list and its effect to
overwrite the triedProducts cookie; change the call so that when
disabledIntegrations is undefined you pass the full productData into
useGreenCorners (i.e., compute enabledProducts = disabledIntegrations ===
undefined ? productData : productData.filter(p =>
!disabledIntegrations.includes(p.id))) so useGreenCorners receives the real
product list during loading and does not clear persisted state; update
references to enabledProducts and the useMemo keying if needed to include
productData and disabledIntegrations.
In `@plugins/sandbox/src/hooks/useSandboxContext.tsx`:
- Around line 239-243: Normalize the external uiConfig.disabledIntegrations
before calling setDisabledIntegrations: call registerApi.getUIConfig(), then
compute const safeDisabled = Array.isArray(uiConfig.disabledIntegrations) ?
uiConfig.disabledIntegrations : []; and pass safeDisabled to
setDisabledIntegrations so non-array or malformed values never reach the grid;
keep existing handling for workatoWebHookURL and use uiConfig as before.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: e6f2d361-ec63-4103-8e47-a9fd084d86b0
📒 Files selected for processing (5)
plugins/sandbox/src/api/RegistrationBackendClient.tsxplugins/sandbox/src/api/__tests__/RegistrationBackendClient.test.tsxplugins/sandbox/src/components/SandboxCatalog/SandboxCatalogGrid.tsxplugins/sandbox/src/components/SandboxCatalog/__tests__/SandboxCatalogGrid.test.tsxplugins/sandbox/src/hooks/useSandboxContext.tsx
These changes prevent wiping the "green corner" cookie which stored the users' active trials by accident introduced by the new changes, and it also introduces a type check to make sure that we guard the UI from any unexpected array structures that might come from the back end. SANDBOX-1769
SANDBOX-1769
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: alexeykazakov, MikelAlejoBR The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
There are times when we want to disable certain faulty integrations in the UI, so that we can prevent customers from accessing them and having a bad experience.
These changes read the new "disabledIntegrations" from the registration service to hide the integrations that are disabled.
Assisted-by: Cursor with claude-4.6-opus-max-thinking
Jira ticket
[SANDBOX-1769]
Summary by CodeRabbit
New Features
Tests