website: Unify task controls

Also happens to fix some issues with the no-changes are-you-sure dialog only appearing once and other form values not being reset correctly.
This commit is contained in:
Adrian Cowan
2023-01-11 02:59:10 +11:00
parent d4e8759a68
commit 805bc33ba4
21 changed files with 293 additions and 295 deletions
+4
View File
@@ -12,6 +12,10 @@ export const enum TaskType {
label_assistant_reply = "label_assistant_reply",
}
// we need to reconsider how to handle task content types
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export type TaskContent = any;
export interface ValidLabel {
name: string;
display_text: string;
+10
View File
@@ -0,0 +1,10 @@
export interface TaskReplyValid<T> {
content: T;
state: "VALID";
}
export interface TaskReplyDefault<T> {
content: T;
state: "DEFAULT";
}
export type TaskReplyState<T> = TaskReplyValid<T> | TaskReplyDefault<T>;