summaryrefslogtreecommitdiffstats
path: root/catalog-ui/src/app/ng2/pages/interface-operation/operation-creator/param-row/param-row.component.ts
blob: 75d4fcf7d2cc77efcd363d4ebc3088155eddb1d6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import {Component, Input} from '@angular/core';
import {DropdownValue} from "app/ng2/components/ui/form-components/dropdown/ui-element-dropdown.component";
import {OperationParameter} from 'app/models';

@Component({
    selector: 'param-row',
    templateUrl: './param-row.component.html',
    styleUrls: ['./param-row.component.less']
})

export class ParamRowComponent {
    @Input() param: OperationParameter;
    @Input() inputProps: Array<DropdownValue>;
    @Input() propTypes: {};
    @Input() onRemoveParam: Function;
    @Input() isAssociateWorkflow: boolean;

    propTypeEnum: Array<string> = ['boolean', 'float', 'integer', 'string'];
    filteredInputProps: Array<DropdownValue> = [];

    ngOnInit() {
        this.onChangeType();
    }

    onChangeType() {
        this.filteredInputProps = _.filter(this.inputProps, prop => {
            return this.propTypes[prop.value] === this.param.type;
        });
    }
}