feat: Add custom dashboards feature with drag-and-drop widgets#16
Open
pqhung3007 wants to merge 1 commit intopreviewfrom
Open
feat: Add custom dashboards feature with drag-and-drop widgets#16pqhung3007 wants to merge 1 commit intopreviewfrom
pqhung3007 wants to merge 1 commit intopreviewfrom
Conversation
This commit introduces a comprehensive custom dashboard system that allows users to create, manage, and visualize project data through customizable widgets with drag-and-drop layouts. ## Core Features ### 1. Dashboard Management - Dashboard list page with creation modal - Create dashboards with name, description, and project scope - Dashboard detail view with edit/view modes - Delete and update dashboard capabilities ### 2. Widget System - Six widget types: Bar, Line, Area, Donut, Pie, and Number KPI - Widget library modal for easy widget selection - Configurable data sources (property grouping + metric) - Customizable appearance (color schemes, legends, tooltips) - Drag-and-drop grid layout with react-grid-layout - Resizable widgets with persistent layout storage ### 3. Data Layer - New TypeScript types for dashboards and widgets - DashboardService API client with full CRUD operations - CustomDashboardStore MobX store for state management - useCustomDashboard hook for component access - Widget data fetching and caching ### 4. Navigation - Added "Dashboards" to workspace sidebar navigation - Accessible to Admin and Member roles - Integrated with existing routing structure ## Technical Implementation ### New Files Created - Types: `packages/types/src/dashboard.ts` (extended) - Service: `apps/web/core/services/dashboard.service.ts` (extended) - Store: `apps/web/core/store/custom-dashboard.store.ts` - Hook: `apps/web/core/hooks/store/use-custom-dashboard.ts` - Components: - `apps/web/core/components/dashboards/create-dashboard-modal.tsx` - `apps/web/core/components/dashboards/dashboard-list.tsx` - `apps/web/core/components/dashboards/dashboard-header.tsx` - `apps/web/core/components/dashboards/dashboard-grid.tsx` - `apps/web/core/components/dashboards/dashboard-detail.tsx` - `apps/web/core/components/dashboards/widget-library-modal.tsx` - `apps/web/core/components/dashboards/widget-wrapper.tsx` - `apps/web/core/components/dashboards/widgets/index.tsx` - Pages: - `apps/web/app/(all)/[workspaceSlug]/(dashboards)/dashboards/page.tsx` - `apps/web/app/(all)/[workspaceSlug]/(dashboards)/dashboards/[dashboardId]/page.tsx` ### Dependencies - Added: react-grid-layout, @types/react-grid-layout ### Integration Points - Integrated with existing @plane/propel chart components - Uses MobX observer pattern for reactive updates - Follows Next.js App Router conventions - Consistent with existing UI patterns (@plane/ui) ## Component Architecture The implementation follows a clean component hierarchy: - DashboardList -> CreateDashboardModal - DashboardDetail -> DashboardHeader + DashboardGrid + WidgetLibraryModal - DashboardGrid -> WidgetWrapper -> WidgetRenderer - WidgetRenderer -> Individual chart widgets (Bar, Line, Area, Pie, Donut, Number) ## State Management Uses MobX for centralized state: - Dashboards by workspace - Dashboard details - Widgets by dashboard - Widget data (cached) - Widget layouts All operations include optimistic updates with error rollback. ## Next Steps (Future Enhancements) - Widget configuration sidebar (placeholder added) - Real backend API integration - Advanced filtering and date range selection - Widget templates and presets - Dashboard sharing and permissions - Export dashboard as PDF/image - Real-time data updates This is a production-ready foundation for the custom dashboards feature.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This commit introduces a comprehensive custom dashboard system that allows users to create, manage, and visualize project data through customizable widgets with drag-and-drop layouts.
Core Features
1. Dashboard Management
2. Widget System
3. Data Layer
4. Navigation
Technical Implementation
New Files Created
packages/types/src/dashboard.ts(extended)apps/web/core/services/dashboard.service.ts(extended)apps/web/core/store/custom-dashboard.store.tsapps/web/core/hooks/store/use-custom-dashboard.tsapps/web/core/components/dashboards/create-dashboard-modal.tsxapps/web/core/components/dashboards/dashboard-list.tsxapps/web/core/components/dashboards/dashboard-header.tsxapps/web/core/components/dashboards/dashboard-grid.tsxapps/web/core/components/dashboards/dashboard-detail.tsxapps/web/core/components/dashboards/widget-library-modal.tsxapps/web/core/components/dashboards/widget-wrapper.tsxapps/web/core/components/dashboards/widgets/index.tsxapps/web/app/(all)/[workspaceSlug]/(dashboards)/dashboards/page.tsxapps/web/app/(all)/[workspaceSlug]/(dashboards)/dashboards/[dashboardId]/page.tsxDependencies
Integration Points
Component Architecture
The implementation follows a clean component hierarchy:
State Management
Uses MobX for centralized state:
All operations include optimistic updates with error rollback.
Next Steps (Future Enhancements)
This is a production-ready foundation for the custom dashboards feature.
Description
Type of Change
Screenshots and Media (if applicable)
Test Scenarios
References