[WEB-2376] dev: workspace settings improvement & refactor.#5519
[WEB-2376] dev: workspace settings improvement & refactor.#5519SatishGandham merged 3 commits intopreviewfrom
Conversation
WalkthroughThe changes involve enhancing the rendering logic of workspace settings components to conditionally display links based on user roles. A new helper function, Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant StoreProvider
participant WorkspaceSettings
User->>StoreProvider: Request settings
StoreProvider->>Store: Get initialized store
Store->>StoreProvider: Return store instance
StoreProvider->>WorkspaceSettings: Render settings
WorkspaceSettings->>shouldRenderSettingLink: Check link visibility
shouldRenderSettingLink-->>WorkspaceSettings: Return true/false
WorkspaceSettings->>User: Display appropriate settings links
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.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (6)
- web/app/[workspaceSlug]/(projects)/settings/mobile-header-tabs.tsx (1 hunks)
- web/app/[workspaceSlug]/(projects)/settings/sidebar.tsx (3 hunks)
- web/ce/helpers/workspace.helper.ts (1 hunks)
- web/core/components/command-palette/actions/workspace-settings-actions.tsx (2 hunks)
- web/core/lib/store-context.tsx (1 hunks)
- web/ee/helpers/workspace.helper.ts (1 hunks)
Files skipped from review due to trivial changes (2)
- web/ce/helpers/workspace.helper.ts
- web/ee/helpers/workspace.helper.ts
Additional comments not posted (11)
web/core/lib/store-context.tsx (2)
18-18: LGTM!Moving the store initialization logic outside the
StoreProvidercomponent is a good optimization. It ensures that the store is initialized only once, rather than on every render of theStoreProvider, potentially improving performance by avoiding unnecessary reinitialization.
20-20: LGTM!The
StoreProvidercomponent has been simplified by using the pre-initializedstoredirectly when rendering theStoreContext.Provider. This change is consistent with the store initialization logic being moved outside the component and makes the component's implementation more concise and easier to understand.web/core/components/command-palette/actions/workspace-settings-actions.tsx (2)
14-15: LGTM!The code changes are approved.
43-44: LGTM!The code changes are approved. The changes improve the component's functionality by allowing for more granular control over which settings are displayed based on the provided key.
web/app/[workspaceSlug]/(projects)/settings/mobile-header-tabs.tsx (4)
2-3: LGTM!The code changes are approved.
5-10: LGTM!The code changes are approved.
16-23: LGTM!The code changes are approved.
26-41: LGTM!The code changes are approved.
web/app/[workspaceSlug]/(projects)/settings/sidebar.tsx (3)
16-16: LGTM!The code changes are approved.
27-27: LGTM!The code changes are approved.
37-37: LGTM!The code changes are approved.
In this PR, I've moved the
storeinstance out ofStoreProviderand exported it globally for access outside of React.Summary by CodeRabbit
New Features
Bug Fixes
Chores