64 lines
3.1 KiB
HTML
64 lines
3.1 KiB
HTML
<div class="container" *ngIf="form" [formGroup]='form' class="dataset-profile-editor">
|
|
<mat-form-field class="full-width">
|
|
<input matInput formControlName="label" placeholder="{{'DATASET-PROFILE-EDITOR.FIELDS.DATASET-TITLE' | translate}}" required>
|
|
<mat-error *ngIf="form.get('label').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
|
|
</mat-form-field>
|
|
|
|
<mat-horizontal-stepper [linear]="true" #stepper>
|
|
<mat-step>
|
|
<ng-template matStepLabel>{{'DATASET-PROFILE-EDITOR.STEPS.PAGES.TITLE' | translate}}</ng-template>
|
|
<div class="row">
|
|
<app-dataset-profile-editor-page-component class="col-12" [form]="form.get('pages')" [viewOnly]="viewOnly"></app-dataset-profile-editor-page-component>
|
|
<div class="col-12">
|
|
<button mat-button class="full-width" (click)="addPage()" [disabled]="viewOnly">{{'DATASET-PROFILE-EDITOR.ACTIONS.ADD-PAGE' | translate}}</button>
|
|
</div>
|
|
</div>
|
|
</mat-step>
|
|
<mat-step>
|
|
<ng-template matStepLabel>{{'DATASET-PROFILE-EDITOR.STEPS.FORM.TITLE' | translate}}</ng-template>
|
|
<div class="row">
|
|
<mat-accordion class="col-12" [multi]="true">
|
|
<mat-expansion-panel *ngFor="let section of dataModel.sections; let i=index;" #panel>
|
|
<mat-expansion-panel-header>
|
|
<mat-panel-title>{{i + 1}}. {{form.get('sections').get(''+i).get('title').value}}</mat-panel-title>
|
|
<button mat-icon-button type="button" (click)="DeleteSection(i);" [disabled]="viewOnly">
|
|
<mat-icon>delete</mat-icon>
|
|
</button>
|
|
</mat-expansion-panel-header>
|
|
<div id="{{'s' + i}}" class="row" *ngIf="panel.expanded">
|
|
<app-dataset-profile-editor-section-component class="col-12" [form]="form.get('sections').get(''+i)" [dataModel]="section"
|
|
[indexPath]="'s' + i" [viewOnly]="viewOnly"></app-dataset-profile-editor-section-component>
|
|
</div>
|
|
</mat-expansion-panel>
|
|
</mat-accordion>
|
|
<div class="col-12">
|
|
<button mat-button (click)="addSection()" class="full-width" [disabled]="viewOnly">{{'DATASET-PROFILE-EDITOR.ACTIONS.ADD-SECTION' | translate}}</button>
|
|
</div>
|
|
</div>
|
|
</mat-step>
|
|
<!-- <mat-step>
|
|
<ng-template matStepLabel>{{'DATASET-PROFILE.PREVIEW' | translate}}</ng-template>
|
|
<div *ngIf='this.isStepActive(2)'>
|
|
<app-dynamic-form *ngIf="dataWizardModel && previewerFormGroup" [form]="this.previewerFormGroup" [dataModel]="dataWizardModel"></app-dynamic-form>
|
|
</div>
|
|
</mat-step> -->
|
|
</mat-horizontal-stepper>
|
|
<div class="row">
|
|
<!-- SAVE BUTTON -->
|
|
<div class="col-auto" *ngIf="!viewOnly">
|
|
<div class="row">
|
|
<button mat-raised-button color="primary" type="button col-auto" (click)='onSubmit()' [disabled]="!form.valid">Save</button>
|
|
<div class="col-1"></div>
|
|
<button mat-raised-button color="primary" type="button col-auto" (click)='finalize()' [disabled]="!form.valid">Finalize</button>
|
|
</div>
|
|
</div>
|
|
<div class="col"></div>
|
|
<!-- DELETE BUTTON -->
|
|
<div class="col-auto" *ngIf="!isNew">
|
|
<button mat-raised-button color="primary" (click)="delete()">
|
|
<mat-icon>delete</mat-icon>{{'DATASET-PROFILE-EDITOR.ACTIONS.DELETE' | translate}}
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|