2 * Copyright (c) 2017 ZTE Corporation.
\r
3 * All rights reserved. This program and the accompanying materials
\r
4 * are made available under the terms of the Eclipse Public License v1.0
\r
5 * and the Apache License 2.0 which both accompany this distribution,
\r
6 * and are available at http://www.eclipse.org/legal/epl-v10.html
\r
7 * and http://www.apache.org/licenses/LICENSE-2.0
\r
10 * ZTE - initial API and implementation and/or initial documentation
\r
13 import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
\r
15 import { ValueSource } from '../../model/value-source.enum';
\r
16 import { Parameter } from '../../model/workflow/parameter';
\r
17 import { DataAccessService } from "../../services/data-access/data-access.service";
\r
20 * this component contains in property component if the corresponding node has parameter properties
\r
21 * eg. task node have input and output params, start event node has input param
\r
24 selector: 'b4t-parameter',
\r
25 templateUrl: 'parameter.component.html',
\r
27 export class ParameterComponent implements OnInit {
\r
28 @Input() public param: Parameter;
\r
29 @Input() public valueSource: ValueSource[];
\r
30 @Input() public canEditName: boolean;
\r
31 @Input() public showLabel = true;
\r
32 @Input() public canDelete: boolean;
\r
33 @Output() public paramChange = new EventEmitter<Parameter>();
\r
34 @Output() delete: EventEmitter<Parameter> = new EventEmitter<Parameter>();
\r
36 public sourceEnum = ValueSource;
\r
37 public valueGroupClass;
\r
39 public showValueSource: boolean = true;
\r
41 constructor(private dataAccessService: DataAccessService) { }
\r
43 public ngOnInit(): void {
\r
44 if (1 === this.valueSource.length) {
\r
45 this.showValueSource = false;
\r
48 'col-md-9': this.showValueSource,
\r
49 'col-md-12': !this.showValueSource
\r
52 this.valueGroupClass = {
\r
53 'col-md-7': this.canDelete,
\r
54 'col-md-9': !this.canDelete
\r
58 public deleteParam(): void {
\r
62 public modelChange(value: any) {
\r
63 this.param.value = value;
\r
64 this.paramChange.emit(this.param)
\r