argos/dmp-frontend/src/app/ui/admin/dataset-profile/editor/dataset-profile-editor.comp...

46 lines
2.4 KiB
HTML
Raw Normal View History

2019-01-18 18:03:45 +01:00
<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>
2019-01-18 18:03:45 +01:00
<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')"></app-dataset-profile-editor-page-component>
<div class="col-12"><button mat-button class="full-width" (click)="addPage()">{{'DATASET-PROFILE-EDITOR.ACTIONS.ADD-PAGE'
| translate}}</button></div>
2019-01-18 18:03:45 +01:00
</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);">
<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"></app-dataset-profile-editor-section-component>
2019-01-18 18:03:45 +01:00
</div>
</mat-expansion-panel>
</mat-accordion>
<div class="col-12"><button mat-button (click)="addSection()" class="full-width">{{'DATASET-PROFILE-EDITOR.ACTIONS.ADD-SECTION'
| translate}}</button></div>
2019-01-18 18:03:45 +01:00
</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>
<button mat-raised-button color="primary" type="button" (click)='onSubmit()' [disabled]="!form.valid">Save</button>
</div>