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

fix(core): 'Is' column should be mandatory in Valid Workflow #76

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
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"
}

Loading