From 71eee988aa59eb5c9b5734ee93457c9ac590e21c Mon Sep 17 00:00:00 2001 From: Anton Ramanovich <90370279+rmnvch@users.noreply.github.com> Date: Thu, 6 Nov 2025 13:22:02 +0100 Subject: [PATCH] [ACS-10421] Add support for legacy config.json based approach for saved-searches (#4863) * [ACS-9166]: introduces saved searches context service * [ACS-9166]: migrates to context service * [ACS-9166]: fixes tests * [ACS-9166]: removes prev approach artifacts * [ACS-9166]: fixes falsy emissions form pipe * [ACS-9166]: adds reactive strategy option * [ACS-9166]: tests fixes * [ACS-9166]: minor fix --- docs/extending/rules-list.md | 2 +- .../aca-content/assets/app.extensions.json | 5 +- .../aca-content/src/lib/aca-content.module.ts | 6 +- .../search-results.component.html | 2 - .../search-results.component.spec.ts | 5 +- .../search-results.component.ts | 4 +- ...ved-search-delete-dialog.component.spec.ts | 9 +- .../saved-search-delete-dialog.component.ts | 5 +- ...saved-search-edit-dialog.component.spec.ts | 9 +- .../saved-search-edit-dialog.component.ts | 5 +- .../save-search-dialog.component.spec.ts | 8 +- .../dialog/save-search-dialog.component.ts | 5 +- .../unique-search-name-validator.spec.ts | 6 +- .../dialog/unique-search-name-validator.ts | 4 +- ...aved-searches-smart-list.component.spec.ts | 5 +- .../saved-searches-smart-list.component.ts | 4 +- .../save-search-sidenav.component.spec.ts | 33 ++-- .../sidenav/save-search-sidenav.component.ts | 5 +- .../pipes/is-feature-supported.pipe.spec.ts | 30 ++- .../lib/pipes/is-feature-supported.pipe.ts | 7 +- .../saved-searches-context.service.spec.ts | 186 ++++++++++++++++++ .../saved-searches-context.service.ts | 80 ++++++++ .../aca-shared/rules/src/app.rules.spec.ts | 18 +- projects/aca-shared/rules/src/app.rules.ts | 4 +- 24 files changed, 365 insertions(+), 82 deletions(-) create mode 100644 projects/aca-content/src/lib/services/saved-searches-context.service.spec.ts create mode 100644 projects/aca-content/src/lib/services/saved-searches-context.service.ts diff --git a/docs/extending/rules-list.md b/docs/extending/rules-list.md index 8f7addfa3..0f769ef3d 100644 --- a/docs/extending/rules-list.md +++ b/docs/extending/rules-list.md @@ -82,6 +82,6 @@ Rules/Evaluators created for specific features in ADW to be checked if supported | Version | Key | Description | |---------|---------------------------------|---------------------------------------------------------------------------| -| 8.1.0 | isSavedSearchAvailable | Checks whether current ACS version supports PUT method in Preferences API | +| 8.1.0 | isPreferencesApiAvailable | Checks whether current ACS version supports PUT method in Preferences API | | 8.1.0 | isFolderInfoAvailable | Checks whether current ACS version supports folder size calculation API | | 8.1.0 | isBulkActionsAvailable | Checks whether current ACS version supports bulk update feature | \ No newline at end of file diff --git a/projects/aca-content/assets/app.extensions.json b/projects/aca-content/assets/app.extensions.json index ba5eefd0a..7242920be 100644 --- a/projects/aca-content/assets/app.extensions.json +++ b/projects/aca-content/assets/app.extensions.json @@ -219,10 +219,7 @@ "items": [ { "id": "app.search.navbar", - "component": "app.search.navbar", - "rules": { - "visible": "isSavedSearchAvailable" - } + "component": "app.search.navbar" } ] } diff --git a/projects/aca-content/src/lib/aca-content.module.ts b/projects/aca-content/src/lib/aca-content.module.ts index 7fb1c0e32..2e50a0755 100644 --- a/projects/aca-content/src/lib/aca-content.module.ts +++ b/projects/aca-content/src/lib/aca-content.module.ts @@ -69,6 +69,7 @@ import { SearchResultsRowComponent } from './components/search/search-results-ro import { BulkActionsDropdownComponent } from './components/bulk-actions-dropdown/bulk-actions-dropdown.component'; import { AgentsButtonComponent } from './components/knowledge-retrieval/search-ai/agents-button/agents-button.component'; import { SaveSearchSidenavComponent } from './components/search/search-save/sidenav/save-search-sidenav.component'; +import { IsFeatureSupportedInCurrentAcsPipe } from './pipes/is-feature-supported.pipe'; @NgModule({ imports: [ContentModule.forRoot(), AppStoreModule, HammerModule], @@ -134,7 +135,7 @@ import { SaveSearchSidenavComponent } from './components/search/search-save/side isSmartFolder: rules.isSmartFolder, isMultiSelection: rules.isMultiselection, canPrintFile: rules.canPrintFile, - isSavedSearchAvailable: rules.isSavedSearchAvailable, + isPreferencesApiAvailable: rules.isPreferencesApiAvailable, isFolderInfoAvailable: rules.isFolderInfoAvailable, isBulkActionsAvailable: rules.isBulkActionsAvailable, @@ -169,7 +170,8 @@ import { SaveSearchSidenavComponent } from './components/search/search-save/side 'app.areCategoriesEnabled': rules.areCategoriesEnabled, 'app.isSSOEnabled': rules.isSSOEnabled } - }) + }), + IsFeatureSupportedInCurrentAcsPipe ] }) export class ContentServiceExtensionModule {} diff --git a/projects/aca-content/src/lib/components/search/search-results/search-results.component.html b/projects/aca-content/src/lib/components/search/search-results/search-results.component.html index 74dca72a8..f1b63e145 100644 --- a/projects/aca-content/src/lib/components/search/search-results/search-results.component.html +++ b/projects/aca-content/src/lib/components/search/search-results/search-results.component.html @@ -26,7 +26,6 @@

{{ 'APP.BROWSE.SEARCH.ADVANCED_FILTERS' | translate }}

- @if('isSavedSearchAvailable' | isFeatureSupportedInCurrentAcs | async) {