argos/dmp-frontend/src/app/datasets/dataset-wizard/dataset-wizard.component.html

233 lines
12 KiB
HTML
Raw Normal View History

2018-01-17 12:57:41 +01:00
<div class="dataset-wizard">
2018-07-23 16:01:27 +02:00
<h3 *ngIf="isNew">New Dataset</h3>
2018-08-24 17:21:02 +02:00
<h3 *ngIf="!isNew">{{datasetWizardModel?.label}} Dataset</h3>
2018-05-28 11:50:42 +02:00
<div class="flex-container">
2018-01-26 16:50:16 +01:00
<button mat-raised-button color="primary" *ngIf="datasetWizardModel&&datasetWizardModel?.status != 1" style="margin-top: 15px;margin-bottom: 15px;margin-right: 15px;"
2018-05-28 11:50:42 +02:00
(click)="save();" type="button">Save</button>
2018-01-26 16:50:16 +01:00
<button mat-raised-button color="primary" *ngIf="datasetWizardModel&&datasetWizardModel?.status != 1" style="margin-top: 15px;margin-bottom: 15px;margin-right: 15px;"
2018-05-28 11:50:42 +02:00
(click)="saveFinalize();" type="button">Save and Finalize</button>
2018-03-05 17:18:45 +01:00
<button mat-raised-button color="primary" *ngIf="datasetWizardModel&&datasetWizardModel?.status == 1" style="margin-top: 15px;margin-bottom: 15px;margin-right: 15px;"
2018-05-28 11:50:42 +02:00
(click)="downloadPDF();" type="button">Download PDF</button>
2018-03-06 15:58:38 +01:00
<button mat-raised-button color="primary" *ngIf="datasetWizardModel&&datasetWizardModel?.status == 1" style="margin-top: 15px;margin-bottom: 15px;margin-right: 15px;"
2018-05-28 11:50:42 +02:00
(click)="downloadXML();" type="button">Download XML</button>
<div class="fill-space"></div>
2018-07-23 15:09:19 +02:00
<!-- <button mat-button (click)="redirectToProject()">
2018-07-11 15:47:36 +02:00
<mat-icon>arrow_right_alt</mat-icon>{{'DATASET-WIZARD.ACTIONS.GO-TO-PROJECT' | translate}}</button>
<button mat-button (click)="redirectToDmp()">
2018-07-23 15:09:19 +02:00
<mat-icon>arrow_right_alt</mat-icon>{{'DATASET-WIZARD.ACTIONS.GO-TO-DMP' | translate}}</button> -->
2018-07-11 15:47:36 +02:00
2018-05-28 11:50:42 +02:00
</div>
<mat-horizontal-stepper [linear]="isLinear" #stepper>
<mat-step [stepControl]="formGroup">
<form *ngIf="formGroup" [formGroup]="formGroup">
2018-08-24 17:21:02 +02:00
<app-single-auto-complete [reactiveFormControl]="formGroup.get('dmp')" placeholder="{{'DATASET-EDITOR.FIELDS.DMP' | translate}}"
[configuration]="dmpAutoCompleteConfiguration">
</app-single-auto-complete>
2018-05-28 11:50:42 +02:00
<ng-template matStepLabel>{{'DATASET-WIZARD.FIRST-STEP.TITLE' | translate}}</ng-template>
<mat-form-field formGroupName="profile">
<mat-select placeholder=" {{'DATASET-WIZARD.FIRST-STEP.PROFILE'| translate}}" formControlName="id">
<mat-option *ngFor="let profile of availableProfiles" [value]="profile.id">
{{profile.label}}
</mat-option>
</mat-select>
<mat-error *ngIf="baseErrorModel?.status">{{baseErrorModel['Criteria.status']}}</mat-error>
</mat-form-field>
<app-dataset-editor-component [formGroup]="formGroup"></app-dataset-editor-component>
<div class="navigation-buttons-container">
2018-08-31 10:14:56 +02:00
<button matStepperNext mat-raised-button style="float:right;" color="primary">{{'DATASET-WIZARD.ACTIONS.NEXT' |
2018-09-04 11:36:18 +02:00
translate}}
</button>
2018-05-28 11:50:42 +02:00
</div>
</form>
</mat-step>
<mat-step [stepControl]="formGroup">
<form *ngIf="formGroup" [formGroup]="formGroup">
<ng-template matStepLabel>{{'DATASET-WIZARD.SECOND-STEP.TITLE' | translate}}</ng-template>
2018-06-05 10:18:01 +02:00
<mat-card>
<mat-card-header>
<mat-card-title class="thick">
{{'DATASET-EDITOR.FIELDS.DATAREPOSITORIES' | translate}}
2018-09-04 11:36:18 +02:00
<button mat-raised-button color="primary" (click)="addDataRepository()">
{{'DATASET-EDITOR.FIELDS.CREATE'|translate}}
</button>
2018-06-05 10:18:01 +02:00
</mat-card-title>
</mat-card-header>
<app-external-item-listing *ngIf="formGroup.get('dataRepositories') && dataRepositoriesTemplate && externalSourcesConfiguration"
[options]="externalSourcesConfiguration.dataRepositories" placeholder="{{'DATASET-EDITOR.FIELDS.DATAREPOSITORIES' | translate}}"
2018-07-11 15:47:36 +02:00
[parentTemplate]='dataRepositoriesTemplate' [displayFunction]='dataRepositoryDisplayFunc' [subtitleFunction]='dataRepositoryDisplaySubtitleFunc'
2018-08-31 10:14:56 +02:00
[formGroup]="formGroup.get('dataRepositories')" [viewOnly]='viewOnly' [autoCompleteConfiguration]="dataRepositoriesAutoCompleteConfiguration"
2018-07-11 15:47:36 +02:00
(onItemChange)="dataRepositoriesOnItemChange($event)">
2018-06-05 10:18:01 +02:00
</app-external-item-listing>
<ng-template #dataRepositoriesTemplate let-suggestion let-i="index" let-callback="function">
<div>
<p>
2018-09-04 11:36:18 +02:00
{{i+1}}) {{suggestion.get('label').value}}
2018-06-05 10:18:01 +02:00
</p>
</div>
<div>
<mat-form-field>
<input matInput placeholder="{{'DATASET-EDITOR.FIELDS.DATAREPOSITORIES-INFO' | translate}}" type="text" name="info" [formControl]="suggestion.get('info')">
</mat-form-field>
</div>
<div>
<button mat-button (click)="callback(i)">
<mat-icon>close</mat-icon>
</button>
</div>
</ng-template>
</mat-card>
<mat-card>
<mat-card-header>
<mat-card-title class="thick">
{{'DATASET-EDITOR.FIELDS.EXTERNAL-DATASETS' | translate}}
2018-09-04 11:36:18 +02:00
<button mat-raised-button color="primary" (click)="addExternalDataset()">
{{'DATASET-EDITOR.FIELDS.CREATE'|translate}}
</button>
2018-06-05 10:18:01 +02:00
</mat-card-title>
</mat-card-header>
<app-external-item-listing *ngIf="formGroup.get('externalDatasets') && externalDatasetsTemplate && externalSourcesConfiguration"
[options]="externalSourcesConfiguration.externalDatasets" placeholder="{{'DATASET-EDITOR.FIELDS.EXTERNAL-DATASETS' | translate}}"
2018-07-11 15:47:36 +02:00
[parentTemplate]='externalDatasetsTemplate' [displayFunction]='externalDatasetDisplayFunc' [subtitleFunction]='dataRepositoryDisplaySubtitleFunc'
2018-08-31 10:14:56 +02:00
[formGroup]="formGroup.get('externalDatasets')" [viewOnly]='viewOnly' [autoCompleteConfiguration]="externalDatasetAutoCompleteConfiguration"
2018-07-11 15:47:36 +02:00
(onItemChange)="externalDatasetsOnItemChange($event)">
2018-06-05 10:18:01 +02:00
</app-external-item-listing>
<ng-template #externalDatasetsTemplate let-suggestion let-i="index" let-callback="function">
<div>
<p>
{{i+1}}) {{suggestion.get('label').value}}
</p>
</div>
<div>
<mat-form-field>
<input matInput placeholder="{{'DATASET-EDITOR.FIELDS.EXTERNAL-DATASET-INFO' | translate}}" type="text" name="info" [formControl]="suggestion.get('info')">
</mat-form-field>
</div>
<div>
<mat-form-field>
<mat-select placeholder="{{'DATASET-WIZARD.EDITOR.FIELDS.EXTERNAL-DATASET-TYPE' | translate}}" [formControl]="suggestion.get('type')">
<mat-option [value]="0">{{'TYPES.EXTERNAL-DATASET-TYPE.SOURCE' | translate}}</mat-option>
<mat-option [value]="1">{{'TYPES.EXTERNAL-DATASET-TYPE.OUTPUT' | translate}}</mat-option>
</mat-select>
</mat-form-field>
</div>
<div>
<button mat-button (click)="callback(i)">
<mat-icon>close</mat-icon>
</button>
</div>
</ng-template>
</mat-card>
<mat-card>
<mat-card-header>
<mat-card-title class="thick">
{{'DATASET-EDITOR.FIELDS.REGISTRIES' | translate}}
2018-09-04 11:36:18 +02:00
<button mat-raised-button color="primary" (click)="addRegistry()">
{{'DATASET-EDITOR.FIELDS.CREATE'|translate}}
</button>
2018-06-05 10:18:01 +02:00
</mat-card-title>
</mat-card-header>
<app-external-item-listing *ngIf="formGroup.get('registries') && registriesTemplate && externalSourcesConfiguration" [options]="externalSourcesConfiguration.registries"
placeholder="{{'DATASET-EDITOR.FIELDS.REGISTRIES' | translate}}" [parentTemplate]='registriesTemplate' [displayFunction]='registriesDisplayFunc'
2018-09-04 11:36:18 +02:00
[formGroup]="formGroup.get('registries')" [viewOnly]='viewOnly' [subtitleFunction]='dataRepositoryDisplaySubtitleFunc'
[autoCompleteConfiguration]="registriesAutoCompleteConfiguration" (onItemChange)="registriesOnItemChange($event)">
2018-06-05 10:18:01 +02:00
</app-external-item-listing>
<ng-template #registriesTemplate let-suggestion let-i="index" let-callback="function">
<div>
<p>
{{i+1}}) {{suggestion.get('label').value}}
</p>
</div>
<div>
<button mat-button (click)="callback(i)">
<mat-icon>close</mat-icon>
</button>
</div>
</ng-template>
</mat-card>
<mat-card>
<mat-card-header>
<mat-card-title class="thick">
{{'DATASET-EDITOR.FIELDS.SERVICES' | translate}}
2018-09-04 11:36:18 +02:00
<button mat-raised-button color="primary" (click)="addService()">
{{'DATASET-EDITOR.FIELDS.CREATE'|translate}}
</button>
2018-06-05 10:18:01 +02:00
</mat-card-title>
</mat-card-header>
<app-external-item-listing *ngIf="formGroup.get('services') && servicesTemplate && externalSourcesConfiguration" [options]="externalSourcesConfiguration.services"
placeholder="{{'DATASET-EDITOR.FIELDS.SERVICES' | translate}}" [parentTemplate]='servicesTemplate' [displayFunction]='servicesDisplayFunc'
2018-09-04 11:36:18 +02:00
[formGroup]="formGroup.get('services')" [viewOnly]='viewOnly' [subtitleFunction]='dataRepositoryDisplaySubtitleFunc'
[autoCompleteConfiguration]="servicesAutoCompleteConfiguration" (onItemChange)="servicesOnItemChange($event)">
2018-06-05 10:18:01 +02:00
</app-external-item-listing>
<ng-template #servicesTemplate let-suggestion let-i="index" let-callback="function">
<div>
<p>
{{i+1}}) {{suggestion.get('label').value}}
</p>
</div>
<div>
<button mat-button (click)="callback(i)">
<mat-icon>close</mat-icon>
</button>
</div>
</ng-template>
</mat-card>
2018-07-11 15:47:36 +02:00
<mat-card>
<mat-card-header>
<mat-card-title class="thick">
2018-07-23 15:09:19 +02:00
{{'DATASET-EDITOR.FIELDS.TAGS' | translate}}
2018-07-11 15:47:36 +02:00
</mat-card-title>
</mat-card-header>
<app-external-item-listing *ngIf="formGroup.get('tags') && tagsTemplate && externalSourcesConfiguration" [options]="externalSourcesConfiguration.tags"
placeholder="{{'DATASET-EDITOR.FIELDS.TAGS' | translate}}" [parentTemplate]='tagsTemplate' [displayFunction]='tagsDisplayFunc'
2018-08-31 10:14:56 +02:00
[formGroup]="formGroup.get('tags')" [viewOnly]='viewOnly' [subtitleFunction]='tagsDisplaySubtitleFunc' [autoCompleteConfiguration]="tagsAutoCompleteConfiguration"
2018-07-11 15:47:36 +02:00
(onItemChange)="tagsOnItemChange($event)">
</app-external-item-listing>
<ng-template #tagsTemplate let-suggestion let-i="index" let-callback="function">
<div>
<p>
{{i+1}}) {{suggestion.get('name').value}}
</p>
</div>
<div>
<button mat-button (click)="callback(i)">
<mat-icon>close</mat-icon>
</button>
</div>
</ng-template>
</mat-card>
2018-05-28 11:50:42 +02:00
<div class="navigation-buttons-container">
<button matStepperPrevious mat-raised-button color="primary">{{'DATASET-WIZARD.ACTIONS.BACK' | translate}}</button>
2018-08-31 10:14:56 +02:00
<button matStepperNext mat-raised-button color="primary" style="float:right;" (click)="getDefinition()">{{'DATASET-WIZARD.ACTIONS.NEXT'
| translate}}</button>
2018-05-28 11:50:42 +02:00
</div>
</form>
</mat-step>
<mat-step>
<ng-template matStepLabel>{{'DATASET-WIZARD.THIRD-STEP.TITLE' | translate}}</ng-template>
<dynamic-form class="full-width" *ngIf="formGroup && datasetWizardModel && datasetWizardModel.datasetProfileDefinition" [form]="this.formGroup.get('datasetProfileDefinition')"
[dataModel]="datasetWizardModel"></dynamic-form>
<div class="navigation-buttons-container">
2018-08-31 10:14:56 +02:00
<button style="margin-top:10px;" matStepperPrevious mat-raised-button color="primary">{{'DATASET-WIZARD.ACTIONS.BACK'
| translate}}</button>
2018-05-28 11:50:42 +02:00
</div>
</mat-step>
</mat-horizontal-stepper>
</div>