Adds Dmp criteria on Dataset listing.
This commit is contained in:
parent
0440ecba41
commit
d5cfa7823f
|
@ -4,7 +4,7 @@ import { BaseCriteria } from "../base-criteria";
|
||||||
export class DatasetCriteria extends BaseCriteria {
|
export class DatasetCriteria extends BaseCriteria {
|
||||||
public projects?: string[] = [];
|
public projects?: string[] = [];
|
||||||
public status?: Number;
|
public status?: Number;
|
||||||
public dmpIds?: String[] = [];
|
public dmpIds?: string[] = [];
|
||||||
public tags?: ExternalSourceItemModel[] = [];
|
public tags?: ExternalSourceItemModel[] = [];
|
||||||
public allVersions?: boolean;
|
public allVersions?: boolean;
|
||||||
public role?: number;
|
public role?: number;
|
||||||
|
|
|
@ -23,15 +23,26 @@
|
||||||
</div>
|
</div>
|
||||||
<!-- End of Status Filter-->
|
<!-- End of Status Filter-->
|
||||||
|
|
||||||
|
<!-- Related DMP Filters -->
|
||||||
|
<div class="col-10 gray-container">
|
||||||
|
<h6 class="category-title">{{'CRITERIA.DATA-SETS.RELATED-DMP' | translate}}</h6>
|
||||||
|
<mat-form-field>
|
||||||
|
<app-multiple-auto-complete [formControl]="formGroup.get('dmpIds')"
|
||||||
|
placeholder="{{'CRITERIA.DATA-SETS.SELECT-DMP' | translate }}"
|
||||||
|
[configuration]="dmpAutoCompleteConfiguration">
|
||||||
|
</app-multiple-auto-complete>
|
||||||
|
</mat-form-field>
|
||||||
|
</div>
|
||||||
|
<!-- End of Related DMP Filters -->
|
||||||
|
|
||||||
<!-- Related Project Filters -->
|
<!-- Related Project Filters -->
|
||||||
<div class="col-10 gray-container">
|
<div class="col-10 gray-container">
|
||||||
<h6 class="category-title">{{'CRITERIA.PROJECTS.LIKE' | translate}}</h6>
|
<h6 class="category-title">{{'CRITERIA.DATA-SETS.RELATED-PROJECT' | translate}}</h6>
|
||||||
<mat-form-field>
|
<mat-form-field>
|
||||||
<app-multiple-auto-complete [formControl]="formGroup.get('projects')"
|
<app-multiple-auto-complete [formControl]="formGroup.get('projects')"
|
||||||
placeholder="{{'CRITERIA.DATA-SETS.SELECT-PROJECTS' | translate }}"
|
placeholder="{{'CRITERIA.DATA-SETS.SELECT-PROJECTS' | translate }}"
|
||||||
[configuration]="projectAutoCompleteConfiguration">
|
[configuration]="projectAutoCompleteConfiguration">
|
||||||
</app-multiple-auto-complete>
|
</app-multiple-auto-complete>
|
||||||
<mat-icon matSuffix class="style-icon">arrow_drop_down</mat-icon>
|
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
</div>
|
</div>
|
||||||
<!-- End of Related Projects Filters -->
|
<!-- End of Related Projects Filters -->
|
||||||
|
|
|
@ -48,6 +48,7 @@ export class DatasetCriteriaComponent extends BaseCriteriaComponent implements O
|
||||||
|
|
||||||
public formGroup = new FormBuilder().group({
|
public formGroup = new FormBuilder().group({
|
||||||
like: new FormControl(),
|
like: new FormControl(),
|
||||||
|
dmpIds: new FormControl(),
|
||||||
projects: new FormControl(),
|
projects: new FormControl(),
|
||||||
status: new FormControl(),
|
status: new FormControl(),
|
||||||
role: new FormControl(),
|
role: new FormControl(),
|
||||||
|
@ -108,6 +109,9 @@ export class DatasetCriteriaComponent extends BaseCriteriaComponent implements O
|
||||||
this.formGroup.get('like').valueChanges
|
this.formGroup.get('like').valueChanges
|
||||||
.pipe(takeUntil(this._destroyed))
|
.pipe(takeUntil(this._destroyed))
|
||||||
.subscribe(x => this.controlModified());
|
.subscribe(x => this.controlModified());
|
||||||
|
this.formGroup.get('dmpIds').valueChanges
|
||||||
|
.pipe(takeUntil(this._destroyed))
|
||||||
|
.subscribe(x => this.controlModified());
|
||||||
this.formGroup.get('projects').valueChanges
|
this.formGroup.get('projects').valueChanges
|
||||||
.pipe(takeUntil(this._destroyed))
|
.pipe(takeUntil(this._destroyed))
|
||||||
.subscribe(x => this.controlModified());
|
.subscribe(x => this.controlModified());
|
||||||
|
@ -125,8 +129,9 @@ export class DatasetCriteriaComponent extends BaseCriteriaComponent implements O
|
||||||
|
|
||||||
setCriteria(criteria: DatasetCriteria): void {
|
setCriteria(criteria: DatasetCriteria): void {
|
||||||
this.formGroup.get('like').patchValue(criteria.like);
|
this.formGroup.get('like').patchValue(criteria.like);
|
||||||
|
this.formGroup.get('dmpIds').patchValue(criteria.dmpIds);
|
||||||
|
this.formGroup.get('projects').patchValue(criteria.projects);
|
||||||
this.formGroup.get('status').patchValue(criteria.like);
|
this.formGroup.get('status').patchValue(criteria.like);
|
||||||
// this.formGroup.get('projects').patchValue(criteria.projects);
|
|
||||||
this.formGroup.get('role').patchValue(criteria.like);
|
this.formGroup.get('role').patchValue(criteria.like);
|
||||||
// this.criteria = criteria;
|
// this.criteria = criteria;
|
||||||
}
|
}
|
||||||
|
@ -180,7 +185,6 @@ export class DatasetCriteriaComponent extends BaseCriteriaComponent implements O
|
||||||
const dataTableRequest: DataTableRequest<OrganisationCriteria> = new DataTableRequest(0, null, { fields: fields });
|
const dataTableRequest: DataTableRequest<OrganisationCriteria> = new DataTableRequest(0, null, { fields: fields });
|
||||||
dataTableRequest.criteria = new OrganisationCriteria();
|
dataTableRequest.criteria = new OrganisationCriteria();
|
||||||
dataTableRequest.criteria.labelLike = value;
|
dataTableRequest.criteria.labelLike = value;
|
||||||
|
|
||||||
return this.organisationService.searchInternalOrganisations(dataTableRequest).map(x => x.data);
|
return this.organisationService.searchInternalOrganisations(dataTableRequest).map(x => x.data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -85,11 +85,11 @@ export class DatasetListingComponent extends BaseComponent implements OnInit, IB
|
||||||
allVersions: value.allVersions,
|
allVersions: value.allVersions,
|
||||||
role: value.role
|
role: value.role
|
||||||
}
|
}
|
||||||
if (value.projects) {
|
|
||||||
request.criteria.projects = value.projects.map(x => x.id);
|
|
||||||
}
|
|
||||||
if (value.dmpIds) {
|
if (value.dmpIds) {
|
||||||
request.criteria.dmpIds = value.dmpIds;
|
request.criteria.dmpIds = value.dmpIds.map(x => x.id);
|
||||||
|
}
|
||||||
|
if (value.projects) {
|
||||||
|
request.criteria.projects = value.projects.map(x => x.id);
|
||||||
}
|
}
|
||||||
if (value.organisations) {
|
if (value.organisations) {
|
||||||
request.criteria.organisations = value.organisations.map(x => x.id);
|
request.criteria.organisations = value.organisations.map(x => x.id);
|
||||||
|
|
|
@ -487,7 +487,10 @@
|
||||||
"SELECT-PROJECTS": "Select Projects",
|
"SELECT-PROJECTS": "Select Projects",
|
||||||
"ROLE": "Role",
|
"ROLE": "Role",
|
||||||
"ORGANIZATION": "Organization",
|
"ORGANIZATION": "Organization",
|
||||||
"SELECT-ORGANIZATIONS": "Select Organizations"
|
"SELECT-ORGANIZATIONS": "Select Organizations",
|
||||||
|
"RELATED-PROJECT": "Related Project",
|
||||||
|
"SELECT-DMP": "DMP",
|
||||||
|
"RELATED-DMP": "Related DMPs"
|
||||||
},
|
},
|
||||||
"DMP": {
|
"DMP": {
|
||||||
"LIKE": "Search DMPs",
|
"LIKE": "Search DMPs",
|
||||||
|
|
Loading…
Reference in New Issue