Skip to content

Commit 4c0638e

Browse files
committed
fix: planning view
1 parent c74f67b commit 4c0638e

2 files changed

Lines changed: 91 additions & 165 deletions

File tree

Lines changed: 91 additions & 154 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,6 @@
11
import type { Meta, StoryObj } from '@storybook/react';
22
import { action } from '@storybook/addon-actions';
33
import { ManagementSidebar } from './ManagementSidebar';
4-
import { mockEpics, mockSprints, mockProjects } from './test-data';
5-
6-
// Additional epics for more variety in ManagementSidebar
7-
const extendedEpics = [
8-
...mockEpics,
9-
{
10-
id: '5',
11-
name: 'Security Enhancements',
12-
color: 'bg-red-500',
13-
description: 'Implement additional security measures',
14-
confidence: 'medium' as const,
15-
phase: 1,
16-
startDate: new Date('2024-04-01'),
17-
endDate: new Date('2024-05-15'),
18-
progress: 0,
19-
isSelected: true,
20-
},
21-
{
22-
id: '6',
23-
name: 'API Integration',
24-
color: 'bg-yellow-500',
25-
description: 'Connect with external APIs',
26-
confidence: 'low' as const,
27-
phase: 2,
28-
startDate: new Date('2024-05-01'),
29-
endDate: new Date('2024-06-15'),
30-
progress: 25,
31-
isSelected: false,
32-
},
33-
];
344

