mirror of
https://github.com/zulip/zulip.git
synced 2025-11-15 19:31:58 +00:00
todo_widget: Allow task list title to be set and edited by author.
Users can now name task lists by providing the task list title in the `/todo` command on the same line. Example: `/todo School Work`. If no title is provided by the user, "Task list" (which is also the placeholder) is used as default. The author of a task list can later edit / update the task list title in the todo widget, just like the question in the poll widget. Fixes part of #20213.
This commit is contained in:
@@ -29,12 +29,21 @@ const poll_widget_extra_data_schema = z
|
||||
})
|
||||
.nullable();
|
||||
|
||||
export const todo_widget_extra_data_schema = z
|
||||
.object({
|
||||
task_list_title: z.string().optional(),
|
||||
})
|
||||
.nullable();
|
||||
|
||||
const widget_data_event_schema = z.object({
|
||||
sender_id: z.number(),
|
||||
data: z.discriminatedUnion("widget_type", [
|
||||
z.object({widget_type: z.literal("poll"), extra_data: poll_widget_extra_data_schema}),
|
||||
z.object({widget_type: z.literal("zform"), extra_data: zform_widget_extra_data_schema}),
|
||||
z.object({widget_type: z.literal("todo"), extra_data: z.null()}),
|
||||
z.object({
|
||||
widget_type: z.literal("todo"),
|
||||
extra_data: todo_widget_extra_data_schema,
|
||||
}),
|
||||
]),
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user