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(() =>
|
||||
recordStore.createAndRetrieveTaskRecord(props.taskId, props.recordId)
|
||||
)
|
||||
const recordNotes = computed(() => recordStore.getRecordNotes(props.recordId))
|
||||
const { duration } = useTaskRecordMetadata(record)
|
||||
|
||||
const getNextStepId = () => {
|
||||
@@ -137,6 +138,18 @@ const isSuperiorToEstimation = computed(() => {
|
||||
than expected.
|
||||
</span>
|
||||
</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>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -11,4 +11,5 @@ export interface Recordable {
|
||||
start: ISODate
|
||||
end?: ISODate
|
||||
stepRecords: Record<string, StepRecordable>
|
||||
notes: string
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ export class TaskRecord implements Recordable {
|
||||
public start: ISODate = toISODate(new Date())
|
||||
public end: ISODate | undefined = undefined
|
||||
public stepRecords: Record<string, StepRecordable> = {}
|
||||
public notes = ''
|
||||
|
||||
public constructor(
|
||||
public readonly id: string,
|
||||
|
||||
@@ -85,6 +85,21 @@ export const useTaskRecordStore = defineStore('task-record-store', {
|
||||
endRecord(recordId: string) {
|
||||
this.records[recordId].end = toISODate(new Date())
|
||||
this.currentStepId = null
|
||||
},
|
||||
updateRecordNotes(recordId: string, notes: string) {
|
||||
const record = this.records[recordId]
|
||||
|
||||
if (record) {
|
||||
this.$patch({
|
||||
records: {
|
||||
...this.records,
|
||||
[recordId]: {
|
||||
...record,
|
||||
notes
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
getters: {
|
||||
@@ -109,11 +124,14 @@ export const useTaskRecordStore = defineStore('task-record-store', {
|
||||
}
|
||||
},
|
||||
getRecord() {
|
||||
return (recordId: string) => this.records?.[recordId] ?? null
|
||||
return (recordId: string) => this.records[recordId] ?? null
|
||||
},
|
||||
getStepRecord() {
|
||||
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