take some notes while doing a task
This commit is contained in:
@@ -21,6 +21,7 @@ const task = computed(() => taskStore.getTask(props.taskId))
|
|||||||
const record = computed(() =>
|
const record = computed(() =>
|
||||||
recordStore.createAndRetrieveTaskRecord(props.taskId, props.recordId)
|
recordStore.createAndRetrieveTaskRecord(props.taskId, props.recordId)
|
||||||
)
|
)
|
||||||
|
const recordNotes = computed(() => recordStore.getRecordNotes(props.recordId))
|
||||||
const { duration } = useTaskRecordMetadata(record)
|
const { duration } = useTaskRecordMetadata(record)
|
||||||
|
|
||||||
const getNextStepId = () => {
|
const getNextStepId = () => {
|
||||||
@@ -137,6 +138,18 @@ const isSuperiorToEstimation = computed(() => {
|
|||||||
than expected.
|
than expected.
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
<textarea
|
||||||
|
name="record-notes"
|
||||||
|
id="record-notes"
|
||||||
|
cols="30"
|
||||||
|
rows="10"
|
||||||
|
:value="recordNotes"
|
||||||
|
@input="
|
||||||
|
//@ts-ignore
|
||||||
|
recordStore.updateRecordNotes(recordId, $event.target?.value)
|
||||||
|
"
|
||||||
|
placeholder="notes"
|
||||||
|
></textarea>
|
||||||
</main>
|
</main>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|||||||
@@ -11,4 +11,5 @@ export interface Recordable {
|
|||||||
start: ISODate
|
start: ISODate
|
||||||
end?: ISODate
|
end?: ISODate
|
||||||
stepRecords: Record<string, StepRecordable>
|
stepRecords: Record<string, StepRecordable>
|
||||||
|
notes: string
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ export class TaskRecord implements Recordable {
|
|||||||
public start: ISODate = toISODate(new Date())
|
public start: ISODate = toISODate(new Date())
|
||||||
public end: ISODate | undefined = undefined
|
public end: ISODate | undefined = undefined
|
||||||
public stepRecords: Record<string, StepRecordable> = {}
|
public stepRecords: Record<string, StepRecordable> = {}
|
||||||
|
public notes = ''
|
||||||
|
|
||||||
public constructor(
|
public constructor(
|
||||||
public readonly id: string,
|
public readonly id: string,
|
||||||
|
|||||||
@@ -85,6 +85,21 @@ export const useTaskRecordStore = defineStore('task-record-store', {
|
|||||||
endRecord(recordId: string) {
|
endRecord(recordId: string) {
|
||||||
this.records[recordId].end = toISODate(new Date())
|
this.records[recordId].end = toISODate(new Date())
|
||||||
this.currentStepId = null
|
this.currentStepId = null
|
||||||
|
},
|
||||||
|
updateRecordNotes(recordId: string, notes: string) {
|
||||||
|
const record = this.records[recordId]
|
||||||
|
|
||||||
|
if (record) {
|
||||||
|
this.$patch({
|
||||||
|
records: {
|
||||||
|
...this.records,
|
||||||
|
[recordId]: {
|
||||||
|
...record,
|
||||||
|
notes
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
getters: {
|
getters: {
|
||||||
@@ -109,11 +124,14 @@ export const useTaskRecordStore = defineStore('task-record-store', {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
getRecord() {
|
getRecord() {
|
||||||
return (recordId: string) => this.records?.[recordId] ?? null
|
return (recordId: string) => this.records[recordId] ?? null
|
||||||
},
|
},
|
||||||
getStepRecord() {
|
getStepRecord() {
|
||||||
return (recordId: string, stepId: string): StepRecordable | null =>
|
return (recordId: string, stepId: string): StepRecordable | null =>
|
||||||
this.records?.[recordId]?.stepRecords[stepId] ?? null
|
this.records[recordId]?.stepRecords[stepId] ?? null
|
||||||
|
},
|
||||||
|
getRecordNotes() {
|
||||||
|
return (recordId: string): string => this.records[recordId]?.notes ?? ''
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user