Skip to content

Commit

Permalink
Merge pull request #1018 from qoretechnologies/develop
Browse files Browse the repository at this point in the history
v3.6.6
  • Loading branch information
Foxhoundn authored May 19, 2022
2 parents ad59702 + a80aa85 commit a1ac140
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 6 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
# Changelog

## Version 3.6.6

#### Bug Fixes

- Fixed a bug that left "null" value in an FSM state when removing all transitions

## Version 3.6.5

#### Bug Fixes

- Fixed a bug that caused a crash when creating a job while the Schedule field was empty

## Version 3.6.4
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ This extension makes it possible to easily create, deploy, and test Qorus interf
It is a perfect tool for creating no-code solutions for the Qorus Integration Engine. The Qorus Developer Tools allow to create building blocks that can be
reused later and setup an initial configuration for them.

## Version 3.6.6 overview - What's new:

- Fixed a bug that left "null" value in an FSM state when removing all transitions

## Version 3.6.5 overview - What's new:

- Fixed a bug that caused a crash when creating a job while the Schedule field was empty
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "qorus-vscode",
"displayName": "Qorus Developer Tools",
"description": "Qorus Integration Engine developer tools",
"version": "3.6.5",
"version": "3.6.6",
"publisher": "qoretechnologies",
"author": {
"name": "Qore Technologies",
Expand Down
17 changes: 13 additions & 4 deletions web/containers/InterfaceCreator/fsm/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -961,6 +961,11 @@ const FSMView: React.FC<IFSMViewProps> = ({
fixedStates[id].transitions = newTransitions;
}

// Check if transitions are null and remove them
if (size(fixedStates[id].transitions) === 0) {
delete fixedStates[id].transitions;
}

fixedStates = await fixIncomptibleStates(id, fixedStates);
}

Expand All @@ -977,7 +982,7 @@ const FSMView: React.FC<IFSMViewProps> = ({
const anotherTransitionData = transitionData?.data;
const remove = !transitionData;

let transitionsCopy = [...states[stateId].transitions];
let transitionsCopy = [...(states[stateId].transitions || [])];

if (remove) {
delete transitionsCopy[index];
Expand All @@ -989,7 +994,6 @@ const FSMView: React.FC<IFSMViewProps> = ({
}

transitionsCopy = transitionsCopy.filter((t) => t);
transitionsCopy = size(transitionsCopy) === 0 ? null : transitionsCopy;

// @ts-expect-error
const data: IFSMState = { transitions: transitionsCopy };
Expand All @@ -999,6 +1003,11 @@ const FSMView: React.FC<IFSMViewProps> = ({
...data,
};

// Remove the transitions if they are empty
if (size(fixedStates[stateId].transitions) === 0) {
delete fixedStates[stateId].transitions;
}

if (data?.type !== states[stateId].type || !isEqual(data.action, states[stateId].action)) {
if (size(fixedStates[stateId].transitions)) {
const newTransitions = [];
Expand Down Expand Up @@ -1093,12 +1102,12 @@ const FSMView: React.FC<IFSMViewProps> = ({
const hasBothWayTransition = (
stateId: string,
targetId: string
): { stateId: string; index: number } => {
): { stateId: string; index: number } | null => {
const transitionIndex = states[targetId].transitions?.findIndex(
(transition) => transition.state === stateId
);

if (transitionIndex >= 0) {
if (transitionIndex && transitionIndex >= 0) {
return { stateId: targetId, index: transitionIndex };
}

Expand Down

0 comments on commit a1ac140

Please sign in to comment.