aboutsummaryrefslogtreecommitdiffstats
path: root/deprecated-workflow-designer/sdc-workflow-designer-ui/src/app/components/editable-property
diff options
context:
space:
mode:
Diffstat (limited to 'deprecated-workflow-designer/sdc-workflow-designer-ui/src/app/components/editable-property')
-rw-r--r--deprecated-workflow-designer/sdc-workflow-designer-ui/src/app/components/editable-property/editable-property.component.css61
-rw-r--r--deprecated-workflow-designer/sdc-workflow-designer-ui/src/app/components/editable-property/editable-property.component.html22
-rw-r--r--deprecated-workflow-designer/sdc-workflow-designer-ui/src/app/components/editable-property/editable-property.component.ts122
3 files changed, 0 insertions, 205 deletions
diff --git a/deprecated-workflow-designer/sdc-workflow-designer-ui/src/app/components/editable-property/editable-property.component.css b/deprecated-workflow-designer/sdc-workflow-designer-ui/src/app/components/editable-property/editable-property.component.css
deleted file mode 100644
index 35d21fce..00000000
--- a/deprecated-workflow-designer/sdc-workflow-designer-ui/src/app/components/editable-property/editable-property.component.css
+++ /dev/null
@@ -1,61 +0,0 @@
-/**
- * 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
- */
-
-.editable-content {
- display: inline-block;
- width: 300px;
- visibility: visible;
-}
-
-.editable-main {
- border: 1px solid transparent;
- border-radius: 3px;
- cursor: pointer;
- font-size: 24px;
- min-height: 34px;
- padding: 2px 20px 2px 2px;
- position: relative;
- word-wrap: break-word;
-}
-
-.editable-main:hover {
- border: 1px solid #ddd;
-}
-
-.editable-main span {
- background-color: #f0f0f0;
- border-left: 1px solid #ddd;
- display: none;
- padding: 0 4px 0 4px;
- height: 100%;
- position: absolute;
- right: 0;
- top: 0;
- -moz-border-radius-topright: 3px;
- -moz-border-radius-bottomright: 3px;
- -webkit-border-top-right-radius: 3px;
- -webkit-border-bottom-right-radius: 3px;
-}
-
-.editable-main span i {
- font-size: 16px;
- color: #707070;
-}
-
-.editable-main:hover span {
- display: inline;
-}
-
-.editable-field {
- display: inline-block;
- width: 100%;
-} \ No newline at end of file
diff --git a/deprecated-workflow-designer/sdc-workflow-designer-ui/src/app/components/editable-property/editable-property.component.html b/deprecated-workflow-designer/sdc-workflow-designer-ui/src/app/components/editable-property/editable-property.component.html
deleted file mode 100644
index eb59b3c4..00000000
--- a/deprecated-workflow-designer/sdc-workflow-designer-ui/src/app/components/editable-property/editable-property.component.html
+++ /dev/null
@@ -1,22 +0,0 @@
-<!--
-/**
- * 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="editable-content" (click)="preEdit()">
- <h3 class="editable-main" *ngIf="!editable" [title]="'BLUEPRINT.BP_PANE.RENAME' | translate">
- <div class="editable-field">{{value}}</div>
- <span><i class="fa fa-pencil"></i></span>
- </h3>
- <wfm-text-input *ngIf="editable" #editInput [(ngModel)]="editValue" (blur)="afterEdit()"
- isFocus="true" required>
- </wfm-text-input>
-</div> \ No newline at end of file
diff --git a/deprecated-workflow-designer/sdc-workflow-designer-ui/src/app/components/editable-property/editable-property.component.ts b/deprecated-workflow-designer/sdc-workflow-designer-ui/src/app/components/editable-property/editable-property.component.ts
deleted file mode 100644
index 7f6ffbe2..00000000
--- a/deprecated-workflow-designer/sdc-workflow-designer-ui/src/app/components/editable-property/editable-property.component.ts
+++ /dev/null
@@ -1,122 +0,0 @@
-/**
- * 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 {Component, EventEmitter, Input, Output, ViewChild} from "@angular/core";
-import {TranslateService} from "@ngx-translate/core";
-import {isArray, isObject} from "util";
-import {ModelService} from "../../services/model.service";
-import {NoticeService} from "../../services/notice.service";
-import {NodeType} from "../../model/workflow/node-type.enum";
-import {ValueSource} from "../../model/value-source.enum";
-import {JsPlumbService} from "../../services/jsplumb.service";
-import {WorkflowNode} from "../../model/workflow/workflow-node";
-
-/**
- * node or workflow-line name
- */
-@Component({
- selector: 'wfm-editable-property',
- templateUrl: 'editable-property.component.html',
- styleUrls: ['./editable-property.component.css']
-})
-export class EditablePropertyComponent {
- @Input() public value: string;
- @Output() public valueChange = new EventEmitter<string>();
- @ViewChild('editInput') private editInput: any;
-
- public editValue = '';
- public editable = false;
-
- public preEdit(): void {
- if (!this.editable) {
- this.editable = true;
- this.editValue = this.value;
- }
- }
-
- public afterEdit(): void {
- if (this.editable) {
- this.editable = false;
- if (this.value === this.editValue) {
- return;
- }
-
- if (this.editInput.wfInput.valid) {
- this.value = this.editValue;
- this.valueChange.emit(this.value);
- } else {
- this.editValue = this.value;
- }
- }
- }
-
- /*private validate(): boolean {
- const nodes = this.modelService.getNodes();
- const existNode = nodes.find(node => node.id === this.editValue);
- if (existNode) {
- this.translate.get('WORKFLOW.MSG.NODE_ID_SAME', {value: existNode.id}).subscribe((res: string) => {
- this.notice.error(res, 10000);
- });
- return false;
- }
- return true;
- }
-
- private changeReferencedValue(): void {
- const newNodeConnections = [];
- const nodes = this.modelService.getNodes();
- nodes.forEach((node: any) => {
- this.changeConnectionReferencedValue(node, this.value, this.editValue);
-
- if (node.type === NodeType[NodeType.restTask]) {
- const parameters = node.parameters || [];
- parameters.forEach(param => {
- this.changeRestTaskReferencedValue(param, this.value, this.editValue);
- });
- }
- });
- }
-
- private changeConnectionReferencedValue(node: WorkflowNode, oldValue: string, newValue: string): void {
- node.connection.forEach(connection => {
- if (connection.sourceRef === oldValue) {
- connection.sourceRef = newValue;
- } else if (connection.targetRef === oldValue) {
- connection.targetRef = newValue;
- }
- });
- }
-
- // 当restTask类型的节点的属性中valueSource是Plan时,value的值为引用其他节点id
- // value格式为[restTask_2].[responseBody].[name],可能有更多层,当时第一个[]里面的值为被引用节点的id
- private changeRestTaskReferencedValue(param: any, oldValue: string, newValue: string): void {
- if (param.valueSource === ValueSource[ValueSource.Plan]) {
- const value = param.value || '';
- const index = value.indexOf('].[');
- if (index > -1) {
- const nodeId = value.substring(1, index);
- if (nodeId === oldValue) {
- param.value = '[' + newValue + value.substring(index);
- }
- }
- } else if (param.valueSource === ValueSource[ValueSource.Definition]) {
- const value = param.value;
- if (isArray(value)) {
- value.forEach(subValue => {
- this.changeRestTaskReferencedValue(subValue, oldValue, newValue);
- });
- } else if (isObject(value)) {
- this.changeRestTaskReferencedValue(value, oldValue, newValue);
- }
- }
- }*/
-}