Skip to content

Commit 00c46e6

Browse files
committed
fix: board
1 parent 9756143 commit 00c46e6

3 files changed

Lines changed: 225 additions & 3 deletions

File tree

src/components/CRM/CogeBoard.stories.tsx

Lines changed: 221 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,227 @@ Default.args = {
6464
},
6565
};
6666

67+
export const Test: Story = Template.bind({});
68+
Test.args = {
69+
...Default.args,
70+
initialData: {
71+
"deals": [
72+
{
73+
"id": 11,
74+
"customer": {
75+
"id": 1,
76+
"name": "Customer 1",
77+
"intro": null,
78+
"active": true,
79+
"icon": null,
80+
"updatedAt": "2025-04-28T21:56:26.595Z",
81+
"createdAt": "2025-04-28T21:56:26.594Z"
82+
},
83+
"value": 1,
84+
"assignee": {
85+
"id": 1,
86+
"name": "Test user - do not delete",
87+
"email": "test@test.com",
88+
"jobRole": null,
89+
"manager": null,
90+
"about": null,
91+
"profilePicture": null,
92+
"holidaysRemaining": 25,
93+
"startingHolidays": 25,
94+
"dateOfBirth": null,
95+
"joinDate": null,
96+
"linkedIn": null,
97+
"assets": [],
98+
"role": "admin",
99+
"updatedAt": "2025-04-28T21:23:55.792Z",
100+
"createdAt": "2025-04-28T21:23:55.787Z",
101+
"enableAPIKey": null,
102+
"apiKey": null
103+
},
104+
"status": "Won",
105+
"gecoStatus": "firm",
106+
"categories": [],
107+
"dateLogged": "2025-04-29T21:08:45.154Z",
108+
"closureDate": "2025-04-30T00:00:00.000Z",
109+
"description": "wewewewewedsds",
110+
"comments": [],
111+
"updatedAt": "2025-06-17T11:54:01.228Z",
112+
"createdAt": "2025-04-29T21:09:20.627Z"
113+
},
114+
{
115+
"id": 10,
116+
"value": 1,
117+
"status": "Lost",
118+
"gecoStatus": "other",
119+
"categories": [],
120+
"dateLogged": "2025-04-29T21:08:45.154Z",
121+
"closureDate": "2025-04-30T00:00:00.000Z",
122+
"description": "Lost deal example",
123+
"comments": [],
124+
"updatedAt": "2025-04-29T21:09:18.942Z",
125+
"createdAt": "2025-04-29T21:09:18.940Z"
126+
},
127+
{
128+
"id": 9,
129+
"value": 1,
130+
"status": "Cold",
131+
"gecoStatus": "other",
132+
"categories": [],
133+
"dateLogged": "2025-04-29T21:08:45.154Z",
134+
"closureDate": "2025-04-30T00:00:00.000Z",
135+
"description": "wewewewewedsds",
136+
"comments": [],
137+
"updatedAt": "2025-04-29T21:09:17.611Z",
138+
"createdAt": "2025-04-29T21:09:17.601Z"
139+
},
140+
{
141+
"id": 8,
142+
"value": 1,
143+
"status": "Cold",
144+
"gecoStatus": "other",
145+
"categories": [],
146+
"dateLogged": "2025-04-29T21:08:45.154Z",
147+
"closureDate": "2025-04-30T00:00:00.000Z",
148+
"description": "wewewewewedsds",
149+
"comments": [],
150+
"updatedAt": "2025-04-29T21:09:15.980Z",
151+
"createdAt": "2025-04-29T21:09:15.979Z"
152+
},
153+
{
154+
"id": 7,
155+
"value": 1,
156+
"status": "Cold",
157+
"gecoStatus": "other",
158+
"categories": [],
159+
"dateLogged": "2025-04-29T21:08:45.154Z",
160+
"closureDate": "2025-04-30T00:00:00.000Z",
161+
"description": "wewewewewedsds",
162+
"comments": [],
163+
"updatedAt": "2025-04-29T21:09:14.452Z",
164+
"createdAt": "2025-04-29T21:09:14.442Z"
165+
},
166+
{
167+
"id": 6,
168+
"value": 1,
169+
"status": "Cold",
170+
"gecoStatus": "other",
171+
"categories": [],
172+
"dateLogged": "2025-04-29T21:08:45.154Z",
173+
"closureDate": "2025-04-30T00:00:00.000Z",
174+
"description": "wewewewewedsds",
175+
"comments": [],
176+
"updatedAt": "2025-04-29T21:09:12.527Z",
177+
"createdAt": "2025-04-29T21:09:12.526Z"
178+
},
179+
{
180+
"id": 5,
181+
"value": 1,
182+
"status": "Cold",
183+
"gecoStatus": "other",
184+
"categories": [],
185+
"dateLogged": "2025-04-29T21:08:45.154Z",
186+
"closureDate": "2025-04-30T00:00:00.000Z",
187+
"description": "wewewewewedsds",
188+
"comments": [],
189+
"updatedAt": "2025-04-29T21:09:10.603Z",
190+
"createdAt": "2025-04-29T21:09:10.592Z"
191+
},
192+
{
193+
"id": 4,
194+
"value": 1,
195+
"status": "Cold",
196+
"gecoStatus": "other",
197+
"categories": [],
198+
"dateLogged": "2025-04-29T21:08:45.154Z",
199+
"closureDate": "2025-04-30T00:00:00.000Z",
200+
"description": "wewewewewedsds",
201+
"comments": [],
202+
"updatedAt": "2025-04-29T21:09:09.032Z",
203+
"createdAt": "2025-04-29T21:09:09.031Z"
204+
},
205+
{
206+
"id": 3,
207+
"value": 1,
208+
"status": "Cold",
209+
"gecoStatus": "other",
210+
"categories": [],
211+
"dateLogged": "2025-04-29T21:08:45.154Z",
212+
"closureDate": "2025-04-30T00:00:00.000Z",
213+
"description": "wewewewewedsds",
214+
"comments": [],
215+
"updatedAt": "2025-04-29T21:09:07.464Z",
216+
"createdAt": "2025-04-29T21:09:07.463Z"
217+
},
218+
{
219+
"id": 2,
220+
"value": 1,
221+
"status": "Cold",
222+
"gecoStatus": "other",
223+
"categories": [],
224+
"dateLogged": "2025-04-29T21:08:45.154Z",
225+
"closureDate": "2025-04-30T00:00:00.000Z",
226+
"description": "wewewewewedsds",
227+
"comments": [],
228+
"updatedAt": "2025-04-29T21:09:03.844Z",
229+
"createdAt": "2025-04-29T21:09:03.840Z"
230+
},
231+
{
232+
"id": 1,
233+
"value": 1,
234+
"status": "Cold",
235+
"gecoStatus": "other",
236+
"categories": [],
237+
"dateLogged": "2025-04-29T21:08:45.154Z",
238+
"closureDate": "2025-04-30T00:00:00.000Z",
239+
"description": "wewewewewedsds",
240+
"comments": [],
241+
"updatedAt": "2025-04-29T21:08:45.164Z",
242+
"createdAt": "2025-04-29T21:08:45.160Z"
243+
}
244+
],
245+
"customers": [
246+
{
247+
"id": 1,
248+
"name": "Customer 1",
249+
"active": true
250+
},
251+
{
252+
"id": 2,
253+
"name": "Customer 2",
254+
"active": true
255+
},
256+
{
257+
"id": 3,
258+
"name": "Customer 3",
259+
"active": true
260+
}
261+
],
262+
"users": [
263+
{
264+
"id": 1,
265+
"name": "Test user - do not delete",
266+
"email": "test@test.com",
267+
"jobRole": null,
268+
"manager": null,
269+
"about": null,
270+
"profilePicture": null,
271+
"holidaysRemaining": 25,
272+
"startingHolidays": 25,
273+
"dateOfBirth": null,
274+
"joinDate": null,
275+
"linkedIn": null,
276+
"assets": [],
277+
"role": "admin",
278+
"updatedAt": "2025-04-28T21:23:55.792Z",
279+
"createdAt": "2025-04-28T21:23:55.787Z",
280+
"enableAPIKey": null,
281+
"apiKey": null
282+
}
283+
],
284+
"categories": []
285+
}
286+
};
287+
67288
export const NoDeals: Story = Template.bind({});
68289
NoDeals.args = {
69290
...Default.args,

src/components/CRM/CogeBoard.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ export function CRMCogeBoard({
3434
const getColumnDeals = (status: gecoStatus) => {
3535
return (initialData.deals ?? [])
3636
.filter((deal) => deal.gecoStatus === status)
37-
.filter((deal) => deal.status !== 'Lost' && deal.status !== 'Cold')
37+
.filter((deal) => deal.status !== 'Lost' )
38+
.filter((deal) => deal.status !== 'Cold' )
3839
}
3940

4041
const calculateColumnValue = (deals: Deal[]) => {

src/components/CRM/DealDetails.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ try {
141141
<Dialog open={true}>
142142
<DialogContent className="max-w-3xl max-h-[90vh] overflow-hidden flex flex-col [&>button:last-child]:hidden">
143143
<DialogHeader className="flex flex-row items-center justify-between">
144-
<DialogTitle className="text-2xl font-bold">{customer?.name}</DialogTitle>
144+
<DialogTitle className="text-2xl font-bold">{customer?.name || 'no customer'}</DialogTitle>
145145
<div className="flex space-x-2">
146146
<Button variant="outline" onClick={onClose}>
147147
Close
@@ -202,7 +202,7 @@ try {
202202
onClick={() => setEditingField('assignee')}
203203
>
204204
<UserIcon className="w-4 h-4 text-gray-400" />
205-
<span>{(editedDeal.assignee as User).name}</span>
205+
<span>{(editedDeal?.assignee as User)?.name}</span>
206206
</div>
207207
)}
208208
</div>

0 commit comments

Comments
 (0)