mirror of
https://github.com/wassname/Open-Assistant.git
synced 2026-08-17 11:13:32 +08:00
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:
@@ -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;
|
||||
|
||||
@@ -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>;
|
||||
Reference in New Issue
Block a user