Enable pipeline stage ordering (#577)
* Enable pipeline stage ordering * Removing migration * Remove Save button
This commit is contained in:
@ -19,12 +19,7 @@ export function RightDrawerCreateCommentThread() {
|
||||
|
||||
return (
|
||||
<RightDrawerPage>
|
||||
<RightDrawerTopBar
|
||||
title="New note"
|
||||
onSave={() => {
|
||||
return;
|
||||
}}
|
||||
/>
|
||||
<RightDrawerTopBar title="New note" />
|
||||
<RightDrawerBody>
|
||||
{commentThreadId && (
|
||||
<CommentThread
|
||||
|
||||
@ -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 || []),
|
||||
|
||||
@ -10,6 +10,7 @@ export const GET_PIPELINES = gql`
|
||||
id
|
||||
name
|
||||
color
|
||||
index
|
||||
pipelineProgresses {
|
||||
id
|
||||
progressableType
|
||||
|
||||
Reference in New Issue
Block a user