Skip to content

Commit

Permalink
fix(core): is column should be mandatory
Browse files Browse the repository at this point in the history
is column needs to be mandatory in valid WF

GH-72
  • Loading branch information
Deepika516 committed Mar 26, 2024
1 parent 284545b commit 0b4e4c2
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
17 changes: 14 additions & 3 deletions projects/workflows-creator/src/lib/builder/builder.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ import {
} from '../types';
import {LocalizationProviderService} from '../services/localization-provider.service';
import {LocalizationPipe} from '../pipes/localization.pipe';
import {ConditionInput} from '../services';
@Component({
selector: 'workflow-builder',
templateUrl: './builder.component.html',
Expand Down Expand Up @@ -487,6 +488,14 @@ export class BuilderComponent<E> implements OnInit, OnChanges {
case ActionTypes.ChangeColumnValueAction:
const columnExists = !!node.node.state.get('column');
let valueExists = false;
const valueTypeIsAnyValue =
node.node.state.get('valueType') === ValueTypes.AnyValue;
let conditionExist = false;
if (node.node.prompts.includes(ConditionInput.identifier)) {
conditionExist = !!node.node.state.get('condition');
} else {
conditionExist = true;
}
if (typeof node.node.state.get('value') !== 'undefined') {
valueExists = true;
} else if (
Expand All @@ -496,9 +505,11 @@ export class BuilderComponent<E> implements OnInit, OnChanges {
} else {
valueExists = !!node.node.state.get('value');
}
const valueTypeIsAnyValue =
node.node.state.get('valueType') === ValueTypes.AnyValue;
isValid = columnExists && (valueExists || valueTypeIsAnyValue);

isValid =
columnExists &&
(valueExists || valueTypeIsAnyValue) &&
conditionExist;
break;
case EventTypes.OnIntervalEvent:
const intervalExists = !!node.node.state.get('interval');
Expand Down
2 changes: 1 addition & 1 deletion projects/workflows-element/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@
"access": "public",
"directory": "dist"
},
"hash": "2de169ac759548f51f2397daa81b6187fa75d7ca99c31f0f14e9ab95335919fb"
"hash": "e7d87648d791167bdf0951718bdf5aa7fd8813267d827776af30b4e2f6d3741e"
}

0 comments on commit 0b4e4c2

Please sign in to comment.