Skip to content

Commit

Permalink
Added check for invalid schedule type (#3630)
Browse files Browse the repository at this point in the history
Signed-off-by: Amit Kumar Das <[email protected]>
  • Loading branch information
amityt authored Jun 13, 2022
1 parent a337542 commit 9a9e63a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions litmus-portal/frontend/public/locales/en/translation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ workflowStepper:
errorSnackbar: Please provide a valid Workflow Name
step4:
errorSnackbar: Please select atleast one experiment to proceed
step5:
errorSnackbar: Please select a valid schedule option to proceed
step6:
errorSnackbar: Please validate and retry scheduling with correct parameters
finish: Finish
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,8 @@ const WorkflowStepper = () => {
return t(`workflowStepper.step3.errorSnackbar`);
case 3:
return t(`workflowStepper.step4.errorSnackbar`);
case 5:
return t(`workflowStepper.step5.errorSnackbar`);
case 6:
return t(`workflowStepper.step6.errorSnackbar`);
default:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import { WorkflowData } from '../../../models/redux/workflow';
import useActions from '../../../redux/actions';
import * as TemplateSelectionActions from '../../../redux/actions/template';
import * as WorkflowActions from '../../../redux/actions/workflow';
import * as AlertActions from '../../../redux/actions/alert';
import { RootState } from '../../../redux/reducers';
import { cronWorkflow, workflowOnce } from '../../../utils/workflowTemplate';
import { fetchWorkflowNameFromManifest } from '../../../utils/yamlUtils';
Expand Down Expand Up @@ -55,6 +56,7 @@ const ScheduleWorkflow = forwardRef((_, ref) => {
const workflowData: WorkflowData = useSelector(
(state: RootState) => state.workflowData
);
const alert = useActions(AlertActions);
const workflow = useActions(WorkflowActions);
const template = useActions(TemplateSelectionActions);

Expand Down Expand Up @@ -365,6 +367,10 @@ const ScheduleWorkflow = forwardRef((_, ref) => {
}, [valueDef, value]);

function onNext() {
if (value === 'recurringSchedule' && valueDef.length === 0) {
alert.changeAlertState(true);
return false;
}
EditYaml();
return true;
}
Expand Down

0 comments on commit 9a9e63a

Please sign in to comment.