1 import {Component, Input} from '@angular/core';
2 import {PROPERTY_DATA} from "app/utils";
3 import {DataTypeService} from "app/ng2/services/data-type.service";
4 import {OperationParameter} from 'app/models';
5 import {DropdownValue} from "app/ng2/components/ui/form-components/dropdown/ui-element-dropdown.component";
9 templateUrl: './param-row.component.html',
10 styleUrls: ['./param-row.component.less']
13 export class ParamRowComponent {
14 @Input() param: OperationParameter;
15 @Input() inputProps: Array<DropdownValue>;
16 @Input() propTypes: { [key: string]: string };
17 @Input() onRemoveParam: Function;
18 @Input() isAssociateWorkflow: boolean;
19 @Input() readonly: boolean;
20 @Input() isInputParam: boolean;
22 propTypeEnum: Array<String> = [];
23 filteredInputProps: Array<DropdownValue> = [];
25 constructor(private dataTypeService:DataTypeService) {}
28 const types = PROPERTY_DATA.TYPES.concat(
30 Object.keys(this.dataTypeService.getAllDataTypes()),
31 type => PROPERTY_DATA.TYPES.indexOf(type) === -1
34 this.propTypeEnum = _.filter(
36 type => _.toArray(this.propTypes).indexOf(type) > -1
42 this.filteredInputProps = _.filter(this.inputProps, prop => {
43 return this.propTypes[prop.value] === this.param.type;