summaryrefslogtreecommitdiffstats
path: root/sdc-workflow-designer-ui/src/app/components
diff options
context:
space:
mode:
Diffstat (limited to 'sdc-workflow-designer-ui/src/app/components')
-rw-r--r--sdc-workflow-designer-ui/src/app/components/node/node.component.html3
-rw-r--r--sdc-workflow-designer-ui/src/app/components/node/node.component.ts10
-rw-r--r--sdc-workflow-designer-ui/src/app/components/toolbar/toolbar.component.css25
-rw-r--r--sdc-workflow-designer-ui/src/app/components/toolbar/toolbar.component.html23
-rw-r--r--sdc-workflow-designer-ui/src/app/components/toolbar/toolbar.component.ts35
5 files changed, 93 insertions, 3 deletions
diff --git a/sdc-workflow-designer-ui/src/app/components/node/node.component.html b/sdc-workflow-designer-ui/src/app/components/node/node.component.html
index 72700551..a178e6f5 100644
--- a/sdc-workflow-designer-ui/src/app/components/node/node.component.html
+++ b/sdc-workflow-designer-ui/src/app/components/node/node.component.html
@@ -11,8 +11,7 @@
* ZTE - initial API and implementation and/or initial documentation
*/
-->
-<div class="node" [style.top]="node.top + 'px'"
- [style.left]="node.left + 'px'">
+<div class="node" [style.top]="node.top + 'px'" [style.left]="node.left + 'px'">
<div>{{node.name}}</div>
<div class="anchor anchors anchor-left">
<span class="left">
diff --git a/sdc-workflow-designer-ui/src/app/components/node/node.component.ts b/sdc-workflow-designer-ui/src/app/components/node/node.component.ts
index 12f23cc5..c2686fbb 100644
--- a/sdc-workflow-designer-ui/src/app/components/node/node.component.ts
+++ b/sdc-workflow-designer-ui/src/app/components/node/node.component.ts
@@ -22,11 +22,19 @@ import { JsPlumbService } from '../../services/jsplumb.service';
styleUrls: ['./node.component.css'],
templateUrl: 'node.component.html',
})
-export class NodeComponent {
+export class NodeComponent implements AfterViewInit {
+
@Input() public node: Node;
+ @Input() public last: boolean;
constructor(private jsPlumbService: JsPlumbService) {
}
+ ngAfterViewInit(): void {
+ if(this.last) {
+ this.jsPlumbService.initNode('.node');
+ }
+ }
+
}
diff --git a/sdc-workflow-designer-ui/src/app/components/toolbar/toolbar.component.css b/sdc-workflow-designer-ui/src/app/components/toolbar/toolbar.component.css
new file mode 100644
index 00000000..94559eff
--- /dev/null
+++ b/sdc-workflow-designer-ui/src/app/components/toolbar/toolbar.component.css
@@ -0,0 +1,25 @@
+/**
+ * Copyright (c) 2017 ZTE Corporation.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * and the Apache License 2.0 which both accompany this distribution,
+ * and are available at http://www.eclipse.org/legal/epl-v10.html
+ * and http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Contributors:
+ * ZTE - initial API and implementation and/or initial documentation
+ */
+
+.toolbar {
+ padding: 10px 30px 0px 10px;
+ position: fixed;
+ top: 0px;
+ left: 0px;
+ width: 100%;
+ z-index: 4;
+}
+
+button {
+ transition: all 0s;
+ height: 30px;
+}
diff --git a/sdc-workflow-designer-ui/src/app/components/toolbar/toolbar.component.html b/sdc-workflow-designer-ui/src/app/components/toolbar/toolbar.component.html
new file mode 100644
index 00000000..5d028b90
--- /dev/null
+++ b/sdc-workflow-designer-ui/src/app/components/toolbar/toolbar.component.html
@@ -0,0 +1,23 @@
+<!--
+/**
+ * Copyright (c) 2017 ZTE Corporation.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * and the Apache License 2.0 which both accompany this distribution,
+ * and are available at http://www.eclipse.org/legal/epl-v10.html
+ * and http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Contributors:
+ * ZTE - initial API and implementation and/or initial documentation
+ */
+-->
+<div class="toolbar">
+ <div class="row">
+ <button type="button" class="btn btn-secondary item ui-draggable" [attr.nodeType]="'startEvent'">
+ <span>startEvent</span>
+ </button>
+ <button type="button" class="btn btn-secondary item ui-draggable" [attr.nodeType]="'endEvent'">
+ <span>endEvent</span>
+ </button>
+ </div>
+</div>
diff --git a/sdc-workflow-designer-ui/src/app/components/toolbar/toolbar.component.ts b/sdc-workflow-designer-ui/src/app/components/toolbar/toolbar.component.ts
new file mode 100644
index 00000000..5fdb6ce5
--- /dev/null
+++ b/sdc-workflow-designer-ui/src/app/components/toolbar/toolbar.component.ts
@@ -0,0 +1,35 @@
+/**
+ * Copyright (c) 2017 ZTE Corporation.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * and the Apache License 2.0 which both accompany this distribution,
+ * and are available at http://www.eclipse.org/legal/epl-v10.html
+ * and http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Contributors:
+ * ZTE - initial API and implementation and/or initial documentation
+ */
+
+import { AfterViewInit, Component } from '@angular/core';
+
+import { JsPlumbService } from '../../services/jsplumb.service';
+
+/**
+ * toolbar component contains some basic operations(save) and all of the supported workflow nodes.
+ * The supported nodes can be dragged to container component. which will add a new node to the workflow.
+ */
+@Component({
+ selector: 'b4t-toolbar',
+ templateUrl: 'toolbar.component.html',
+ styleUrls: ['./toolbar.component.css']
+})
+export class ToolbarComponent implements AfterViewInit {
+
+ constructor(private jsPlumbService: JsPlumbService) {
+ }
+
+ public ngAfterViewInit() {
+ this.jsPlumbService.buttonDraggable();
+ }
+
+}