Enable pipeline stage ordering (#577)

* Enable pipeline stage ordering

* Removing migration

* Remove Save button
This commit is contained in:
Charles Bochet
2023-07-10 17:20:37 -07:00
committed by GitHub
parent eae583209e
commit 03c6d1f19d
56 changed files with 322 additions and 10 deletions

View File

@ -19,12 +19,7 @@ export function RightDrawerCreateCommentThread() {
return (
<RightDrawerPage>
<RightDrawerTopBar
title="New note"
onSave={() => {
return;
}}
/>
<RightDrawerTopBar title="New note" />
<RightDrawerBody>
{commentThreadId && (
<CommentThread

View File

@ -23,9 +23,15 @@ export function useBoard(pipelineId: string) {
variables: { where: { id: { equals: pipelineId } } },
});
const pipelineStages = pipelines.data?.findManyPipeline[0]?.pipelineStages;
const orderedPipelineStages = pipelineStages
? [...pipelineStages].sort((a, b) => {
if (!a.index || !b.index) return 0;
return a.index - b.index;
})
: [];
const initialBoard: Column[] =
pipelineStages?.map((pipelineStage) => ({
orderedPipelineStages?.map((pipelineStage) => ({
id: pipelineStage.id,
title: pipelineStage.name,
colorCode: pipelineStage.color,
@ -34,7 +40,7 @@ export function useBoard(pipelineId: string) {
[],
})) || [];
const pipelineProgresses = pipelineStages?.reduce(
const pipelineProgresses = orderedPipelineStages?.reduce(
(acc, pipelineStage) => [
...acc,
...(pipelineStage.pipelineProgresses || []),

View File

@ -10,6 +10,7 @@ export const GET_PIPELINES = gql`
id
name
color
index
pipelineProgresses {
id
progressableType