no message
This commit is contained in:
parent
22582676a3
commit
518a2ffd3c
|
@ -1,122 +1,120 @@
|
||||||
import { UnauthorizedComponent } from './unauthorized/unauthorized.component';
|
|
||||||
import { NgModule } from '@angular/core';
|
import { NgModule } from '@angular/core';
|
||||||
import { RouterModule, Routes } from '@angular/router';
|
import { RouterModule, Routes } from '@angular/router';
|
||||||
import { HomepageComponent } from './homepage/homepage.component';
|
import { HomepageComponent } from './homepage/homepage.component';
|
||||||
import { AuthGuard } from './shared/guards/auth.guard';
|
import { AuthGuard } from './shared/guards/auth.guard';
|
||||||
import { LoginComponent } from './user-management/login/login.component';
|
|
||||||
import { WelcomepageComponent } from './welcomepage/welcomepage.component';
|
import { WelcomepageComponent } from './welcomepage/welcomepage.component';
|
||||||
import { B2AccessLoginComponent } from './user-management/login/b2access/b2access-login.component';
|
import { B2AccessLoginComponent } from './user-management/login/b2access/b2access-login.component';
|
||||||
|
|
||||||
const appRoutes: Routes = [
|
const appRoutes: Routes = [
|
||||||
{
|
{
|
||||||
path: 'datasets',
|
path: 'datasets',
|
||||||
loadChildren: './datasets/dataset.module#DatasetModule',
|
loadChildren: './datasets/dataset.module#DatasetModule',
|
||||||
data: {
|
data: {
|
||||||
breadcrumb: true
|
breadcrumb: true
|
||||||
},
|
},
|
||||||
canActivate: [AuthGuard]
|
canActivate: [AuthGuard]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'about',
|
path: 'about',
|
||||||
loadChildren: './about/about.module#AboutModule',
|
loadChildren: './about/about.module#AboutModule',
|
||||||
data: {
|
data: {
|
||||||
breadcrumb: true
|
breadcrumb: true
|
||||||
},
|
},
|
||||||
canActivate: [AuthGuard]
|
canActivate: [AuthGuard]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'projects',
|
path: 'projects',
|
||||||
loadChildren: './projects/projects.module#ProjectsModule',
|
loadChildren: './projects/projects.module#ProjectsModule',
|
||||||
data: {
|
data: {
|
||||||
breadcrumb: true
|
breadcrumb: true
|
||||||
},
|
},
|
||||||
canActivate: [AuthGuard]
|
canActivate: [AuthGuard]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "dmps",
|
path: "dmps",
|
||||||
loadChildren: './dmps/dmps.module#DataManagementPlanModule',
|
loadChildren: './dmps/dmps.module#DataManagementPlanModule',
|
||||||
data: {
|
data: {
|
||||||
breadcrumb: true
|
breadcrumb: true
|
||||||
},
|
},
|
||||||
canActivate: [AuthGuard]
|
canActivate: [AuthGuard]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "dmp-profiles",
|
path: "dmp-profiles",
|
||||||
loadChildren: './dmp-profiles/dmp-profile.module#DataManagamentPlanProfileModule',
|
loadChildren: './dmp-profiles/dmp-profile.module#DataManagamentPlanProfileModule',
|
||||||
data: {
|
data: {
|
||||||
breadcrumb: true
|
breadcrumb: true
|
||||||
},
|
},
|
||||||
canActivate: [AuthGuard]
|
canActivate: [AuthGuard]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'form',
|
path: 'form',
|
||||||
loadChildren: './dataset-profile-form/dataset-profile.module#DatasetProfileModule',
|
loadChildren: './dataset-profile-form/dataset-profile.module#DatasetProfileModule',
|
||||||
data: {
|
data: {
|
||||||
breadcrumb: true
|
breadcrumb: true
|
||||||
},
|
},
|
||||||
canActivate: [AuthGuard]
|
canActivate: [AuthGuard]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'home',
|
path: 'home',
|
||||||
component: HomepageComponent,
|
component: HomepageComponent,
|
||||||
data: {
|
data: {
|
||||||
breadcrumb: false
|
breadcrumb: false
|
||||||
},
|
},
|
||||||
canActivate: [AuthGuard]
|
canActivate: [AuthGuard]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '',
|
path: '',
|
||||||
redirectTo: '/welcome',
|
redirectTo: '/welcome',
|
||||||
data: {
|
data: {
|
||||||
breadcrumbs: false
|
breadcrumbs: false
|
||||||
},
|
},
|
||||||
pathMatch: 'full'
|
pathMatch: 'full'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "unauthorized",
|
path: "unauthorized",
|
||||||
loadChildren: './unauthorized/unauthorized.module#UnauthorizedModule',
|
loadChildren: './unauthorized/unauthorized.module#UnauthorizedModule',
|
||||||
data: {
|
data: {
|
||||||
breadcrumb: true
|
breadcrumb: true
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "users",
|
path: "users",
|
||||||
loadChildren: './users/users.module#UsersModule'
|
loadChildren: './users/users.module#UsersModule'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "datasetsProfiles",
|
path: "datasetsProfiles",
|
||||||
loadChildren: './datasets-admin-listing/dataset-admin.module#DatasetAdminModule',
|
loadChildren: './datasets-admin-listing/dataset-admin.module#DatasetAdminModule',
|
||||||
data: {
|
data: {
|
||||||
breadcrumb: true
|
breadcrumb: true
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "welcome",
|
path: "welcome",
|
||||||
component: WelcomepageComponent,
|
component: WelcomepageComponent,
|
||||||
data: {
|
data: {
|
||||||
breadcrumb: false
|
breadcrumb: false
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "api/oauth/authorized/b2access",
|
path: "api/oauth/authorized/b2access",
|
||||||
component: B2AccessLoginComponent,
|
component: B2AccessLoginComponent,
|
||||||
data: {
|
data: {
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
RouterModule.forRoot(
|
RouterModule.forRoot(
|
||||||
appRoutes
|
appRoutes
|
||||||
, {
|
, {
|
||||||
useHash: false
|
useHash: false
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
exports: [
|
exports: [
|
||||||
RouterModule
|
RouterModule
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
export class AppRoutingModule { }
|
export class AppRoutingModule { }
|
||||||
|
|
||||||
|
|
|
@ -1,150 +1,145 @@
|
||||||
<div class="data-management-plan-editor">
|
<div class="data-management-plan-editor">
|
||||||
|
<mat-card-title *ngIf="isNew">{{'DMP-EDITOR.TITLE.NEW' | translate}}</mat-card-title>
|
||||||
|
<mat-card-title *ngIf="!isNew">
|
||||||
|
<h3>{{formGroup?.get('label')?.value}} </h3>
|
||||||
|
</mat-card-title>
|
||||||
<form *ngIf="formGroup" (ngSubmit)="formSubmit()" [formGroup]="formGroup">
|
<form *ngIf="formGroup" (ngSubmit)="formSubmit()" [formGroup]="formGroup">
|
||||||
|
|
||||||
|
|
||||||
<mat-card>
|
<mat-card>
|
||||||
|
|
||||||
<mat-card-header>
|
<mat-card-header>
|
||||||
<mat-card-title *ngIf="isNew">{{'DMP-EDITOR.TITLE.NEW' | translate}}</mat-card-title>
|
|
||||||
<mat-card-title *ngIf="!isNew">
|
|
||||||
<h3>{{formGroup.get('label').value}} </h3>
|
|
||||||
</mat-card-title>
|
|
||||||
<div class="fill-space"></div>
|
<div class="fill-space"></div>
|
||||||
<div *ngIf="!isNew" flexLayout="row">
|
<div *ngIf="!isNew">
|
||||||
<!-- <div fxFlex>
|
<!-- <div fxFlex>
|
||||||
<button mat-button type="button" (click)="redirectToProject()">
|
<button mat-button type="button" (click)="redirectToProject()">
|
||||||
<mat-icon>arrow_right_alt</mat-icon>{{'DMP-EDITOR.ACTIONS.GO-TO-PROJECT' | translate}}</button>
|
<mat-icon>arrow_right_alt</mat-icon>{{'DMP-EDITOR.ACTIONS.GO-TO-PROJECT' | translate}}</button>
|
||||||
</div> -->
|
</div> -->
|
||||||
<div fxFlex>
|
<div>
|
||||||
<button mat-button type="button" (click)="redirectToDatasets()">
|
<button mat-button type="button" (click)="redirectToDatasets()">
|
||||||
<mat-icon>arrow_right_alt</mat-icon>{{'DMP-EDITOR.ACTIONS.GO-TO-DATASETS' | translate}}</button>
|
<mat-icon>arrow_right_alt</mat-icon>{{'DMP-EDITOR.ACTIONS.GO-TO-DATASETS' | translate}}</button>
|
||||||
</div>
|
</div>
|
||||||
<mat-menu #actionsMenu="matMenu">
|
<mat-menu #actionsMenu="matMenu">
|
||||||
|
|
||||||
<button mat-menu-item (click)="newVersion(this.dataManagementPlan.id, this.dataManagementPlan.label)">
|
<button mat-menu-item (click)="newVersion(this.dataManagementPlan.id, this.dataManagementPlan.label)">
|
||||||
<mat-icon>queue</mat-icon>{{'DMP-LISTING.ACTIONS.NEW-VERSION' | translate}}</button>
|
<mat-icon>queue</mat-icon>{{'DMP-LISTING.ACTIONS.NEW-VERSION' | translate}}</button>
|
||||||
<button mat-menu-item (click)="clone(this.dataManagementPlan.id)">
|
<button mat-menu-item (click)="clone(this.dataManagementPlan.id)">
|
||||||
<mat-icon>filter_none</mat-icon>{{'DMP-LISTING.ACTIONS.CLONE' | translate}}</button>
|
<mat-icon>filter_none</mat-icon>{{'DMP-LISTING.ACTIONS.CLONE' | translate}}</button>
|
||||||
</mat-menu>
|
</mat-menu>
|
||||||
<div fxFlex>
|
<div>
|
||||||
<button fxFlex mat-icon-button type="button" [matMenuTriggerFor]="actionsMenu">
|
<button mat-icon-button type="button" [matMenuTriggerFor]="actionsMenu">
|
||||||
<mat-icon>more_vert</mat-icon>
|
<mat-icon>more_vert</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</mat-card-header>
|
</mat-card-header>
|
||||||
<mat-card-content>
|
<mat-card-content>
|
||||||
<mat-form-field class="full-width">
|
<div class="row">
|
||||||
<input matInput placeholder="{{'DMP-EDITOR.FIELDS.NAME' | translate}}" type="text" name="label" formControlName="label" required>
|
<mat-form-field class="col-md-12">
|
||||||
<mat-error *ngIf="formGroup.get('label').errors?.backendError">{{baseErrorModel.label}}</mat-error>
|
<input matInput placeholder="{{'DMP-EDITOR.FIELDS.NAME' | translate}}" type="text" name="label" formControlName="label" required>
|
||||||
<mat-error *ngIf="formGroup.get('label').errors?.required">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
|
<mat-error *ngIf="formGroup.get('label').errors?.backendError">{{baseErrorModel.label}}</mat-error>
|
||||||
</mat-form-field>
|
<mat-error *ngIf="formGroup.get('label').errors?.required">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
|
||||||
|
</mat-form-field>
|
||||||
|
|
||||||
<mat-form-field class="full-width">
|
<mat-form-field class="col-md-12">
|
||||||
<textarea matInput class="description-area" placeholder="{{'DMP-EDITOR.FIELDS.DESCRIPTION' | translate}}" formControlName="description"
|
<textarea matInput class="description-area" placeholder="{{'DMP-EDITOR.FIELDS.DESCRIPTION' | translate}}" formControlName="description"
|
||||||
required></textarea>
|
required></textarea>
|
||||||
<mat-error *ngIf="formGroup.get('description').errors?.backendError">{{errorModel.description}}</mat-error>
|
<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-error *ngIf="formGroup.get('description').errors?.required">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
|
|
||||||
<auto-complete class="mat-form-field-full-width" placeholder="{{this.languageResolverService.getBy('dmpEditor') | translate}}"
|
<auto-complete class="col-md-6" placeholder="{{this.languageResolverService.getBy('dmpEditor') | translate}}" [configuration]="projectAutoCompleteConfiguration"
|
||||||
[configuration]="projectAutoCompleteConfiguration" titleKey="label" [control]="formGroup.get('project')" [required]="true">
|
titleKey="label" [control]="formGroup.get('project')" [required]="true">
|
||||||
</auto-complete>
|
</auto-complete>
|
||||||
|
|
||||||
<!-- <app-dynamic-fields-project [formGroup]="formGroup"></app-dynamic-fields-project> -->
|
<!-- <app-dynamic-fields-project [formGroup]="formGroup"></app-dynamic-fields-project> -->
|
||||||
|
|
||||||
<td-chips color="accent" [items]="filteredProfiles" formControlName="profiles" placeholder="{{'DMP-EDITOR.FIELDS.PROFILES' | translate}}"
|
<td-chips class="col-md-6" color="accent" [items]="filteredProfiles" formControlName="profiles" placeholder="{{'DMP-EDITOR.FIELDS.PROFILES' | translate}}"
|
||||||
(inputChange)="filterProfiles($event)" requireMatch required>
|
(inputChange)="filterProfiles($event)" requireMatch required>
|
||||||
<ng-template td-chip let-chip="chip">
|
<ng-template td-chip let-chip="chip">
|
||||||
<div class="tc-grey-100 bgc-teal-700" td-chip-avatar>{{chip.label.substring(0, 1).toUpperCase()}}</div>
|
<div class="tc-grey-100 bgc-teal-700" td-chip-avatar>{{chip.label.substring(0, 1).toUpperCase()}}</div>
|
||||||
{{chip.label}}
|
{{chip.label}}
|
||||||
</ng-template>
|
</ng-template>
|
||||||
<ng-template td-autocomplete-option let-option="option">
|
<ng-template td-autocomplete-option let-option="option">
|
||||||
<div layout="row" layout-align="start center">
|
<div>
|
||||||
{{option.label}}
|
{{option.label}}
|
||||||
</div>
|
</div>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
<mat-progress-bar [style.height.px]="2" *ngIf="filteredProfilesAsync" mode="indeterminate"></mat-progress-bar>
|
<mat-progress-bar [style.height.px]="2" *ngIf="filteredProfilesAsync" mode="indeterminate"></mat-progress-bar>
|
||||||
<span *ngIf="formGroup.get('profiles').touched || !formGroup.get('profiles').pristine">
|
<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>
|
<mat-error style="font-size:10.5px" *ngIf="formGroup.get('profiles').errors?.required">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
|
||||||
</span>
|
</span>
|
||||||
</td-chips>
|
</td-chips>
|
||||||
<!-- <button mat-button (click)="availableProfiles()">View All</button> -->
|
<!-- <button mat-button (click)="availableProfiles()">View All</button> -->
|
||||||
<a style="float:right" href="#" (click)="availableProfiles()">View All</a>
|
<a style="float:right" href="#" (click)="availableProfiles()">View All</a>
|
||||||
|
|
||||||
<!-- <auto-complete-chip class="mat-form-field-full-width" placeholder="{{'DMP-EDITOR.FIELDS.ORGANISATIONS' | translate}}" [configuration]="organisationsAutoCompleteConfiguration"
|
<!-- <auto-complete-chip placeholder="{{'DMP-EDITOR.FIELDS.ORGANISATIONS' | translate}}" [configuration]="organisationsAutoCompleteConfiguration"
|
||||||
titleKey="name" [control]="formGroup.get('organisations')" [required]="true">
|
titleKey="name" [control]="formGroup.get('organisations')" [required]="true">
|
||||||
</auto-complete-chip> -->
|
</auto-complete-chip> -->
|
||||||
|
|
||||||
<td-chips color="accent" [items]="filteredOrganisations" formControlName="organisations" placeholder="{{'DMP-EDITOR.FIELDS.ORGANISATIONS' | translate}}"
|
<td-chips class="col-md-6" color="accent" [items]="filteredOrganisations" formControlName="organisations" placeholder="{{'DMP-EDITOR.FIELDS.ORGANISATIONS' | translate}}"
|
||||||
(inputChange)="filterOrganisations($event)" requireMatch>
|
(inputChange)="filterOrganisations($event)" requireMatch>
|
||||||
<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="filteringOrganisationsAsync" mode="indeterminate"></mat-progress-bar>
|
|
||||||
</td-chips>
|
|
||||||
|
|
||||||
<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>
|
|
||||||
<ng-template td-chip let-chip="chip">
|
<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>
|
<div class="tc-grey-100 bgc-teal-700" td-chip-avatar>{{chip.name.substring(0, 1).toUpperCase()}}</div>
|
||||||
{{chip.name}}
|
{{chip.name}}
|
||||||
</ng-template>
|
</ng-template>
|
||||||
<ng-template td-autocomplete-option let-option="option">
|
<ng-template td-autocomplete-option let-option="option">
|
||||||
<div layout="row" layout-align="start center">
|
<div>
|
||||||
{{option.name}}
|
{{option.name}}
|
||||||
</div>
|
</div>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
<mat-progress-bar [style.height.px]="2" *ngIf="filteringResearchersAsync" mode="indeterminate"></mat-progress-bar>
|
<mat-progress-bar [style.height.px]="2" *ngIf="filteringOrganisationsAsync" mode="indeterminate"></mat-progress-bar>
|
||||||
</td-chips>
|
</td-chips>
|
||||||
|
|
||||||
<button style="display:inline-block;" mat-icon-button type="button" (click)="addResearcher()">
|
<div class="col-md-6">
|
||||||
<mat-icon aria-label="Example icon-button with a heart icon">add_circle</mat-icon>
|
<td-chips style="margin-bottom:25px; display:inline-block; width:90%" color="accent" [items]="filteredResearchers" formControlName="researchers"
|
||||||
</button>
|
placeholder="{{'DMP-EDITOR.FIELDS.RESEARCHERS' | translate}}" (inputChange)="filterResearchers($event)" requireMatch>
|
||||||
|
<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>
|
||||||
|
{{option.name}}
|
||||||
|
</div>
|
||||||
|
</ng-template>
|
||||||
|
<mat-progress-bar [style.height.px]="2" *ngIf="filteringResearchersAsync" mode="indeterminate"></mat-progress-bar>
|
||||||
|
</td-chips>
|
||||||
|
|
||||||
|
<button style="display:inline-block;" mat-icon-button type="button" (click)="addResearcher()">
|
||||||
|
<mat-icon aria-label="Example icon-button with a heart icon">add_circle</mat-icon>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<h3 mat-subheader class="col-md-12">{{'DMP-EDITOR.FIELDS.PROFILE' | translate}}</h3>
|
||||||
|
|
||||||
|
<mat-form-field class="col-md-6">
|
||||||
|
<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>
|
||||||
|
<app-dynamic-dmp-field-resolver class="col-md-12" *ngIf="dataManagementPlan.definition" [formGroup]="formGroup" [dataManagementPlanProfile]="dataManagementPlan.definition"></app-dynamic-dmp-field-resolver>
|
||||||
|
|
||||||
|
<mat-form-field class="col-md-6">
|
||||||
|
<input matInput placeholder="Version" disabled [value]="formGroup.get('version').value== undefined ?0 :formGroup.get('version').value">
|
||||||
|
</mat-form-field>
|
||||||
|
|
||||||
|
|
||||||
|
<mat-list *ngIf="associatedUsers?.length" role="list" class="col-md-12">
|
||||||
|
<h3 mat-subheader>Associated Users</h3>
|
||||||
|
<mat-list-item role="listitem" *ngFor="let user of associatedUsers">
|
||||||
|
<mat-icon mat-list-icon>person</mat-icon>
|
||||||
|
<div>{{user.name}}</div>
|
||||||
|
</mat-list-item>
|
||||||
|
</mat-list>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="col-md-12">
|
||||||
|
<button mat-raised-button color="primary" (click)="cancel()" type="button">{{'DMP-EDITOR.ACTIONS.CANCEL' | translate}}</button>
|
||||||
|
<!-- <button *ngIf="!isNew" mat-raised-button color="primary" (click)="invite()" type="button">{{'DMP-EDITOR.ACTIONS.INVITE' | translate}}</button> -->
|
||||||
|
<button mat-raised-button color="primary" type="submit">{{'DMP-EDITOR.ACTIONS.SAVE' | translate}}</button>
|
||||||
|
<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>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<h3 mat-subheader>{{'DMP-EDITOR.FIELDS.PROFILE' | translate}}</h3>
|
|
||||||
|
|
||||||
<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>
|
|
||||||
<app-dynamic-dmp-field-resolver class="full-width" *ngIf="dataManagementPlan.definition" [formGroup]="formGroup" [dataManagementPlanProfile]="dataManagementPlan.definition"></app-dynamic-dmp-field-resolver>
|
|
||||||
|
|
||||||
<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>
|
|
||||||
|
|
||||||
|
|
||||||
<mat-list *ngIf="associatedUsers?.length" role="list">
|
|
||||||
<h3 mat-subheader>Associated Users</h3>
|
|
||||||
<mat-list-item role="listitem" *ngFor="let user of associatedUsers">
|
|
||||||
<mat-icon mat-list-icon>person</mat-icon>
|
|
||||||
<div>{{user.name}}</div>
|
|
||||||
</mat-list-item>
|
|
||||||
</mat-list>
|
|
||||||
|
|
||||||
|
|
||||||
<div layout="row" class="full-width text-right" align="end">
|
|
||||||
<button mat-raised-button color="primary" (click)="cancel()" type="button">{{'DMP-EDITOR.ACTIONS.CANCEL' | translate}}</button>
|
|
||||||
<!-- <button *ngIf="!isNew" mat-raised-button color="primary" (click)="invite()" type="button">{{'DMP-EDITOR.ACTIONS.INVITE' | translate}}</button> -->
|
|
||||||
<button mat-raised-button color="primary" type="submit">{{'DMP-EDITOR.ACTIONS.SAVE' | translate}}</button>
|
|
||||||
<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>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
</mat-card-content>
|
</mat-card-content>
|
||||||
</mat-card>
|
</mat-card>
|
||||||
</form>
|
</form>
|
||||||
|
|
|
@ -1,7 +1,3 @@
|
||||||
.full-width {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.input-table {
|
.input-table {
|
||||||
table-layout: fixed;
|
table-layout: fixed;
|
||||||
}
|
}
|
||||||
|
@ -11,12 +7,6 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.data-management-plan-editor {
|
.data-management-plan-editor {
|
||||||
.mat-form-field-full-width {
|
|
||||||
mat-form-field {
|
|
||||||
width: 100%;
|
|
||||||
padding: 3px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.fill-space {
|
.fill-space {
|
||||||
flex: 1 1 auto;
|
flex: 1 1 auto;
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,276 +35,276 @@ import { IBreadCrumbComponent } from "../../shared/components/breadcrumb/definit
|
||||||
import { BreadcrumbItem } from "../../shared/components/breadcrumb/definition/breadcrumb-item";
|
import { BreadcrumbItem } from "../../shared/components/breadcrumb/definition/breadcrumb-item";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-dmp-editor-component',
|
selector: 'app-dmp-editor-component',
|
||||||
templateUrl: 'dmp-editor.component.html',
|
templateUrl: 'dmp-editor.component.html',
|
||||||
styleUrls: ['./dmp-editor.component.scss'],
|
styleUrls: ['./dmp-editor.component.scss'],
|
||||||
encapsulation: ViewEncapsulation.None
|
encapsulation: ViewEncapsulation.None
|
||||||
})
|
})
|
||||||
export class DataManagementPlanEditorComponent implements AfterViewInit, IBreadCrumbComponent {
|
export class DataManagementPlanEditorComponent implements AfterViewInit, IBreadCrumbComponent {
|
||||||
|
|
||||||
|
|
||||||
breadCrumbs: Observable<BreadcrumbItem[]>;
|
breadCrumbs: Observable<BreadcrumbItem[]>;
|
||||||
isNew = true;
|
isNew = true;
|
||||||
textCtrl = new FormControl();
|
textCtrl = new FormControl();
|
||||||
dataManagementPlan: DataManagementPlanModel;
|
dataManagementPlan: DataManagementPlanModel;
|
||||||
formGroup: FormGroup = null;
|
formGroup: FormGroup = null;
|
||||||
|
|
||||||
filteringOrganisationsAsync: boolean = false;
|
filteringOrganisationsAsync: boolean = false;
|
||||||
filteringResearchersAsync: boolean = false;
|
filteringResearchersAsync: boolean = false;
|
||||||
filteredProfilesAsync: boolean = false;
|
filteredProfilesAsync: boolean = false;
|
||||||
filteredOrganisations: ExternalSourcesItemModel[];
|
filteredOrganisations: ExternalSourcesItemModel[];
|
||||||
filteredResearchers: ExternalSourcesItemModel[];
|
filteredResearchers: ExternalSourcesItemModel[];
|
||||||
filteredProfiles: DatasetProfileModel[];
|
filteredProfiles: DatasetProfileModel[];
|
||||||
|
|
||||||
projectAutoCompleteConfiguration: AutoCompleteConfiguration;
|
projectAutoCompleteConfiguration: AutoCompleteConfiguration;
|
||||||
organisationsAutoCompleteConfiguration: AutoCompleteChipConfiguration;
|
organisationsAutoCompleteConfiguration: AutoCompleteChipConfiguration;
|
||||||
createNewVersion;
|
createNewVersion;
|
||||||
associatedUsers: Array<DmpUsersModel>
|
associatedUsers: Array<DmpUsersModel>
|
||||||
filteredOptions: Observable<DataManagementPlanProfileListingModel>
|
filteredOptions: Observable<DataManagementPlanProfileListingModel>
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private dmpProfileService: DataManagementPlanProfileService,
|
private dmpProfileService: DataManagementPlanProfileService,
|
||||||
private dataManagementPlanService: DataManagementPlanService,
|
private dataManagementPlanService: DataManagementPlanService,
|
||||||
private projectService: ProjectService,
|
private projectService: ProjectService,
|
||||||
private externalSourcesService: ExternalSourcesService,
|
private externalSourcesService: ExternalSourcesService,
|
||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
public snackBar: MatSnackBar,
|
public snackBar: MatSnackBar,
|
||||||
public router: Router,
|
public router: Router,
|
||||||
public language: TranslateService,
|
public language: TranslateService,
|
||||||
private _service: DataManagementPlanService,
|
private _service: DataManagementPlanService,
|
||||||
public dialog: MatDialog,
|
public dialog: MatDialog,
|
||||||
private _dialogService: TdDialogService,
|
private _dialogService: TdDialogService,
|
||||||
private _viewContainerRef: ViewContainerRef,
|
private _viewContainerRef: ViewContainerRef,
|
||||||
private languageResolverService: LanguageResolverService
|
private languageResolverService: LanguageResolverService
|
||||||
) {
|
) {
|
||||||
this.filteredOptions = dmpProfileService.getAll({ criteria: new DataManagementPlanProfileCriteria() });
|
this.filteredOptions = dmpProfileService.getAll({ criteria: new DataManagementPlanProfileCriteria() });
|
||||||
}
|
}
|
||||||
|
|
||||||
ngAfterViewInit() {
|
ngAfterViewInit() {
|
||||||
this.route.params.subscribe((params: Params) => {
|
this.route.params.subscribe((params: Params) => {
|
||||||
const itemId = params['id'];
|
const itemId = params['id'];
|
||||||
|
|
||||||
let projectRequestItem: RequestItem<ProjectCriteria> = new RequestItem();
|
let projectRequestItem: RequestItem<ProjectCriteria> = new RequestItem();
|
||||||
projectRequestItem.criteria = new ProjectCriteria();
|
projectRequestItem.criteria = new ProjectCriteria();
|
||||||
let organisationRequestItem: RequestItem<BaseCriteria> = new RequestItem();
|
let organisationRequestItem: RequestItem<BaseCriteria> = new RequestItem();
|
||||||
organisationRequestItem.criteria = new BaseCriteria();
|
organisationRequestItem.criteria = new BaseCriteria();
|
||||||
this.projectAutoCompleteConfiguration = new AutoCompleteConfiguration(this.projectService.getWithExternal.bind(this.projectService), projectRequestItem);
|
this.projectAutoCompleteConfiguration = new AutoCompleteConfiguration(this.projectService.getWithExternal.bind(this.projectService), projectRequestItem);
|
||||||
this.organisationsAutoCompleteConfiguration = new AutoCompleteChipConfiguration(this.externalSourcesService.searchDMPOrganizations.bind(this.externalSourcesService), organisationRequestItem);
|
this.organisationsAutoCompleteConfiguration = new AutoCompleteChipConfiguration(this.externalSourcesService.searchDMPOrganizations.bind(this.externalSourcesService), organisationRequestItem);
|
||||||
|
|
||||||
if (itemId != null) {
|
if (itemId != null) {
|
||||||
this.isNew = false;
|
this.isNew = false;
|
||||||
this.dataManagementPlanService.getSingle(itemId).map(data => data as DataManagementPlanModel)
|
this.dataManagementPlanService.getSingle(itemId).map(data => data as DataManagementPlanModel)
|
||||||
.subscribe(async data => {
|
.subscribe(async data => {
|
||||||
this.dataManagementPlan = JsonSerializer.fromJSONObject(data, DataManagementPlanModel);
|
this.dataManagementPlan = JsonSerializer.fromJSONObject(data, DataManagementPlanModel);
|
||||||
this.formGroup = this.dataManagementPlan.buildForm();
|
this.formGroup = this.dataManagementPlan.buildForm();
|
||||||
if (this.formGroup.get("profile") && this.formGroup.get("profile").value) {
|
if (this.formGroup.get("profile") && this.formGroup.get("profile").value) {
|
||||||
this.textCtrl.patchValue(this.formGroup.get("profile").value);
|
this.textCtrl.patchValue(this.formGroup.get("profile").value);
|
||||||
}
|
}
|
||||||
this.breadCrumbs = Observable.of([
|
this.breadCrumbs = Observable.of([
|
||||||
{
|
{
|
||||||
parentComponentName: "DataManagementPlanListingComponent",
|
parentComponentName: "DataManagementPlanListingComponent",
|
||||||
label: 'DMPs',
|
label: 'DMPs',
|
||||||
url: "dmps",
|
url: "dmps",
|
||||||
notFoundResolver: [await this.projectService.getSingle(this.dataManagementPlan.project.id).map(x => ({ label: x.label, url: '/projects/edit/' + x.id }) as BreadcrumbItem).toPromise()]
|
notFoundResolver: [await this.projectService.getSingle(this.dataManagementPlan.project.id).map(x => ({ label: x.label, url: '/projects/edit/' + x.id }) as BreadcrumbItem).toPromise()]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
this.associatedUsers = data.associatedUsers;
|
this.associatedUsers = data.associatedUsers;
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
this.dataManagementPlan = new DataManagementPlanModel();
|
this.dataManagementPlan = new DataManagementPlanModel();
|
||||||
setTimeout(async () => {
|
setTimeout(async () => {
|
||||||
this.formGroup = this.dataManagementPlan.buildForm();
|
this.formGroup = this.dataManagementPlan.buildForm();
|
||||||
if (this.formGroup.get("profile") && this.formGroup.get("profile").value) {
|
if (this.formGroup.get("profile") && this.formGroup.get("profile").value) {
|
||||||
this.textCtrl.patchValue(this.formGroup.get("profile").value);
|
this.textCtrl.patchValue(this.formGroup.get("profile").value);
|
||||||
}
|
}
|
||||||
this.breadCrumbs = Observable.of([
|
this.breadCrumbs = Observable.of([
|
||||||
{
|
{
|
||||||
parentComponentName: "DataManagementPlanListingComponent",
|
parentComponentName: "DataManagementPlanListingComponent",
|
||||||
label: 'DMPs',
|
label: 'DMPs',
|
||||||
url: "dmps",
|
url: "dmps",
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
this.route
|
this.route
|
||||||
.queryParams
|
.queryParams
|
||||||
.subscribe(params => {
|
.subscribe(params => {
|
||||||
this.createNewVersion = params["clone"];
|
this.createNewVersion = params["clone"];
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
formSubmit(): void {
|
formSubmit(): void {
|
||||||
//this.touchAllFormFields(this.formGroup);
|
//this.touchAllFormFields(this.formGroup);
|
||||||
if (!this.isFormValid()) { return; }
|
if (!this.isFormValid()) { return; }
|
||||||
this.onSubmit();
|
this.onSubmit();
|
||||||
}
|
}
|
||||||
|
|
||||||
public isFormValid() {
|
public isFormValid() {
|
||||||
return this.formGroup.valid;
|
return this.formGroup.valid;
|
||||||
}
|
}
|
||||||
|
|
||||||
onSubmit(): void {
|
onSubmit(): void {
|
||||||
this.dataManagementPlanService.createDataManagementPlan(this.formGroup.value).subscribe(
|
this.dataManagementPlanService.createDataManagementPlan(this.formGroup.value).subscribe(
|
||||||
complete => this.onCallbackSuccess(),
|
complete => this.onCallbackSuccess(),
|
||||||
error => this.onCallbackError(error)
|
error => this.onCallbackError(error)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
onCallbackSuccess(): void {
|
onCallbackSuccess(): void {
|
||||||
this.snackBar.openFromComponent(SnackBarNotificationComponent, {
|
this.snackBar.openFromComponent(SnackBarNotificationComponent, {
|
||||||
data: { message: this.isNew ? 'GENERAL.SNACK-BAR.SUCCESSFUL-CREATION' : 'GENERAL.SNACK-BAR.SUCCESSFUL-UPDATE', language: this.language },
|
data: { message: this.isNew ? 'GENERAL.SNACK-BAR.SUCCESSFUL-CREATION' : 'GENERAL.SNACK-BAR.SUCCESSFUL-UPDATE', language: this.language },
|
||||||
duration: 3000,
|
duration: 3000,
|
||||||
})
|
})
|
||||||
this.router.navigate(['/dmps']);
|
this.router.navigate(['/dmps']);
|
||||||
}
|
}
|
||||||
|
|
||||||
onCallbackError(error: any) {
|
onCallbackError(error: any) {
|
||||||
this.setErrorModel(error.error);
|
this.setErrorModel(error.error);
|
||||||
//this.validateAllFormFields(this.formGroup);
|
//this.validateAllFormFields(this.formGroup);
|
||||||
}
|
}
|
||||||
|
|
||||||
public setErrorModel(errorModel: BaseErrorModel) {
|
public setErrorModel(errorModel: BaseErrorModel) {
|
||||||
Object.keys(errorModel).forEach(item => {
|
Object.keys(errorModel).forEach(item => {
|
||||||
(<any>this.dataManagementPlan.errorModel)[item] = (<any>errorModel)[item];
|
(<any>this.dataManagementPlan.errorModel)[item] = (<any>errorModel)[item];
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
public cancel(): void {
|
public cancel(): void {
|
||||||
this.router.navigate(['/dmps']);
|
this.router.navigate(['/dmps']);
|
||||||
}
|
}
|
||||||
|
|
||||||
public invite(): void {
|
public invite(): void {
|
||||||
this.router.navigate(['/invite/' + this.dataManagementPlan.id]);
|
this.router.navigate(['/invite/' + this.dataManagementPlan.id]);
|
||||||
}
|
}
|
||||||
|
|
||||||
filterOrganisations(value: string): void {
|
filterOrganisations(value: string): void {
|
||||||
|
|
||||||
this.filteredOrganisations = undefined;
|
this.filteredOrganisations = undefined;
|
||||||
if (value) {
|
if (value) {
|
||||||
this.filteringOrganisationsAsync = true;
|
this.filteringOrganisationsAsync = true;
|
||||||
|
|
||||||
this.externalSourcesService.searchDMPOrganizations(value).subscribe(items => {
|
this.externalSourcesService.searchDMPOrganizations(value).subscribe(items => {
|
||||||
this.filteredOrganisations = items;
|
this.filteredOrganisations = items;
|
||||||
this.filteringOrganisationsAsync = false;
|
this.filteringOrganisationsAsync = false;
|
||||||
|
|
||||||
// this.filteredOrganisations = items.filter((filteredObj: any) => {
|
// this.filteredOrganisations = items.filter((filteredObj: any) => {
|
||||||
// return this.objectsModel ? this.objectsModel.indexOf(filteredObj) < 0 : true;
|
// return this.objectsModel ? this.objectsModel.indexOf(filteredObj) < 0 : true;
|
||||||
// });
|
// });
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
filterResearchers(value: string): void {
|
filterResearchers(value: string): void {
|
||||||
|
|
||||||
this.filteredResearchers = undefined;
|
this.filteredResearchers = undefined;
|
||||||
if (value) {
|
if (value) {
|
||||||
this.filteringResearchersAsync = true;
|
this.filteringResearchersAsync = true;
|
||||||
|
|
||||||
this.externalSourcesService.searchDMPResearchers({ criteria: { name: value, like: null } }).subscribe(items => {
|
this.externalSourcesService.searchDMPResearchers({ criteria: { name: value, like: null } }).subscribe(items => {
|
||||||
this.filteredResearchers = items;
|
this.filteredResearchers = items;
|
||||||
this.filteringResearchersAsync = false;
|
this.filteringResearchersAsync = false;
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
filterProfiles(value: string): void {
|
filterProfiles(value: string): void {
|
||||||
|
|
||||||
this.filteredProfiles = undefined;
|
this.filteredProfiles = undefined;
|
||||||
if (value) {
|
if (value) {
|
||||||
this.filteredProfilesAsync = true;
|
this.filteredProfilesAsync = true;
|
||||||
|
|
||||||
const request = new RequestItem<DatasetProfileCriteria>();
|
const request = new RequestItem<DatasetProfileCriteria>();
|
||||||
let criteria = new DatasetProfileCriteria();
|
let criteria = new DatasetProfileCriteria();
|
||||||
criteria.like = value;
|
criteria.like = value;
|
||||||
request.criteria = criteria;
|
request.criteria = criteria;
|
||||||
this._service.searchDMPProfiles(request).subscribe(items => {
|
this._service.searchDMPProfiles(request).subscribe(items => {
|
||||||
this.filteredProfiles = items;
|
this.filteredProfiles = items;
|
||||||
this.filteredProfilesAsync = false;
|
this.filteredProfilesAsync = false;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
addResearcher(rowId: any, rowName: any) {
|
addResearcher(rowId: any, rowName: any) {
|
||||||
let dialogRef = this.dialog.open(AddResearchersComponent, {
|
let dialogRef = this.dialog.open(AddResearchersComponent, {
|
||||||
height: '255px',
|
height: '255px',
|
||||||
width: '700px',
|
width: '700px',
|
||||||
data: {
|
data: {
|
||||||
dmpId: rowId,
|
dmpId: rowId,
|
||||||
dmpName: rowName
|
dmpName: rowName
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
availableProfiles() {
|
availableProfiles() {
|
||||||
let dialogRef = this.dialog.open(AvailableProfilesComponent, {
|
let dialogRef = this.dialog.open(AvailableProfilesComponent, {
|
||||||
height: '355px',
|
height: '355px',
|
||||||
width: '700px',
|
width: '700px',
|
||||||
data: {
|
data: {
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
dialogRef.afterClosed().subscribe(result => {
|
dialogRef.afterClosed().subscribe(result => {
|
||||||
this.formGroup.get("profiles").setValue(result);
|
this.formGroup.get("profiles").setValue(result);
|
||||||
});
|
});
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
openConfirm(dmpLabel, id): void {
|
openConfirm(dmpLabel, id): void {
|
||||||
this._dialogService.openConfirm({
|
this._dialogService.openConfirm({
|
||||||
message: 'Are you sure you want to delete the "' + dmpLabel + '"',
|
message: 'Are you sure you want to delete the "' + dmpLabel + '"',
|
||||||
disableClose: true || false, // defaults to false
|
disableClose: true || false, // defaults to false
|
||||||
viewContainerRef: this._viewContainerRef, //OPTIONAL
|
viewContainerRef: this._viewContainerRef, //OPTIONAL
|
||||||
title: 'Confirm', //OPTIONAL, hides if not provided
|
title: 'Confirm', //OPTIONAL, hides if not provided
|
||||||
cancelButton: 'No', //OPTIONAL, defaults to 'CANCEL'
|
cancelButton: 'No', //OPTIONAL, defaults to 'CANCEL'
|
||||||
acceptButton: 'Yes' //OPTIONAL, defaults to 'ACCEPT'
|
acceptButton: 'Yes' //OPTIONAL, defaults to 'ACCEPT'
|
||||||
// width: '500px', //OPTIONAL, defaults to 400px
|
// width: '500px', //OPTIONAL, defaults to 400px
|
||||||
}).afterClosed().subscribe((accept: boolean) => {
|
}).afterClosed().subscribe((accept: boolean) => {
|
||||||
if (accept) {
|
if (accept) {
|
||||||
this.dataManagementPlanService.delete(id).subscribe(() => {
|
this.dataManagementPlanService.delete(id).subscribe(() => {
|
||||||
this.router.navigate(['/dmps'])
|
this.router.navigate(['/dmps'])
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
// DO SOMETHING ELSE
|
// DO SOMETHING ELSE
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
selectOption(option: any) {
|
selectOption(option: any) {
|
||||||
this.dataManagementPlan.definition = null;
|
this.dataManagementPlan.definition = null;
|
||||||
this.formGroup.get("profile").patchValue(option, { emitEvent: false })
|
this.formGroup.get("profile").patchValue(option, { emitEvent: false })
|
||||||
this.dmpProfileService.getSingle(option.id).subscribe(result => {
|
this.dmpProfileService.getSingle(option.id).subscribe(result => {
|
||||||
this.dataManagementPlan.definition = result.definition;
|
this.dataManagementPlan.definition = result.definition;
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
displayWith(item: any) {
|
displayWith(item: any) {
|
||||||
if (!item) return null;
|
if (!item) return null;
|
||||||
return item["label"];
|
return item["label"];
|
||||||
}
|
}
|
||||||
|
|
||||||
redirectToProject() {
|
redirectToProject() {
|
||||||
this.router.navigate(["projects/edit/" + this.dataManagementPlan.project.id])
|
this.router.navigate(["projects/edit/" + this.dataManagementPlan.project.id])
|
||||||
}
|
}
|
||||||
|
|
||||||
redirectToDatasets() {
|
redirectToDatasets() {
|
||||||
this.router.navigate(["datasets/dmp/" + this.dataManagementPlan.id])
|
this.router.navigate(["datasets/dmp/" + this.dataManagementPlan.id])
|
||||||
}
|
}
|
||||||
|
|
||||||
newVersion(id: String, label: String) {
|
newVersion(id: String, label: String) {
|
||||||
this.router.navigate(['/dmps/new_version/' + id, { dmpLabel: label }]);
|
this.router.navigate(['/dmps/new_version/' + id, { dmpLabel: label }]);
|
||||||
}
|
}
|
||||||
|
|
||||||
clone(id: String) {
|
clone(id: String) {
|
||||||
this.router.navigate(['/dmps/clone/' + id]);
|
this.router.navigate(['/dmps/clone/' + id]);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -77,10 +77,18 @@
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
<div class="col-md-12 text-right" align="end">
|
<div class="col-md-12">
|
||||||
<button mat-raised-button color="primary" (click)="cancel()" type="button">{{'PROJECT-EDITOR.ACTIONS.CANCEL' | translate}}</button>
|
<div class="row">
|
||||||
<button *ngIf="isNew || editMode" mat-raised-button color="primary" type="submit">{{'PROJECT-EDITOR.ACTIONS.SAVE' | translate}}</button>
|
<div class="col-auto">
|
||||||
<button *ngIf="!isNew && editMode" mat-raised-button color="primary" type="button" (click)="delete()">{{'PROJECT-EDITOR.ACTIONS.DELETE' | translate}}</button>
|
<button mat-raised-button color="primary" (click)="cancel()" type="button">{{'PROJECT-EDITOR.ACTIONS.CANCEL' | translate}}</button>
|
||||||
|
</div>
|
||||||
|
<div class="col-auto">
|
||||||
|
<button *ngIf="isNew || editMode" mat-raised-button color="primary" type="submit">{{'PROJECT-EDITOR.ACTIONS.SAVE' | translate}}</button>
|
||||||
|
</div>
|
||||||
|
<div class="col-auto">
|
||||||
|
<button *ngIf="!isNew && editMode" mat-raised-button color="primary" type="button" (click)="delete()">{{'PROJECT-EDITOR.ACTIONS.DELETE' | translate}}</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</mat-card-content>
|
</mat-card-content>
|
||||||
|
|
|
@ -1,65 +1,68 @@
|
||||||
<div>
|
<div>
|
||||||
<h3>{{languageResolverService.getBy('listingTitle') | translate}}</h3>
|
<h3>{{languageResolverService.getBy('listingTitle') | translate}}</h3>
|
||||||
|
|
||||||
<app-projects-criteria-component></app-projects-criteria-component>
|
|
||||||
<mat-card class="mat-card">
|
<mat-card class="mat-card">
|
||||||
<mat-card-header>
|
<mat-card-header>
|
||||||
<mat-progress-bar *ngIf="dataSource?.isLoadingResults" mode="query"></mat-progress-bar>
|
<!-- <mat-progress-bar *ngIf="dataSource?.isLoadingResults" mode="query"></mat-progress-bar> -->
|
||||||
</mat-card-header>
|
</mat-card-header>
|
||||||
|
<mat-card-content>
|
||||||
|
<div class="row">
|
||||||
|
<app-projects-criteria-component class="col-md-12"></app-projects-criteria-component>
|
||||||
|
<mat-table class="col-md-12" [dataSource]="dataSource" matSort (matSortChange)="refresh()">
|
||||||
|
|
||||||
<mat-table [dataSource]="dataSource" matSort (matSortChange)="refresh()">
|
<ng-container cdkColumnDef="avatar">
|
||||||
|
<mat-header-cell *matHeaderCellDef mat-sort-header="avatar">{{'PROJECT-LISTING.COLUMNS.AVATAR' | translate}}</mat-header-cell>
|
||||||
|
<mat-cell *matCellDef="let row">
|
||||||
|
<img mat-card-avatar [src]="host+'files/'+row.files[0].id+'?location='+row.files[0].location+'&type='+row.files[0].type">
|
||||||
|
</mat-cell>
|
||||||
|
</ng-container>
|
||||||
|
<!-- Column Definition: Name -->
|
||||||
|
<ng-container cdkColumnDef="name">
|
||||||
|
<mat-header-cell *matHeaderCellDef mat-sort-header="label">{{'PROJECT-LISTING.COLUMNS.NAME' | translate}}</mat-header-cell>
|
||||||
|
<mat-cell *matCellDef="let row">{{row.label}}</mat-cell>
|
||||||
|
</ng-container>
|
||||||
|
|
||||||
<ng-container cdkColumnDef="avatar">
|
<!-- Column Definition: Αbbreviation -->
|
||||||
<mat-header-cell *matHeaderCellDef mat-sort-header="avatar">{{'PROJECT-LISTING.COLUMNS.AVATAR' | translate}}</mat-header-cell>
|
<ng-container cdkColumnDef="abbreviation">
|
||||||
<mat-cell *matCellDef="let row">
|
<mat-header-cell *matHeaderCellDef mat-sort-header="abbreviation">{{'PROJECT-LISTING.COLUMNS.ABBREVIATION' | translate}}</mat-header-cell>
|
||||||
<img mat-card-avatar [src]="host+'files/'+row.files[0].id+'?location='+row.files[0].location+'&type='+row.files[0].type">
|
<mat-cell *matCellDef="let row"> {{row.abbreviation}} </mat-cell>
|
||||||
</mat-cell>
|
</ng-container>
|
||||||
</ng-container>
|
|
||||||
<!-- Column Definition: Name -->
|
|
||||||
<ng-container cdkColumnDef="name">
|
|
||||||
<mat-header-cell *matHeaderCellDef mat-sort-header="label">{{'PROJECT-LISTING.COLUMNS.NAME' | translate}}</mat-header-cell>
|
|
||||||
<mat-cell *matCellDef="let row">{{row.label}}</mat-cell>
|
|
||||||
</ng-container>
|
|
||||||
|
|
||||||
<!-- Column Definition: Αbbreviation -->
|
<!-- Column Definition: Start -->
|
||||||
<ng-container cdkColumnDef="abbreviation">
|
<ng-container cdkColumnDef="start">
|
||||||
<mat-header-cell *matHeaderCellDef mat-sort-header="abbreviation">{{'PROJECT-LISTING.COLUMNS.ABBREVIATION' | translate}}</mat-header-cell>
|
<mat-header-cell *matHeaderCellDef mat-sort-header="startdate">{{'PROJECT-LISTING.COLUMNS.START' | translate}}</mat-header-cell>
|
||||||
<mat-cell *matCellDef="let row"> {{row.abbreviation}} </mat-cell>
|
<mat-cell *matCellDef="let row"> {{row.startDate | date:'shortDate'}} </mat-cell>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
<!-- Column Definition: Start -->
|
<!-- Column Definition: End -->
|
||||||
<ng-container cdkColumnDef="start">
|
<ng-container cdkColumnDef="end">
|
||||||
<mat-header-cell *matHeaderCellDef mat-sort-header="startdate">{{'PROJECT-LISTING.COLUMNS.START' | translate}}</mat-header-cell>
|
<mat-header-cell *matHeaderCellDef mat-sort-header="enddate">{{'PROJECT-LISTING.COLUMNS.END' | translate}}</mat-header-cell>
|
||||||
<mat-cell *matCellDef="let row"> {{row.startDate | date:'shortDate'}} </mat-cell>
|
<mat-cell *matCellDef="let row"> {{row.endDate | date:'shortDate'}} </mat-cell>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
<!-- Column Definition: End -->
|
<!-- Column Definition: End -->
|
||||||
<ng-container cdkColumnDef="end">
|
<ng-container cdkColumnDef="dmps">
|
||||||
<mat-header-cell *matHeaderCellDef mat-sort-header="enddate">{{'PROJECT-LISTING.COLUMNS.END' | translate}}</mat-header-cell>
|
<mat-header-cell *matHeaderCellDef>{{'PROJECT-LISTING.COLUMNS.DMPS' | translate}}</mat-header-cell>
|
||||||
<mat-cell *matCellDef="let row"> {{row.endDate | date:'shortDate'}} </mat-cell>
|
<mat-cell *matCellDef="let row" (click)="$event.stopPropagation()">
|
||||||
</ng-container>
|
<app-url-listing [items]="row.dmps" [urlLimit]="5" [parameters]="{ projectLabel: row.label }"></app-url-listing>
|
||||||
|
</mat-cell>
|
||||||
<!-- Column Definition: End -->
|
</ng-container>
|
||||||
<ng-container cdkColumnDef="dmps">
|
|
||||||
<mat-header-cell *matHeaderCellDef>{{'PROJECT-LISTING.COLUMNS.DMPS' | translate}}</mat-header-cell>
|
|
||||||
<mat-cell *matCellDef="let row" (click)="$event.stopPropagation()">
|
|
||||||
<app-url-listing [items]="row.dmps" [urlLimit]="5" [parameters]="{ projectLabel: row.label }"></app-url-listing>
|
|
||||||
</mat-cell>
|
|
||||||
</ng-container>
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Column Definition: Submission Time -->
|
<!-- Column Definition: Submission Time -->
|
||||||
<!-- <ng-container cdkColumnDef="actions">
|
<!-- <ng-container cdkColumnDef="actions">
|
||||||
<mat-header-cell *matHeaderCellDef>{{'PROJECT-LISTING.COLUMNS.ACTIONS' | translate}}</mat-header-cell>
|
<mat-header-cell *matHeaderCellDef>{{'PROJECT-LISTING.COLUMNS.ACTIONS' | translate}}</mat-header-cell>
|
||||||
<mat-cell *matCellDef="let row"></mat-cell>
|
<mat-cell *matCellDef="let row"></mat-cell>
|
||||||
</ng-container> -->
|
</ng-container> -->
|
||||||
|
|
||||||
<mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>
|
<mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>
|
||||||
<mat-row *matRowDef="let row; columns: displayedColumns" (click)="rowClick(row.id)"></mat-row>
|
<mat-row *matRowDef="let row; columns: displayedColumns" (click)="rowClick(row.id)"></mat-row>
|
||||||
|
|
||||||
</mat-table>
|
</mat-table>
|
||||||
<mat-paginator #paginator [length]="dataSource?.totalCount" [pageSizeOptions]="[10, 25, 100]">
|
<mat-paginator #paginator [length]="dataSource?.totalCount" [pageSizeOptions]="[10, 25, 100]">
|
||||||
</mat-paginator>
|
</mat-paginator>
|
||||||
|
</div>
|
||||||
|
</mat-card-content>
|
||||||
</mat-card>
|
</mat-card>
|
||||||
|
|
||||||
<button mat-fab class="mat-fab-bottom-right" color="primary" [routerLink]=" ['./new'] ">
|
<button mat-fab class="mat-fab-bottom-right" color="primary" [routerLink]=" ['./new'] ">
|
||||||
|
|
|
@ -1,34 +1,31 @@
|
||||||
.mat-table {
|
h3 {
|
||||||
margin: 24px;
|
margin-top: 0px;
|
||||||
}
|
}
|
||||||
|
|
||||||
h3{
|
.mat-fab-bottom-right {
|
||||||
margin-top: 0px;
|
top: auto !important;
|
||||||
}
|
right: 20px !important;
|
||||||
.mat-fab-bottom-right {
|
bottom: 10px !important;
|
||||||
top: auto !important;
|
left: auto !important;
|
||||||
right: 20px !important;
|
position: fixed !important;
|
||||||
bottom: 10px !important;
|
}
|
||||||
left: auto !important;
|
|
||||||
position: fixed !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.full-width {
|
.full-width {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mat-card {
|
.mat-card {
|
||||||
margin: 16px 0;
|
margin: 16px 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mat-row {
|
.mat-row {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
mat-row:hover {
|
mat-row:hover {
|
||||||
background-color: lightgray;
|
background-color: lightgray;
|
||||||
}
|
}
|
||||||
|
|
||||||
mat-row:nth-child(odd){
|
mat-row:nth-child(odd) {
|
||||||
background-color:#eef0fb;
|
background-color: #eef0fb;
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
</mat-autocomplete>
|
</mat-autocomplete>
|
||||||
</div> -->
|
</div> -->
|
||||||
|
|
||||||
<mat-form-field>
|
<mat-form-field class="autocomplete-input">
|
||||||
<input matInput [matAutocomplete]="auto" [formControl]="control" placeholder="{{placeholder}}" [required]="required">
|
<input matInput [matAutocomplete]="auto" [formControl]="control" placeholder="{{placeholder}}" [required]="required">
|
||||||
<mat-error *ngIf="control['errors'] && control['errors']['required']">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
|
<mat-error *ngIf="control['errors'] && control['errors']['required']">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
|
||||||
<mat-progress-spinner matSuffix mode="indeterminate" *ngIf="loading" [diameter]="22"></mat-progress-spinner>
|
<mat-progress-spinner matSuffix mode="indeterminate" *ngIf="loading" [diameter]="22"></mat-progress-spinner>
|
||||||
|
|
|
@ -1,37 +1,23 @@
|
||||||
<div class="project-criteria">
|
<div class="row">
|
||||||
<mat-card class="mat-card">
|
<!-- <h4 class="col-md-12">{{'CRITERIA.FILTERS'| translate}}</h4> -->
|
||||||
<mat-card-header>
|
<mat-form-field class="col-md-4">
|
||||||
<mat-card-title>
|
<input matInput placeholder=" {{'CRITERIA.PROJECTS.LIKE'| translate}}" name="projectCriteriaLike" [(ngModel)]="criteria.like"
|
||||||
<h4>{{'CRITERIA.FILTERS'| translate}}</h4>
|
(ngModelChange)="controlModified()">
|
||||||
</mat-card-title>
|
<mat-error *ngIf="baseErrorModel?.like">{{baseErrorModel['criteria.like']}}</mat-error>
|
||||||
</mat-card-header>
|
</mat-form-field>
|
||||||
<div class="row">
|
<mat-form-field class="col-md-4">
|
||||||
<div class="col-md-4">
|
<input matInput (focus)="periodStartPicker.open()" (click)="periodStartPicker.open()" placeholder=" {{this.languageResolver.getBy('criteriaStart')| translate}}"
|
||||||
<mat-form-field>
|
[matDatepicker]="periodStartPicker" name="projectCriteriaPeriodStart" [(ngModel)]="criteria.periodStart" (ngModelChange)="controlModified()">
|
||||||
<input matInput placeholder=" {{'CRITERIA.PROJECTS.LIKE'| translate}}" name="projectCriteriaLike" [(ngModel)]="criteria.like"
|
<mat-datepicker-toggle matSuffix [for]="periodStartPicker"></mat-datepicker-toggle>
|
||||||
(ngModelChange)="controlModified()">
|
<mat-datepicker #periodStartPicker></mat-datepicker>
|
||||||
<mat-error *ngIf="baseErrorModel?.like">{{baseErrorModel['criteria.like']}}</mat-error>
|
</mat-form-field>
|
||||||
</mat-form-field>
|
<mat-error *ngIf="baseErrorModel['criteria.periodStart']">{{baseErrorModel['criteria.periodStart']}}</mat-error>
|
||||||
</div>
|
|
||||||
<div class="col-md-4">
|
|
||||||
<mat-form-field>
|
|
||||||
<input matInput (focus)="periodStartPicker.open()" (click)="periodStartPicker.open()" placeholder=" {{this.languageResolver.getBy('criteriaStart')| translate}}"
|
|
||||||
[matDatepicker]="periodStartPicker" name="projectCriteriaPeriodStart" [(ngModel)]="criteria.periodStart" (ngModelChange)="controlModified()">
|
|
||||||
<mat-datepicker-toggle matSuffix [for]="periodStartPicker"></mat-datepicker-toggle>
|
|
||||||
<mat-datepicker #periodStartPicker></mat-datepicker>
|
|
||||||
</mat-form-field>
|
|
||||||
<mat-error *ngIf="baseErrorModel['criteria.periodStart']">{{baseErrorModel['criteria.periodStart']}}</mat-error>
|
|
||||||
|
|
||||||
</div>
|
<mat-form-field class="col-md-4">
|
||||||
<div class="col-md-4">
|
<input matInput (focus)="periodEndPicker.open()" (click)="periodEndPicker.open()" name="projectCriteriaPeriodEnd" placeholder=" {{this.languageResolver.getBy('criteriaEnd')| translate}}"
|
||||||
<mat-form-field>
|
[matDatepicker]="periodEndPicker" [(ngModel)]="criteria.periodEnd" (ngModelChange)="controlModified()">
|
||||||
<input matInput (focus)="periodEndPicker.open()" (click)="periodEndPicker.open()" name="projectCriteriaPeriodEnd" placeholder=" {{this.languageResolver.getBy('criteriaEnd')| translate}}"
|
<mat-error *ngIf="baseErrorModel['criteria.periodEnd']">{{baseErrorModel['criteria.periodEnd']}}</mat-error>
|
||||||
[matDatepicker]="periodEndPicker" [(ngModel)]="criteria.periodEnd" (ngModelChange)="controlModified()">
|
<mat-datepicker-toggle matSuffix [for]="periodEndPicker"></mat-datepicker-toggle>
|
||||||
<mat-error *ngIf="baseErrorModel['criteria.periodEnd']">{{baseErrorModel['criteria.periodEnd']}}</mat-error>
|
<mat-datepicker #periodEndPicker></mat-datepicker>
|
||||||
<mat-datepicker-toggle matSuffix [for]="periodEndPicker"></mat-datepicker-toggle>
|
</mat-form-field>
|
||||||
<mat-datepicker #periodEndPicker></mat-datepicker>
|
|
||||||
</mat-form-field>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</mat-card>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,10 +0,0 @@
|
||||||
.project-criteria {
|
|
||||||
mat-form-field {
|
|
||||||
padding-bottom: 5px;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
mat-card {
|
|
||||||
padding-bottom: 0px;
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in New Issue