[ACS-8634] Change saved searches config file name (#10370)

This commit is contained in:
MichalKinas 2024-11-08 07:37:30 +01:00 committed by GitHub
parent 3aabb9420d
commit 3ec3e732c0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 6 additions and 6 deletions

View File

@ -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);
});
```

View File

@ -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();
});

View File

@ -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<NodeEntry> {
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<Array<SavedSearch>> {