From 518a2ffd3ccd48032b639af8d2fb6902527d2e33 Mon Sep 17 00:00:00 2001 From: "CITE\\dtziotzios" Date: Tue, 24 Jul 2018 10:58:55 +0300 Subject: [PATCH] no message --- dmp-frontend/src/app/app-routing.module.ts | 214 ++++----- .../app/dmps/editor/dmp-editor.component.html | 203 ++++---- .../app/dmps/editor/dmp-editor.component.scss | 10 - .../app/dmps/editor/dmp-editor.component.ts | 452 +++++++++--------- .../editor/project-editor.component.html | 16 +- .../listing/project-listing.component.html | 91 ++-- .../listing/project-listing.component.scss | 53 +- .../autocomplete/autocomplete.component.html | 2 +- .../projects/projects-criteria.component.html | 56 +-- .../projects/projects-criteria.component.scss | 10 - 10 files changed, 537 insertions(+), 570 deletions(-) diff --git a/dmp-frontend/src/app/app-routing.module.ts b/dmp-frontend/src/app/app-routing.module.ts index 7fd32336b..a767b1eb3 100644 --- a/dmp-frontend/src/app/app-routing.module.ts +++ b/dmp-frontend/src/app/app-routing.module.ts @@ -1,122 +1,120 @@ -import { UnauthorizedComponent } from './unauthorized/unauthorized.component'; import { NgModule } from '@angular/core'; import { RouterModule, Routes } from '@angular/router'; import { HomepageComponent } from './homepage/homepage.component'; import { AuthGuard } from './shared/guards/auth.guard'; -import { LoginComponent } from './user-management/login/login.component'; import { WelcomepageComponent } from './welcomepage/welcomepage.component'; import { B2AccessLoginComponent } from './user-management/login/b2access/b2access-login.component'; const appRoutes: Routes = [ - { - path: 'datasets', - loadChildren: './datasets/dataset.module#DatasetModule', - data: { - breadcrumb: true - }, - canActivate: [AuthGuard] - }, - { - path: 'about', - loadChildren: './about/about.module#AboutModule', - data: { - breadcrumb: true - }, - canActivate: [AuthGuard] - }, - { - path: 'projects', - loadChildren: './projects/projects.module#ProjectsModule', - data: { - breadcrumb: true - }, - canActivate: [AuthGuard] - }, - { - path: "dmps", - loadChildren: './dmps/dmps.module#DataManagementPlanModule', - data: { - breadcrumb: true - }, - canActivate: [AuthGuard] - }, - { - path: "dmp-profiles", - loadChildren: './dmp-profiles/dmp-profile.module#DataManagamentPlanProfileModule', - data: { - breadcrumb: true - }, - canActivate: [AuthGuard] - }, - { - path: 'form', - loadChildren: './dataset-profile-form/dataset-profile.module#DatasetProfileModule', - data: { - breadcrumb: true - }, - canActivate: [AuthGuard] - }, - { - path: 'home', - component: HomepageComponent, - data: { - breadcrumb: false - }, - canActivate: [AuthGuard] - }, - { - path: '', - redirectTo: '/welcome', - data: { - breadcrumbs: false - }, - pathMatch: 'full' - }, - { - path: "unauthorized", - loadChildren: './unauthorized/unauthorized.module#UnauthorizedModule', - data: { - breadcrumb: true - }, - }, - { - path: "users", - loadChildren: './users/users.module#UsersModule' - }, - { - path: "datasetsProfiles", - loadChildren: './datasets-admin-listing/dataset-admin.module#DatasetAdminModule', - data: { - breadcrumb: true - }, - }, - { - path: "welcome", - component: WelcomepageComponent, - data: { - breadcrumb: false - }, - }, - { - path: "api/oauth/authorized/b2access", - component: B2AccessLoginComponent, - data: { - }, - } + { + path: 'datasets', + loadChildren: './datasets/dataset.module#DatasetModule', + data: { + breadcrumb: true + }, + canActivate: [AuthGuard] + }, + { + path: 'about', + loadChildren: './about/about.module#AboutModule', + data: { + breadcrumb: true + }, + canActivate: [AuthGuard] + }, + { + path: 'projects', + loadChildren: './projects/projects.module#ProjectsModule', + data: { + breadcrumb: true + }, + canActivate: [AuthGuard] + }, + { + path: "dmps", + loadChildren: './dmps/dmps.module#DataManagementPlanModule', + data: { + breadcrumb: true + }, + canActivate: [AuthGuard] + }, + { + path: "dmp-profiles", + loadChildren: './dmp-profiles/dmp-profile.module#DataManagamentPlanProfileModule', + data: { + breadcrumb: true + }, + canActivate: [AuthGuard] + }, + { + path: 'form', + loadChildren: './dataset-profile-form/dataset-profile.module#DatasetProfileModule', + data: { + breadcrumb: true + }, + canActivate: [AuthGuard] + }, + { + path: 'home', + component: HomepageComponent, + data: { + breadcrumb: false + }, + canActivate: [AuthGuard] + }, + { + path: '', + redirectTo: '/welcome', + data: { + breadcrumbs: false + }, + pathMatch: 'full' + }, + { + path: "unauthorized", + loadChildren: './unauthorized/unauthorized.module#UnauthorizedModule', + data: { + breadcrumb: true + }, + }, + { + path: "users", + loadChildren: './users/users.module#UsersModule' + }, + { + path: "datasetsProfiles", + loadChildren: './datasets-admin-listing/dataset-admin.module#DatasetAdminModule', + data: { + breadcrumb: true + }, + }, + { + path: "welcome", + component: WelcomepageComponent, + data: { + breadcrumb: false + }, + }, + { + path: "api/oauth/authorized/b2access", + component: B2AccessLoginComponent, + data: { + }, + } ]; @NgModule({ - imports: [ - RouterModule.forRoot( - appRoutes - , { - useHash: false - } - ) - ], - exports: [ - RouterModule - ] + imports: [ + RouterModule.forRoot( + appRoutes + , { + useHash: false + } + ) + ], + exports: [ + RouterModule + ] }) export class AppRoutingModule { } diff --git a/dmp-frontend/src/app/dmps/editor/dmp-editor.component.html b/dmp-frontend/src/app/dmps/editor/dmp-editor.component.html index 493dd281d..8eb65f4e3 100644 --- a/dmp-frontend/src/app/dmps/editor/dmp-editor.component.html +++ b/dmp-frontend/src/app/dmps/editor/dmp-editor.component.html @@ -1,150 +1,145 @@
- + {{'DMP-EDITOR.TITLE.NEW' | translate}} + +

