argos/dmp-frontend/src/app/dmps/editor/dmp-editor.component.html

120 lines
8.0 KiB
HTML
Raw Normal View History

2017-12-19 11:33:47 +01:00
<div class="data-management-plan-editor">
2017-12-18 11:01:22 +01:00
<form *ngIf="formGroup" (ngSubmit)="formSubmit()" [formGroup]="formGroup">
<mat-card>
2018-03-28 15:24:47 +02:00
<mat-form-field class="full-width">
<input type="text" placeholder="{{'DMP-EDITOR.FIELDS.PROFILE' | translate}}" [formControl]="textCtrl" matInput [matAutocomplete]="auto">
<mat-autocomplete #auto="matAutocomplete" [displayWith]="displayWith">
<mat-option *ngFor="let option of filteredOptions | async" [value]="option" (click)="selectOption(option)">
{{ option.label }}
</mat-option>
</mat-autocomplete>
</mat-form-field>
2017-12-18 12:24:12 +01:00
<mat-card-title *ngIf="isNew">{{'DMP-EDITOR.TITLE.NEW' | translate}}</mat-card-title>
2017-12-19 12:45:56 +01:00
<mat-card-title *ngIf="!isNew">{{formGroup.get('label').value}}</mat-card-title>
2017-12-18 11:01:22 +01:00
<mat-card-content>
2017-12-14 18:13:28 +01:00
2018-01-11 17:19:15 +01:00
<mat-form-field class="full-width">
2017-12-18 12:24:12 +01:00
<input matInput placeholder="{{'DMP-EDITOR.FIELDS.NAME' | translate}}" type="text" name="label" formControlName="label" required>
2017-12-18 11:01:22 +01:00
<mat-error *ngIf="formGroup.get('label').errors?.backendError">{{baseErrorModel.label}}</mat-error>
<mat-error *ngIf="formGroup.get('label').errors?.required">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
</mat-form-field>
2017-12-14 18:13:28 +01:00
2017-12-18 11:01:22 +01:00
<mat-form-field class="full-width">
2017-12-18 12:24:12 +01:00
<textarea matInput class="description-area" placeholder="{{'DMP-EDITOR.FIELDS.DESCRIPTION' | translate}}" formControlName="description"
2017-12-18 11:01:22 +01:00
required></textarea>
<mat-error *ngIf="formGroup.get('description').errors?.backendError">{{errorModel.description}}</mat-error>
<mat-error *ngIf="formGroup.get('description').errors?.required">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
</mat-form-field>
2017-12-14 18:13:28 +01:00
2018-03-28 15:24:47 +02:00
<auto-complete class="mat-form-field-full-width" placeholder="{{this.languageResolverService.getBy('dmpEditor') | translate}}" [configuration]="projectAutoCompleteConfiguration"
2018-02-05 10:44:40 +01:00
titleKey="label" [control]="formGroup.get('project')" [required]="true">
2018-02-16 17:48:23 +01:00
</auto-complete>
2017-12-21 10:39:17 +01:00
2018-03-28 15:24:47 +02:00
<app-dynamic-fields-project [formGroup]="formGroup"></app-dynamic-fields-project>
2017-12-20 17:50:16 +01:00
<td-chips color="accent" [items]="filteredProfiles" formControlName="profiles" placeholder="{{'DMP-EDITOR.FIELDS.PROFILES' | translate}}"
2018-02-05 10:44:40 +01:00
(inputChange)="filterProfiles($event)" requireMatch required>
2017-12-20 17:50:16 +01:00
<ng-template td-chip let-chip="chip">
2017-12-21 10:16:46 +01:00
<div class="tc-grey-100 bgc-teal-700" td-chip-avatar>{{chip.label.substring(0, 1).toUpperCase()}}</div>
{{chip.label}}
2017-12-20 17:50:16 +01:00
</ng-template>
<ng-template td-autocomplete-option let-option="option">
<div layout="row" layout-align="start center">
2017-12-21 10:16:46 +01:00
{{option.label}}
2017-12-20 17:50:16 +01:00
</div>
</ng-template>
<mat-progress-bar [style.height.px]="2" *ngIf="filteredProfilesAsync" mode="indeterminate"></mat-progress-bar>
2018-02-05 10:44:40 +01:00
<span *ngIf="formGroup.get('profiles').touched || !formGroup.get('profiles').pristine">
<mat-error style="font-size:10.5px" *ngIf="formGroup.get('profiles').errors?.required">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
</span>
2017-12-20 17:50:16 +01:00
</td-chips>
2018-02-08 09:50:39 +01:00
<!-- <button mat-button (click)="availableProfiles()">View All</button> -->
<a style="float:right" href="#" (click)="availableProfiles()">View All</a>
2018-02-05 10:44:40 +01:00
2018-02-23 13:12:58 +01:00
<!-- <auto-complete-chip class="mat-form-field-full-width" placeholder="{{'DMP-EDITOR.FIELDS.ORGANISATIONS' | translate}}" [configuration]="organisationsAutoCompleteConfiguration"
2018-02-16 17:48:23 +01:00
titleKey="name" [control]="formGroup.get('organisations')" [required]="true">
2018-02-23 13:12:58 +01:00
</auto-complete-chip> -->
2018-02-23 13:12:58 +01:00
<td-chips color="accent" [items]="filteredOrganisations" formControlName="organisations" placeholder="{{'DMP-EDITOR.FIELDS.ORGANISATIONS' | translate}}"
2017-12-18 12:24:12 +01:00
(inputChange)="filterOrganisations($event)" requireMatch>
2017-12-18 11:01:22 +01:00
<ng-template td-chip let-chip="chip">
2017-12-18 12:24:12 +01:00
<div class="tc-grey-100 bgc-teal-700" td-chip-avatar>{{chip.name.substring(0, 1).toUpperCase()}}</div>
2017-12-18 11:01:22 +01:00
{{chip.name}}
</ng-template>
<ng-template td-autocomplete-option let-option="option">
<div layout="row" layout-align="start center">
2017-12-18 12:24:12 +01:00
{{option.name}}
2017-12-18 11:01:22 +01:00
</div>
2017-12-18 12:24:12 +01:00
</ng-template>
2017-12-18 11:01:22 +01:00
<mat-progress-bar [style.height.px]="2" *ngIf="filteringOrganisationsAsync" mode="indeterminate"></mat-progress-bar>
2018-02-23 13:12:58 +01:00
</td-chips>
2017-12-14 18:13:28 +01:00
2018-02-16 17:48:23 +01:00
<div layout="row" layout-align="start center">
<td-chips style="margin-bottom:25px; display:inline-block; width:90%" color="accent" [items]="filteredResearchers" formControlName="researchers"
placeholder="{{'DMP-EDITOR.FIELDS.RESEARCHERS' | translate}}" (inputChange)="filterResearchers($event)"
requireMatch>
2018-02-05 10:44:40 +01:00
<ng-template td-chip let-chip="chip">
<div class="tc-grey-100 bgc-teal-700" td-chip-avatar>{{chip.name.substring(0, 1).toUpperCase()}}</div>
{{chip.name}}
</ng-template>
<ng-template td-autocomplete-option let-option="option">
<div layout="row" layout-align="start center">
{{option.name}}
</div>
</ng-template>
<mat-progress-bar [style.height.px]="2" *ngIf="filteringResearchersAsync" mode="indeterminate"></mat-progress-bar>
</td-chips>
2018-02-16 17:48:23 +01:00
<button style="display:inline-block;" mat-icon-button (click)="addResearcher()">
2018-02-05 10:44:40 +01:00
<mat-icon aria-label="Example icon-button with a heart icon">add_circle</mat-icon>
</button>
</div>
2018-03-28 15:24:47 +02:00
<app-dynamic-dmp-field-resolver class="full-width" *ngIf="dataManagementPlan.definition" [formGroup]="formGroup" [dataManagementPlanProfile]="dataManagementPlan.definition"></app-dynamic-dmp-field-resolver>
2018-02-05 10:44:40 +01:00
<mat-form-field class="full-width">
<input matInput placeholder="Version" disabled [value]="formGroup.get('version').value== undefined ?0 :formGroup.get('version').value">
</mat-form-field>
2018-02-23 13:12:58 +01:00
2017-12-18 12:24:12 +01:00
2018-01-24 12:29:53 +01:00
<mat-list *ngIf="associatedUsers?.length" role="list">
2018-02-05 10:44:40 +01:00
<h3 mat-subheader>Associated Users</h3>
<mat-list-item role="listitem" *ngFor="let user of associatedUsers">
2018-01-23 14:46:38 +01:00
<mat-icon mat-list-icon>person</mat-icon>
<div>{{user.name}}</div>
</mat-list-item>
2018-02-05 10:44:40 +01:00
</mat-list>
2018-01-23 12:56:43 +01:00
2017-12-18 11:01:22 +01:00
<div layout="row" class="full-width text-right" align="end">
2017-12-18 12:24:12 +01:00
<button mat-raised-button color="primary" (click)="cancel()" type="button">{{'DMP-EDITOR.ACTIONS.CANCEL' | translate}}</button>
2018-01-17 18:30:09 +01:00
<!-- <button *ngIf="!isNew" mat-raised-button color="primary" (click)="invite()" type="button">{{'DMP-EDITOR.ACTIONS.INVITE' | translate}}</button> -->
2017-12-18 12:24:12 +01:00
<button mat-raised-button color="primary" type="submit">{{'DMP-EDITOR.ACTIONS.SAVE' | translate}}</button>
2018-02-05 12:26:23 +01:00
<button *ngIf="!isNew" mat-raised-button color="primary" type="button" (click)="openConfirm(formGroup.get('label').value, formGroup.get('id').value)">{{'DMP-EDITOR.ACTIONS.DELETE' | translate}}</button>
2017-12-14 18:13:28 +01:00
</div>
2018-03-28 15:24:47 +02:00
2017-12-18 11:01:22 +01:00
</mat-card-content>
</mat-card>
</form>
2017-12-21 10:46:11 +01:00
<!-- <div *ngIf="formGroup"> {{ formGroup.value | json }}</div> -->
2017-12-18 11:01:22 +01:00
</div>