AAE-34390 Clean old theming files (#10800)

This commit is contained in:
Denys Vuika
2025-04-22 18:30:30 -04:00
committed by GitHub
parent 4cfda763b6
commit d829d8eefb
26 changed files with 20 additions and 1041 deletions

View File

@@ -18,7 +18,7 @@
import { fakeAsync, TestBed } from '@angular/core/testing';
import { CategoryService } from '../services/category.service';
import { CategoryServiceMock } from '../mock/category-mock.service';
import { TreeNodeType, TreeResponse } from '../../tree';
import { TreeNodeType } from '../../tree';
import { EMPTY, of } from 'rxjs';
import { Pagination } from '@alfresco/js-api';
import { CategoryTreeDatasourceService } from './category-tree-datasource.service';
@@ -39,7 +39,7 @@ describe('CategoryTreeDatasourceService', () => {
it('should get root level categories', fakeAsync(() => {
spyOn(categoryTreeDatasourceService, 'getParentNode').and.returnValue(undefined);
categoryTreeDatasourceService.getSubNodes(null, 0, 100).subscribe((treeResponse: TreeResponse<CategoryNode>) => {
categoryTreeDatasourceService.getSubNodes(null, 0, 100).subscribe((treeResponse) => {
expect(treeResponse.entries.length).toBe(1);
expect(treeResponse.entries[0].level).toBe(0);
expect(treeResponse.entries[0].nodeType).toBe(TreeNodeType.RegularNode);
@@ -57,7 +57,7 @@ describe('CategoryTreeDatasourceService', () => {
nodeType: TreeNodeType.RegularNode
};
spyOn(categoryTreeDatasourceService, 'getParentNode').and.returnValue(parentNode);
categoryTreeDatasourceService.getSubNodes(parentNode.id, 0, 100).subscribe((treeResponse: TreeResponse<CategoryNode>) => {
categoryTreeDatasourceService.getSubNodes(parentNode.id, 0, 100).subscribe((treeResponse) => {
expect(treeResponse.entries.length).toBe(2);
expect(treeResponse.entries[0].parentId).toBe(parentNode.id);
expect(treeResponse.entries[0].level).toBe(1);

View File

@@ -19,7 +19,6 @@ import { Injectable } from '@angular/core';
import { TreeNodeType, TreeResponse, TreeService } from '../../tree';
import { CategoryNode } from '../models/category-node.interface';
import { CategoryService } from './category.service';
import { CategoryEntry, CategoryPaging } from '@alfresco/js-api';
import { from, Observable } from 'rxjs';
import { map, mergeMap, toArray } from 'rxjs/operators';
@@ -32,9 +31,9 @@ export class CategoryTreeDatasourceService extends TreeService<CategoryNode> {
public getSubNodes(parentNodeId: string, skipCount?: number, maxItems?: number, name?: string): Observable<TreeResponse<CategoryNode>> {
return !name
? this.categoryService.getSubcategories(parentNodeId, skipCount, maxItems).pipe(
map((response: CategoryPaging) => {
const parentNode: CategoryNode = this.getParentNode(parentNodeId);
const nodesList: CategoryNode[] = response.list.entries.map((entry: CategoryEntry) => ({
map((response) => {
const parentNode = this.getParentNode(parentNodeId);
const nodesList: CategoryNode[] = response.list.entries.map((entry) => ({
id: entry.entry.id,
nodeName: entry.entry.name,
parentId: entry.entry.parentId,
@@ -55,8 +54,7 @@ export class CategoryTreeDatasourceService extends TreeService<CategoryNode> {
};
nodesList.push(loadMoreNode);
}
const treeResponse: TreeResponse<CategoryNode> = { entries: nodesList, pagination: response.list.pagination };
return treeResponse;
return { entries: nodesList, pagination: response.list.pagination };
})
)
: this.categoryService.searchCategories(name, skipCount, maxItems).pipe(