Skip to content

Commit 2283832

Browse files
Merge pull request #634 from vmware/fix/615-decision-item-missing-closing-bracket
[vrotsc] (#615) Fix incorrectly transpiled `DecisionItem` Workflow decorator
2 parents acd50d6 + bc46d5c commit 2283832

File tree

2 files changed

+24
-12
lines changed

2 files changed

+24
-12
lines changed

docs/versions/latest/Release.md

+22-10
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,17 @@
2828

2929
## Improvements
3030

31+
[//]: # (### *Improvement Name* )
32+
[//]: # (Talk ONLY regarding the improvement)
33+
[//]: # (Optional But higlhy recommended)
34+
[//]: # (#### Previous Behavior)
35+
[//]: # (Explain how it used to behave, regarding to the change)
36+
[//]: # (Optional But higlhy recommended)
37+
[//]: # (#### New Behavior)
38+
[//]: # (Explain how it behaves now, regarding to the change)
39+
[//]: # (Optional But higlhy recommended Specify *NONE* if missing)
40+
[//]: # (#### Relevant Documentation:)
41+
3142
### *Improve type definitions of Server class functions*
3243

3344
Improve type definitions of Server class functions by adding `| null` to the return type.
@@ -46,16 +57,17 @@ The following function definitions have `| null` added to their return type:
4657
- `Server.getPackageWithName`
4758
- `Server.getPolicyTemplateCategoryWithPath`
4859

49-
[//]: # (### *Improvement Name* )
50-
[//]: # (Talk ONLY regarding the improvement)
51-
[//]: # (Optional But higlhy recommended)
52-
[//]: # (#### Previous Behavior)
53-
[//]: # (Explain how it used to behave, regarding to the change)
54-
[//]: # (Optional But higlhy recommended)
55-
[//]: # (#### New Behavior)
56-
[//]: # (Explain how it behaves now, regarding to the change)
57-
[//]: # (Optional But higlhy recommended Specify *NONE* if missing)
58-
[//]: # (#### Relevant Documentation:)
60+
### *Fix Decision element transpilation issue*
61+
62+
In Typescript workflow classes, methods with the DecisionItem decorator were transpiled incorrectly into Javascript.
63+
64+
#### Previous Behavior
65+
66+
Closing brackets ('{'), e.g in if blocks, were missing from the contents of the transpiled Decision element.
67+
68+
#### New Behavior
69+
70+
Closing brackets are no longer missing from the contents of the transpiled Decision element.
5971

6072
## Upgrade procedure
6173

typescript/vrotsc/src/compiler/transformer/fileTransformers/workflow/decorators/decisionItemDecoratorStrategy.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ export default class DecisionItemDecoratorStrategy extends BaseItemDecoratorStra
150150
* @param sourceText The source text to clear the `wrapper` function from
151151
* @returns The source text without the `wrapper` function
152152
*/
153-
private clearWrapperFunction(sourceText: string): string {
154-
return sourceText.replace(/function wrapper\(\) \{|}$/gm, '').trim();
153+
private clearWrapperFunction(sourceText: string): string {
154+
return sourceText.replace(/function wrapper\(\) \{([\s\S]*)\}$/gm, '$1').trim();
155155
}
156156
}

0 commit comments

Comments
 (0)