Skip to content
Merged
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
10 changes: 10 additions & 0 deletions projects/workflows-creator/src/lib/builder/builder.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ export class BuilderComponent<E> implements OnInit, OnChanges {
// sonarignore:start
elseBlockHidden = false;
elseBlockRemoved = false;
events: WorkflowNode<E>[] = [];
public types = NodeTypes;

localizedStringKeys = LocalizedStringKeys;
Expand All @@ -158,6 +159,7 @@ export class BuilderComponent<E> implements OnInit, OnChanges {
this.nodes
.getGroups(true, NodeTypes.ACTION, true)
.forEach(group => this.elseActionGroups.push(group));
this.events = this.nodes.getEvents();

this.localizationSvc.setLocalizedStrings(this.localizedStringMap);
}
Expand Down Expand Up @@ -268,6 +270,14 @@ export class BuilderComponent<E> implements OnInit, OnChanges {
* @param selectedEvent - The identifier of the selected event
*/
private clearIncompatibleActions(selectedEvent: string) {
// Validate if selected event is (non trigger) then return
const foundEvent = this.events.find(
e => e.getIdentifier() === selectedEvent,
);
if (foundEvent) {
return;
}

if (this.actionGroups[0]?.children?.length > 0) {
// Get list of actions that should remain (compatible with new event)
const compatibleActions = this.nodes.getActions(selectedEvent);
Expand Down
Loading