Skip to content

Commit f75f1eb

Browse files
committed
fix(core): is column should be mandatory
is column needs to be mandatory in valid WF GH-72
1 parent a91ebd7 commit f75f1eb

File tree

2 files changed

+23
-13
lines changed

2 files changed

+23
-13
lines changed

projects/workflows-creator/src/lib/builder/builder.component.ts

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ import {
4848
} from '../types';
4949
import {LocalizationProviderService} from '../services/localization-provider.service';
5050
import {LocalizationPipe} from '../pipes/localization.pipe';
51+
import {ConditionInput} from '../services';
5152
@Component({
5253
selector: 'workflow-builder',
5354
templateUrl: './builder.component.html',
@@ -460,19 +461,29 @@ export class BuilderComponent<E> implements OnInit, OnChanges {
460461
case EventTypes.OnValueEvent:
461462
case ActionTypes.ChangeColumnValueAction:
462463
const columnExists = !!node.node.state.get('column');
463-
let valueExists = false;
464-
if (typeof node.node.state.get('value') !== 'undefined') {
465-
valueExists = true;
466-
} else if (
467-
node.node.state.get('condition') === ConditionTypes.PastToday
468-
) {
469-
valueExists = true;
470-
} else {
471-
valueExists = !!node.node.state.get('value');
472-
}
464+
let valueExists = false;
473465
const valueTypeIsAnyValue =
474466
node.node.state.get('valueType') === ValueTypes.AnyValue;
475-
isValid = columnExists && (valueExists || valueTypeIsAnyValue);
467+
let conditionExist = false;
468+
if (node.node.prompts.includes(ConditionInput.identifier)) {
469+
conditionExist = !!node.node.state.get('condition');
470+
} else {
471+
conditionExist = true;
472+
}
473+
if (typeof node.node.state.get('value') !== 'undefined') {
474+
valueExists = true;
475+
} else if (
476+
node.node.state.get('condition') === ConditionTypes.PastToday
477+
) {
478+
valueExists = true;
479+
} else {
480+
valueExists = !!node.node.state.get('value');
481+
}
482+
483+
isValid =
484+
columnExists &&
485+
(valueExists || valueTypeIsAnyValue) &&
486+
conditionExist;
476487
break;
477488
case EventTypes.OnIntervalEvent:
478489
const intervalExists = !!node.node.state.get('interval');

projects/workflows-element/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,5 @@
1717
"access": "public",
1818
"directory": "dist"
1919
},
20-
"hash": "52e16f7339ae099b920d5eba85c8551b9ac2178d0fdb8c34eb6eb6de8aa96685"
21-
20+
"hash": "e7d87648d791167bdf0951718bdf5aa7fd8813267d827776af30b4e2f6d3741e"
2221
}

0 commit comments

Comments
 (0)