added svcapi ui and camunda code
[it/otf.git] / otf-frontend / client / src / app / layout / modeler / custom-elements / log-test-result / draw / LogTestResultRenderer.js
diff --git a/otf-frontend/client/src/app/layout/modeler/custom-elements/log-test-result/draw/LogTestResultRenderer.js b/otf-frontend/client/src/app/layout/modeler/custom-elements/log-test-result/draw/LogTestResultRenderer.js
new file mode 100644 (file)
index 0000000..607cd08
--- /dev/null
@@ -0,0 +1,60 @@
+/*  Copyright (c) 2019 AT&T Intellectual Property.                             #\r
+#                                                                              #\r
+#   Licensed under the Apache License, Version 2.0 (the "License");            #\r
+#   you may not use this file except in compliance with the License.           #\r
+#   You may obtain a copy of the License at                                    #\r
+#                                                                              #\r
+#       http://www.apache.org/licenses/LICENSE-2.0                             #\r
+#                                                                              #\r
+#   Unless required by applicable law or agreed to in writing, software        #\r
+#   distributed under the License is distributed on an "AS IS" BASIS,          #\r
+#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   #\r
+#   See the License for the specific language governing permissions and        #\r
+#   limitations under the License.                                             #\r
+##############################################################################*/\r
+\r
+\r
+import inherits from 'inherits';\r
+\r
+import BaseRenderer from 'diagram-js/lib/draw/BaseRenderer';\r
+\r
+import {\r
+  is\r
+} from 'bpmn-js/lib/util/ModelUtil';\r
+\r
+import Cat from '../image';\r
+\r
+import {\r
+  append as svgAppend,\r
+  create as svgCreate\r
+} from 'tiny-svg';\r
+\r
+\r
+export default function NyanRender(eventBus) {\r
+  BaseRenderer.call(this, eventBus, 1500);\r
+\r
+  this.canRender = function(element) {\r
+    return is(element, 'custom:Log');\r
+  };\r
+\r
+\r
+  this.drawShape = function(parent, shape) {\r
+    var url = Cat.dataURL;\r
+\r
+    var catGfx = svgCreate('image', {\r
+      x: 0,\r
+      y: 0,\r
+      width: shape.width,\r
+      height: shape.height,\r
+      href: url\r
+    });\r
+\r
+    svgAppend(parent, catGfx);\r
+\r
+    return catGfx;\r
+  };\r
+}\r
+\r
+inherits(NyanRender, BaseRenderer);\r
+\r
+NyanRender.$inject = [ 'eventBus' ];
\ No newline at end of file