Skip to content
This repository was archived by the owner on May 14, 2025. It is now read-only.

Commit d5f124f

Browse files
BoykoAlexjvalkeal
authored andcommitted
sync node refactored into SYNC to match the server side
- Fixes #524
1 parent 65138dd commit d5f124f

File tree

3 files changed

+40
-39
lines changed

3 files changed

+40
-39
lines changed

ui/src/app/tasks/flo/node/node.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<svg:circle class="input-port" tooltip="Input Port" container="body" [isDisabled]="!isCanvas() && canvasNodeTooltip"/>
1818
</svg:g>
1919

20-
<svg:g *ngSwitchCase="'sync'" class="composed-task">
20+
<svg:g *ngSwitchCase="'SYNC'" class="composed-task">
2121
<svg:g class="shape" [tooltip]="canvasNodeTooltip" container="body" placement="bottom" containerClass="app-tooltip" [isDisabled]="isDisabled">
2222
<svg:circle class="border"/>
2323
<svg:text class="label"/>

ui/src/app/tasks/flo/render.service.ts

Lines changed: 38 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { BsModalService } from 'ngx-bootstrap';
66
import { MetamodelService} from './metamodel.service';
77
import {
88
TaskAppShape, BatchSyncShape, BatchLink, BatchStartShape, BatchEndShape,
9-
CONTROL_GROUP_TYPE, IMAGE_W
9+
CONTROL_GROUP_TYPE, IMAGE_W, START_NODE_TYPE, END_NODE_TYPE, SYNC_NODE_TYPE
1010
} from './support/shapes';
1111
import { layout } from './support/layout';
1212
import { ElementComponent } from '../../shared/flo/support/shape-component';
@@ -96,46 +96,47 @@ export class RenderService implements Flo.Renderer {
9696
* @returns {dia.Element} the created element
9797
*/
9898
createNode(metadata: Flo.ElementMetadata): dia.Element {
99-
if (metadata.name === 'START') {
100-
return new BatchStartShape(
101-
defaultsDeep({
102-
attrs: {
103-
'.label': {
104-
'text': metadata.name
99+
switch (metadata.name) {
100+
case START_NODE_TYPE:
101+
return new BatchStartShape(
102+
defaultsDeep({
103+
attrs: {
104+
'.label': {
105+
'text': metadata.name
106+
}
105107
}
106-
}
107-
}, BatchStartShape.prototype.defaults)
108-
);
109-
} else if (metadata.name === 'END') {
110-
return new BatchEndShape(
111-
defaultsDeep({
112-
attrs: {
113-
'.label': {
114-
'text': metadata.name
108+
}, BatchStartShape.prototype.defaults)
109+
);
110+
case END_NODE_TYPE:
111+
return new BatchEndShape(
112+
defaultsDeep({
113+
attrs: {
114+
'.label': {
115+
'text': metadata.name
116+
}
115117
}
116-
}
117-
}, BatchEndShape.prototype.defaults)
118-
);
119-
} else if (metadata.name === 'sync') {
120-
return new BatchSyncShape(
121-
defaultsDeep({
122-
attrs: {
123-
'.label': {
124-
'text': metadata.name
118+
}, BatchEndShape.prototype.defaults)
119+
);
120+
case SYNC_NODE_TYPE:
121+
return new BatchSyncShape(
122+
defaultsDeep({
123+
attrs: {
124+
'.label': {
125+
'text': metadata.name
126+
}
125127
}
126-
}
127-
}, BatchSyncShape.prototype.defaults)
128-
);
129-
} else {
130-
return new TaskAppShape(
131-
defaultsDeep({
132-
attrs: {
133-
'.label': {
134-
'text': metadata.name
128+
}, BatchSyncShape.prototype.defaults)
129+
);
130+
default:
131+
return new TaskAppShape(
132+
defaultsDeep({
133+
attrs: {
134+
'.label': {
135+
'text': metadata.name
136+
}
135137
}
136-
}
137-
}, TaskAppShape.prototype.defaults)
138-
);
138+
}, TaskAppShape.prototype.defaults)
139+
);
139140
}
140141
}
141142

ui/src/app/tasks/flo/support/shapes.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export const TASK_GROUP_TYPE = 'task';
1010

1111
export const START_NODE_TYPE = 'START';
1212
export const END_NODE_TYPE = 'END';
13-
export const SYNC_NODE_TYPE = 'sync';
13+
export const SYNC_NODE_TYPE = 'SYNC';
1414

1515
const CONTROL_NODE_SIZE = {
1616
width: 40,

0 commit comments

Comments
 (0)