Skip to content

fix(site): disable autostart and autostop according to template settings #11809

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jan 26, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
tweaks
  • Loading branch information
Kira-Pilot committed Jan 26, 2024
commit a9ef49902b26a608408e2a820480a204ace8af5b
Original file line number Diff line number Diff line change
Expand Up @@ -211,11 +211,6 @@ export const WorkspaceScheduleForm: FC<
);

const checkboxes: Array<{ value: boolean; name: string; label: string }> = [
{
value: form.values.sunday,
name: "sunday",
label: Language.daySundayLabel,
},
{
value: form.values.monday,
name: "monday",
Expand Down Expand Up @@ -246,6 +241,11 @@ export const WorkspaceScheduleForm: FC<
name: "saturday",
label: Language.daySaturdayLabel,
},
{
value: form.values.sunday,
name: "sunday",
label: Language.daySundayLabel,
},
];

const handleToggleAutostart = async (e: ChangeEvent) => {
Expand Down Expand Up @@ -441,7 +441,14 @@ export const WorkspaceScheduleForm: FC<
/>
</FormFields>
</FormSection>
<FormFooter onCancel={onCancel} isLoading={isLoading} />
<FormFooter
onCancel={onCancel}
isLoading={isLoading}
submitDisabled={
(!allowTemplateAutoStart && !allowTemplateAutoStop) ||
(!form.values.autostartEnabled && !form.values.autostopEnabled)
}
/>
</HorizontalForm>
);
};
Expand Down