refactor: unused components, hooks, constants#7157
refactor: unused components, hooks, constants#7157sriramveeraghanta merged 4 commits intopreviewfrom
Conversation
WalkthroughThis change removes a large set of dashboard-related React components, hooks, utility functions, and index files from the codebase. It eliminates many widgets, loaders, empty/error states, helper functions, and associated cache key generators, along with related dependencies. Centralized re-export files and several utility hooks are also deleted. Changes
Sequence Diagram(s)No sequence diagram generated as the changes are broad deletions and cleanup without new or altered control flow. Suggested labels
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (2)
💤 Files with no reviewable changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (1)
🔇 Additional comments (2)
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. 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
🔭 Outside diff range comments (1)
web/core/constants/fetch-keys.ts (1)
3-3: 🛠️ Refactor suggestionReplace
anytype with a proper interface for type safety.Using
anytype defeats TypeScript's type checking benefits and could lead to runtime errors if the params structure changes.Consider defining an interface for the params:
-const paramsToKey = (params: any) => { +interface IFetchKeyParams { + state?: string; + state_group?: string; + priority?: string; + mentions?: string; + assignees?: string; + created_by?: string; + labels?: string; + start_date?: string; + target_date?: string; + sub_issue?: string; + project?: string; + layout?: string; + subscriber?: string; + type?: string; + group_by?: string; + order_by?: string; +} + +const paramsToKey = (params: IFetchKeyParams) => {
🧹 Nitpick comments (2)
web/core/constants/fetch-keys.ts (2)
47-47: Consider breaking down the long concatenated string for better maintainability.The current implementation creates a very long cache key that's hard to read and maintain. Consider using an array join approach or template literals with better formatting.
- return `${layoutKey}_${projectKey}_${stateGroupKey}_${stateKey}_${priorityKey}_${assigneesKey}_${mentionsKey}_${createdByKey}_${type}_${groupBy}_${orderBy}_${labelsKey}_${startDateKey}_${targetDateKey}_${sub_issue}_${subscriberKey}`; + const keyParts = [ + layoutKey, + projectKey, + stateGroupKey, + stateKey, + priorityKey, + assigneesKey, + mentionsKey, + createdByKey, + type, + groupBy, + orderBy, + labelsKey, + startDateKey, + targetDateKey, + sub_issue, + subscriberKey + ].filter(Boolean); // Remove empty values + + return keyParts.join("_");
50-126: Consider adding JSDoc comments for exported functions.After the refactoring that removed many dashboard-related exports, it would be helpful to document the remaining exported functions to clarify their purpose and expected parameter formats.
Example for one function:
+/** + * Generates a cache key for workspace members + * @param workspaceSlug - The workspace identifier + * @returns Uppercase cache key string + */ export const WORKSPACE_MEMBERS = (workspaceSlug: string) => `WORKSPACE_MEMBERS_${workspaceSlug.toUpperCase()}`;
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
web/core/constants/fetch-keys.ts(1 hunks)
🔇 Additional comments (1)
web/core/constants/fetch-keys.ts (1)
54-54: LGTM!The function follows the established pattern for cache key generation.
* refactor: remove unused dashboard components and fetch keys * refactor: remove unused hooks and wrappers * chore: remove unused function
Description
Type of Change
Screenshots and Media (if applicable)
Test Scenarios
References
Summary by CodeRabbit