Skip to content
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

Removed the Cron option from the scheduler picker to simplify functio… #949

Merged
merged 1 commit into from
Nov 21, 2024
Merged
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ function SchedulePicker({
completeSchedule,
setCompleteSchedule,
cron,
setCron,
cronMessage,
// setCron,
// cronMessage,
setCronMessage,
}) {
const [yearlyRadio, setYearlyRadio] = useState(null);
Expand Down Expand Up @@ -385,43 +385,43 @@ function SchedulePicker({
</div>
);
// handle corn input change
const handleCronInputChange = (e) => {
const v = e.target.value;
setCron(v);
setIntermittentScheduling((prev) => ({ frequency: prev.frequency, cron: v }));
};
// const handleCronInputChange = (e) => {
// const v = e.target.value;
// setCron(v);
// setIntermittentScheduling((prev) => ({ frequency: prev.frequency, cron: v }));
// };

//Cron Input and validation
const cronInputAndValidation = (
<>
<Input placeholder="*/5 * * * *" onChange={(e) => handleCronInputChange(e)} allowClear value={cron} />
{cronMessage == null ? (
<div>
Click{' '}
<a
href="https://crontab.cronhub.io/"
style={{ textDecoration: 'underline' }}
target="_blank"
rel="noreferrer">
Here
</a>{' '}
to create cron expression
</div>
) : null}
{cronMessage && cronMessage?.valid ? (
<div style={{ color: 'var(--primary' }}>Runs {cronMessage.message.toLowerCase()} </div>
) : null}
{cronMessage && !cronMessage?.valid ? <div style={{ color: 'var(--danger' }}>{cronMessage.message} </div> : null}
</>
);
// const cronInputAndValidation = (
// <>
// <Input placeholder="*/5 * * * *" onChange={(e) => handleCronInputChange(e)} allowClear value={cron} />
// {cronMessage == null ? (
// <div>
// Click{' '}
// <a
// href="https://crontab.cronhub.io/"
// style={{ textDecoration: 'underline' }}
// target="_blank"
// rel="noreferrer">
// Here
// </a>{' '}
// to create cron expression
// </div>
// ) : null}
// {cronMessage && cronMessage?.valid ? (
// <div style={{ color: 'var(--primary' }}>Runs {cronMessage.message.toLowerCase()} </div>
// ) : null}
// {cronMessage && !cronMessage?.valid ? <div style={{ color: 'var(--danger' }}>{cronMessage.message} </div> : null}
// </>
// );

//Schedule options
const schedulingOptions = [
{ label: 'Daily', value: 'daily', component: dailyBreakDown },
{ label: 'Weekly', value: 'weekly', component: weeklyBreakDown },
{ label: 'Monthly', value: 'monthly', component: monthlyBreakDown },
{ label: 'Yearly', value: 'yearly', component: yearlyBreakDown },
{ label: 'Cron', value: 'cron', component: cronInputAndValidation },
// { label: 'Cron', value: 'cron', component: cronInputAndValidation },
];

const selectedComponent = schedulingOptions.find(
Expand Down
Loading