<commit_before>import {Component, EventEmitter, Input, OnInit, Output} from '@angular/core';
import {Project} from '../../../../model/project.model';
import {Application} from '../../../../model/application.model';
import {Environment} from '../../../../model/environment.model';
import {WorkflowNode} from '../../../../model/workflow.model';
import {cloneDeep} from 'lodash';

@Component({
    selector: 'app-workflow-node-form',
    templateUrl: './workflow.node.form.html',
    styleUrls: ['./workflow.node.form.scss']
})
export class WorkflowNodeFormComponent implements OnInit {

    @Input() project: Project;
    @Input() node: WorkflowNode;
    @Output() nodeChange = new EventEmitter<WorkflowNode>();

    environments: Environment[];
    applications: Application[];

    constructor() { }

    ngOnInit() {
        let voidEnv = new Environment();
        voidEnv.id = 0;
        voidEnv.name = ' ';
        this.environments = cloneDeep(this.project.environments);
        this.environments.unshift(voidEnv);

        let voidApp = new Application();
        voidApp.id = 0;
        voidApp.name = ' ';
        this.applications = cloneDeep(this.project.applications);<commit_msg>fix(ui): fix node form (#1798)<commit_after>import {Component, EventEmitter, Input, OnInit, Output} from '@angular/core';
import {Project} from '../../../../model/project.model';
import {Application} from '../../../../model/application.model';
import {Environment} from '../../../../model/environment.model';
import {WorkflowNode} from '../../../../model/workflow.model';
import {cloneDeep} from 'lodash';

@Component({
    selector: 'app-workflow-node-form',
    templateUrl: './workflow.node.form.html',
    styleUrls: ['./workflow.node.form.scss']
})
export class WorkflowNodeFormComponent implements OnInit {

    @Input() project: Project;
    @Input() node: WorkflowNode;
    @Output() nodeChange = new EventEmitter<WorkflowNode>();

    environments: Environment[];
    applications: Application[];

    constructor() { }

    ngOnInit() {
        let voidEnv = new Environment();
        voidEnv.id = 0;
        voidEnv.name = ' ';
        this.environments = cloneDeep(this.project.environments) || [];
        this.environments.unshift(voidEnv);

        let voidApp = new Application();
        voidApp.id = 0;
        voidApp.name = ' ';
        this.applications = cloneDeep(this.project.applications) || [];
{'fraction_non_alphanumeric': 0.17488603398259428, 'fraction_numerical': 0.003315375051802735, 'mean_word_length': 3.0708263069139967, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2562070', 'n_tokens_mistral': 691, 'n_tokens_neox': 693, 'n_words': 153}