Skip to content

Commit dc76451

Browse files
committed
Fix #300 More than one task with transformation causes flow execution to fail.
- Fixed issue where transformation component persisted state across tasks, making it save transformations from task A into task B causing the flow execution to fail as it was trying to map fields that didn’t existed. - Added unit test for the case
1 parent c4b9a62 commit dc76451

File tree

5 files changed

+260
-156
lines changed

5 files changed

+260
-156
lines changed

src/client/app/flogo.form-builder/flogo.form-builder.module.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ import {FlogoFormBuilderComponent} from './components/form-builder.component';
4141
TaskDirective,
4242
BranchDirective,
4343
FlogoFormBuilderComponent
44-
],
44+
],
4545
exports: [
4646
FlogoFormBuilderComponent
4747
],

src/client/app/flogo.transform/components/transform-mapper-field.component.less

Lines changed: 0 additions & 144 deletions
Original file line numberDiff line numberDiff line change
@@ -180,147 +180,3 @@
180180
}
181181

182182
}
183-
184-
/*
185-
@height: 40;
186-
@height-item: 25;
187-
//@color-output: #3498db;
188-
@color-output: #b3e3ff;
189-
@color-input: #e6e7e9;
190-
191-
.flogo-visual-mapper {
192-
margin-top:10px;
193-
194-
.flogo-visual-mapper__item {
195-
display: flex;
196-
flex-direction: row;
197-
height: (@height)*1px;
198-
199-
}
200-
201-
.flogo-visual-mapper__item__name {
202-
font-weight: bold;
203-
margin-left: 5px;
204-
margin-top: 0;
205-
margin-bottom: 5px;
206-
cursor:pointer;
207-
list-style-type: none;
208-
display: inline
209-
}
210-
211-
.flogo-visual-mapper__item__field {
212-
margin-left: 30px
213-
}
214-
215-
.flogo-visual-mapper__item__error {
216-
color: red;
217-
}
218-
219-
.flogo-visual-mapper__item__remove {
220-
left:-5px;
221-
color:dimgray;
222-
cursor:pointer
223-
}
224-
225-
.flogo-visual-mapper__item__action {
226-
color:dimgray;
227-
font-size: 0.8em;
228-
}
229-
230-
.flogo-visual-mapper__item__output {
231-
flex: 0 0 60%;
232-
background: @color-output;
233-
margin: 0 10px 0 0;
234-
}
235-
236-
.flogo-visual-mapper__item__output__text {
237-
width: 94%;background-color: transparent;border:0
238-
}
239-
240-
.flogo-visual-mapper__item__output__list__selector {
241-
cursor: pointer;
242-
color: dimgray;
243-
}
244-
245-
246-
.flogo-visual-mapper__item__output__text:focus {
247-
outline-width: 0;
248-
}
249-
250-
251-
.flogo-visual-mapper__item__input {
252-
flex: 0 0 35%;
253-
background-color: #ccd0d8;
254-
color: #000;
255-
}
256-
257-
.flogo-visual-mapper__item__list {
258-
width: 250px;
259-
background-color: white;
260-
z-index: 900;
261-
position: absolute;
262-
}
263-
264-
.flogo-visual-mapper__item__list__item {
265-
margin-top: 0;
266-
padding-top: 0;
267-
}
268-
269-
270-
.flogo-visual-mapper__item__list li {
271-
cursor: pointer;
272-
}
273-
274-
.flogo-visual-mapper__item__list__field {
275-
cursor:pointer;
276-
list-style-type: none;
277-
278-
margin-bottom: 5px;
279-
//margin-left: 10px
280-
}
281-
282-
.flogo-visual-mapper__item__list__field:hover {
283-
background-color: #ededed;
284-
}
285-
286-
.flogo-visual-mapper__item__output, .flogo-visual-mapper__item__input {
287-
display: block;
288-
float: left;
289-
text-align: center;
290-
padding: 10px;
291-
//padding: 15px 40px 0 40px;
292-
position: relative;
293-
//font-size: 10px;
294-
text-decoration: none;
295-
}
296-
297-
.flogo-visual-mapper__item__output:after {
298-
content: "";
299-
border-top: (@height-item - 5)*1px solid transparent;
300-
border-bottom: (@height-item - 5)*1px solid transparent;
301-
border-left: (@height-item - 5)*1px solid @color-output;
302-
position: absolute;
303-
right: -(@height-item - 5)*1px;
304-
top: 0;
305-
z-index: 1;
306-
}
307-
308-
.flogo-visual-mapper__item__input:before {
309-
content: "";
310-
border-top: (@height-item - 5)*1px solid transparent;
311-
border-bottom: (@height-item - 5)*1px solid transparent;
312-
border-left: (@height-item - 5)*1px solid #fff;
313-
position: absolute;
314-
left: 0;
315-
top: 0
316-
}
317-
318-
.flogo-visual-mapper__item__output--connected {
319-
margin-right: 0;
320-
}
321-
.flogo-visual-mapper__item__input--connected {
322-
background-color: #ccd0d8;
323-
flex: 0 0 30%;
324-
}
325-
}
326-
*/

src/client/app/flogo.transform/components/transform-mapper.component.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,12 @@ export class TransformMapperComponent implements OnChanges {
5252
let nextValue = mappingsChange.currentValue;
5353
let currentEditorValue:any = null;
5454
try {
55-
//##currentEditorValue = JSON.parse(this.editor.value);
5655
currentEditorValue = this.transformationJSON;
5756
} catch (e) { // current val is just not valid json
5857
}
5958

6059
if (!_.isEqual(mappingsChange.previousValue, nextValue) && !_.isEqual(nextValue, currentEditorValue)) {
6160
let stringified = JSON.stringify(nextValue || [], null, 2);
62-
//##this.editor.updateValue(stringified, {onlySelf: true, emitEvent: false});
6361
}
6462
}
6563

0 commit comments

Comments
 (0)