dmp associated users, dmp cloning

This commit is contained in:
annampak 2018-01-23 13:56:43 +02:00
parent dcada74d7b
commit 46479118e7
7 changed files with 44 additions and 11 deletions

View File

@ -25,6 +25,7 @@ const appRoutes: Routes = [
{ path: 'projects/new', component: ProjectEditorComponent, canActivate: [AuthGuard] },
{ path: 'dmps', component: DataManagementPlanListingComponent, canActivate: [AuthGuard] },
{ path: 'dmp/:id', component: DataManagementPlanEditorComponent,canActivate: [AuthGuard] },
{ path: 'dmp/:id/new_version', component: DataManagementPlanEditorComponent, canActivate: [AuthGuard] },
{ path: 'dmps/new', component: DataManagementPlanEditorComponent, canActivate: [AuthGuard] },
{ path: 'datasets', component: DatasetListingComponent, canActivate: [AuthGuard] },
//{ path: 'dataset/new', component: DatasetWizardComponent, canActivate: [AuthGuard] },

View File

@ -62,7 +62,7 @@ export class DataManagementPlanListingComponent implements OnInit {
}
newVersion(rowId: String) {
//this.router.navigate(['/datasets/' + rowId]);
this.router.navigate(['/dmp/' + rowId+ '/new_version'],{queryParams:{clone: 'true'}});
}
getDefaultCriteria(): DataManagementPlanCriteria {

View File

@ -67,6 +67,15 @@
<mat-progress-bar [style.height.px]="2" *ngIf="filteringResearchersAsync" mode="indeterminate"></mat-progress-bar>
</td-chips>
<mat-list 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> -->

View File

@ -44,6 +44,8 @@ export class DataManagementPlanEditorComponent implements AfterViewInit {
filteredProfiles: DatasetProfileModel[];
projectAutoCompleteConfiguration: AutoCompleteConfiguration;
createNewVersion;
associatedUsers = [{name:"Ioannis Kalyvas"}];
constructor(
private dataManagementPlanService: DataManagementPlanService,
@ -80,6 +82,11 @@ export class DataManagementPlanEditorComponent implements AfterViewInit {
});
}
});
this.route
.queryParams
.subscribe(params => {
this.createNewVersion = params["clone"];
});
}
formSubmit(): void {
@ -92,7 +99,15 @@ export class DataManagementPlanEditorComponent implements AfterViewInit {
return this.formGroup.valid;
}
onSubmit(): void {
onSubmit(): void {debugger;
if(this.createNewVersion =="true"){
this.formGroup.value.id = null;
this.dataManagementPlanService.createDataManagementPlanClone(this.formGroup.value, this.formGroup.get("id").value).subscribe(
complete => this.onCallbackSuccess(),
error => this.onCallbackError(error)
);
}
else
this.dataManagementPlanService.createDataManagementPlan(this.formGroup.value).subscribe(
complete => this.onCallbackSuccess(),
error => this.onCallbackError(error)

View File

@ -48,4 +48,8 @@ export class DataManagementPlanService {
searchDMPProfiles(dataSetProfileRequest: RequestItem<DatasetProfileCriteria>): Observable<DatasetProfileModel[]> {
return this.http.post<DatasetProfileModel[]>(this.actionUrl + "datasetprofiles/get", dataSetProfileRequest, { headers: this.headers });
}
createDataManagementPlanClone(dataManagementPlanModel: DataManagementPlanModel, id:String): Observable<DataManagementPlanModel> {
return this.http.post<DataManagementPlanModel>(this.actionUrl + 'clone/' + id , dataManagementPlanModel, { headers: this.headers });
}
}

View File

@ -26,7 +26,8 @@ import {
MatTabsModule,
MatStepperModule,
MatRadioModule,
MatMenuModule
MatMenuModule,
MatListModule
} from '@angular/material';
import { CdkTableModule } from '@angular/cdk/table';
import { SnackBarNotificationComponent } from '../components/notificaiton/snack-bar-notification.component';
@ -66,7 +67,8 @@ import { CovalentLayoutModule, CovalentChipsModule, CovalentDialogsModule } from
CovalentDialogsModule,
MatStepperModule,
MatRadioModule,
MatMenuModule
MatMenuModule,
MatListModule
],
providers: [

View File

@ -43,7 +43,8 @@
"RESEARCHERS": "Researchers",
"ORGANISATIONS": "Organisations",
"VERSION": "Version",
"ACTIONS": "Actions"
"ACTIONS": "Actions",
"DATASETS":"Datasets"
},
"ACTIONS": {
"EDIT": "Edit",
@ -88,7 +89,8 @@
},
"ACTIONS": {
"EDIT": "Edit",
"MAKE-IT-PUBLIC": "Make it public"
"MAKE-IT-PUBLIC": "Make it public",
"VIEW": "View"
}
},
"PROJECT-EDITOR": {