Fixes filter criteria bug on "Published DMP" and "Published Dataset Description" listings.

This commit is contained in:
gkolokythas 2020-01-03 17:47:25 +02:00
parent 0f6583ca4b
commit 89b98f5377
2 changed files with 15 additions and 21 deletions

View File

@ -254,9 +254,8 @@ export class ExploreDatasetFiltersComponent extends BaseComponent implements OnI
this.facetCriteriaChange.emit(this.facetCriteria);
}
onGrantOptionSelected(items: GrantListingModel[]) {
this.facetCriteria.grants.splice(0);
this.facetCriteria.grants.push(...items.map(x => x.id));
onGrantOptionSelected(item: GrantListingModel) {
this.facetCriteria.grants.push(item.id);
this.facetCriteriaChange.emit(this.facetCriteria);
}
@ -268,9 +267,8 @@ export class ExploreDatasetFiltersComponent extends BaseComponent implements OnI
}
}
onDmpOptionSelected(items: DmpListingModel[]) {
this.facetCriteria.dmpIds.splice(0);
this.facetCriteria.dmpIds.push(...items.map(x => x.id));
onDmpOptionSelected(item: DmpListingModel) {
this.facetCriteria.dmpIds.push(item.id);
this.facetCriteriaChange.emit(this.facetCriteria);
}
@ -282,9 +280,8 @@ export class ExploreDatasetFiltersComponent extends BaseComponent implements OnI
}
}
onProfileOptionSelected(items: DatasetProfileModel[]) {
this.facetCriteria.datasetProfile.splice(0);
this.facetCriteria.datasetProfile.push(...items.map(x => x.id));
onProfileOptionSelected(item: DatasetProfileModel) {
this.facetCriteria.datasetProfile.push(item.id);
this.facetCriteriaChange.emit(this.facetCriteria);
}
@ -296,9 +293,8 @@ export class ExploreDatasetFiltersComponent extends BaseComponent implements OnI
}
}
onOrganizationOptionSelected(items: OrganizationModel[]) {
this.facetCriteria.dmpOrganisations.splice(0);
this.facetCriteria.dmpOrganisations.push(...items.map(x => x.id));
onOrganizationOptionSelected(item: OrganizationModel) {
this.facetCriteria.dmpOrganisations.push(item.id);
this.facetCriteriaChange.emit(this.facetCriteria);
}

View File

@ -197,9 +197,9 @@ export class ExploreDmpFiltersComponent extends BaseCriteriaComponent implements
this.facetCriteriaChange.emit(this.facetCriteria);
}
onProfileOptionSelected(items: DatasetProfileModel[]) {
this.facetCriteria.datasetProfile.splice(0);
this.facetCriteria.datasetProfile.push(...items.map(x => x.id));
onProfileOptionSelected(items: DatasetProfileModel) {
//this.facetCriteria.datasetProfile.splice(0);
this.facetCriteria.datasetProfile.push(items.id);
this.facetCriteriaChange.emit(this.facetCriteria);
}
@ -228,9 +228,8 @@ export class ExploreDmpFiltersComponent extends BaseCriteriaComponent implements
this.facetCriteriaChange.emit(this.facetCriteria);
}
onOrganizationOptionSelected(items: OrganizationModel[]) {
this.facetCriteria.dmpOrganisations.splice(0);
this.facetCriteria.dmpOrganisations.push(...items.map(x => x.id));
onOrganizationOptionSelected(item: OrganizationModel) {
this.facetCriteria.dmpOrganisations.push(item.id);
this.facetCriteriaChange.emit(this.facetCriteria);
}
@ -242,9 +241,8 @@ export class ExploreDmpFiltersComponent extends BaseCriteriaComponent implements
}
}
onGrantOptionSelected(items: GrantListingModel[]) {
this.facetCriteria.grants.splice(0);
this.facetCriteria.grants.push(...items.map(x => x.id));
onGrantOptionSelected(item: GrantListingModel) {
this.facetCriteria.grants.push(item.id);
this.facetCriteriaChange.emit(this.facetCriteria);
}