diff --git a/ogWebconsole/src/app/app.module.ts b/ogWebconsole/src/app/app.module.ts index 7fd54d9..2e28d37 100644 --- a/ogWebconsole/src/app/app.module.ts +++ b/ogWebconsole/src/app/app.module.ts @@ -42,6 +42,7 @@ import { CreateClientComponent } from './components/groups/clients/create-client import { DeleteModalComponent } from './components/groups/delete-modal/delete-modal.component'; import { EditOrganizationalUnitComponent } from './components/groups/organizational-units/edit-organizational-unit/edit-organizational-unit.component'; import { EditClientComponent } from './components/groups/clients/edit-client/edit-client.component'; +import { ClassroomViewComponent } from './components/groups/classroom-view/classroom-view.component'; @NgModule({ declarations: [ @@ -66,7 +67,8 @@ import { EditClientComponent } from './components/groups/clients/edit-client/edi CreateClientComponent, DeleteModalComponent, EditOrganizationalUnitComponent, - EditClientComponent + EditClientComponent, + ClassroomViewComponent ], bootstrap: [AppComponent], imports: [BrowserModule, diff --git a/ogWebconsole/src/app/components/groups/data.service.ts b/ogWebconsole/src/app/components/groups/data.service.ts index ee41398..e25336e 100644 --- a/ogWebconsole/src/app/components/groups/data.service.ts +++ b/ogWebconsole/src/app/components/groups/data.service.ts @@ -55,10 +55,10 @@ export class DataService { } getClients(uuid: string): Observable { - console.log('unidadId', uuid); return this.http.get(this.clientsUrl).pipe( map(response => { if (response['hydra:member'] && Array.isArray(response['hydra:member'])) { + console.log(response); return response['hydra:member'].filter((client: any) => client.organizationalUnit && client.organizationalUnit['@id'] === `/organizational-units/${uuid}`); } else { throw new Error('Unexpected response format'); diff --git a/ogWebconsole/src/app/components/groups/groups.component.html b/ogWebconsole/src/app/components/groups/groups.component.html index 7edc5cd..84a1aa7 100644 --- a/ogWebconsole/src/app/components/groups/groups.component.html +++ b/ogWebconsole/src/app/components/groups/groups.component.html @@ -68,3 +68,7 @@ + + + \ No newline at end of file diff --git a/ogWebconsole/src/app/components/groups/groups.component.ts b/ogWebconsole/src/app/components/groups/groups.component.ts index 163b45e..ad342f2 100644 --- a/ogWebconsole/src/app/components/groups/groups.component.ts +++ b/ogWebconsole/src/app/components/groups/groups.component.ts @@ -1,6 +1,6 @@ import { Component, OnInit } from '@angular/core'; import { DataService } from './data.service'; -import { UnidadOrganizativa } from './model'; +import { ClientCollection, UnidadOrganizativa } from './model'; import { MatDialog } from '@angular/material/dialog'; import { CreateOrganizationalUnitComponent } from './organizational-units/create-organizational-unit/create-organizational-unit.component'; import { DeleteModalComponent } from './delete-modal/delete-modal.component'; @@ -114,4 +114,6 @@ export class GroupsComponent implements OnInit { const dialogComponent = type === 'client' ? EditClientComponent : EditOrganizationalUnitComponent; this.dialog.open(dialogComponent as any); // Usando type assertion aquĆ­ } + + } diff --git a/ogWebconsole/src/app/components/groups/model.ts b/ogWebconsole/src/app/components/groups/model.ts index 8d52796..f90b50d 100644 --- a/ogWebconsole/src/app/components/groups/model.ts +++ b/ogWebconsole/src/app/components/groups/model.ts @@ -16,3 +16,38 @@ export interface UnidadOrganizativa { aulas: Aula[]; } +export interface OrganizationalUnit { + "@id": string; + "@type": string; + id: number; + name: string; + type: string; + uuid: string; +} + +export interface Client { + "@id": string; + "@type": string; + id: number; + name: string; + type: string; + serialNumber: string; + netiface: string; + organizationalUnit: OrganizationalUnit; + partitions: any[]; + createdAt: string; + createdBy: string; + uuid: string; +} + +export interface ClientCollection { + "@context": string; + "@id": string; + "@type": string; + "hydra:totalItems": number; + "hydra:member": Client[]; + "hydra:view": { + "@id": string; + "@type": string; + }; +} \ No newline at end of file