Merge branch 'Development' of https://gitlab.eudat.eu/dmp/OpenAIRE-EUDAT-DMP-service-pilot into Development
This commit is contained in:
commit
bd1bc36085
|
@ -2,43 +2,36 @@
|
|||
<mat-horizontal-stepper [linear]="isLinear">
|
||||
<mat-step [stepControl]="formGroup">
|
||||
<form *ngIf="formGroup" [formGroup]="formGroup">
|
||||
<ng-template matStepLabel>Dataset Profile Associations</ng-template>
|
||||
<auto-complete class="full-width" placeholder="{{'FORM-PAYMENT-ORDER.EDITOR.FIELDS.PROJECT' | translate}}"
|
||||
[configuration]="dmpAutoCompleteConfiguration"
|
||||
titleKey="label"
|
||||
[control]="formGroup.get('dmp')"
|
||||
[required]="true">
|
||||
<ng-template matStepLabel>{{'DATASET-WIZARD.FIRST-STEP.TITLE' | translate}}</ng-template>
|
||||
<auto-complete class="full-width" placeholder="{{'DATASET-WIZARD.FIRST-STEP.DMP' | translate}}" [configuration]="dmpAutoCompleteConfiguration"
|
||||
titleKey="label" [control]="formGroup.get('dmp')" [required]="true">
|
||||
</auto-complete>
|
||||
<auto-complete class="full-width" placeholder="{{'FORM-PAYMENT-ORDER.EDITOR.FIELDS.PROJECT' | translate}}"
|
||||
[configuration]="datasetProfileAutoCompleteConfiguration"
|
||||
titleKey="label"
|
||||
[control]="formGroup.get('profile')"
|
||||
[required]="true"
|
||||
[disabled]="!formGroup.get('dmp').value">
|
||||
<auto-complete class="full-width" placeholder="{{'DATASET-WIZARD.FIRST-STEP.PROFILE' | translate}}" [configuration]="datasetProfileAutoCompleteConfiguration"
|
||||
titleKey="label" [control]="formGroup.get('profile')" [required]="true" [disabled]="!formGroup.get('dmp').value">
|
||||
</auto-complete>
|
||||
<div>
|
||||
<button mat-button matStepperNext>Next</button>
|
||||
<button matStepperNext mat-raised-button color="primary">{{'DATASET-WIZARD.ACTIONS.NEXT' | translate}}</button>
|
||||
</div>
|
||||
</form>
|
||||
</mat-step>
|
||||
<mat-step [stepControl]="formGroup">
|
||||
<form *ngIf="formGroup" [formGroup]="formGroup">
|
||||
<ng-template matStepLabel>Dataset Profile Basic Info</ng-template>
|
||||
<ng-template matStepLabel>{{'DATASET-WIZARD.SECOND-STEP.TITLE' | translate}}</ng-template>
|
||||
<app-dataset-editor-component [formGroup]="formGroup"></app-dataset-editor-component>
|
||||
<div>
|
||||
<button mat-button matStepperPrevious>Back</button>
|
||||
<button mat-button matStepperNext>Next</button>
|
||||
<button matStepperPrevious mat-raised-button color="primary">{{'DATASET-WIZARD.ACTIONS.BACK' | translate}}</button>
|
||||
<button matStepperNext mat-raised-button color="primary">{{'DATASET-WIZARD.ACTIONS.NEXT' | translate}}</button>
|
||||
</div>
|
||||
</form>
|
||||
</mat-step>
|
||||
<mat-step>
|
||||
<ng-template matStepLabel>Dataset Profile Form</ng-template>
|
||||
You are now done.
|
||||
<ng-template matStepLabel>{{'DATASET-WIZARD.THIRD-STEP.TITLE' | translate}}</ng-template>
|
||||
|
||||
<div>
|
||||
<button mat-button matStepperPrevious>Back</button>
|
||||
<button matStepperPrevious mat-raised-button color="primary">{{'DATASET-WIZARD.ACTIONS.BACK' | translate}}</button>
|
||||
</div>
|
||||
</mat-step>
|
||||
</mat-horizontal-stepper>
|
||||
<div *ngIf="formGroup"> {{ formGroup.value | json }}</div>
|
||||
|
||||
<!-- <div *ngIf="formGroup"> {{ formGroup.value | json }}</div> -->
|
||||
|
||||
</div>
|
|
@ -76,7 +76,7 @@
|
|||
</mat-paginator>
|
||||
</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]=" ['/dataset/new'] ">
|
||||
<mat-icon class="mat-24">add</mat-icon>
|
||||
</button>
|
||||
</div>
|
|
@ -95,5 +95,5 @@
|
|||
</mat-card-content>
|
||||
</mat-card>
|
||||
</form>
|
||||
<div *ngIf="formGroup"> {{ formGroup.value | json }}</div>
|
||||
<!-- <div *ngIf="formGroup"> {{ formGroup.value | json }}</div> -->
|
||||
</div>
|
|
@ -18,6 +18,13 @@
|
|||
<mat-error *ngIf="formGroup.get('description').errors?.required">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
<auto-complete class="full-width" placeholder="{{'DMP-EDITOR.FIELDS.PROJECT' | translate}}"
|
||||
[configuration]="projectAutoCompleteConfiguration"
|
||||
titleKey="label"
|
||||
[control]="formGroup.get('project')"
|
||||
[required]="true">
|
||||
</auto-complete>
|
||||
|
||||
<td-chips color="accent" [items]="filteredProfiles" formControlName="profiles" placeholder="{{'DMP-EDITOR.FIELDS.PROFILES' | translate}}"
|
||||
(inputChange)="filterProfiles($event)" requireMatch>
|
||||
<ng-template td-chip let-chip="chip">
|
||||
|
@ -69,5 +76,5 @@
|
|||
</mat-card-content>
|
||||
</mat-card>
|
||||
</form>
|
||||
<div *ngIf="formGroup"> {{ formGroup.value | json }}</div>
|
||||
<!-- <div *ngIf="formGroup"> {{ formGroup.value | json }}</div> -->
|
||||
</div>
|
|
@ -16,6 +16,9 @@ import { RequestItem } from "../../models/criteria/RequestItem";
|
|||
import { DatasetProfileCriteria } from "../../models/criteria/dataset/DatasetProfileCriteria";
|
||||
import { DataManagementPlanCriteriaComponent } from "../../shared/components/criteria/data-management-plan/dmp-criteria.component";
|
||||
import { DatasetProfileModel } from "../../models/datasets/DatasetProfileModel";
|
||||
import { AutoCompleteConfiguration } from "../../shared/components/autocomplete/AutoCompleteConfiguration";
|
||||
import { ProjectCriteria } from "../../models/criteria/project/ProjectCriteria";
|
||||
import { ProjectService } from "../../services/project/project.service";
|
||||
|
||||
|
||||
|
||||
|
@ -23,7 +26,7 @@ import { DatasetProfileModel } from "../../models/datasets/DatasetProfileModel";
|
|||
selector: 'app-dmp-editor-component',
|
||||
templateUrl: 'dmp-editor.component.html',
|
||||
styleUrls: ['./dmp-editor.component.scss'],
|
||||
providers: [DataManagementPlanService, ExternalSourcesService],
|
||||
providers: [DataManagementPlanService, ExternalSourcesService, ProjectService],
|
||||
encapsulation: ViewEncapsulation.None
|
||||
})
|
||||
export class DataManagementPlanEditorComponent implements AfterViewInit {
|
||||
|
@ -40,8 +43,11 @@ export class DataManagementPlanEditorComponent implements AfterViewInit {
|
|||
filteredResearchers: ExternalSourcesItemModel[];
|
||||
filteredProfiles: DatasetProfileModel[];
|
||||
|
||||
projectAutoCompleteConfiguration: AutoCompleteConfiguration;
|
||||
|
||||
constructor(
|
||||
private dataManagementPlanService: DataManagementPlanService,
|
||||
private projectService: ProjectService,
|
||||
private externalSourcesService: ExternalSourcesService,
|
||||
private route: ActivatedRoute,
|
||||
public snackBar: MatSnackBar,
|
||||
|
@ -56,6 +62,10 @@ export class DataManagementPlanEditorComponent implements AfterViewInit {
|
|||
this.route.params.subscribe((params: Params) => {
|
||||
const itemId = params['id'];
|
||||
|
||||
let projectRequestItem: RequestItem<ProjectCriteria> = new RequestItem();
|
||||
projectRequestItem.criteria = new ProjectCriteria();
|
||||
this.projectAutoCompleteConfiguration = new AutoCompleteConfiguration(this.projectService.get.bind(this.projectService), projectRequestItem);
|
||||
|
||||
if (itemId != null) {
|
||||
this.isNew = false;
|
||||
this.dataManagementPlanService.getSingle(itemId).map(data => data as DataManagementPlanModel)
|
||||
|
@ -114,11 +124,11 @@ export class DataManagementPlanEditorComponent implements AfterViewInit {
|
|||
}
|
||||
|
||||
filterOrganisations(value: string): void {
|
||||
|
||||
|
||||
this.filteredOrganisations = undefined;
|
||||
if (value) {
|
||||
this.filteringOrganisationsAsync = true;
|
||||
|
||||
|
||||
this.externalSourcesService.searchDMPOrganizations(value).subscribe(items => {
|
||||
this.filteredOrganisations = items;
|
||||
this.filteringOrganisationsAsync = false;
|
||||
|
@ -128,16 +138,16 @@ export class DataManagementPlanEditorComponent implements AfterViewInit {
|
|||
// });
|
||||
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
filterResearchers(value: string): void {
|
||||
|
||||
|
||||
this.filteredResearchers = undefined;
|
||||
if (value) {
|
||||
this.filteringResearchersAsync = true;
|
||||
|
||||
|
||||
this.externalSourcesService.searchDMPResearchers(value).subscribe(items => {
|
||||
this.filteredResearchers = items;
|
||||
this.filteringResearchersAsync = false;
|
||||
|
@ -151,11 +161,11 @@ export class DataManagementPlanEditorComponent implements AfterViewInit {
|
|||
}
|
||||
|
||||
filterProfiles(value: string): void {
|
||||
|
||||
|
||||
this.filteredProfiles = undefined;
|
||||
if (value) {
|
||||
this.filteredProfilesAsync = true;
|
||||
|
||||
|
||||
// this.externalSourcesService.searchDMPProfiles(value).subscribe(items => {
|
||||
// this.filteredProfiles = items;
|
||||
// this.filteredProfilesAsync = false;
|
||||
|
|
|
@ -9,13 +9,14 @@ import { OrganisationModel } from "../organisation/OrganisationModel";
|
|||
import { ResearcherModel } from "../researcher/ResearcherModel";
|
||||
import { JsonSerializer } from "../../utilities/JsonSerializer";
|
||||
import { ProfileModel } from "../profile/ProfileModel";
|
||||
import { Status } from "../Status";
|
||||
|
||||
export class DataManagementPlanModel implements Serializable<DataManagementPlanModel> {
|
||||
public id: String;
|
||||
public label: String;
|
||||
public previous: String;
|
||||
public version: number;
|
||||
public status: String;
|
||||
public status: Status = Status.Active;
|
||||
public description: String;
|
||||
public project: ProjectModel;
|
||||
public organisations: OrganisationModel[] = [];
|
||||
|
@ -63,7 +64,7 @@ export class DataManagementPlanModel implements Serializable<DataManagementPlanM
|
|||
baseContext.validation.push({ key: 'id', validators: [ BackendErrorValidator(this.errorModel, 'id')] });
|
||||
baseContext.validation.push({ key: 'label', validators: [Validators.required, BackendErrorValidator(this.errorModel, 'label')] });
|
||||
baseContext.validation.push({ key: 'previous', validators: [BackendErrorValidator(this.errorModel, 'previous')] });
|
||||
baseContext.validation.push({ key: 'version', validators: [Validators.required, BackendErrorValidator(this.errorModel, 'version')] });
|
||||
baseContext.validation.push({ key: 'version', validators: [BackendErrorValidator(this.errorModel, 'version')] });
|
||||
baseContext.validation.push({ key: 'status', validators: [Validators.required, BackendErrorValidator(this.errorModel, 'status')] });
|
||||
baseContext.validation.push({ key: 'description', validators: [Validators.required, BackendErrorValidator(this.errorModel, 'description')] });
|
||||
baseContext.validation.push({ key: 'project', validators: [Validators.required, BackendErrorValidator(this.errorModel, 'project')] });
|
||||
|
|
|
@ -44,6 +44,23 @@
|
|||
"VERSION": "Version"
|
||||
}
|
||||
},
|
||||
"DATASET-WIZARD": {
|
||||
"FIRST-STEP": {
|
||||
"TITLE": "Plan Information",
|
||||
"DMP": "Data Management Plan",
|
||||
"PROFILE": "Profile"
|
||||
},
|
||||
"SECOND-STEP": {
|
||||
"TITLE": "Dataset Information"
|
||||
},
|
||||
"THIRD-STEP": {
|
||||
"TITLE": "Definition"
|
||||
},
|
||||
"ACTIONS": {
|
||||
"NEXT": "Next",
|
||||
"BACK": "Back"
|
||||
}
|
||||
},
|
||||
"DATASET-LISTING": {
|
||||
"TITLE": "Datasets",
|
||||
"COLUMNS": {
|
||||
|
@ -87,10 +104,11 @@
|
|||
},
|
||||
"FIELDS": {
|
||||
"NAME": "Name",
|
||||
"PROJECT": "Project",
|
||||
"DESCRIPTION": "Description",
|
||||
"ORGANISATIONS": "Organisations",
|
||||
"RESEARCHERS": "Researchers",
|
||||
"PROFILES": "Profiles"
|
||||
"PROFILES": "Available Profiles"
|
||||
},
|
||||
"ACTIONS": {
|
||||
"SAVE": "Save",
|
||||
|
|
Loading…
Reference in New Issue