@@ -15,7 +15,11 @@ import { ScheduleOverlapPolicy } from '@/__generated__/proto-ts/uber/cadence/api
1515import DomainSchedulesHorizontalField from '@/views/domain-schedules/domain-schedules-horizontal-field/domain-schedules-horizontal-field' ;
1616import getFieldErrorMessage from '@/views/workflow-actions/workflow-action-start-form/helpers/get-field-error-message' ;
1717
18- import { OVERLAP_POLICY_OPTIONS } from './domain-schedules-create-advanced-form.constants' ;
18+ import {
19+ CREATE_SCHEDULE_ADVANCED_FIELD_DESCRIPTIONS ,
20+ CREATE_SCHEDULE_ADVANCED_FIELD_IDS ,
21+ OVERLAP_POLICY_OPTIONS ,
22+ } from './domain-schedules-create-advanced-form.constants' ;
1923import {
2024 overrides ,
2125 styled ,
@@ -64,18 +68,18 @@ export default function DomainSchedulesCreateAdvancedForm({
6468 < >
6569 < DomainSchedulesHorizontalField
6670 label = "Schedule Id"
67- description = "Unique name provided by users to name the schedule."
68- htmlFor = "create-schedule-form-schedule-id"
71+ description = { CREATE_SCHEDULE_ADVANCED_FIELD_DESCRIPTIONS . scheduleId }
72+ htmlFor = { CREATE_SCHEDULE_ADVANCED_FIELD_IDS . scheduleId }
6973 error = { getFieldErrorMessage ( fieldErrors , 'scheduleId' ) }
7074 >
7175 < Controller
7276 name = "scheduleId"
7377 control = { control }
78+ defaultValue = ""
7479 render = { ( { field : { ref, ...field } } ) => (
7580 < Input
7681 { ...field }
77- value = { field . value ?? '' }
78- id = "create-schedule-form-schedule-id"
82+ id = { CREATE_SCHEDULE_ADVANCED_FIELD_IDS . scheduleId }
7983 // @ts -expect-error - inputRef expects ref object while ref is a callback. It should support both.
8084 inputRef = { ref }
8185 aria-label = "Schedule Id"
@@ -91,7 +95,9 @@ export default function DomainSchedulesCreateAdvancedForm({
9195
9296 < DomainSchedulesHorizontalField
9397 label = "Overlap Policy"
94- description = "Policy that controls what the scheduler should do if the previous action is still running."
98+ description = {
99+ CREATE_SCHEDULE_ADVANCED_FIELD_DESCRIPTIONS . overlapPolicy
100+ }
95101 error = { getFieldErrorMessage ( fieldErrors , 'overlapPolicy' ) }
96102 >
97103 < Controller
@@ -122,8 +128,10 @@ export default function DomainSchedulesCreateAdvancedForm({
122128 < DomainSchedulesHorizontalField
123129 subfield = { true }
124130 label = "Buffer limit"
125- description = "Max number of pending workflows allowed when using Buffer overlap policy."
126- htmlFor = "create-schedule-form-buffer-limit"
131+ description = {
132+ CREATE_SCHEDULE_ADVANCED_FIELD_DESCRIPTIONS . bufferLimit
133+ }
134+ htmlFor = { CREATE_SCHEDULE_ADVANCED_FIELD_IDS . bufferLimit }
127135 caption = "Defaults to 0 (unlimited)"
128136 error = { getFieldErrorMessage ( fieldErrors , 'bufferLimit' ) }
129137 >
@@ -133,7 +141,7 @@ export default function DomainSchedulesCreateAdvancedForm({
133141 render = { ( { field : { ref, ...field } } ) => (
134142 < Input
135143 { ...field }
136- id = "create-schedule-form-buffer-limit"
144+ id = { CREATE_SCHEDULE_ADVANCED_FIELD_IDS . bufferLimit }
137145 // @ts -expect-error - inputRef expects ref object while ref is a callback. It should support both.
138146 inputRef = { ref }
139147 aria-label = "Buffer limit"
@@ -156,8 +164,10 @@ export default function DomainSchedulesCreateAdvancedForm({
156164 < DomainSchedulesHorizontalField
157165 subfield = { true }
158166 label = "Concurrency limit"
159- description = "Max number of concurrently running workflows allowed for Concurrent overlap policy."
160- htmlFor = "create-schedule-form-concurrency-limit"
167+ description = {
168+ CREATE_SCHEDULE_ADVANCED_FIELD_DESCRIPTIONS . concurrencyLimit
169+ }
170+ htmlFor = { CREATE_SCHEDULE_ADVANCED_FIELD_IDS . concurrencyLimit }
161171 caption = "Defaults to 0 (unlimited)"
162172 error = { getFieldErrorMessage ( fieldErrors , 'concurrencyLimit' ) }
163173 >
@@ -167,7 +177,7 @@ export default function DomainSchedulesCreateAdvancedForm({
167177 render = { ( { field : { ref, ...field } } ) => (
168178 < Input
169179 { ...field }
170- id = "create-schedule-form-concurrency-limit"
180+ id = { CREATE_SCHEDULE_ADVANCED_FIELD_IDS . concurrencyLimit }
171181 // @ts -expect-error - inputRef expects ref object while ref is a callback. It should support both.
172182 inputRef = { ref }
173183 aria-label = "Concurrency limit"
@@ -187,17 +197,20 @@ export default function DomainSchedulesCreateAdvancedForm({
187197
188198 < DomainSchedulesHorizontalField
189199 label = "Jitter duration"
190- description = "Time range to distribute starting workflows across. This helps avoiding burst of workflow creations in a single point of time."
191- htmlFor = "create-schedule-form-jitter"
200+ description = {
201+ CREATE_SCHEDULE_ADVANCED_FIELD_DESCRIPTIONS . jitterSeconds
202+ }
203+ htmlFor = { CREATE_SCHEDULE_ADVANCED_FIELD_IDS . jitterSeconds }
192204 error = { getFieldErrorMessage ( fieldErrors , 'jitterSeconds' ) }
193205 >
194206 < Controller
195207 name = "jitterSeconds"
196208 control = { control }
209+ defaultValue = ""
197210 render = { ( { field : { ref, ...field } } ) => (
198211 < Input
199212 { ...field }
200- id = "create-schedule-form-jitter"
213+ id = { CREATE_SCHEDULE_ADVANCED_FIELD_IDS . jitterSeconds }
201214 // @ts -expect-error - inputRef expects ref object while ref is a callback. It should support both.
202215 inputRef = { ref }
203216 aria-label = "Jitter duration"
@@ -217,18 +230,20 @@ export default function DomainSchedulesCreateAdvancedForm({
217230
218231 < DomainSchedulesHorizontalField
219232 label = "Workflow Id Prefix"
220- description = "Prefix text to add into started workflows. Ids are formed as `${Prefix}+{auto generated postfix}`."
221- htmlFor = "create-schedule-form-workflow-id-prefix"
233+ description = {
234+ CREATE_SCHEDULE_ADVANCED_FIELD_DESCRIPTIONS . workflowIdPrefix
235+ }
236+ htmlFor = { CREATE_SCHEDULE_ADVANCED_FIELD_IDS . workflowIdPrefix }
222237 error = { getFieldErrorMessage ( fieldErrors , 'workflowIdPrefix' ) }
223238 >
224239 < Controller
225240 name = "workflowIdPrefix"
226241 control = { control }
242+ defaultValue = ""
227243 render = { ( { field : { ref, ...field } } ) => (
228244 < Input
229245 { ...field }
230- value = { field . value ?? '' }
231- id = "create-schedule-form-workflow-id-prefix"
246+ id = { CREATE_SCHEDULE_ADVANCED_FIELD_IDS . workflowIdPrefix }
232247 // @ts -expect-error - inputRef expects ref object while ref is a callback. It should support both.
233248 inputRef = { ref }
234249 aria-label = "Workflow Id Prefix"
0 commit comments