Skip to content

Commit

Permalink
Merge pull request #949 from hpcc-systems/yadhap/remove-cron-option-f…
Browse files Browse the repository at this point in the history
…rom-schedular

Removed the Cron option from the scheduler picker to simplify functio…
  • Loading branch information
FancMa01 authored Nov 21, 2024
2 parents dc198c4 + 1978b1a commit 6c763a1
Showing 1 changed file with 30 additions and 30 deletions.
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

0 comments on commit 6c763a1

Please sign in to comment.