feat/edit steps (#7)
* refactor: ♻️ edit steps * add md5 hash lib * now step ids are generated based on titles and estimation * feat: ✨ edit steps now add steps will be a modal for editing all steps * chore(commitizen): init cz changelog * chore(changelog): init git cliff * feat(edit steps): add a message to alert on the fact that the record may change * feat(task): task link is a normal button now * with the good ids * remove column * autofocus to title * --wip-- [skip ci] * lint * can modify the whole task when recording
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { createUuid } from '@/shared/create-uuid'
|
||||
import { generateId } from '@/shared/generate-id'
|
||||
import type { Stepable } from '../interfaces/stepable'
|
||||
|
||||
export const adaptStepsToTextarea = (steps: Stepable[]) =>
|
||||
@@ -33,6 +33,12 @@ export const adaptTextareaToSteps = (textareaValue: string): Stepable[] =>
|
||||
return null
|
||||
}
|
||||
|
||||
return { id: createUuid(), title, estimation }
|
||||
return { id: generateId(`${title}-${estimation}`), title, estimation }
|
||||
})
|
||||
.filter((step): step is Stepable => step !== null)
|
||||
.map((step, index, steps) => {
|
||||
const subSteps = steps.slice(0, index + 1)
|
||||
const duplicates = subSteps.filter((s) => s.id === step.id).length
|
||||
|
||||
return { ...step, id: `${step.id}-${duplicates}` }
|
||||
})
|
||||
.filter((step) => step !== null) as Stepable[]
|
||||
|
||||
Reference in New Issue
Block a user