mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-06-23 18:05:09 +00:00
[ACS-8634] Change saved searches config file name (#10370)
This commit is contained in:
parent
3aabb9420d
commit
3ec3e732c0
@ -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);
|
||||
});
|
||||
```
|
||||
|
||||
|
@ -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();
|
||||
});
|
||||
|
@ -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>> {
|
||||
|
Loading…
x
Reference in New Issue
Block a user