Skip to content

Commit

Permalink
Merge pull request #39 from sakazuki/issue-37
Browse files Browse the repository at this point in the history
fix #37 #38
  • Loading branch information
sakazuki authored Feb 20, 2020
2 parents b0256bb + afa7491 commit c35784c
Show file tree
Hide file tree
Showing 14 changed files with 23 additions and 20 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
1. Select Save Option (ex. Decide Later...)
1. Select Menu [Extras]-[Plugins]
1. Click [Add]
1. Input https://cdn.jsdelivr.net/gh/sakazuki/[email protected].1/dist/aws-step-functions.js
1. Input https://cdn.jsdelivr.net/gh/sakazuki/[email protected].2/dist/aws-step-functions.js
1. [Apply]
1. Reload the page

Expand Down Expand Up @@ -84,6 +84,7 @@ node carlo.js
```

## Version history
- https://cdn.jsdelivr.net/gh/sakazuki/[email protected]/dist/aws-step-functions.js
- https://cdn.jsdelivr.net/gh/sakazuki/[email protected]/dist/aws-step-functions.js
- https://cdn.jsdelivr.net/gh/sakazuki/[email protected]/dist/aws-step-functions.js
- https://cdn.jsdelivr.net/gh/sakazuki/[email protected]/dist/aws-step-functions.js
Expand Down
2 changes: 1 addition & 1 deletion dist/aws-step-functions.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/states/awsconfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ AWSconfig.prototype.create = function () {
return createAWSconfig(this);
};
AWSconfig.prototype.handler = awssfStateHandler;
registCodec(AWSconfig);
registCodec('AWSconfig', AWSconfig);
2 changes: 1 addition & 1 deletion src/states/choice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ ChoiceState.prototype.expJSON = function (cell, cells) {
}
return data;
};
registCodec(ChoiceState);
registCodec('ChoiceState', ChoiceState);
var ChoiceStateHandler = function (state) {
this.custom = function () {
this.domNode.appendChild(ChoiceEdge.prototype.createHandlerImage.apply(this, arguments));
Expand Down
12 changes: 6 additions & 6 deletions src/states/edge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ StartAtEdge.prototype.expJSON = function (cell, cells) {
}
};
StartAtEdge.prototype.handler = awssfEdgeHandler;
registCodec(StartAtEdge);
registCodec('StartAtEdge', StartAtEdge);


const NextEdge = function () {};
Expand Down Expand Up @@ -58,7 +58,7 @@ NextEdge.prototype.createHandlerImage = function () {
return img;
};
NextEdge.prototype.handler = awssfEdgeHandler;
registCodec(NextEdge);
registCodec('NextEdge', NextEdge);


const RetryEdge = function () {};
Expand Down Expand Up @@ -117,7 +117,7 @@ RetryEdge.prototype.createHandlerImage = function () {
return img;
};
RetryEdge.prototype.handler = awssfEdgeHandler;
registCodec(RetryEdge);
registCodec('RetryEdge', RetryEdge);

const CatchEdge = function () {};
CatchEdge.prototype.type = 'Catch';
Expand Down Expand Up @@ -163,7 +163,7 @@ CatchEdge.prototype.createHandlerImage = function () {
return img;
};
CatchEdge.prototype.handler = awssfEdgeHandler;
registCodec(CatchEdge);
registCodec('CatchEdge', CatchEdge);

const ChoiceEdge = function () {};
ChoiceEdge.prototype.type = 'Choice';
Expand Down Expand Up @@ -213,7 +213,7 @@ ChoiceEdge.prototype.createHandlerImage = function () {
return img;
};
ChoiceEdge.prototype.handler = awssfEdgeHandler;
registCodec(ChoiceEdge);
registCodec('ChoiceEdge', ChoiceEdge);

const DefaultEdge = function DefaultEdge () {};
DefaultEdge.prototype.type = 'Default';
Expand Down Expand Up @@ -244,6 +244,6 @@ DefaultEdge.prototype.createHandlerImage = function () {
return img;
};
DefaultEdge.prototype.handler = awssfEdgeHandler;
registCodec(DefaultEdge);
registCodec('DefaultEdge', DefaultEdge);

export { StartAtEdge, NextEdge, RetryEdge, CatchEdge, ChoiceEdge, DefaultEdge };
2 changes: 1 addition & 1 deletion src/states/fail.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,5 @@ FailState.prototype.expJSON = function (cell, cells) {
data[label].Comment = cell.getAttribute("comment");
return data;
};
registCodec(FailState);
registCodec('FailState', FailState);
FailState.prototype.handler = awssfStateHandler;
4 changes: 2 additions & 2 deletions src/states/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ export function init (editorUi) {
graph = editorUi.editor ? editorUi.editor.graph : editorUi.graph;
}

export function registCodec (func) {
export function registCodec (name, func) {
var codec = new mxObjectCodec(new func());
codec.encode = function (enc, obj) {
try{
var data = enc.document.createElement(func.name);
var data = enc.document.createElement(name);
}catch(e) {
console.log("encode error", e);
}
Expand Down
2 changes: 1 addition & 1 deletion src/states/map.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ MapState.prototype.expJSON = function (cell, cells) {

};

registCodec(MapState);
registCodec('MapState', MapState);

var MapStateHandler = function (state) {
this.custom = function () {
Expand Down
2 changes: 1 addition & 1 deletion src/states/parallel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ ParallelState.prototype.expJSON = function (cell, cells) {
return data;

};
registCodec(ParallelState);
registCodec('ParallelState', ParallelState);
var ParallelStateHandler = function (state) {
this.custom = function () {
this.domNode.appendChild(NextEdge.prototype.createHandlerImage.apply(this, arguments));
Expand Down
2 changes: 1 addition & 1 deletion src/states/pass.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ PassState.prototype.expJSON = function (cell, cells) {
}
return data;
};
registCodec(PassState);
registCodec('PassState', PassState);
var PassStateHandler = function (state) {
this.custom = function () {
this.domNode.appendChild(NextEdge.prototype.createHandlerImage.apply(this, arguments));
Expand Down
4 changes: 3 additions & 1 deletion src/states/point.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createPoint } from "./helper";
import { registCodec, createPoint } from "./helper";

const StartPoint = function () {};
StartPoint.prototype.type = 'Start';
Expand All @@ -9,13 +9,15 @@ StartPoint.prototype.create = function (geometry) {
StartPoint.prototype.createDefaultEdge = function () {
return StartAtEdge.prototype.create();
};
registCodec('StartPoint', StartPoint);

const EndPoint = function () {};
EndPoint.prototype.type = 'End';
EndPoint.prototype.create = function () {
var cell = createPoint(this);
return cell;
};
registCodec('EndPoint', EndPoint);

export { StartPoint, EndPoint };

2 changes: 1 addition & 1 deletion src/states/succeed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@ SucceedState.prototype.expJSON = function (cell, cells) {
data[label].OutputPath = awssfUtils.adjustJsonPath(cell.getAttribute("output_path"));
return data;
};
registCodec(SucceedState);
registCodec('SucceedState', SucceedState);
SucceedState.prototype.handler = awssfStateHandler;
2 changes: 1 addition & 1 deletion src/states/task.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ TaskState.prototype.expJSON = function (cell, cells) {
}
return data;
};
registCodec(TaskState);
registCodec('TaskState', TaskState);
var TaskStateHandler = function (state) {
this.custom = function () {
this.domNode.appendChild(NextEdge.prototype.createHandlerImage.apply(this, arguments));
Expand Down
2 changes: 1 addition & 1 deletion src/states/wait.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ WaitState.prototype.applyForm = function (value, name, text) {
}
return removeLabel;
};
registCodec(WaitState);
registCodec('WaitState', WaitState);
var WaitStateHandler = function (state) {
this.custom = function () {
this.domNode.appendChild(NextEdge.prototype.createHandlerImage.apply(this, arguments));
Expand Down

0 comments on commit c35784c

Please sign in to comment.