Skip to content

fix: hide OneDrive if not OSS#1830

Merged
edwinjosechittilappilly merged 2 commits into
mainfrom
hide-onedrive-connector-v2
Jun 10, 2026
Merged

fix: hide OneDrive if not OSS#1830
edwinjosechittilappilly merged 2 commits into
mainfrom
hide-onedrive-connector-v2

Conversation

@Wallgau

@Wallgau Wallgau commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator

Hide OneDrive in the frontend if not in OSS

Summary by CodeRabbit

  • Bug Fixes
    • Improved connector visibility so available connectors reflect the current deployment and authentication context.
    • Fixed OneDrive visibility so it remains hidden in cloud deployments even when workspace access is present.
    • Made access state updates more consistent across different deployment modes so connector lists stay accurate.

@github-actions github-actions Bot added the frontend 🟨 Issues related to the UI/UX label Jun 10, 2026
@coderabbitai

coderabbitai Bot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: b494fe8f-5134-4ade-b2e2-7076f6423a5c

📥 Commits

Reviewing files that changed from the base of the PR and between ee79771 and 9c24da4.

📒 Files selected for processing (1)
  • frontend/app/api/queries/useGetConnectorsQuery.ts

Walkthrough

The hook useGetConnectorAccessQuery now derives deployment context (cloud brand, IBM auth mode) and filters the connector list before returning, while expanding the React Query cache key to separate results by these inputs. The brand utility isConnectorShownInWorkspace adds a brand-specific rule to hide OneDrive in cloud deployments.

Changes

Connector Visibility Filtering by Deployment Context

Layer / File(s) Summary
Connector visibility rule with brand exception
frontend/lib/brand.ts
isConnectorShownInWorkspace now suppresses OneDrive visibility when cloudBrand is true, overriding explicit storedAccess[type] === true for that connector type. Documentation updated to reflect this brand-specific exception.
Query hook with deployment-aware filtering and caching
frontend/app/api/queries/useGetConnectorsQuery.ts
useGetConnectorAccessQuery reads isCloudBrand and isIbmAuthMode context, filters connectors via isConnectorTypeVisible, and updates the React Query cache key to include these deployment inputs, ensuring cached results are separated by deployment visibility context.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested labels

bug

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix: hide OneDrive if not OSS' directly describes the main change: hiding OneDrive in non-OSS contexts, which is the core objective and primary modification across both modified files.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch hide-onedrive-connector-v2

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added bug 🔴 Something isn't working. and removed bug 🔴 Something isn't working. labels Jun 10, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@frontend/app/api/queries/useGetConnectorsQuery.ts`:
- Around line 280-288: The optimistic update fails because useGetConnectorsQuery
includes isCloudBrand and isIbmAuthMode in the query key and filters connectors
with isConnectorTypeVisible, but useUpdateConnectorAccessMutation still writes
to CONNECTOR_USER_ACCESS_KEY without those context values and caches the raw
server response; update useUpdateConnectorAccessMutation to derive the same
deployment context (isCloudBrand, isIbmAuthMode) used in useGetConnectorsQuery,
use that full key when calling setQueryData, and apply isConnectorTypeVisible to
the server response before writing to the cache so the optimistic update targets
the correct cache entry and remains filtered by deployment context.
🪄 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 0f89ba1a-c28c-46e7-a450-a6b9d3a950bc

📥 Commits

Reviewing files that changed from the base of the PR and between b1154be and ee79771.

📒 Files selected for processing (2)
  • frontend/app/api/queries/useGetConnectorsQuery.ts
  • frontend/lib/brand.ts

Comment thread frontend/app/api/queries/useGetConnectorsQuery.ts Outdated
useUpdateConnectorAccessMutation wrote unfiltered results to
CONNECTOR_USER_ACCESS_KEY while the query caches under brand/auth
context. Share connectorUserAccessQueryKey and filterConnectorAccessItems
with useGetConnectorAccessQuery so saves update the correct entry.
@github-actions github-actions Bot added bug 🔴 Something isn't working. and removed bug 🔴 Something isn't working. labels Jun 10, 2026
@github-actions github-actions Bot added the lgtm label Jun 10, 2026
@edwinjosechittilappilly edwinjosechittilappilly merged commit 026a426 into main Jun 10, 2026
18 of 19 checks passed
@github-actions github-actions Bot deleted the hide-onedrive-connector-v2 branch June 10, 2026 22:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug 🔴 Something isn't working. frontend 🟨 Issues related to the UI/UX lgtm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants