Centralize task types

This commit is contained in:
AbdBarho
2023-01-10 06:51:59 +01:00
parent 942dc42d03
commit 54a042d002
29 changed files with 162 additions and 192 deletions
+2 -2
View File
@@ -4,13 +4,13 @@ import { Messages } from "src/components/Messages";
import { TaskControls } from "src/components/Survey/TaskControls";
import { TrackedTextarea } from "src/components/Survey/TrackedTextarea";
import { TwoColumnsWithCards } from "src/components/Survey/TwoColumnsWithCards";
import { TaskType } from "./TaskTypes";
import { TaskInfo } from "./TaskTypes";
export interface CreateTaskProps {
// we need a task type
// eslint-disable-next-line @typescript-eslint/no-explicit-any
tasks: any[];
taskType: TaskType;
taskType: TaskInfo;
trigger: (update: { id: string; update_type: string; content: { text: string } }) => void;
onSkipTask: (task: { id: string }, reason: string) => void;
onNextTask: () => void;
+2 -2
View File
@@ -4,7 +4,7 @@ export enum TaskCategory {
Label = "Label",
}
export interface TaskType {
export interface TaskInfo {
label: string;
desc: string;
category: TaskCategory;
@@ -14,7 +14,7 @@ export interface TaskType {
instruction?: string;
}
export const TaskTypes: TaskType[] = [
export const TaskTypes: TaskInfo[] = [
// create
{
label: "Create Initial Prompts",