WIP Whiteboard Changes
This commit is contained in:
@@ -11,7 +11,7 @@ export default function WhiteBoardKanBan({ data, eventBus }) {
|
||||
<Board
|
||||
tagStyle={{ fontSize: "80%" }}
|
||||
data={data}
|
||||
draggable
|
||||
laneDraggable={false}
|
||||
eventBusHandle={setEventBus}
|
||||
components={{ Card: WhiteBoardCard }}
|
||||
onCardClick={(cardId, metadata) =>
|
||||
|
||||
@@ -13,39 +13,34 @@ export default function WhiteBoardKanBanContainer() {
|
||||
}
|
||||
);
|
||||
|
||||
const static_data = {
|
||||
lanes: [
|
||||
{
|
||||
id: "lane1",
|
||||
title: "Planned Tasks",
|
||||
label: "2/2",
|
||||
cards: [
|
||||
{
|
||||
id: "Card1",
|
||||
title: "Write Blog",
|
||||
description: "Can AI make memes",
|
||||
label: "30 mins"
|
||||
},
|
||||
{
|
||||
id: "Card2",
|
||||
title: "Pay Rent",
|
||||
description: "Transfer via NEFT",
|
||||
label: "5 mins",
|
||||
metadata: { sha: "be312a1" }
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
id: "lane2",
|
||||
title: "Completed",
|
||||
label: "0/0",
|
||||
cards: []
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
if (loading) return <LoadingSpinner />;
|
||||
if (error) return <Alert message={error.message} />;
|
||||
let eventBus;
|
||||
return <WhiteBoardKanBan eventBus={eventBus} data={static_data} />;
|
||||
|
||||
let i = data.job_status.reduce((acc, value) => {
|
||||
//Create a lane object for each row.
|
||||
let newLane = {
|
||||
id: value.name,
|
||||
title: value.name,
|
||||
label: "0",
|
||||
cards: value.jobs.reduce((acc, value) => {
|
||||
acc.push({
|
||||
id: value.id,
|
||||
title: value.ro_number,
|
||||
description: value.est_number,
|
||||
label: value.id,
|
||||
metadata: value
|
||||
});
|
||||
return acc;
|
||||
}, [])
|
||||
};
|
||||
acc.push(newLane);
|
||||
return acc;
|
||||
}, []);
|
||||
|
||||
let laneData = {
|
||||
lanes: i
|
||||
};
|
||||
|
||||
return <WhiteBoardKanBan eventBus={eventBus} data={laneData} />;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user