diff --git a/ogWebconsole/src/app/components/groups/groups.component.css b/ogWebconsole/src/app/components/groups/groups.component.css index 5b9e321..74b2034 100644 --- a/ogWebconsole/src/app/components/groups/groups.component.css +++ b/ogWebconsole/src/app/components/groups/groups.component.css @@ -24,3 +24,24 @@ button { .selected-item { background-color: #e0e0e0; } + +.actions { + margin-left: auto; +} + +.actions mat-icon { + cursor: pointer; + margin-left: 48px; + color: #757575; +} + +.actions mat-icon:hover { + color: #212121; +} + +.elements-card{ + margin: 10px; + width: 800px; + background-color: #fafafa; + +} \ No newline at end of file diff --git a/ogWebconsole/src/app/components/groups/groups.component.html b/ogWebconsole/src/app/components/groups/groups.component.html index efeb674..4dc1d5d 100644 --- a/ogWebconsole/src/app/components/groups/groups.component.html +++ b/ogWebconsole/src/app/components/groups/groups.component.html @@ -5,7 +5,7 @@

Grupos

- + Unidad organizativa @@ -15,20 +15,35 @@
apartment {{ unidad.nombre }} -
+
- + {{ breadcrumb.join(' > ') }} - {{ child.name || child.nombre }} +
+ + + apartment + + + + + + {{ child.name || child.nombre }} + + + edit + delete + +
diff --git a/ogWebconsole/src/app/components/groups/groups.component.ts b/ogWebconsole/src/app/components/groups/groups.component.ts index 6009b91..340a751 100644 --- a/ogWebconsole/src/app/components/groups/groups.component.ts +++ b/ogWebconsole/src/app/components/groups/groups.component.ts @@ -27,17 +27,17 @@ export class GroupsComponent implements OnInit { onSelectUnidad(unidad: UnidadOrganizativa): void { this.selectedUnidad = unidad; this.breadcrumb = [unidad.nombre]; - this.loadChildrenAndClients(unidad.uuid); + this.loadChildrenAndClients(unidad.uuid, unidad.id); } onSelectChild(child: any): void { if (child.uuid && child.id) { this.breadcrumb.push(child.name || child.nombre); - this.loadChildrenAndClients(child.uuid); + this.loadChildrenAndClients(child.uuid, child.id); } } - loadChildrenAndClients(uuid: string): void { + loadChildrenAndClients(uuid: string, id: number): void { this.dataService.getChildren(uuid).subscribe( childrenData => { this.dataService.getClients(uuid).subscribe( @@ -60,4 +60,31 @@ export class GroupsComponent implements OnInit { addOU(): void { this.dialog.open(CreateOrganizationalUnitComponent); } + + getIcon(type: string): string { + switch(type) { + case 'organizational-unit': + return 'apartment'; + case 'classroom-group': + return 'classrooms-group-icon'; + case 'classroom': + return 'classroom-icon'; + case 'client': + return 'client-icon'; + case 'clients-group': + return 'clients-group-icon'; + default: + return ''; + } + } + + onDeleteClick(uuid: string): void { + console.log('UUID del elemento a eliminar:', uuid); + // Aquí puedes agregar lógica adicional para eliminar el elemento si es necesario + } + + onEditClick(uuid: string): void { + console.log('UUID del elemento a editar:', uuid); + // Aquí puedes agregar lógica adicional para editar el elemento si es necesario + } } diff --git a/ogWebconsole/src/app/components/groups/model.ts b/ogWebconsole/src/app/components/groups/model.ts index 2436b80..77c405d 100644 --- a/ogWebconsole/src/app/components/groups/model.ts +++ b/ogWebconsole/src/app/components/groups/model.ts @@ -14,3 +14,4 @@ export interface UnidadOrganizativa { uuid: string; aulas: Aula[]; } +