Skip to content

Commit 0dd7a1d

Browse files
committed
Add task editor route and task submission flow on new tasking API
1 parent 861a002 commit 0dd7a1d

6 files changed

Lines changed: 887 additions & 76 deletions

File tree

pages/workspace/[id]/projects/[projectId].vue

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -458,6 +458,12 @@ function buildTabRoute(tab: WorkspaceProjectDetailTab) {
458458
};
459459
}
460460
461+
function buildTaskEditorRoute(taskNumber: number) {
462+
return {
463+
path: `/workspaces/${workspaceId}/${projectId}/${taskNumber}/editor`,
464+
};
465+
}
466+
461467
type StatusDialogState = {
462468
message: string;
463469
primaryActionLabel: string;
@@ -529,7 +535,9 @@ async function handleStatusDialogPrimaryAction() {
529535
}
530536
531537
async function handleSelectedTaskAction() {
532-
if (!selectedTask.value) {
538+
const taskToOpen = selectedTask.value;
539+
540+
if (!taskToOpen) {
533541
return;
534542
}
535543
@@ -538,27 +546,21 @@ async function handleSelectedTaskAction() {
538546
return;
539547
}
540548
541-
if (selectedTask.value.locked) {
549+
if (taskToOpen.locked) {
542550
if (!selectedTaskLockedByCurrentUser.value) {
543551
return;
544552
}
545553
}
546554
547-
if (!selectedTask.value.locked) {
548-
const didLockTask = await lockTaskAndRefreshState(selectedTask.value.taskNumber);
555+
if (!taskToOpen.locked) {
556+
const didLockTask = await lockTaskAndRefreshState(taskToOpen.taskNumber);
549557
550558
if (!didLockTask) {
551559
return;
552560
}
553561
}
554562
555-
statusDialog.value = {
556-
variant: 'success',
557-
title: selectedTaskWorkActionLabel.value,
558-
message: `Task locked for ${selectedTask.value.label}. Connect the mapping or validation route next.`,
559-
primaryActionLabel: 'Close',
560-
primaryActionType: 'dismiss',
561-
};
563+
await navigateTo(buildTaskEditorRoute(taskToOpen.taskNumber));
562564
}
563565
564566
async function handleActivateProject() {

0 commit comments

Comments
 (0)