Skip to content

Commit e0bb5cb

Browse files
committed
Use the same field ordering in the test page
1 parent e923081 commit e0bb5cb

File tree

1 file changed

+121
-121
lines changed
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.test.tasks.$taskParam

1 file changed

+121
-121
lines changed

apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.test.tasks.$taskParam/route.tsx

Lines changed: 121 additions & 121 deletions
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@ function StandardTaskForm({
447447
setConcurrencyKeyValue(template.concurrencyKey ?? "");
448448
setMaxAttemptsValue(template.maxAttempts ?? undefined);
449449
setMaxDurationValue(template.maxDurationSeconds ?? 0);
450-
setMachineValue(template.machinePreset ?? "");
450+
setMachineValue(template.machinePreset ?? undefined);
451451
setTagsValue(template.tags ?? []);
452452
setQueueValue(template.queue ?? undefined);
453453
}}
@@ -527,21 +527,55 @@ function StandardTaskForm({
527527
<TextLink to={docsPath("triggering#options")}>Read the docs.</TextLink>
528528
</Hint>
529529
<InputGroup>
530-
<Label variant="small">Delay</Label>
531-
<DurationPicker name={delaySeconds.name} id={delaySeconds.id} />
532-
<Hint>Delays run by a specific duration.</Hint>
533-
<FormError id={delaySeconds.errorId}>{delaySeconds.error}</FormError>
530+
<Label htmlFor={machine.id} variant="small">
531+
Machine
532+
</Label>
533+
<Select
534+
{...conform.select(machine)}
535+
variant="tertiary/small"
536+
placeholder="Select machine type"
537+
dropdownIcon
538+
items={machinePresets}
539+
defaultValue={undefined}
540+
value={machineValue}
541+
setValue={(e) => {
542+
if (Array.isArray(e)) return;
543+
setMachineValue(e);
544+
}}
545+
>
546+
{machinePresets.map((machine) => (
547+
<SelectItem key={machine} value={machine}>
548+
{machine}
549+
</SelectItem>
550+
))}
551+
</Select>
552+
<Hint>Overrides the machine preset.</Hint>
553+
<FormError id={machine.errorId}>{machine.error}</FormError>
534554
</InputGroup>
535555
<InputGroup>
536-
<Label variant="small">TTL</Label>
537-
<DurationPicker
538-
name={ttlSeconds.name}
539-
id={ttlSeconds.id}
540-
value={ttlValue}
541-
onChange={setTtlValue}
542-
/>
543-
<Hint>Expires the run if it hasn't started within the TTL.</Hint>
544-
<FormError id={ttlSeconds.errorId}>{ttlSeconds.error}</FormError>
556+
<Label htmlFor={version.id} variant="small">
557+
Version
558+
</Label>
559+
<Select
560+
{...conform.select(version)}
561+
defaultValue="latest"
562+
variant="tertiary/small"
563+
placeholder="Select version"
564+
dropdownIcon
565+
disabled={disableVersionSelection}
566+
>
567+
{versions.map((version, i) => (
568+
<SelectItem key={version} value={i === 0 ? "latest" : version}>
569+
{version} {i === 0 && "(latest)"}
570+
</SelectItem>
571+
))}
572+
</Select>
573+
{disableVersionSelection ? (
574+
<Hint>Only the latest version is available in the development environment.</Hint>
575+
) : (
576+
<Hint>Runs task on a specific version.</Hint>
577+
)}
578+
<FormError id={version.errorId}>{version.error}</FormError>
545579
</InputGroup>
546580
<InputGroup>
547581
<Label htmlFor={queue.id} variant="small">
@@ -689,55 +723,21 @@ function StandardTaskForm({
689723
<FormError id={concurrencyKey.errorId}>{concurrencyKey.error}</FormError>
690724
</InputGroup>
691725
<InputGroup>
692-
<Label htmlFor={machine.id} variant="small">
693-
Machine
694-
</Label>
695-
<Select
696-
{...conform.select(machine)}
697-
variant="tertiary/small"
698-
placeholder="Select machine type"
699-
dropdownIcon
700-
items={machinePresets}
701-
defaultValue={undefined}
702-
value={machineValue}
703-
setValue={(e) => {
704-
if (Array.isArray(e)) return;
705-
setMachineValue(e);
706-
}}
707-
>
708-
{machinePresets.map((machine) => (
709-
<SelectItem key={machine} value={machine}>
710-
{machine}
711-
</SelectItem>
712-
))}
713-
</Select>
714-
<Hint>Overrides the machine preset.</Hint>
715-
<FormError id={machine.errorId}>{machine.error}</FormError>
726+
<Label variant="small">Delay</Label>
727+
<DurationPicker name={delaySeconds.name} id={delaySeconds.id} />
728+
<Hint>Delays run by a specific duration.</Hint>
729+
<FormError id={delaySeconds.errorId}>{delaySeconds.error}</FormError>
716730
</InputGroup>
717731
<InputGroup>
718-
<Label htmlFor={version.id} variant="small">
719-
Version
720-
</Label>
721-
<Select
722-
{...conform.select(version)}
723-
defaultValue="latest"
724-
variant="tertiary/small"
725-
placeholder="Select version"
726-
dropdownIcon
727-
disabled={disableVersionSelection}
728-
>
729-
{versions.map((version, i) => (
730-
<SelectItem key={version} value={i === 0 ? "latest" : version}>
731-
{version} {i === 0 && "(latest)"}
732-
</SelectItem>
733-
))}
734-
</Select>
735-
{disableVersionSelection ? (
736-
<Hint>Only the latest version is available in the development environment.</Hint>
737-
) : (
738-
<Hint>Runs task on a specific version.</Hint>
739-
)}
740-
<FormError id={version.errorId}>{version.error}</FormError>
732+
<Label variant="small">TTL</Label>
733+
<DurationPicker
734+
name={ttlSeconds.name}
735+
id={ttlSeconds.id}
736+
value={ttlValue}
737+
onChange={setTtlValue}
738+
/>
739+
<Hint>Expires the run if it hasn't started within the TTL.</Hint>
740+
<FormError id={ttlSeconds.errorId}>{ttlSeconds.error}</FormError>
741741
</InputGroup>
742742
<FormError>{form.error}</FormError>
743743
</Fieldset>
@@ -912,7 +912,7 @@ function ScheduledTaskForm({
912912
setConcurrencyKeyValue(template.concurrencyKey ?? "");
913913
setMaxAttemptsValue(template.maxAttempts ?? undefined);
914914
setMaxDurationValue(template.maxDurationSeconds ?? 0);
915-
setMachineValue(template.machinePreset ?? "");
915+
setMachineValue(template.machinePreset ?? undefined);
916916
setTagsValue(template.tags ?? []);
917917
setQueueValue(template.queue ?? undefined);
918918

@@ -936,7 +936,7 @@ function ScheduledTaskForm({
936936
setMaxDurationValue(run.maxDurationInSeconds);
937937
setTagsValue(run.runTags ?? []);
938938
setQueueValue(run.queue);
939-
setMachineValue(run.machinePreset);
939+
setMachineValue(run.machinePreset ?? undefined);
940940
}}
941941
/>
942942
</div>
@@ -1041,17 +1041,55 @@ function ScheduledTaskForm({
10411041
<TextLink to={docsPath("triggering#options")}>Read the docs.</TextLink>
10421042
</Hint>
10431043
<InputGroup>
1044-
<Label htmlFor={ttlSeconds.id} variant="small">
1045-
TTL
1044+
<Label htmlFor={machine.id} variant="small">
1045+
Machine
10461046
</Label>
1047-
<DurationPicker
1048-
name={ttlSeconds.name}
1049-
id={ttlSeconds.id}
1050-
value={ttlValue}
1051-
onChange={setTtlValue}
1052-
/>
1053-
<Hint>Expires the run if it hasn't started within the TTL.</Hint>
1054-
<FormError id={ttlSeconds.errorId}>{ttlSeconds.error}</FormError>
1047+
<Select
1048+
{...conform.select(machine)}
1049+
variant="tertiary/small"
1050+
placeholder="Select machine type"
1051+
dropdownIcon
1052+
items={machinePresets}
1053+
defaultValue={undefined}
1054+
value={machineValue}
1055+
setValue={(e) => {
1056+
if (Array.isArray(e)) return;
1057+
setMachineValue(e);
1058+
}}
1059+
>
1060+
{machinePresets.map((machine) => (
1061+
<SelectItem key={machine} value={machine}>
1062+
{machine}
1063+
</SelectItem>
1064+
))}
1065+
</Select>
1066+
<Hint>Overrides the machine preset.</Hint>
1067+
<FormError id={machine.errorId}>{machine.error}</FormError>
1068+
</InputGroup>
1069+
<InputGroup>
1070+
<Label htmlFor={version.id} variant="small">
1071+
Version
1072+
</Label>
1073+
<Select
1074+
{...conform.select(version)}
1075+
defaultValue="latest"
1076+
variant="tertiary/small"
1077+
placeholder="Select version"
1078+
dropdownIcon
1079+
disabled={disableVersionSelection}
1080+
>
1081+
{versions.map((version, i) => (
1082+
<SelectItem key={version} value={i === 0 ? "latest" : version}>
1083+
{version} {i === 0 && "(latest)"}
1084+
</SelectItem>
1085+
))}
1086+
</Select>
1087+
{disableVersionSelection ? (
1088+
<Hint>Only the latest version is available in the development environment.</Hint>
1089+
) : (
1090+
<Hint>Runs task on a specific version.</Hint>
1091+
)}
1092+
<FormError id={version.errorId}>{version.error}</FormError>
10551093
</InputGroup>
10561094
<InputGroup>
10571095
<Label htmlFor={queue.id} variant="small">
@@ -1198,55 +1236,17 @@ function ScheduledTaskForm({
11981236
<FormError id={concurrencyKey.errorId}>{concurrencyKey.error}</FormError>
11991237
</InputGroup>
12001238
<InputGroup>
1201-
<Label htmlFor={machine.id} variant="small">
1202-
Machine
1203-
</Label>
1204-
<Select
1205-
{...conform.select(machine)}
1206-
variant="tertiary/small"
1207-
placeholder="Select machine type"
1208-
dropdownIcon
1209-
items={machinePresets}
1210-
defaultValue={undefined}
1211-
value={machineValue}
1212-
setValue={(e) => {
1213-
if (Array.isArray(e)) return;
1214-
setMachineValue(e);
1215-
}}
1216-
>
1217-
{machinePresets.map((machine) => (
1218-
<SelectItem key={machine} value={machine}>
1219-
{machine}
1220-
</SelectItem>
1221-
))}
1222-
</Select>
1223-
<Hint>Overrides the machine preset.</Hint>
1224-
<FormError id={machine.errorId}>{machine.error}</FormError>
1225-
</InputGroup>
1226-
<InputGroup>
1227-
<Label htmlFor={version.id} variant="small">
1228-
Version
1239+
<Label htmlFor={ttlSeconds.id} variant="small">
1240+
TTL
12291241
</Label>
1230-
<Select
1231-
{...conform.select(version)}
1232-
defaultValue="latest"
1233-
variant="tertiary/small"
1234-
placeholder="Select version"
1235-
dropdownIcon
1236-
disabled={disableVersionSelection}
1237-
>
1238-
{versions.map((version, i) => (
1239-
<SelectItem key={version} value={i === 0 ? "latest" : version}>
1240-
{version} {i === 0 && "(latest)"}
1241-
</SelectItem>
1242-
))}
1243-
</Select>
1244-
{disableVersionSelection ? (
1245-
<Hint>Only the latest version is available in the development environment.</Hint>
1246-
) : (
1247-
<Hint>Runs task on a specific version.</Hint>
1248-
)}
1249-
<FormError id={version.errorId}>{version.error}</FormError>
1242+
<DurationPicker
1243+
name={ttlSeconds.name}
1244+
id={ttlSeconds.id}
1245+
value={ttlValue}
1246+
onChange={setTtlValue}
1247+
/>
1248+
<Hint>Expires the run if it hasn't started within the TTL.</Hint>
1249+
<FormError id={ttlSeconds.errorId}>{ttlSeconds.error}</FormError>
12501250
</InputGroup>
12511251
</Fieldset>
12521252
</div>

0 commit comments

Comments
 (0)