diff --git a/ogWebconsole/src/app/components/admin/users/users/add-user-modal/add-user-modal.component.html b/ogWebconsole/src/app/components/admin/users/users/add-user-modal/add-user-modal.component.html index 6139635..f441c10 100644 --- a/ogWebconsole/src/app/components/admin/users/users/add-user-modal/add-user-modal.component.html +++ b/ogWebconsole/src/app/components/admin/users/users/add-user-modal/add-user-modal.component.html @@ -38,6 +38,12 @@ + + + Clientes por página + + Número de clientes mostrados por página en el listado + diff --git a/ogWebconsole/src/app/components/admin/users/users/add-user-modal/add-user-modal.component.ts b/ogWebconsole/src/app/components/admin/users/users/add-user-modal/add-user-modal.component.ts index add5556..5642ee8 100644 --- a/ogWebconsole/src/app/components/admin/users/users/add-user-modal/add-user-modal.component.ts +++ b/ogWebconsole/src/app/components/admin/users/users/add-user-modal/add-user-modal.component.ts @@ -48,6 +48,7 @@ export class AddUserModalComponent implements OnInit { password: ['', Validators.required], role: ['', Validators.required], groupsView: ['card', Validators.required], + clientsPerPage: [null, [Validators.min(1)]], organizationalUnits: [[]] }); @@ -82,7 +83,8 @@ export class AddUserModalComponent implements OnInit { username: response.username, role: response.userGroups.length > 0 ? response.userGroups[0]['@id'] : null, organizationalUnits: organizationalUnitIds, - groupsView: response.groupsView + groupsView: response.groupsView, + clientsPerPage: response.clientsPerPage ?? null }); this.userId = response['@id']; @@ -108,7 +110,8 @@ export class AddUserModalComponent implements OnInit { allowedOrganizationalUnits: this.userForm.value.organizationalUnits, enabled: true, userGroups: [this.userForm.value.role], - groupsView: this.userForm.value.groupsView + groupsView: this.userForm.value.groupsView, + clientsPerPage: this.userForm.value.clientsPerPage || null }; if (!this.userId && this.userForm.value.password) { diff --git a/ogWebconsole/src/app/components/admin/users/users/users.component.ts b/ogWebconsole/src/app/components/admin/users/users/users.component.ts index 73abe86..a7d3ce5 100644 --- a/ogWebconsole/src/app/components/admin/users/users/users.component.ts +++ b/ogWebconsole/src/app/components/admin/users/users/users.component.ts @@ -38,6 +38,11 @@ export class UsersComponent implements OnInit { header: 'Vista de Grupos', cell: (user: any) => `${user.groupsView}` }, + { + columnDef: 'clientsPerPage', + header: 'Clientes por página', + cell: (user: any) => user.clientsPerPage != null ? `${user.clientsPerPage}` : '-' + }, { columnDef: 'allowedOrganizationalUnits', header: 'Unidades Organizacionales Permitidas', diff --git a/ogWebconsole/src/app/components/groups/groups.component.ts b/ogWebconsole/src/app/components/groups/groups.component.ts index 266cbf3..f761051 100644 --- a/ogWebconsole/src/app/components/groups/groups.component.ts +++ b/ogWebconsole/src/app/components/groups/groups.component.ts @@ -151,6 +151,7 @@ export class GroupsComponent implements OnInit, OnDestroy { this.treeDataSource = new MatTreeFlatDataSource(this.treeControl, this.treeFlattener); this.currentView = this.auth.groupsView || 'list'; + this.itemsPerPage = this.auth.clientsPerPage || 20; } diff --git a/ogWebconsole/src/app/services/auth.service.ts b/ogWebconsole/src/app/services/auth.service.ts index 84fdabb..80d820c 100644 --- a/ogWebconsole/src/app/services/auth.service.ts +++ b/ogWebconsole/src/app/services/auth.service.ts @@ -15,6 +15,7 @@ interface JwtPayload { id: number; uuid: string; groupsView: string; + clientsPerPage: number | null; } @Injectable({ providedIn: 'root' }) @@ -94,6 +95,11 @@ export class AuthService { return this.tokenPayload?.groupsView || null; } + /** clientsPerPage del usuario */ + get clientsPerPage(): number | null { + return this.tokenPayload?.clientsPerPage ?? null; + } + /** * Devuelve el rol principal del usuario según prioridad. */