Git revert commit
parent
d188f8e590
commit
ea9ec9087b
|
@ -42,6 +42,7 @@ import { CreateClientComponent } from './components/groups/clients/create-client
|
||||||
import { DeleteModalComponent } from './components/groups/delete-modal/delete-modal.component';
|
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 { 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 { EditClientComponent } from './components/groups/clients/edit-client/edit-client.component';
|
||||||
|
import { ClassroomViewComponent } from './components/groups/classroom-view/classroom-view.component';
|
||||||
|
|
||||||
|
|
||||||
@NgModule({ declarations: [
|
@NgModule({ declarations: [
|
||||||
|
@ -66,7 +67,8 @@ import { EditClientComponent } from './components/groups/clients/edit-client/edi
|
||||||
CreateClientComponent,
|
CreateClientComponent,
|
||||||
DeleteModalComponent,
|
DeleteModalComponent,
|
||||||
EditOrganizationalUnitComponent,
|
EditOrganizationalUnitComponent,
|
||||||
EditClientComponent
|
EditClientComponent,
|
||||||
|
ClassroomViewComponent
|
||||||
],
|
],
|
||||||
bootstrap: [AppComponent],
|
bootstrap: [AppComponent],
|
||||||
imports: [BrowserModule,
|
imports: [BrowserModule,
|
||||||
|
|
|
@ -55,10 +55,10 @@ export class DataService {
|
||||||
}
|
}
|
||||||
|
|
||||||
getClients(uuid: string): Observable<any[]> {
|
getClients(uuid: string): Observable<any[]> {
|
||||||
console.log('unidadId', uuid);
|
|
||||||
return this.http.get<any>(this.clientsUrl).pipe(
|
return this.http.get<any>(this.clientsUrl).pipe(
|
||||||
map(response => {
|
map(response => {
|
||||||
if (response['hydra:member'] && Array.isArray(response['hydra:member'])) {
|
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}`);
|
return response['hydra:member'].filter((client: any) => client.organizationalUnit && client.organizationalUnit['@id'] === `/organizational-units/${uuid}`);
|
||||||
} else {
|
} else {
|
||||||
throw new Error('Unexpected response format');
|
throw new Error('Unexpected response format');
|
||||||
|
|
|
@ -68,3 +68,7 @@
|
||||||
</mat-card-content>
|
</mat-card-content>
|
||||||
</mat-card>
|
</mat-card>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<app-classroom-view
|
||||||
|
></app-classroom-view>
|
|
@ -1,6 +1,6 @@
|
||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
import { DataService } from './data.service';
|
import { DataService } from './data.service';
|
||||||
import { UnidadOrganizativa } from './model';
|
import { ClientCollection, UnidadOrganizativa } from './model';
|
||||||
import { MatDialog } from '@angular/material/dialog';
|
import { MatDialog } from '@angular/material/dialog';
|
||||||
import { CreateOrganizationalUnitComponent } from './organizational-units/create-organizational-unit/create-organizational-unit.component';
|
import { CreateOrganizationalUnitComponent } from './organizational-units/create-organizational-unit/create-organizational-unit.component';
|
||||||
import { DeleteModalComponent } from './delete-modal/delete-modal.component';
|
import { DeleteModalComponent } from './delete-modal/delete-modal.component';
|
||||||
|
@ -114,4 +114,6 @@ export class GroupsComponent implements OnInit {
|
||||||
const dialogComponent = type === 'client' ? EditClientComponent : EditOrganizationalUnitComponent;
|
const dialogComponent = type === 'client' ? EditClientComponent : EditOrganizationalUnitComponent;
|
||||||
this.dialog.open(dialogComponent as any); // Usando type assertion aquí
|
this.dialog.open(dialogComponent as any); // Usando type assertion aquí
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,3 +16,38 @@ export interface UnidadOrganizativa {
|
||||||
aulas: Aula[];
|
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;
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in New Issue