argos/dmp-frontend/src/app/ui/quick-wizard/quick-wizard-editor/quick-wizard-editor.compone...

69 lines
4.5 KiB
HTML

<div class="main-content">
<div class="container-fluid">
<div class="quick-wizard-editor">
<form [formGroup]="formGroup">
<h3 *ngIf="isNew">{{ 'QUICKWIZARD.CREATE-ADD.CREATE.QUICKWIZARD_CREATE.TITLE' | translate }}</h3>
<p *ngIf="isNew">{{ 'QUICKWIZARD.CREATE-ADD.CREATE.QUICKWIZARD_CREATE.POST-SELECTION-INFO' | translate }}</p>
<div class="row">
<mat-horizontal-stepper linear class="col-12" #stepper>
<mat-step [stepControl]="formGroup.get('grant')" *ngIf="formGroup">
<ng-template matStepLabel>
{{'QUICKWIZARD.CREATE-ADD.CREATE.QUICKWIZARD_CREATE.FIRST-STEP.TITLE' | translate}}
</ng-template>
<div class="col-12">
<div class="row">
<app-quick-wizard-funder-editor-component class="col-6" [funderFormGroup]="formGroup.get('funder')"></app-quick-wizard-funder-editor-component>
<app-quick-wizard-grant-editor-component class="col-6" [grantformGroup]="formGroup.get('grant')" [funderFormGroup]="formGroup.get('funder')"></app-quick-wizard-grant-editor-component>
</div>
</div>
<div *ngIf="formGroup.get('project')">
<app-quick-wizard-project-editor-component class="col-12" [formGroup]="formGroup.get('project')"></app-quick-wizard-project-editor-component>
</div>
<div class="navigation-buttons-container">
<button class="float-right" [disabled]="!isFormValid()" matStepperNext mat-raised-button color="primary">{{'QUICKWIZARD.CREATE-ADD.CREATE.QUICKWIZARD_CREATE.ACTIONS.NEXT' | translate}}</button>
</div>
</mat-step>
<mat-step [stepControl]="formGroup.get('dmp')" *ngIf="formGroup">
<ng-template matStepLabel>
{{'QUICKWIZARD.CREATE-ADD.CREATE.QUICKWIZARD_CREATE.SECOND-STEP.TITLE' | translate}}
</ng-template>
<ng-container *ngIf="formGroup.get('grant').valid">
<div>
<app-quick-wizard-dmp-editor-component class="col-12" [formGroup]="formGroup.get('dmp')" [datasetFormGroup]="formGroup.get('datasets')" [dmpLabel]="getGrantLabel()">
</app-quick-wizard-dmp-editor-component>
</div>
<div class="navigation-buttons-container">
<button matStepperPrevious mat-raised-button color="primary">{{'QUICKWIZARD.CREATE-ADD.CREATE.QUICKWIZARD_CREATE.ACTIONS.BACK' | translate}}</button>
<button class="float-right" [disabled]="!(this.formGroup.get('dmp').get('datasetProfile').valid)" matStepperNext mat-raised-button color="primary">
{{'QUICKWIZARD.CREATE-ADD.CREATE.QUICKWIZARD_CREATE.ACTIONS.NEXT' | translate}}
</button>
</div>
</ng-container>
</mat-step>
<mat-step [stepControl]="formGroup.get('datasets')" *ngIf="formGroup">
<ng-template matStepLabel>
{{'QUICKWIZARD.CREATE-ADD.CREATE.QUICKWIZARD_CREATE.THIRD-STEP.TITLE' | translate}}
</ng-template>
<!-- <ng-container *ngIf="isAvtive('step3')"> -->
<ng-container *ngIf="formGroup.get('dmp').valid && isActive('step3')">
<div *ngIf="formGroup.get('datasets')" class="row">
<!-- <div *ngIf="this.isActiveStep(3)" class="row"> -->
<app-dataset-editor-wizard-component class="col-12" [formGroup]="formGroup" [datasetProfile]="formGroup.get('dmp').get('datasetProfile')" [datasetLabel]="formGroup.get('dmp').get('label').value">
</app-dataset-editor-wizard-component>
<!-- <app-dataset-description-form class="col-12" *ngIf="formGroup && datasetWizardModel && datasetWizardModel.datasetProfileDefinition" [form]="this.formGroup.get('datasetProfileDefinition')" [visibilityRules]="datasetWizardModel.datasetProfileDefinition.rules" [datasetProfileId]="formGroup.get('profile').value"></app-dataset-description-form> -->
<!-- </div> -->
</div>
<div class="navigation-buttons-container mt-3">
<button matStepperPrevious mat-raised-button color="primary">{{'QUICKWIZARD.CREATE-ADD.CREATE.QUICKWIZARD_CREATE.ACTIONS.BACK' | translate}}</button>
<button class="saveAndFinalizeButton" matStepperNext mat-raised-button (click)='saveFinalize()' [disabled]="!isFormValid() || !hasDatasets()" color="primary">{{'QUICKWIZARD.CREATE-ADD.CREATE.QUICKWIZARD_CREATE.ACTIONS.SAVE-AND-FINALIZE' | translate}}</button>
<button class="saveButton" matStepperNext mat-raised-button (click)='formSubmit()' [disabled]="!hasDatasets()" color="primary">{{'QUICKWIZARD.CREATE-ADD.CREATE.QUICKWIZARD_CREATE.ACTIONS.SAVE' | translate}}</button>
</div>
</ng-container>
</mat-step>
</mat-horizontal-stepper>
</div>
</form>
</div>
</div>
</div>