75d4fcf7d2cc77efcd363d4ebc3088155eddb1d6
[sdc.git] / catalog-ui / src / app / ng2 / pages / interface-operation / operation-creator / param-row / param-row.component.ts
1 import {Component, Input} from '@angular/core';
2 import {DropdownValue} from "app/ng2/components/ui/form-components/dropdown/ui-element-dropdown.component";
3 import {OperationParameter} from 'app/models';
4
5 @Component({
6     selector: 'param-row',
7     templateUrl: './param-row.component.html',
8     styleUrls: ['./param-row.component.less']
9 })
10
11 export class ParamRowComponent {
12     @Input() param: OperationParameter;
13     @Input() inputProps: Array<DropdownValue>;
14     @Input() propTypes: {};
15     @Input() onRemoveParam: Function;
16     @Input() isAssociateWorkflow: boolean;
17
18     propTypeEnum: Array<string> = ['boolean', 'float', 'integer', 'string'];
19     filteredInputProps: Array<DropdownValue> = [];
20
21     ngOnInit() {
22         this.onChangeType();
23     }
24
25     onChangeType() {
26         this.filteredInputProps = _.filter(this.inputProps, prop => {
27             return this.propTypes[prop.value] === this.param.type;
28         });
29     }
30 }