{{formGroup?.get('label')?.value}}

+
- - - - {{'DMP-EDITOR.TITLE.NEW' | translate}} - -

{{formGroup.get('label').value}}

-
-
+
-
+
- -
-
- - - {{baseErrorModel.label}} - {{'GENERAL.VALIDATION.REQUIRED' | translate}} - +
+ + + {{baseErrorModel.label}} + {{'GENERAL.VALIDATION.REQUIRED' | translate}} + - - - {{errorModel.description}} - {{'GENERAL.VALIDATION.REQUIRED' | translate}} - + + + {{errorModel.description}} + {{'GENERAL.VALIDATION.REQUIRED' | translate}} + - - + + - + - - -
{{chip.label.substring(0, 1).toUpperCase()}}
- {{chip.label}} -
- -
- {{option.label}} -
-
- - - {{'GENERAL.VALIDATION.REQUIRED' | translate}} - -
- - View All + + +
{{chip.label.substring(0, 1).toUpperCase()}}
+ {{chip.label}} +
+ +
+ {{option.label}} +
+
+ + + {{'GENERAL.VALIDATION.REQUIRED' | translate}} + +
+ + View All - - - -
{{chip.name.substring(0, 1).toUpperCase()}}
- {{chip.name}} -
- -
- {{option.name}} -
-
- -
- -
- +
{{chip.name.substring(0, 1).toUpperCase()}}
{{chip.name}}
-
+
{{option.name}}
- + - +
+ + +
{{chip.name.substring(0, 1).toUpperCase()}}
+ {{chip.name}} +
+ +
+ {{option.name}} +
+
+ +
+ + +
+ +

{{'DMP-EDITOR.FIELDS.PROFILE' | translate}}

+ + + + + + {{ option.label }} + + + + + + + + + + + +

Associated Users

+ + person +
{{user.name}}
+
+
+ + +
+ + + + +
- -

{{'DMP-EDITOR.FIELDS.PROFILE' | translate}}

- - - - - - {{ option.label }} - - - - - - - - - - - -

Associated Users

