feat(DT-3565): Schedules Redesign#3405
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
43fa679 to
23923a6
Compare
| <Loading /> | ||
| {:then { schedule, searchAttributes }} | ||
| <ScheduleFormView onConfirm={handleEdit} {schedule} {searchAttributes} /> | ||
| <ScheduleFormView |
There was a problem hiding this comment.
⚠️ Argument of type 'ISchedule | undefined' is not assignable to parameter of type 'ISchedule'.
| <ScheduleFormView onConfirm={handleEdit} {schedule} {searchAttributes} /> | ||
| <ScheduleFormView | ||
| onSubmit={handleEdit(schedule)} | ||
| {schedule} |
There was a problem hiding this comment.
⚠️ Type 'ISearchAttributes | null | undefined' is not assignable to type 'ISearchAttributes | undefined'.
|
23923a6 to
f6459bf
Compare
61bbcf7 to
b0bed58
Compare
| <NumberInput | ||
| id="endAfterOccurrences" | ||
| label={translate('schedules.occurrences-label')} | ||
| labelHidden |
There was a problem hiding this comment.
⚠️ Type 'number | undefined' is not assignable to type 'number'.
| let body: ScheduleRequestBody; | ||
| try { | ||
| body = await formDataToCreateScheduleRequest(formData); | ||
| } catch (e) { |
There was a problem hiding this comment.
⚠️ Property 'message' does not exist on type '{}'.
| let body: ScheduleRequestBody; | ||
| try { | ||
| body = await formDataToEditScheduleRequest(formData, schedule, scheduleId); | ||
| } catch (e) { |
There was a problem hiding this comment.
⚠️ Property 'message' does not exist on type '{}'.
| } catch (e) { | ||
| actionPending.set(false); | ||
| serverError.set( | ||
| translate('schedules.delete-schedule-error', { |
There was a problem hiding this comment.
⚠️ Property 'message' does not exist on type '{}'.
| isPaused | ||
| ? 'schedules.pause-schedule-error' | ||
| : 'schedules.unpause-schedule-error', | ||
| { |
There was a problem hiding this comment.
⚠️ Property 'message' does not exist on type '{}'.
| } catch (e) { | ||
| actionPending.set(true); | ||
| serverError.set( | ||
| translate('schedules.trigger-schedule-error', { |
There was a problem hiding this comment.
⚠️ Property 'message' does not exist on type '{}'.
| } catch (e) { | ||
| actionPending.set(true); | ||
| serverError.set( | ||
| translate('schedules.backfill-schedule-error', { |
There was a problem hiding this comment.
⚠️ Property 'message' does not exist on type '{}'.
| } | ||
| } | ||
|
|
||
| export const currentScheduleFetch = |
There was a problem hiding this comment.
⚠️ Argument of type 'null' is not assignable to parameter of type 'Promise<DescribeFullSchedule | null> | undefined'.
| <Panel class="flex w-full flex-col gap-4 border-subtle p-6" as="section"> | ||
| <header class="mb-1 flex items-center justify-between"> | ||
| <h2 class="text-2xl font-medium">{translate('schedules.workflow-runs')}</h2> | ||
| <Link |
There was a problem hiding this comment.
⚠️ Type 'string | undefined' is not assignable to type 'string'.
| class="grid grid-cols-[max-content_1fr] gap-x-2 gap-y-1 border-b border-subtle py-2 sm:grid-cols-[minmax(max-content,7rem)_1fr_max-content]" | ||
| > | ||
| <div class="col-start-1 row-start-1 flex items-center"> | ||
| <WorkflowStatus |
There was a problem hiding this comment.
⚠️ Argument of type 'WorkflowExecutionStatus | null | undefined' is not assignable to parameter of type 'WorkflowStatus | WorkflowExecutionStatus'.
| class="col-span-2 row-start-2 flex justify-center sm:col-span-1 sm:col-start-2 sm:row-start-1 sm:justify-start" | ||
| > | ||
| <Link | ||
| href={routeForWorkflow({ |
There was a problem hiding this comment.
⚠️ 'run.startWorkflowResult' is possibly 'null' or 'undefined'.⚠️ Type 'string | null | undefined' is not assignable to type 'string'.
| > | ||
| <Link | ||
| href={routeForWorkflow({ | ||
| workflow: run.startWorkflowResult.workflowId, |
There was a problem hiding this comment.
⚠️ 'run.startWorkflowResult' is possibly 'null' or 'undefined'.⚠️ Type 'string | null | undefined' is not assignable to type 'string'.
| run: run.startWorkflowResult.runId, | ||
| namespace, | ||
| })} | ||
| > |
There was a problem hiding this comment.
⚠️ 'run.startWorkflowResult' is possibly 'null' or 'undefined'.
| id="catchup-window-policy-duration" | ||
| label={translate('schedules.catchup-window-label')} | ||
| inputmode="numeric" | ||
| bind:value={$policies.catchupWindow} |
There was a problem hiding this comment.
⚠️ Type '"month(s)" | "day(s)" | "hour(s)" | "minute(s)" | "second(s)" | undefined' is not assignable to type '"month(s)" | "day(s)" | "hour(s)" | "minute(s)" | "second(s)"'.
| id="task-timeout-duration" | ||
| label={translate('schedules.task-timeout')} | ||
| inputmode="numeric" | ||
| bind:value={$policies.taskTimeout} |
There was a problem hiding this comment.
⚠️ Type '"month(s)" | "day(s)" | "hour(s)" | "minute(s)" | "second(s)" | undefined' is not assignable to type '"month(s)" | "day(s)" | "hour(s)" | "minute(s)" | "second(s)"'.
| id="run-timeout-duration" | ||
| label={translate('schedules.run-timeout')} | ||
| inputmode="numeric" | ||
| bind:value={$policies.runTimeout} |
There was a problem hiding this comment.
⚠️ Type '"month(s)" | "day(s)" | "hour(s)" | "minute(s)" | "second(s)" | undefined' is not assignable to type '"month(s)" | "day(s)" | "hour(s)" | "minute(s)" | "second(s)"'.
| id="execution-timeout-duration" | ||
| label={translate('schedules.execution-timeout')} | ||
| inputmode="numeric" | ||
| bind:value={$policies.executionTimeout} |
There was a problem hiding this comment.
⚠️ Type '"month(s)" | "day(s)" | "hour(s)" | "minute(s)" | "second(s)" | undefined' is not assignable to type '"month(s)" | "day(s)" | "hour(s)" | "minute(s)" | "second(s)"'.
| baseFormData({ name: ' my-schedule ' }), | ||
| ); | ||
|
|
||
| expect(body.schedule_id).toBe('my-schedule'); |
There was a problem hiding this comment.
⚠️ 'body.schedule.action' is possibly 'undefined'.
| existingSchedule(), | ||
| 'real-id', | ||
| ); | ||
|
|
There was a problem hiding this comment.
⚠️ 'body.schedule.action' is possibly 'undefined'.
| }); | ||
|
|
||
| it('encodes header fields without mutating the source schedule', async () => { | ||
| const schedule = existingSchedule(); |
There was a problem hiding this comment.
⚠️ 'schedule.action' is possibly 'null' or 'undefined'.⚠️ 'schedule.action.startWorkflow' is possibly 'null' or 'undefined'.
| it('encodes header fields without mutating the source schedule', async () => { | ||
| const schedule = existingSchedule(); | ||
| schedule.action.startWorkflow.header = { | ||
| fields: { greeting: 'hello' }, |
There was a problem hiding this comment.
⚠️ Property 'startWorkflow' does not exist on type 'IScheduleAction | null | undefined'.
| schedule, | ||
| 'real-id', | ||
| ); | ||
|
|
There was a problem hiding this comment.
⚠️ 'body.schedule.action' is possibly 'undefined'.⚠️ 'body.schedule.action.startWorkflow.header' is possibly 'null' or 'undefined'.⚠️ 'body.schedule.action.startWorkflow.header.fields' is possibly 'null' or 'undefined'.
| metadata: { encoding: 'json/plain' }, | ||
| data: '"hello"', | ||
| }); | ||
| // source schedule is untouched |
There was a problem hiding this comment.
⚠️ 'schedule.action' is possibly 'null' or 'undefined'.⚠️ 'schedule.action.startWorkflow' is possibly 'null' or 'undefined'.⚠️ 'schedule.action.startWorkflow.header' is possibly 'null' or 'undefined'.⚠️ 'schedule.action.startWorkflow.header.fields' is possibly 'null' or 'undefined'.
| </Input> | ||
| </div> | ||
|
|
||
| <ScheduleInputPayload |
There was a problem hiding this comment.
⚠️ Type 'string | undefined' is not assignable to type 'string'.
| <ScheduleInputPayload | ||
| bind:input={$form.input} | ||
| bind:editInput={$form.editInput} | ||
| bind:encoding={$form.encoding} |
There was a problem hiding this comment.
⚠️ Type 'string | undefined' is not assignable to type 'string'.
| bind:input={$form.input} | ||
| bind:editInput={$form.editInput} | ||
| bind:encoding={$form.encoding} | ||
| bind:messageType={$form.messageType} |
There was a problem hiding this comment.
⚠️ Type 'IPayloads | null | undefined' is not assignable to type 'IPayloads | undefined'.
| structuredCalendar: spec.excludeStructuredCalendar, | ||
| }) || translate('common.none') | ||
| : translate('common.none'), | ||
| )} |
There was a problem hiding this comment.
⚠️ 'state' is possibly 'null' or 'undefined'.
| class="flex select-all flex-wrap items-center gap-2 text-3xl" | ||
| data-testid="schedule-name" | ||
| > | ||
| <WorkflowStatus |
There was a problem hiding this comment.
⚠️ 'currentSchedule.schedule' is possibly 'undefined'.⚠️ 'currentSchedule.schedule.state' is possibly 'null' or 'undefined'.
| ?.name} | ||
| <div class="flex items-center gap-2"> | ||
| <Link | ||
| class="block p-1" |
There was a problem hiding this comment.
⚠️ Type 'string | undefined' is not assignable to type 'string'.
| class="p-1 text-secondary" | ||
| onclick={(e) => { | ||
| copy( | ||
| e, |
There was a problem hiding this comment.
⚠️ Argument of type 'string | null | undefined' is not assignable to parameter of type 'string'.
| {$timestamp(currentSchedule?.info?.createTime)} | ||
| </dd> | ||
| </div> | ||
|
|
There was a problem hiding this comment.
⚠️ 'currentSchedule.info' is possibly 'null' or 'undefined'.
|
|
||
| <div class="flex w-full flex-col gap-4 xl:w-1/3"> | ||
| <ScheduleInputCard | ||
| {scheduleId} |
There was a problem hiding this comment.
⚠️ Type 'IPayloads | null | undefined' is not assignable to type 'IPayloads'.
| </div> | ||
| <PauseScheduleModal | ||
| {scheduleId} | ||
| {namespace} |
There was a problem hiding this comment.
⚠️ Type 'boolean | null | undefined' is not assignable to type 'boolean | undefined'.
| } | ||
|
|
||
| return { | ||
| schedule_id: formData.name.trim(), |
There was a problem hiding this comment.
⚠️ Type '{ indexedFields: { indexedFields?: { [k: string]: IPayload; } | null | undefined; }; } | null' is not assignable to type 'ISearchAttributes | null | undefined'.
| workflowId: formData.workflowId, | ||
| workflowType: { name: formData.workflowType }, | ||
| taskQueue: { name: formData.taskQueue }, | ||
| input: payloads ? { payloads } : null, |
There was a problem hiding this comment.
⚠️ Type '{ indexedFields: { indexedFields?: { [k: string]: IPayload; } | null | undefined; }; } | null' is not assignable to type 'ISearchAttributes | null | undefined'.
| const header = await encodeHeaderFields(startWorkflow.header); | ||
|
|
||
| return { | ||
| schedule_id: scheduleId, |
There was a problem hiding this comment.
⚠️ Type '{ indexedFields: { indexedFields?: { [k: string]: IPayload; } | null | undefined; }; } | null' is not assignable to type 'ISearchAttributes | null | undefined'.
| taskQueue: { name: formData.taskQueue }, | ||
| ...(formData.editInput && { | ||
| input: payloads ? { payloads } : null, | ||
| }), |
There was a problem hiding this comment.
⚠️ Type '{ indexedFields: { indexedFields?: { [k: string]: IPayload; } | null | undefined; }; } | null' is not assignable to type 'ISearchAttributes | null | undefined'.
Description & motivation 💭
Scehdules Redesign
Screenshots (if applicable) 📸
Design Considerations 🎨
https://www.figma.com/design/tzggy7x7JIM0payi0D4Xr4/Cloud-UI-Redesign?node-id=943-9543&m=dev
Testing 🧪
How was this tested 👻
Steps for others to test: 🚶🏽♂️🚶🏽♀️
Checklists
Draft Checklist
Merge Checklist
Issue(s) closed https://temporalio.atlassian.net/browse/DT-3565
Docs
Any docs updates needed?