diff --git a/dmp-admin/src/app/services/rest-base.ts b/dmp-admin/src/app/services/rest-base.ts index 089754158..edb8002ee 100644 --- a/dmp-admin/src/app/services/rest-base.ts +++ b/dmp-admin/src/app/services/rest-base.ts @@ -19,7 +19,7 @@ export class RestBase { */ protocol: string = "http"; //hostname: string = "localhost"; - hostname: string = "192.168.32.67"; + hostname: string = "192.168.32.64"; port: number = 8080; webappname: string = ""; restpath: string = ""; diff --git a/dmp-frontend/src/app/app.constants.ts b/dmp-frontend/src/app/app.constants.ts index 4e7918c93..06956ba9b 100644 --- a/dmp-frontend/src/app/app.constants.ts +++ b/dmp-frontend/src/app/app.constants.ts @@ -1,5 +1,5 @@ export const HostConfiguration = { - Server: 'http://192.168.32.67:8080/', //'http://dl043.madgik.di.uoa.gr:8080/' + Server: 'http://192.168.32.64:8080/', //'http://dl043.madgik.di.uoa.gr:8080/' App: 'localhost:4200/' // 'http://dl043.madgik.di.uoa.gr:8080/' //CASHost: 'https://login-devel.uoa.gr/login', //Service: 'http://elkefinman/login' diff --git a/dmp-frontend/src/app/available-profiles/available-profiles.component.html b/dmp-frontend/src/app/available-profiles/available-profiles.component.html new file mode 100644 index 000000000..ab3d95fae --- /dev/null +++ b/dmp-frontend/src/app/available-profiles/available-profiles.component.html @@ -0,0 +1,11 @@ + + + {{profile.label}} + + + +

+ Dataset Profiles selected: {{datasetsprofiles.selectedOptions.selected.length}} + Dataset Profiles selected: {{datasetsprofiles.value}} +

+ \ No newline at end of file diff --git a/dmp-frontend/src/app/available-profiles/available-profiles.component.ts b/dmp-frontend/src/app/available-profiles/available-profiles.component.ts new file mode 100644 index 000000000..b2cd1ea34 --- /dev/null +++ b/dmp-frontend/src/app/available-profiles/available-profiles.component.ts @@ -0,0 +1,40 @@ +import { JsonSerializer } from '../utilities/JsonSerializer'; +import { RequestItem } from '../models/criteria/RequestItem'; +import { Component, OnInit, Inject } from "@angular/core"; +import { FormGroup } from '@angular/forms'; +import { Params, ActivatedRoute, Router } from '@angular/router'; +import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material'; +import { DatasetService } from '@app/services/dataset/dataset.service'; +import { DatasetProfileModel } from '@app/models/datasetprofile/DatasetProfileModel'; + +@Component({ + selector: 'available-profiles-component', + templateUrl: 'available-profiles.component.html', + providers: [DatasetService] + +}) +export class AvailableProfilesComponent implements OnInit { + + private formGroup: FormGroup; + private profiles: DatasetProfileModel[] =[]; + + constructor( + private datasetService: DatasetService, + private route: ActivatedRoute, + public router: Router, + public dialogRef: MatDialogRef, + @Inject(MAT_DIALOG_DATA) public data: any + ) { } + + ngOnInit(): void { + + this.datasetService.getDatasetProfiles().subscribe(data=>{ + this.profiles = JsonSerializer.fromJSONArray(data, DatasetProfileModel) + } + ) + } + + addProfiles(profiles){ + this.dialogRef.close(); + } +} \ No newline at end of file diff --git a/dmp-frontend/src/app/dataset-profile-form/form/form.component.ts b/dmp-frontend/src/app/dataset-profile-form/form/form.component.ts index b46186c0c..2331a6a46 100644 --- a/dmp-frontend/src/app/dataset-profile-form/form/form.component.ts +++ b/dmp-frontend/src/app/dataset-profile-form/form/form.component.ts @@ -24,7 +24,8 @@ export class FormComponent { form: FormGroup; private profileID: string; - constructor(public datasetprofileAdmin: DatasetProfileAdmin, private datasetProfileService: DatasetProfileService, private route: ActivatedRoute) { + constructor(public datasetprofileAdmin: DatasetProfileAdmin, private datasetProfileService: DatasetProfileService, private route: ActivatedRoute, + private router:Router) { this.profileID = route.snapshot.params['id']; } @@ -82,8 +83,12 @@ export class FormComponent { onSubmit() { let data = this.form.value; - if (this.profileID) this.updateForm(this.profileID, data).subscribe(); - else this.createForm(data).subscribe(); + if (this.profileID) this.updateForm(this.profileID, data).subscribe(()=>{ + this.router.navigate(['/datasetsProfiles']) + }); + else this.createForm(data).subscribe(()=>{ + this.router.navigate(['/datasetsProfiles']) + }); } } \ No newline at end of file diff --git a/dmp-frontend/src/app/dmps/dmps.module.ts b/dmp-frontend/src/app/dmps/dmps.module.ts index 4ae220f53..fa63d3bb1 100644 --- a/dmp-frontend/src/app/dmps/dmps.module.ts +++ b/dmp-frontend/src/app/dmps/dmps.module.ts @@ -14,6 +14,7 @@ import { CovalentDialogsModule } from '@covalent/core'; import { SharedModule } from '../shared/shared.module' import { NgModule } from '@angular/core'; import { AddResearchersComponent } from '@app/add-researchers/add-researchers.component'; +import { AvailableProfilesComponent } from '@app/available-profiles/available-profiles.component'; @NgModule({ imports: [ @@ -38,7 +39,8 @@ import { AddResearchersComponent } from '@app/add-researchers/add-researchers.co DataManagementPlanEditorComponent, InvitationComponent, InvitationAcceptedComponent, - AddResearchersComponent + AddResearchersComponent, + AvailableProfilesComponent ], exports: [ @@ -46,12 +48,14 @@ import { AddResearchersComponent } from '@app/add-researchers/add-researchers.co DataManagementPlanEditorComponent, InvitationComponent, InvitationAcceptedComponent, - AddResearchersComponent + AddResearchersComponent, + AvailableProfilesComponent ], entryComponents: [ InvitationComponent, - AddResearchersComponent + AddResearchersComponent, + AvailableProfilesComponent ], providers: [ BaseHttpService 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 fcc41ff99..4edae2d7c 100644 --- a/dmp-frontend/src/app/dmps/editor/dmp-editor.component.html +++ b/dmp-frontend/src/app/dmps/editor/dmp-editor.component.html @@ -38,6 +38,8 @@ {{'GENERAL.VALIDATION.REQUIRED' | translate}} + + View All { + console.log(result); + + }); + + return false; } openConfirm(dmpLabel, id): void { diff --git a/dmp-frontend/src/app/form/dynamic-fields/dynamic-field-radiobox/dynamic-field-radiobox.component.css b/dmp-frontend/src/app/form/dynamic-fields/dynamic-field-radiobox/dynamic-field-radiobox.component.css index f7be5b613..3ea0d17c5 100644 --- a/dmp-frontend/src/app/form/dynamic-fields/dynamic-field-radiobox/dynamic-field-radiobox.component.css +++ b/dmp-frontend/src/app/form/dynamic-fields/dynamic-field-radiobox/dynamic-field-radiobox.component.css @@ -1,3 +1,14 @@ .radio-label { margin-left: 10px; +} + +.inline-radio{ + display: inline-flex; + flex-direction: row; +} +.mat-radio-group .mat-radio-inline { + display: flex; +} +.radio-button{ + margin-right: 15px; } \ No newline at end of file diff --git a/dmp-frontend/src/app/form/dynamic-fields/dynamic-field-radiobox/dynamic-field-radiobox.component.html b/dmp-frontend/src/app/form/dynamic-fields/dynamic-field-radiobox/dynamic-field-radiobox.component.html index 2153f7a93..bd4e2952a 100644 --- a/dmp-frontend/src/app/form/dynamic-fields/dynamic-field-radiobox/dynamic-field-radiobox.component.html +++ b/dmp-frontend/src/app/form/dynamic-fields/dynamic-field-radiobox/dynamic-field-radiobox.component.html @@ -1,7 +1,7 @@
- +
- {{option.label}} + {{option.label}}
diff --git a/dmp-frontend/src/app/services/dataset/dataset.service.ts b/dmp-frontend/src/app/services/dataset/dataset.service.ts index 25d41fc06..22939eba1 100644 --- a/dmp-frontend/src/app/services/dataset/dataset.service.ts +++ b/dmp-frontend/src/app/services/dataset/dataset.service.ts @@ -9,6 +9,8 @@ import { DataTableData } from '../../models/data-table/DataTableData'; import { DatasetListingModel } from '../../models/datasets/DatasetListingModel'; import { DatasetModel } from '../../models/datasets/DatasetModel'; import { DatasetCriteria } from '../../models/criteria/dataset/DatasetCriteria'; +import { DatasetProfileModel } from '@app/models/datasetprofile/DatasetProfileModel'; + @Injectable() @@ -33,5 +35,9 @@ export class DatasetService { makeDatasetPublic(id: String){ return this.http.get(this.actionUrl + 'makepublic/' + id, { headers: this.headers }) } + + getDatasetProfiles(): Observable{ + return this.http.get(HostConfiguration.Server +'datasetprofiles/getAll', { headers: this.headers }) + } }