355
const meta: Meta<typeof ManagementSidebar> = {
366
title: 'Digital Colleagues/ManagementSidebar',
@@ -41,10 +11,7 @@ const meta: Meta<typeof ManagementSidebar> = {
4111
argTypes: {
4212
currentView: {
4313
control: { type: 'select' },
44-
options: ['kanban', 'planning', 'documentation', 'epics'],
45-
},
46-
mobileMenuOpen: {
47-
control: 'boolean',
14+
options: ['kanban', 'planning', 'tasks', 'files', 'epics'],
4815
},
4916
},
5017
};
@@ -54,155 +21,125 @@ type Story = StoryObj<typeof ManagementSidebar>;
5421

5522
export const KanbanView: Story = {
5623
args: {
57-
projects: mockProjects,
58-
epics: extendedEpics,
59-
sprints: mockSprints,
6024
currentView: 'kanban',
61-
mobileMenuOpen: false,
62-
onUpdateProject: action('onUpdateProject'),
63-
onDeleteProject: action('onDeleteProject'),
64-
onAddProject: action('onAddProject'),
65-
onUpdateEpic: action('onUpdateEpic'),
66-
onDeleteEpic: action('onDeleteEpic'),
67-
onAddEpic: action('onAddEpic'),
68-
onAddSprint: action('onAddSprint'),
69-
onUpdateSprint: action('onUpdateSprint'),
70-
onDeleteSprint: action('onDeleteSprint'),
7125
onViewChange: action('onViewChange'),
72-
onToggleMobileMenu: action('onToggleMobileMenu'),
73-
children: <div className="p-8 bg-gray-50 h-full">Main content area</div>,
26+
children: (
27+
<div className="p-8 bg-gray-50 h-full flex items-center justify-center">
28+
<div className="text-center">
29+
<h2 className="text-2xl font-bold mb-4">Kanban View</h2>
30+
<p className="text-gray-600">This is where the Kanban board would be displayed</p>
31+
</div>
32+
</div>
33+
),
7434
},
7535
};
7636

7737
export const PlanningView: Story = {
7838
args: {
79-
projects: mockProjects,
80-
epics: extendedEpics,
81-
sprints: mockSprints,
8239
currentView: 'planning',
83-
mobileMenuOpen: false,
84-
onUpdateProject: action('onUpdateProject'),
85-
onDeleteProject: action('onDeleteProject'),
86-
onAddProject: action('onAddProject'),
87-
onUpdateEpic: action('onUpdateEpic'),
88-
onDeleteEpic: action('onDeleteEpic'),
89-
onAddEpic: action('onAddEpic'),
90-
onAddSprint: action('onAddSprint'),
91-
onUpdateSprint: action('onUpdateSprint'),
92-
onDeleteSprint: action('onDeleteSprint'),
9340
onViewChange: action('onViewChange'),
94-
onToggleMobileMenu: action('onToggleMobileMenu'),
95-
children: <div className="p-8 bg-gray-50 h-full">Planning view content</div>,
41+
children: (
42+
<div className="p-8 bg-blue-50 h-full flex items-center justify-center">
43+
<div className="text-center">
44+
<h2 className="text-2xl font-bold mb-4">Planning View</h2>
45+
<p className="text-gray-600">This is where the planning interface would be displayed</p>
46+
</div>
47+
</div>
48+
),
9649
},
9750
};
9851

99-
export const DocumentationView: Story = {
52+
export const TasksView: Story = {
10053
args: {
101-
projects: mockProjects,
102-
epics: mockEpics,
103-
sprints: mockSprints,
104-
currentView: 'documentation',
105-
mobileMenuOpen: false,
106-
onUpdateProject: action('onUpdateProject'),
107-
onDeleteProject: action('onDeleteProject'),
108-
onAddProject: action('onAddProject'),
109-
onUpdateEpic: action('onUpdateEpic'),
110-
onDeleteEpic: action('onDeleteEpic'),
111-
onAddEpic: action('onAddEpic'),
112-
onAddSprint: action('onAddSprint'),
113-
onUpdateSprint: action('onUpdateSprint'),
114-
onDeleteSprint: action('onDeleteSprint'),
54+
currentView: 'tasks',
11555
onViewChange: action('onViewChange'),
116-
onToggleMobileMenu: action('onToggleMobileMenu'),
117-
children: <div className="p-8 bg-gray-50 h-full">Documentation content</div>,
56+
children: (
57+
<div className="p-8 bg-green-50 h-full flex items-center justify-center">
58+
<div className="text-center">
59+
<h2 className="text-2xl font-bold mb-4">Tasks View</h2>
60+
<p className="text-gray-600">This is where the task management would be displayed</p>
61+
</div>
62+
</div>
63+
),
11864
},
11965
};
12066

121-
export const EpicsView: Story = {
67+
export const FilesView: Story = {
12268
args: {
123-
projects: mockProjects,
124-
epics: mockEpics,
125-
sprints: mockSprints,
126-
currentView: 'epics',
127-
mobileMenuOpen: false,
128-
onUpdateProject: action('onUpdateProject'),
129-
onDeleteProject: action('onDeleteProject'),
130-
onAddProject: action('onAddProject'),
131-
onUpdateEpic: action('onUpdateEpic'),
132-
onDeleteEpic: action('onDeleteEpic'),
133-
onAddEpic: action('onAddEpic'),
134-
onAddSprint: action('onAddSprint'),
135-
onUpdateSprint: action('onUpdateSprint'),
136-
onDeleteSprint: action('onDeleteSprint'),
69+
currentView: 'files',
13770
onViewChange: action('onViewChange'),
138-
onToggleMobileMenu: action('onToggleMobileMenu'),
139-
children: <div className="p-8 bg-gray-50 h-full">Epic planning content</div>,
71+
children: (
72+
<div className="p-8 bg-purple-50 h-full flex items-center justify-center">
73+
<div className="text-center">
74+
<h2 className="text-2xl font-bold mb-4">Files View</h2>
75+
<p className="text-gray-600">This is where the file browser would be displayed</p>
76+
</div>
77+
</div>
78+
),
14079
},
14180
};
14281

143-
export const MobileMenuOpen: Story = {
82+
export const EpicsView: Story = {
14483
args: {
145-
projects: mockProjects,
146-
epics: mockEpics,
147-
sprints: mockSprints,
148-
currentView: 'kanban',
149-
mobileMenuOpen: true,
150-
onUpdateProject: action('onUpdateProject'),
151-
onDeleteProject: action('onDeleteProject'),
152-
onAddProject: action('onAddProject'),
153-
onUpdateEpic: action('onUpdateEpic'),
154-
onDeleteEpic: action('onDeleteEpic'),
155-
onAddEpic: action('onAddEpic'),
156-
onAddSprint: action('onAddSprint'),
157-
onUpdateSprint: action('onUpdateSprint'),
158-
onDeleteSprint: action('onDeleteSprint'),
84+
currentView: 'epics',
15985
onViewChange: action('onViewChange'),
160-
onToggleMobileMenu: action('onToggleMobileMenu'),
161-
children: <div className="p-8 bg-gray-50 h-full">Main content with mobile menu open</div>,
162-
},
163-
parameters: {
164-
viewport: {
165-
defaultViewport: 'mobile1',
166-
},
86+
children: (
87+
<div className="p-8 bg-orange-50 h-full flex items-center justify-center">
88+
<div className="text-center">
89+
<h2 className="text-2xl font-bold mb-4">Epic Planning</h2>
90+
<p className="text-gray-600">This is where the epic planning would be displayed</p>
91+
</div>
92+
</div>
93+
),
16794
},
16895
};
16996

170-
export const ManyEpicsAndSprints: Story = {
97+
export const InteractiveDemo: Story = {
17198
args: {
172-
projects: mockProjects,
173-
epics: [
174-
...extendedEpics,
175-
{
176-
id: 'epic7',
177-
name: 'User Experience',
178-
color: 'bg-pink-500',
179-
description: 'UX improvements',
180-
isSelected: false,
181-
confidence: 'low' as const,
182-
phase: 1,
183-
startDate: new Date('2024-04-01'),
184-
endDate: new Date('2024-05-15'),
185-
progress: 5
186-
},
187-
],
188-
sprints: [
189-
...mockSprints,
190-
{ id: '3', name: 'Sprint 3', description: 'Future development', startDate: new Date('2024-01-29'), endDate: new Date('2024-02-11'), isActive: false, isSelected: false },
191-
{ id: '4', name: 'Sprint 4', description: 'Planning phase', startDate: new Date('2024-02-12'), endDate: new Date('2024-02-25'), isActive: false, isSelected: false },
192-
],
19399
currentView: 'kanban',
194-
mobileMenuOpen: false,
195-
onUpdateProject: action('onUpdateProject'),
196-
onDeleteProject: action('onDeleteProject'),
197-
onAddProject: action('onAddProject'),
198-
onUpdateEpic: action('onUpdateEpic'),
199-
onDeleteEpic: action('onDeleteEpic'),
200-
onAddEpic: action('onAddEpic'),
201-
onAddSprint: action('onAddSprint'),
202-
onUpdateSprint: action('onUpdateSprint'),
203-
onDeleteSprint: action('onDeleteSprint'),
204100
onViewChange: action('onViewChange'),
205-
onToggleMobileMenu: action('onToggleMobileMenu'),
206-
children: <div className="p-8 bg-gray-50 h-full">Content with many epics and sprints</div>,
101+
children: (
102+
<div className="p-8 h-full">
103+
<div className="mb-6">
104+
<h1 className="text-3xl font-bold mb-2">Project Management Dashboard</h1>
105+
<p className="text-gray-600">Switch between different views using the sidebar</p>
106+
</div>
107+
108+
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
109+
<div className="bg-white p-6 rounded-lg shadow-sm border">
110+
<h3 className="font-semibold mb-2">Active Tasks</h3>
111+
<div className="text-2xl font-bold text-blue-600">23</div>
112+
</div>
113+
114+
<div className="bg-white p-6 rounded-lg shadow-sm border">
115+
<h3 className="font-semibold mb-2">Completed</h3>
116+
<div className="text-2xl font-bold text-green-600">142</div>
117+
</div>
118+
119+
<div className="bg-white p-6 rounded-lg shadow-sm border">
120+
<h3 className="font-semibold mb-2">In Progress</h3>
121+
<div className="text-2xl font-bold text-orange-600">8</div>
122+
</div>
123+
</div>
124+
125+
<div className="mt-8 bg-white p-6 rounded-lg shadow-sm border">
126+
<h3 className="font-semibold mb-4">Recent Activity</h3>
127+
<div className="space-y-3">
128+
<div className="flex items-center gap-3">
129+
<div className="w-2 h-2 bg-blue-500 rounded-full"></div>
130+
<span className="text-sm">Task "User Authentication" was completed</span>
131+
</div>
132+
<div className="flex items-center gap-3">
133+
<div className="w-2 h-2 bg-green-500 rounded-full"></div>
134+
<span className="text-sm">Epic "API Integration" was started</span>
135+
</div>
136+
<div className="flex items-center gap-3">
137+
<div className="w-2 h-2 bg-orange-500 rounded-full"></div>
138+
<span className="text-sm">Sprint planning meeting scheduled</span>
139+
</div>
140+
</div>
141+
</div>
142+
</div>
143+
),
207144
},
208145
};

src/components/Projects/ProjectView.tsx

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -502,19 +502,8 @@ export default function ProjectView({
502502

503503
return (
504504
<ManagementSidebar
505-
projects={projects}
506-
epics={epics}
507-
sprints={sprints}
508505
currentView={currentView}
509-
onUpdateProject={handleUpdateProject}
510-
onDeleteProject={handleDeleteProject}
511-
onAddProject={handleAddProject}
512-
onUpdateEpic={handleUpdateEpic}
513-
onDeleteEpic={handleDeleteEpic}
514-
onAddEpic={handleAddEpicClick}
515506
onViewChange={handleViewChange}
516-
mobileMenuOpen={mobileMenuOpen}
517-
onToggleMobileMenu={handleToggleMobileMenu}
518507
>
519508
{currentView === 'kanban' && (
520509
<div className="h-full overflow-hidden">

0 commit comments

Comments
 (0)