From 5a4e18cb532e5b1e33c14bdf513835556ad6a002 Mon Sep 17 00:00:00 2001 From: MichalKinas Date: Thu, 7 Nov 2024 11:53:02 +0100 Subject: [PATCH] [ACS-8634] Change saved searches config file name --- docs/core/services/saved-searches.service.md | 2 +- .../src/lib/common/services/saved-searches.service.spec.ts | 6 +++--- .../src/lib/common/services/saved-searches.service.ts | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/core/services/saved-searches.service.md b/docs/core/services/saved-searches.service.md index 90e56f87f2e..26ba0a7ffa3 100644 --- a/docs/core/services/saved-searches.service.md +++ b/docs/core/services/saved-searches.service.md @@ -58,7 +58,7 @@ When the saved searches file does not exist, it will be created: ```typescript this.savedSearchService.createSavedSearchesNode('parent-node-id').subscribe((node) => { - console.log('Created saved-searches.json node:', node); + console.log('Created config.json node:', node); }); ``` diff --git a/lib/content-services/src/lib/common/services/saved-searches.service.spec.ts b/lib/content-services/src/lib/common/services/saved-searches.service.spec.ts index 854bbe99e80..e34e95cb6f5 100644 --- a/lib/content-services/src/lib/common/services/saved-searches.service.spec.ts +++ b/lib/content-services/src/lib/common/services/saved-searches.service.spec.ts @@ -69,7 +69,7 @@ describe('SavedSearchesService', () => { localStorage.removeItem(SAVED_SEARCHES_NODE_ID + testUserName); }); - it('should retrieve saved searches from the saved-searches.json file', (done) => { + it('should retrieve saved searches from the config.json file', (done) => { spyOn(authService, 'getUsername').and.callFake(() => testUserName); spyOn(localStorage, 'getItem').and.callFake(() => testNodeId); service.innit(); @@ -84,7 +84,7 @@ describe('SavedSearchesService', () => { }); }); - it('should create saved-searches.json file if it does not exist', (done) => { + it('should create config.json file if it does not exist', (done) => { spyOn(authService, 'getUsername').and.callFake(() => testUserName); getNodeContentSpy.and.callFake(() => Promise.resolve(new Blob(['']))); service.innit(); @@ -92,7 +92,7 @@ describe('SavedSearchesService', () => { service.getSavedSearches().subscribe((searches) => { expect(service.nodesApi.getNode).toHaveBeenCalledWith('-my-'); expect(service.searchApi.search).toHaveBeenCalled(); - expect(service.nodesApi.createNode).toHaveBeenCalledWith(testNodeId, jasmine.objectContaining({ name: 'saved-searches.json' })); + expect(service.nodesApi.createNode).toHaveBeenCalledWith(testNodeId, jasmine.objectContaining({ name: 'config.json' })); expect(searches.length).toBe(0); done(); }); diff --git a/lib/content-services/src/lib/common/services/saved-searches.service.ts b/lib/content-services/src/lib/common/services/saved-searches.service.ts index 33eea246a23..9f82ec1f376 100644 --- a/lib/content-services/src/lib/common/services/saved-searches.service.ts +++ b/lib/content-services/src/lib/common/services/saved-searches.service.ts @@ -217,7 +217,7 @@ export class SavedSearchesService { this.searchApi.search({ query: { language: SEARCH_LANGUAGE.AFTS, - query: `cm:name:"saved-searches.json" AND PARENT:"${parentNodeId}"` + query: `cm:name:"config.json" AND PARENT:"${parentNodeId}"` } }) ).pipe( @@ -247,7 +247,7 @@ export class SavedSearchesService { } } private createSavedSearchesNode(parentNodeId: string): Observable { - return from(this.nodesApi.createNode(parentNodeId, { name: 'saved-searches.json', nodeType: 'cm:content' })); + return from(this.nodesApi.createNode(parentNodeId, { name: 'config.json', nodeType: 'cm:content' })); } private async mapFileContentToSavedSearches(blob: Blob): Promise> {