refs #1354. Added multiple commands logic. Updated endpoints
testing/ogGui-multibranch/pipeline/head There was a failure building this commit Details

pull/12/head
Manuel Aranda Rosales 2025-01-27 16:50:45 +01:00
parent b516103008
commit ab2309c958
1 changed files with 5 additions and 34 deletions

View File

@ -151,7 +151,6 @@ export class GroupsComponent implements OnInit, OnDestroy {
this.cols = width <= 600 ? 1 : width <= 960 ? 2 : width <= 1280 ? 3 : 4;
};
<<<<<<< Updated upstream
clearSelection(): void {
this.selectedUnidad = null;
this.selectedDetail = null;
@ -172,7 +171,6 @@ export class GroupsComponent implements OnInit, OnDestroy {
// )
// );
// }
=======
getFilters(): void {
this.subscriptions.add(
this.dataService.getFilters().subscribe(
@ -185,23 +183,6 @@ export class GroupsComponent implements OnInit, OnDestroy {
)
);
}
>>>>>>> Stashed changes
// Función para cargar un filtro seleccionado actu
// loadSelectedFilter(savedFilter: [string, string]): void {
// this.subscriptions.add(
// this.dataService.getFilter(savedFilter[1]).subscribe(
// (response) => {
// if (response) {
// console.log('Filter:', response.filters);
// }
// },
// (error) => {
// console.error('Error:', error);
// }
// )
// );
// }
search(): void {
this.loading = true;
@ -238,14 +219,9 @@ export class GroupsComponent implements OnInit, OnDestroy {
this.dataService.getOrganizationalUnits().subscribe({
next: (data) => {
<<<<<<< Updated upstream
this.originalTreeData = data.map((unidad) => this.convertToTreeData(unidad));
this.treeDataSource.data = [...this.originalTreeData];
=======
this.treeDataSource.data = data.map((unidad) => this.convertToTreeData(unidad));
>>>>>>> Stashed changes
if (selectedNodeIdOrUuid) {
this.selectedNode = this.findNodeByIdOrUuid(this.treeDataSource.data, selectedNodeIdOrUuid);
@ -276,13 +252,8 @@ export class GroupsComponent implements OnInit, OnDestroy {
},
});
}
<<<<<<< Updated upstream
public expandPathToNode(node: TreeNode): void {
=======
private expandPathToNode(node: TreeNode): void {
>>>>>>> Stashed changes
const path: TreeNode[] = [];
let currentNode: TreeNode | null = node;
@ -574,13 +545,13 @@ export class GroupsComponent implements OnInit, OnDestroy {
filterTree(searchTerm: string): void {
const expandPaths: TreeNode[][] = [];
const filterNodes = (nodes: TreeNode[], parentPath: TreeNode[] = []): TreeNode[] => {
return nodes
.map((node) => {
const matchesName = node.name.toLowerCase().includes(searchTerm.toLowerCase());
const filteredChildren = node.children ? filterNodes(node.children, [...parentPath, node]) : [];
if (matchesName) {
expandPaths.push([...parentPath, node]);
return {
@ -595,9 +566,9 @@ export class GroupsComponent implements OnInit, OnDestroy {
}
return null;
})
.filter((node): node is TreeNode => node !== null);
.filter((node): node is TreeNode => node !== null);
};
if (!searchTerm) {
this.treeDataSource.data = [...this.originalTreeData];
this.treeControl.collapseAll();
@ -606,7 +577,7 @@ export class GroupsComponent implements OnInit, OnDestroy {
expandPaths.forEach((path) => this.expandPath(path));
}
}
private expandPath(path: TreeNode[]): void {
path.forEach((pathNode) => {
const flatNode = this.treeControl.dataNodes?.find((n) => n.id === pathNode.id);