diff --git a/ogWebconsole/src/app/app-routing.module.ts b/ogWebconsole/src/app/app-routing.module.ts index ba8e87d..084a8e1 100644 --- a/ogWebconsole/src/app/app-routing.module.ts +++ b/ogWebconsole/src/app/app-routing.module.ts @@ -8,6 +8,7 @@ import { PageNotFoundComponent } from './components/page-not-found/page-not-foun import { AdminComponent } from './components/pages/admin/admin.component'; import { UsersComponent } from './components/pages/admin/users/users/users.component'; import { RolesComponent } from './components/pages/admin/roles/roles/roles.component'; +import { GroupsComponent } from './components/groups/groups.component'; const routes: Routes = [ { path: '', redirectTo: 'auth/login', pathMatch: 'full' }, { @@ -18,6 +19,7 @@ const routes: Routes = [ { path: 'admin', component: AdminComponent }, { path: 'users', component: UsersComponent }, { path: 'user-groups', component: RolesComponent }, + { path: 'groups', component: GroupsComponent }, ], }, { diff --git a/ogWebconsole/src/app/app.module.ts b/ogWebconsole/src/app/app.module.ts index f687bf7..b8c1f8c 100644 --- a/ogWebconsole/src/app/app.module.ts +++ b/ogWebconsole/src/app/app.module.ts @@ -33,6 +33,7 @@ import { EditUserModalComponent } from './components/pages/admin/users/users/edi import { AddRoleModalComponent } from './components/pages/admin/roles/roles/add-role-modal/add-role-modal.component'; import { DeleteRoleModalComponent } from './components/pages/admin/roles/roles/delete-role-modal/delete-role-modal.component'; import { ChangePasswordModalComponent } from './components/pages/admin/users/users/change-password-modal/change-password-modal.component'; +import { GroupsComponent } from './components/groups/groups.component'; @NgModule({ declarations: [ @@ -51,7 +52,8 @@ import { ChangePasswordModalComponent } from './components/pages/admin/users/use EditUserModalComponent, AddRoleModalComponent, DeleteRoleModalComponent, - ChangePasswordModalComponent + ChangePasswordModalComponent, + GroupsComponent ], bootstrap: [AppComponent], imports: [BrowserModule, diff --git a/ogWebconsole/src/app/components/groups/data.service.ts b/ogWebconsole/src/app/components/groups/data.service.ts new file mode 100644 index 0000000..5ee1405 --- /dev/null +++ b/ogWebconsole/src/app/components/groups/data.service.ts @@ -0,0 +1,35 @@ +// data.service.ts +import { Injectable } from '@angular/core'; +import { UnidadOrganizativa } from './model'; + +@Injectable({ + providedIn: 'root', +}) +export class DataService { + private unidadesOrganizativas: UnidadOrganizativa[] = [ + { + id: 1, + nombre: 'Unidad Organizativa 1', + aulas: [ + { + id: 1, + nombre: 'Aula 1', + clientes: [ + { id: 1, nombre: 'Cliente 1' }, + { id: 2, nombre: 'Cliente 2' }, + ], + }, + { + id: 2, + nombre: 'Aula 2', + clientes: [{ id: 3, nombre: 'Cliente 3' }], + }, + ], + }, + // Otros datos de ejemplo + ]; + + getUnidadesOrganizativas(): UnidadOrganizativa[] { + return this.unidadesOrganizativas; + } +} diff --git a/ogWebconsole/src/app/components/groups/groups.component.css b/ogWebconsole/src/app/components/groups/groups.component.css new file mode 100644 index 0000000..aaecff2 --- /dev/null +++ b/ogWebconsole/src/app/components/groups/groups.component.css @@ -0,0 +1,7 @@ +.groupLists-container{ + display: flex; +} + +mat-card { + margin: 10px; +} \ 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 new file mode 100644 index 0000000..2706b33 --- /dev/null +++ b/ogWebconsole/src/app/components/groups/groups.component.html @@ -0,0 +1,39 @@ + +

groups works!

+
+ + Unidad organizativa + + + + {{ unidad.nombre }} + + + + + + Aulas + + + + {{ aula.nombre }} + + + + + + Clientes + + + + {{ cliente.nombre }} + + + + +
diff --git a/ogWebconsole/src/app/components/groups/groups.component.spec.ts b/ogWebconsole/src/app/components/groups/groups.component.spec.ts new file mode 100644 index 0000000..ee75d8e --- /dev/null +++ b/ogWebconsole/src/app/components/groups/groups.component.spec.ts @@ -0,0 +1,23 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { GroupsComponent } from './groups.component'; + +describe('GroupsComponent', () => { + let component: GroupsComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [GroupsComponent] + }) + .compileComponents(); + + fixture = TestBed.createComponent(GroupsComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/ogWebconsole/src/app/components/groups/groups.component.ts b/ogWebconsole/src/app/components/groups/groups.component.ts new file mode 100644 index 0000000..e84cacf --- /dev/null +++ b/ogWebconsole/src/app/components/groups/groups.component.ts @@ -0,0 +1,33 @@ +// groups.component.ts +import { Component, OnInit } from '@angular/core'; +import { DataService } from './data.service'; +import { UnidadOrganizativa, Aula, Cliente } from './model'; + +@Component({ + selector: 'app-groups', + templateUrl: './groups.component.html', + styleUrls: ['./groups.component.css'] +}) +export class GroupsComponent implements OnInit { + unidadesOrganizativas: UnidadOrganizativa[] = []; + selectedUnidad: UnidadOrganizativa | null = null; + selectedAula: Aula | null = null; + selectedClientes: Cliente[] = []; + + constructor(private dataService: DataService) {} + + ngOnInit(): void { + this.unidadesOrganizativas = this.dataService.getUnidadesOrganizativas(); + } + + onSelectUnidad(unidad: UnidadOrganizativa): void { + this.selectedUnidad = unidad; + this.selectedAula = null; + this.selectedClientes = []; + } + + onSelectAula(aula: Aula): void { + this.selectedAula = aula; + this.selectedClientes = aula.clientes; + } +} diff --git a/ogWebconsole/src/app/components/groups/model.ts b/ogWebconsole/src/app/components/groups/model.ts new file mode 100644 index 0000000..7a672a4 --- /dev/null +++ b/ogWebconsole/src/app/components/groups/model.ts @@ -0,0 +1,19 @@ +// models.ts +export interface Cliente { + id: number; + nombre: string; + } + + export interface Aula { + id: number; + nombre: string; + clientes: Cliente[]; + bloques?: Aula[]; + } + + export interface UnidadOrganizativa { + id: number; + nombre: string; + aulas: Aula[]; + } + \ No newline at end of file diff --git a/ogWebconsole/src/app/components/layout/header/header.component.html b/ogWebconsole/src/app/components/layout/header/header.component.html index b00e6be..737223f 100644 --- a/ogWebconsole/src/app/components/layout/header/header.component.html +++ b/ogWebconsole/src/app/components/layout/header/header.component.html @@ -4,7 +4,7 @@ Opengnsys webconsole