dmp associated users, dmp cloning
This commit is contained in:
parent
dcada74d7b
commit
46479118e7
|
@ -24,7 +24,8 @@ const appRoutes: Routes = [
|
||||||
{ path: 'project/:id', component: ProjectEditorComponent, canActivate: [AuthGuard] },
|
{ path: 'project/:id', component: ProjectEditorComponent, canActivate: [AuthGuard] },
|
||||||
{ path: 'projects/new', component: ProjectEditorComponent, canActivate: [AuthGuard] },
|
{ path: 'projects/new', component: ProjectEditorComponent, canActivate: [AuthGuard] },
|
||||||
{ path: 'dmps', component: DataManagementPlanListingComponent, canActivate: [AuthGuard] },
|
{ path: 'dmps', component: DataManagementPlanListingComponent, canActivate: [AuthGuard] },
|
||||||
{ path: 'dmp/:id', component: DataManagementPlanEditorComponent, 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: 'dmps/new', component: DataManagementPlanEditorComponent, canActivate: [AuthGuard] },
|
||||||
{ path: 'datasets', component: DatasetListingComponent, canActivate: [AuthGuard] },
|
{ path: 'datasets', component: DatasetListingComponent, canActivate: [AuthGuard] },
|
||||||
//{ path: 'dataset/new', component: DatasetWizardComponent, canActivate: [AuthGuard] },
|
//{ path: 'dataset/new', component: DatasetWizardComponent, canActivate: [AuthGuard] },
|
||||||
|
|
|
@ -62,7 +62,7 @@ export class DataManagementPlanListingComponent implements OnInit {
|
||||||
}
|
}
|
||||||
|
|
||||||
newVersion(rowId: String) {
|
newVersion(rowId: String) {
|
||||||
//this.router.navigate(['/datasets/' + rowId]);
|
this.router.navigate(['/dmp/' + rowId+ '/new_version'],{queryParams:{clone: 'true'}});
|
||||||
}
|
}
|
||||||
|
|
||||||
getDefaultCriteria(): DataManagementPlanCriteria {
|
getDefaultCriteria(): DataManagementPlanCriteria {
|
||||||
|
|
|
@ -67,6 +67,15 @@
|
||||||
<mat-progress-bar [style.height.px]="2" *ngIf="filteringResearchersAsync" mode="indeterminate"></mat-progress-bar>
|
<mat-progress-bar [style.height.px]="2" *ngIf="filteringResearchersAsync" mode="indeterminate"></mat-progress-bar>
|
||||||
</td-chips>
|
</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">
|
<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 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 *ngIf="!isNew" mat-raised-button color="primary" (click)="invite()" type="button">{{'DMP-EDITOR.ACTIONS.INVITE' | translate}}</button> -->
|
||||||
|
|
|
@ -44,6 +44,8 @@ export class DataManagementPlanEditorComponent implements AfterViewInit {
|
||||||
filteredProfiles: DatasetProfileModel[];
|
filteredProfiles: DatasetProfileModel[];
|
||||||
|
|
||||||
projectAutoCompleteConfiguration: AutoCompleteConfiguration;
|
projectAutoCompleteConfiguration: AutoCompleteConfiguration;
|
||||||
|
createNewVersion;
|
||||||
|
associatedUsers = [{name:"Ioannis Kalyvas"}];
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private dataManagementPlanService: DataManagementPlanService,
|
private dataManagementPlanService: DataManagementPlanService,
|
||||||
|
@ -80,6 +82,11 @@ export class DataManagementPlanEditorComponent implements AfterViewInit {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
this.route
|
||||||
|
.queryParams
|
||||||
|
.subscribe(params => {
|
||||||
|
this.createNewVersion = params["clone"];
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
formSubmit(): void {
|
formSubmit(): void {
|
||||||
|
@ -92,11 +99,19 @@ export class DataManagementPlanEditorComponent implements AfterViewInit {
|
||||||
return this.formGroup.valid;
|
return this.formGroup.valid;
|
||||||
}
|
}
|
||||||
|
|
||||||
onSubmit(): void {
|
onSubmit(): void {debugger;
|
||||||
this.dataManagementPlanService.createDataManagementPlan(this.formGroup.value).subscribe(
|
if(this.createNewVersion =="true"){
|
||||||
complete => this.onCallbackSuccess(),
|
this.formGroup.value.id = null;
|
||||||
error => this.onCallbackError(error)
|
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)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
onCallbackSuccess(): void {
|
onCallbackSuccess(): void {
|
||||||
|
|
|
@ -48,4 +48,8 @@ export class DataManagementPlanService {
|
||||||
searchDMPProfiles(dataSetProfileRequest: RequestItem<DatasetProfileCriteria>): Observable<DatasetProfileModel[]> {
|
searchDMPProfiles(dataSetProfileRequest: RequestItem<DatasetProfileCriteria>): Observable<DatasetProfileModel[]> {
|
||||||
return this.http.post<DatasetProfileModel[]>(this.actionUrl + "datasetprofiles/get", dataSetProfileRequest, { headers: this.headers });
|
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 });
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,7 +26,8 @@ import {
|
||||||
MatTabsModule,
|
MatTabsModule,
|
||||||
MatStepperModule,
|
MatStepperModule,
|
||||||
MatRadioModule,
|
MatRadioModule,
|
||||||
MatMenuModule
|
MatMenuModule,
|
||||||
|
MatListModule
|
||||||
} from '@angular/material';
|
} from '@angular/material';
|
||||||
import { CdkTableModule } from '@angular/cdk/table';
|
import { CdkTableModule } from '@angular/cdk/table';
|
||||||
import { SnackBarNotificationComponent } from '../components/notificaiton/snack-bar-notification.component';
|
import { SnackBarNotificationComponent } from '../components/notificaiton/snack-bar-notification.component';
|
||||||
|
@ -66,7 +67,8 @@ import { CovalentLayoutModule, CovalentChipsModule, CovalentDialogsModule } from
|
||||||
CovalentDialogsModule,
|
CovalentDialogsModule,
|
||||||
MatStepperModule,
|
MatStepperModule,
|
||||||
MatRadioModule,
|
MatRadioModule,
|
||||||
MatMenuModule
|
MatMenuModule,
|
||||||
|
MatListModule
|
||||||
],
|
],
|
||||||
|
|
||||||
providers: [
|
providers: [
|
||||||
|
|
|
@ -43,7 +43,8 @@
|
||||||
"RESEARCHERS": "Researchers",
|
"RESEARCHERS": "Researchers",
|
||||||
"ORGANISATIONS": "Organisations",
|
"ORGANISATIONS": "Organisations",
|
||||||
"VERSION": "Version",
|
"VERSION": "Version",
|
||||||
"ACTIONS": "Actions"
|
"ACTIONS": "Actions",
|
||||||
|
"DATASETS":"Datasets"
|
||||||
},
|
},
|
||||||
"ACTIONS": {
|
"ACTIONS": {
|
||||||
"EDIT": "Edit",
|
"EDIT": "Edit",
|
||||||
|
@ -88,7 +89,8 @@
|
||||||
},
|
},
|
||||||
"ACTIONS": {
|
"ACTIONS": {
|
||||||
"EDIT": "Edit",
|
"EDIT": "Edit",
|
||||||
"MAKE-IT-PUBLIC": "Make it public"
|
"MAKE-IT-PUBLIC": "Make it public",
|
||||||
|
"VIEW": "View"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"PROJECT-EDITOR": {
|
"PROJECT-EDITOR": {
|
||||||
|
|
Loading…
Reference in New Issue