From b03445d0d0878c7734df38fc2dcb9741924bf8ea Mon Sep 17 00:00:00 2001 From: Ajoymaity Date: Tue, 3 Jan 2023 09:35:33 +0530 Subject: [PATCH] Issue #ED-718 fix: Fixed Subject is not displayed at top after selecting multiple filter --- src/app/category-list/category-list-page.spec.ts | 7 +++++-- src/app/category-list/category-list-page.ts | 6 +++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/app/category-list/category-list-page.spec.ts b/src/app/category-list/category-list-page.spec.ts index 0fb8c2ed4..0cf996fa5 100644 --- a/src/app/category-list/category-list-page.spec.ts +++ b/src/app/category-list/category-list-page.spec.ts @@ -495,14 +495,17 @@ describe('CategoryListPage', () => { "name": { "order": "asc", "preference": [ - "accountancy", + "audience", + ["subject 1", "subject 2"], + ['accountancy'], ["subject 1", "subject 2"], ], }, }]}, filterPillBy: null }, type: 'Content'}], - supportedFacets: ["se_mediums", "subject", "primaryCategory", "audience"] + supportedFacets: ["se_mediums", "subject", "primaryCategory", "audience"], + totalCount: undefined } }); }); diff --git a/src/app/category-list/category-list-page.ts b/src/app/category-list/category-list-page.ts index 2441758e1..1e131a11e 100755 --- a/src/app/category-list/category-list-page.ts +++ b/src/app/category-list/category-list-page.ts @@ -209,7 +209,11 @@ export class CategoryListPage implements OnInit, OnDestroy { }); if (this.formField.aggregate && this.formField.aggregate.groupSortBy && this.formField.aggregate.groupSortBy.length) { this.formField.aggregate.groupSortBy.forEach((data) => { - data.name.preference = selectedData; + if (data.name && data.name.preference && data.name.preference.length) { + data.name.preference.push(selectedData); + } else { + data.name.preference = selectedData; + } }); } }