utn-cli 2.1.12 → 2.1.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "utn-cli",
3
- "version": "2.1.12",
3
+ "version": "2.1.15",
4
4
  "description": "Herramienta CLI unificada para la gestión de plantillas en SIGU.",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -947,11 +947,14 @@ class Miscelaneo {
947
947
  `a`.`EnlaceDelVideo`,`a`.`EnlaceDelManual`\
948
948
  , `a`.`Estado`, REGEXP_SUBSTR(SUBSTRING_INDEX(`a`.`Repositorios`, '/', -1), '[^,]*front[^,]*') AS `Frontend`\
949
949
  , `c`.`Etiqueta`, `c`.`ColorDeLaEtiqueta`\
950
+ , (SELECT COUNT(*) FROM `SIGU`.`SIGU_ModulosV2` `h`\
951
+ JOIN `SIGU`.`SIGU_PermisosV2` `hp` ON (`h`.`Nombre` = `hp`.`Modulo`)\
952
+ WHERE `h`.`Estado` = 'Activo' AND `h`.`Padre` = `a`.`Nombre` AND `hp`.`PermisoId` IN (?)) AS `CantidadDeHijos`\
950
953
  FROM `SIGU`.`SIGU_ModulosV2` `a`\
951
954
  JOIN `SIGU`.`SIGU_PermisosV2` `b` ON (`a`.`Nombre` = `b`.`Modulo`)\
952
955
  LEFT JOIN `SIGU`.`SIGU_ModulosV2InformacionExtra` `c` ON (`a`.`Nombre` = `c`.`Modulo`)\
953
956
  WHERE `a`.`Estado` = 'Activo' AND `a`.`Padre` = ? AND `b`.`PermisoId` IN (?)\
954
- ORDER BY FIELD(a.Nombre, " + ModulosFavoritos + ") DESC, a.Nombre", [Padre, Permisos.map(p => p.PermisoId)]);
957
+ ORDER BY FIELD(a.Nombre, " + ModulosFavoritos + ") DESC, a.Nombre", [Permisos.map(p => p.PermisoId), Padre, Permisos.map(p => p.PermisoId)]);
955
958
  return Modulos.map((linea) => {
956
959
  linea.Enlace = this.generarEnlace(linea.Frontend);
957
960
  return linea;
@@ -65,6 +65,7 @@
65
65
  } -->
66
66
  <div class="contenido">
67
67
  @if(TienePermiso){
68
+ @if(!esDashboard || tieneTarjetas) {
68
69
  <div class="cabecera2">
69
70
  <div class="cabecera2-info">
70
71
  <p class="titulo2">{{ Descripcion }}</p>
@@ -84,6 +85,7 @@
84
85
  </div>
85
86
  }
86
87
  </div>
88
+ }
87
89
  <ng-content><router-outlet /></ng-content>
88
90
  }@else{
89
91
  <h3>No tiene permisos para consultar este módulo</h3>
@@ -41,6 +41,7 @@ export class ContenedorComponentesComponent implements OnInit, OnDestroy, AfterV
41
41
  private intervaloUsuarios: any;
42
42
 
43
43
  get esDashboard(): boolean { return this.router.url === '/'; }
44
+ get tieneTarjetas(): boolean { return this.datosGlobalesService.cantidadDeTarjetas$.value > 0; }
44
45
  get filtro(): string { return this.datosGlobalesService.filtroDeTarjetas$.value; }
45
46
 
46
47
  onFiltroChange(event: Event): void {
@@ -97,10 +97,12 @@ export class ContenedorPrincipalComponent implements OnInit, OnDestroy {
97
97
  this.http.get(`${this.datosGlobalesService.ObtenerURL()}misc/obtenerTarjetasDelContenedor`).subscribe({
98
98
  next: (datos: any) => {
99
99
  this.tarjetas = (datos.body ?? []).map((d: any) => this.mapearTarjeta(d));
100
+ this.datosGlobalesService.cantidadDeTarjetas$.next(this.tarjetas.length);
100
101
  },
101
102
  error: (error) => {
102
103
  console.error('Error al obtener las tarjetas del contenedor:', error);
103
104
  this.tarjetas = [];
105
+ this.datosGlobalesService.cantidadDeTarjetas$.next(0);
104
106
  }
105
107
  });
106
108
  }
@@ -7,13 +7,14 @@ import { BehaviorSubject } from 'rxjs';
7
7
  export class DatosGlobalesService {
8
8
 
9
9
  readonly filtroDeTarjetas$ = new BehaviorSubject<string>('');
10
+ readonly cantidadDeTarjetas$ = new BehaviorSubject<number>(0);
10
11
 
11
12
  constructor() { }
12
13
 
13
14
  ObtenerToken() {
14
15
  const baseUrl = this.ObtenerURL();
15
16
  if (baseUrl === 'http://localhost/') {
16
- return 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1aWQiOiIxMiIsIklkZW50aWZpY2Fkb3IiOiIxMiIsImlhdCI6MTc3Nzk4OTgwOSwiZXhwIjoxNzc4MDI1ODA5fQ.T1kUm7H4hwbapQ3eFok31GVvezkPitdTlJL96MorozY';
17
+ return 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1aWQiOiIxMiIsIklkZW50aWZpY2Fkb3IiOiIxMiIsImlhdCI6MTc3ODQzMDUzMSwiZXhwIjoxNzc4NDY2NTMxfQ.C0bScJZ00863G1GsjFLox-V4wBj4nLUc2eXfswiOaxg';
17
18
  }
18
19
  const match = document.cookie.match(/(?:^|;\s*)_siguid=([^;]+)/);
19
20
  let token = match ? decodeURIComponent(match[1]) : '';