todo_widget: Allow tasks to be added through /todo command.

Uptil now, users could add tasks to a todo widget only after creating
it through the `/todo` command in the compose box.

Users can now add an initial list of tasks using the `/todo` command,
with each task on a new line in the compose box, where the 1st `:`
would separate a task from its (optional) description. Example:
`/todo\nTask1:description1\nTask2 without description`.

Fixes part of #20213.
This commit is contained in:
N-Shar-ma
2022-08-04 19:50:54 +05:30
committed by Tim Abbott
parent 6df3ad251a
commit d8a8364d1a
5 changed files with 89 additions and 37 deletions

View File

@@ -32,6 +32,7 @@ const poll_widget_extra_data_schema = z
export const todo_widget_extra_data_schema = z
.object({
task_list_title: z.string().optional(),
tasks: z.array(z.object({task: z.string(), desc: z.string()})).optional(),
})
.nullable();