- - person -
{{user.name}}
-
-
- - -
- - - - -
- - diff --git a/dmp-frontend/src/app/dmps/editor/dmp-editor.component.scss b/dmp-frontend/src/app/dmps/editor/dmp-editor.component.scss index b90ca0dab..f767e8175 100644 --- a/dmp-frontend/src/app/dmps/editor/dmp-editor.component.scss +++ b/dmp-frontend/src/app/dmps/editor/dmp-editor.component.scss @@ -1,7 +1,3 @@ -.full-width { - width: 100%; -} - .input-table { table-layout: fixed; } @@ -11,12 +7,6 @@ } .data-management-plan-editor { - .mat-form-field-full-width { - mat-form-field { - width: 100%; - padding: 3px; - } - } .fill-space { flex: 1 1 auto; } diff --git a/dmp-frontend/src/app/dmps/editor/dmp-editor.component.ts b/dmp-frontend/src/app/dmps/editor/dmp-editor.component.ts index e38bdba4e..a9d0e24c1 100644 --- a/dmp-frontend/src/app/dmps/editor/dmp-editor.component.ts +++ b/dmp-frontend/src/app/dmps/editor/dmp-editor.component.ts @@ -35,276 +35,276 @@ import { IBreadCrumbComponent } from "../../shared/components/breadcrumb/definit import { BreadcrumbItem } from "../../shared/components/breadcrumb/definition/breadcrumb-item"; @Component({ - selector: 'app-dmp-editor-component', - templateUrl: 'dmp-editor.component.html', - styleUrls: ['./dmp-editor.component.scss'], - encapsulation: ViewEncapsulation.None + selector: 'app-dmp-editor-component', + templateUrl: 'dmp-editor.component.html', + styleUrls: ['./dmp-editor.component.scss'], + encapsulation: ViewEncapsulation.None }) export class DataManagementPlanEditorComponent implements AfterViewInit, IBreadCrumbComponent { - breadCrumbs: Observable; - isNew = true; - textCtrl = new FormControl(); - dataManagementPlan: DataManagementPlanModel; - formGroup: FormGroup = null; + breadCrumbs: Observable; + isNew = true; + textCtrl = new FormControl(); + dataManagementPlan: DataManagementPlanModel; + formGroup: FormGroup = null; - filteringOrganisationsAsync: boolean = false; - filteringResearchersAsync: boolean = false; - filteredProfilesAsync: boolean = false; - filteredOrganisations: ExternalSourcesItemModel[]; - filteredResearchers: ExternalSourcesItemModel[]; - filteredProfiles: DatasetProfileModel[]; + filteringOrganisationsAsync: boolean = false; + filteringResearchersAsync: boolean = false; + filteredProfilesAsync: boolean = false; + filteredOrganisations: ExternalSourcesItemModel[]; + filteredResearchers: ExternalSourcesItemModel[]; + filteredProfiles: DatasetProfileModel[]; - projectAutoCompleteConfiguration: AutoCompleteConfiguration; - organisationsAutoCompleteConfiguration: AutoCompleteChipConfiguration; - createNewVersion; - associatedUsers: Array - filteredOptions: Observable + projectAutoCompleteConfiguration: AutoCompleteConfiguration; + organisationsAutoCompleteConfiguration: AutoCompleteChipConfiguration; + createNewVersion; + associatedUsers: Array + filteredOptions: Observable - constructor( - private dmpProfileService: DataManagementPlanProfileService, - private dataManagementPlanService: DataManagementPlanService, - private projectService: ProjectService, - private externalSourcesService: ExternalSourcesService, - private route: ActivatedRoute, - public snackBar: MatSnackBar, - public router: Router, - public language: TranslateService, - private _service: DataManagementPlanService, - public dialog: MatDialog, - private _dialogService: TdDialogService, - private _viewContainerRef: ViewContainerRef, - private languageResolverService: LanguageResolverService - ) { - this.filteredOptions = dmpProfileService.getAll({ criteria: new DataManagementPlanProfileCriteria() }); - } + constructor( + private dmpProfileService: DataManagementPlanProfileService, + private dataManagementPlanService: DataManagementPlanService, + private projectService: ProjectService, + private externalSourcesService: ExternalSourcesService, + private route: ActivatedRoute, + public snackBar: MatSnackBar, + public router: Router, + public language: TranslateService, + private _service: DataManagementPlanService, + public dialog: MatDialog, + private _dialogService: TdDialogService, + private _viewContainerRef: ViewContainerRef, + private languageResolverService: LanguageResolverService + ) { + this.filteredOptions = dmpProfileService.getAll({ criteria: new DataManagementPlanProfileCriteria() }); + } - ngAfterViewInit() { - this.route.params.subscribe((params: Params) => { - const itemId = params['id']; + ngAfterViewInit() { + this.route.params.subscribe((params: Params) => { + const itemId = params['id']; - let projectRequestItem: RequestItem = new RequestItem(); - projectRequestItem.criteria = new ProjectCriteria(); - let organisationRequestItem: RequestItem = new RequestItem(); - organisationRequestItem.criteria = new BaseCriteria(); - this.projectAutoCompleteConfiguration = new AutoCompleteConfiguration(this.projectService.getWithExternal.bind(this.projectService), projectRequestItem); - this.organisationsAutoCompleteConfiguration = new AutoCompleteChipConfiguration(this.externalSourcesService.searchDMPOrganizations.bind(this.externalSourcesService), organisationRequestItem); + let projectRequestItem: RequestItem = new RequestItem(); + projectRequestItem.criteria = new ProjectCriteria(); + let organisationRequestItem: RequestItem = new RequestItem(); + organisationRequestItem.criteria = new BaseCriteria(); + this.projectAutoCompleteConfiguration = new AutoCompleteConfiguration(this.projectService.getWithExternal.bind(this.projectService), projectRequestItem); + this.organisationsAutoCompleteConfiguration = new AutoCompleteChipConfiguration(this.externalSourcesService.searchDMPOrganizations.bind(this.externalSourcesService), organisationRequestItem); - if (itemId != null) { - this.isNew = false; - this.dataManagementPlanService.getSingle(itemId).map(data => data as DataManagementPlanModel) - .subscribe(async data => { - this.dataManagementPlan = JsonSerializer.fromJSONObject(data, DataManagementPlanModel); - this.formGroup = this.dataManagementPlan.buildForm(); - if (this.formGroup.get("profile") && this.formGroup.get("profile").value) { - this.textCtrl.patchValue(this.formGroup.get("profile").value); - } - this.breadCrumbs = Observable.of([ - { - parentComponentName: "DataManagementPlanListingComponent", - label: '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()] - } - ] - ) - this.associatedUsers = data.associatedUsers; - }); - } else { - this.dataManagementPlan = new DataManagementPlanModel(); - setTimeout(async () => { - this.formGroup = this.dataManagementPlan.buildForm(); - if (this.formGroup.get("profile") && this.formGroup.get("profile").value) { - this.textCtrl.patchValue(this.formGroup.get("profile").value); - } - this.breadCrumbs = Observable.of([ - { - parentComponentName: "DataManagementPlanListingComponent", - label: 'DMPs', - url: "dmps", - } - ]) - }); - } + if (itemId != null) { + this.isNew = false; + this.dataManagementPlanService.getSingle(itemId).map(data => data as DataManagementPlanModel) + .subscribe(async data => { + this.dataManagementPlan = JsonSerializer.fromJSONObject(data, DataManagementPlanModel); + this.formGroup = this.dataManagementPlan.buildForm(); + if (this.formGroup.get("profile") && this.formGroup.get("profile").value) { + this.textCtrl.patchValue(this.formGroup.get("profile").value); + } + this.breadCrumbs = Observable.of([ + { + parentComponentName: "DataManagementPlanListingComponent", + label: '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()] + } + ] + ) + this.associatedUsers = data.associatedUsers; + }); + } else { + this.dataManagementPlan = new DataManagementPlanModel(); + setTimeout(async () => { + this.formGroup = this.dataManagementPlan.buildForm(); + if (this.formGroup.get("profile") && this.formGroup.get("profile").value) { + this.textCtrl.patchValue(this.formGroup.get("profile").value); + } + this.breadCrumbs = Observable.of([ + { + parentComponentName: "DataManagementPlanListingComponent", + label: 'DMPs', + url: "dmps", + } + ]) + }); + } - }); - this.route - .queryParams - .subscribe(params => { - this.createNewVersion = params["clone"]; - }); - } + }); + this.route + .queryParams + .subscribe(params => { + this.createNewVersion = params["clone"]; + }); + } - formSubmit(): void { - //this.touchAllFormFields(this.formGroup); - if (!this.isFormValid()) { return; } - this.onSubmit(); - } + formSubmit(): void { + //this.touchAllFormFields(this.formGroup); + if (!this.isFormValid()) { return; } + this.onSubmit(); + } - public isFormValid() { - return this.formGroup.valid; - } + public isFormValid() { + return this.formGroup.valid; + } - onSubmit(): void { - this.dataManagementPlanService.createDataManagementPlan(this.formGroup.value).subscribe( - complete => this.onCallbackSuccess(), - error => this.onCallbackError(error) - ) - } + onSubmit(): void { + this.dataManagementPlanService.createDataManagementPlan(this.formGroup.value).subscribe( + complete => this.onCallbackSuccess(), + error => this.onCallbackError(error) + ) + } - onCallbackSuccess(): void { - this.snackBar.openFromComponent(SnackBarNotificationComponent, { - data: { message: this.isNew ? 'GENERAL.SNACK-BAR.SUCCESSFUL-CREATION' : 'GENERAL.SNACK-BAR.SUCCESSFUL-UPDATE', language: this.language }, - duration: 3000, - }) - this.router.navigate(['/dmps']); - } + onCallbackSuccess(): void { + this.snackBar.openFromComponent(SnackBarNotificationComponent, { + data: { message: this.isNew ? 'GENERAL.SNACK-BAR.SUCCESSFUL-CREATION' : 'GENERAL.SNACK-BAR.SUCCESSFUL-UPDATE', language: this.language }, + duration: 3000, + }) + this.router.navigate(['/dmps']); + } - onCallbackError(error: any) { - this.setErrorModel(error.error); - //this.validateAllFormFields(this.formGroup); - } + onCallbackError(error: any) { + this.setErrorModel(error.error); + //this.validateAllFormFields(this.formGroup); + } - public setErrorModel(errorModel: BaseErrorModel) { - Object.keys(errorModel).forEach(item => { - (this.dataManagementPlan.errorModel)[item] = (errorModel)[item]; - }) - } + public setErrorModel(errorModel: BaseErrorModel) { + Object.keys(errorModel).forEach(item => { + (this.dataManagementPlan.errorModel)[item] = (errorModel)[item]; + }) + } - public cancel(): void { - this.router.navigate(['/dmps']); - } + public cancel(): void { + this.router.navigate(['/dmps']); + } - public invite(): void { - this.router.navigate(['/invite/' + this.dataManagementPlan.id]); - } + public invite(): void { + this.router.navigate(['/invite/' + this.dataManagementPlan.id]); + } - filterOrganisations(value: string): void { + filterOrganisations(value: string): void { - this.filteredOrganisations = undefined; - if (value) { - this.filteringOrganisationsAsync = true; + this.filteredOrganisations = undefined; + if (value) { + this.filteringOrganisationsAsync = true; - this.externalSourcesService.searchDMPOrganizations(value).subscribe(items => { - this.filteredOrganisations = items; - this.filteringOrganisationsAsync = false; + this.externalSourcesService.searchDMPOrganizations(value).subscribe(items => { + this.filteredOrganisations = items; + this.filteringOrganisationsAsync = false; - // this.filteredOrganisations = items.filter((filteredObj: any) => { - // return this.objectsModel ? this.objectsModel.indexOf(filteredObj) < 0 : true; - // }); + // this.filteredOrganisations = items.filter((filteredObj: any) => { + // return this.objectsModel ? this.objectsModel.indexOf(filteredObj) < 0 : true; + // }); - }); + }); - } - } + } + } - filterResearchers(value: string): void { + filterResearchers(value: string): void { - this.filteredResearchers = undefined; - if (value) { - this.filteringResearchersAsync = true; + this.filteredResearchers = undefined; + if (value) { + this.filteringResearchersAsync = true; - this.externalSourcesService.searchDMPResearchers({ criteria: { name: value, like: null } }).subscribe(items => { - this.filteredResearchers = items; - this.filteringResearchersAsync = false; + this.externalSourcesService.searchDMPResearchers({ criteria: { name: value, like: null } }).subscribe(items => { + this.filteredResearchers = items; + this.filteringResearchersAsync = false; - }); - } - } + }); + } + } - filterProfiles(value: string): void { + filterProfiles(value: string): void { - this.filteredProfiles = undefined; - if (value) { - this.filteredProfilesAsync = true; + this.filteredProfiles = undefined; + if (value) { + this.filteredProfilesAsync = true; - const request = new RequestItem(); - let criteria = new DatasetProfileCriteria(); - criteria.like = value; - request.criteria = criteria; - this._service.searchDMPProfiles(request).subscribe(items => { - this.filteredProfiles = items; - this.filteredProfilesAsync = false; - }); - } - } + const request = new RequestItem(); + let criteria = new DatasetProfileCriteria(); + criteria.like = value; + request.criteria = criteria; + this._service.searchDMPProfiles(request).subscribe(items => { + this.filteredProfiles = items; + this.filteredProfilesAsync = false; + }); + } + } - addResearcher(rowId: any, rowName: any) { - let dialogRef = this.dialog.open(AddResearchersComponent, { - height: '255px', - width: '700px', - data: { - dmpId: rowId, - dmpName: rowName - } - }); + addResearcher(rowId: any, rowName: any) { + let dialogRef = this.dialog.open(AddResearchersComponent, { + height: '255px', + width: '700px', + data: { + dmpId: rowId, + dmpName: rowName + } + }); - } + } - availableProfiles() { - let dialogRef = this.dialog.open(AvailableProfilesComponent, { - height: '355px', - width: '700px', - data: { + availableProfiles() { + let dialogRef = this.dialog.open(AvailableProfilesComponent, { + height: '355px', + width: '700px', + data: { - } - }); - dialogRef.afterClosed().subscribe(result => { - this.formGroup.get("profiles").setValue(result); - }); + } + }); + dialogRef.afterClosed().subscribe(result => { + this.formGroup.get("profiles").setValue(result); + }); - return false; - } + return false; + } - openConfirm(dmpLabel, id): void { - this._dialogService.openConfirm({ - message: 'Are you sure you want to delete the "' + dmpLabel + '"', - disableClose: true || false, // defaults to false - viewContainerRef: this._viewContainerRef, //OPTIONAL - title: 'Confirm', //OPTIONAL, hides if not provided - cancelButton: 'No', //OPTIONAL, defaults to 'CANCEL' - acceptButton: 'Yes' //OPTIONAL, defaults to 'ACCEPT' - // width: '500px', //OPTIONAL, defaults to 400px - }).afterClosed().subscribe((accept: boolean) => { - if (accept) { - this.dataManagementPlanService.delete(id).subscribe(() => { - this.router.navigate(['/dmps']) - }); - } else { - // DO SOMETHING ELSE - } - }); - } + openConfirm(dmpLabel, id): void { + this._dialogService.openConfirm({ + message: 'Are you sure you want to delete the "' + dmpLabel + '"', + disableClose: true || false, // defaults to false + viewContainerRef: this._viewContainerRef, //OPTIONAL + title: 'Confirm', //OPTIONAL, hides if not provided + cancelButton: 'No', //OPTIONAL, defaults to 'CANCEL' + acceptButton: 'Yes' //OPTIONAL, defaults to 'ACCEPT' + // width: '500px', //OPTIONAL, defaults to 400px + }).afterClosed().subscribe((accept: boolean) => { + if (accept) { + this.dataManagementPlanService.delete(id).subscribe(() => { + this.router.navigate(['/dmps']) + }); + } else { + // DO SOMETHING ELSE + } + }); + } - selectOption(option: any) { - this.dataManagementPlan.definition = null; - this.formGroup.get("profile").patchValue(option, { emitEvent: false }) - this.dmpProfileService.getSingle(option.id).subscribe(result => { - this.dataManagementPlan.definition = result.definition; - }) - } + selectOption(option: any) { + this.dataManagementPlan.definition = null; + this.formGroup.get("profile").patchValue(option, { emitEvent: false }) + this.dmpProfileService.getSingle(option.id).subscribe(result => { + this.dataManagementPlan.definition = result.definition; + }) + } - displayWith(item: any) { - if (!item) return null; - return item["label"]; - } + displayWith(item: any) { + if (!item) return null; + return item["label"]; + } - redirectToProject() { - this.router.navigate(["projects/edit/" + this.dataManagementPlan.project.id]) - } + redirectToProject() { + this.router.navigate(["projects/edit/" + this.dataManagementPlan.project.id]) + } - redirectToDatasets() { - this.router.navigate(["datasets/dmp/" + this.dataManagementPlan.id]) - } + redirectToDatasets() { + this.router.navigate(["datasets/dmp/" + this.dataManagementPlan.id]) + } - newVersion(id: String, label: String) { - this.router.navigate(['/dmps/new_version/' + id, { dmpLabel: label }]); - } + newVersion(id: String, label: String) { + this.router.navigate(['/dmps/new_version/' + id, { dmpLabel: label }]); + } - clone(id: String) { - this.router.navigate(['/dmps/clone/' + id]); - } + clone(id: String) { + this.router.navigate(['/dmps/clone/' + id]); + } } diff --git a/dmp-frontend/src/app/projects/editor/project-editor.component.html b/dmp-frontend/src/app/projects/editor/project-editor.component.html index b1fa5959b..6a7270a7f 100644 --- a/dmp-frontend/src/app/projects/editor/project-editor.component.html +++ b/dmp-frontend/src/app/projects/editor/project-editor.component.html @@ -77,10 +77,18 @@ -
- - - +
+
+
+ +
+
+ +
+
+ +
+
diff --git a/dmp-frontend/src/app/projects/listing/project-listing.component.html b/dmp-frontend/src/app/projects/listing/project-listing.component.html index 4f0b76fec..333902754 100644 --- a/dmp-frontend/src/app/projects/listing/project-listing.component.html +++ b/dmp-frontend/src/app/projects/listing/project-listing.component.html @@ -1,65 +1,68 @@

{{languageResolverService.getBy('listingTitle') | translate}}

- - + + +
+ + - + + {{'PROJECT-LISTING.COLUMNS.AVATAR' | translate}} + + + + + + + {{'PROJECT-LISTING.COLUMNS.NAME' | translate}} + {{row.label}} + - - {{'PROJECT-LISTING.COLUMNS.AVATAR' | translate}} - - - - - - - {{'PROJECT-LISTING.COLUMNS.NAME' | translate}} - {{row.label}} - + + + {{'PROJECT-LISTING.COLUMNS.ABBREVIATION' | translate}} + {{row.abbreviation}} + - - - {{'PROJECT-LISTING.COLUMNS.ABBREVIATION' | translate}} - {{row.abbreviation}} - + + + {{'PROJECT-LISTING.COLUMNS.START' | translate}} + {{row.startDate | date:'shortDate'}} + - - - {{'PROJECT-LISTING.COLUMNS.START' | translate}} - {{row.startDate | date:'shortDate'}} - + + + {{'PROJECT-LISTING.COLUMNS.END' | translate}} + {{row.endDate | date:'shortDate'}} + - - - {{'PROJECT-LISTING.COLUMNS.END' | translate}} - {{row.endDate | date:'shortDate'}} - - - - - {{'PROJECT-LISTING.COLUMNS.DMPS' | translate}} - - - - + + + {{'PROJECT-LISTING.COLUMNS.DMPS' | translate}} + + + + - - + - - + + - - - + + + +
+
--> - + {{'GENERAL.VALIDATION.REQUIRED' | translate}} diff --git a/dmp-frontend/src/app/shared/components/criteria/projects/projects-criteria.component.html b/dmp-frontend/src/app/shared/components/criteria/projects/projects-criteria.component.html index 6318a3670..45ccb7de4 100644 --- a/dmp-frontend/src/app/shared/components/criteria/projects/projects-criteria.component.html +++ b/dmp-frontend/src/app/shared/components/criteria/projects/projects-criteria.component.html @@ -1,37 +1,23 @@ -
- - - -

{{'CRITERIA.FILTERS'| translate}}

-
-
-
-
- - - {{baseErrorModel['criteria.like']}} - -
-
- - - - - - {{baseErrorModel['criteria.periodStart']}} +
+ + + + {{baseErrorModel['criteria.like']}} + + + + + + + {{baseErrorModel['criteria.periodStart']}} -
-
- - - {{baseErrorModel['criteria.periodEnd']}} - - - -
-
- + + + {{baseErrorModel['criteria.periodEnd']}} + + +
diff --git a/dmp-frontend/src/app/shared/components/criteria/projects/projects-criteria.component.scss b/dmp-frontend/src/app/shared/components/criteria/projects/projects-criteria.component.scss index 128b8021f..e69de29bb 100644 --- a/dmp-frontend/src/app/shared/components/criteria/projects/projects-criteria.component.scss +++ b/dmp-frontend/src/app/shared/components/criteria/projects/projects-criteria.component.scss @@ -1,10 +0,0 @@ -.project-criteria { - mat-form-field { - padding-bottom: 5px; - width: 100%; - } - - mat-card { - padding-bottom: 0px; - } -}