All files / src/app/components/view-builder view-builder.component.html

92.39% Statements 85/92
100% Branches 6/6
100% Functions 7/7
100% Lines 33/33

Press n or j to go to the next uncovered block, b, p or k for the previous block.

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 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48  2x 836x 836x 2x 836x   2x 2x 836x   838x 836x 836x   2x     7x 2x 2x 2x 2x 2x 2x 2x 2x   2x   838x 7x     2x 2x 836x 2x 2x 296x   2x 2x       2x  
<div class="container">
    <div class="title">
        <h1 *ngIf="this.viewId === null" class="title">Add new custom View</h1>
        <h1 *ngIf="this.viewId !== null" class="title">Edit {{ buildedView.name }}</h1>
    </div>
    <form [formGroup]="customViewForm">
        <div class="columns">
            <div class="column is-three-fifths">
                    <input class="input" formControlName="customViewName" type="text" id="customViewName" placeholder="Enter a name to your custom view">
                    <p *ngIf="isNameErrorVisible" class="has-text-danger" >You need to add at least one component</p>
                    <div class="pt-5">
                        <textarea formControlName="customViewConfiguration" class="editor" rows="5" cols="30" [(ngModel)]="configurationText"></textarea>
                        <p *ngIf="isConfErrorVisible" class="has-text-danger" >You need to add at least one component</p>
                        <p *ngIf="isDataErrorVisible" class="has-text-danger" >You need to specify required data for each component</p>
                    </div>
            </div>
            <div class="column">
                <div class="select maxwidth">
                    <select class="maxwidth" name="componentSelector" (change)="newComponent($event)" >
                    <option value="" disabled selected>Select component to add on the view</option>
                    <option value="PidComponent">PidComponent</option>
                    <option value="PetriComponent">PetriComponent</option>
                    <option value="VideosComponent">VideosComponent</option>
                    <option value="SignalsComponent">SignalsComponent</option>
                    <option value="SignalCardComponent">SignalCardComponent</option>
                    <option value="SignalsGraphsComponent">SignalsGraphsComponent</option>
                    <option value="EventsComponent">EventsComponent</option>
                    </select>
                </div>
                <div class="pt-5">
                    <textarea formControlName="componentExample" class="editor" rows="5" cols="30" [(ngModel)]="componentText"></textarea>
                    <button (click)="addToConfiguration()" class="button is-block is-info is-small" id="addToConfiguration">Add to custom view</button>
                </div>
            </div>
        </div>
        <div class="has-text-centered">
            @if (this.viewId !== null) {
                <button (click)="saveCustomView()" class="button is-primary" id="saveCustomView">Save custom view</button>
                <button (click)="deleteCustomView(this.viewId, this.buildedView.name)" class="button is-danger" id="deleteCustomView">Delete custom view</button>
                <button [routerLink]="['/custom-views', viewId]" class="button" id="saveCustomView">Go to view</button>
            }
            @else {
                <button (click)="saveCustomView()" class="button is-primary" id="saveCustomView">Create custom view</button>
            }
        </div>
    </form>
</div>