utn-cli 2.0.39 → 2.0.41

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.0.39",
3
+ "version": "2.0.41",
4
4
  "description": "Herramienta CLI unificada para la gestión de plantillas en SIGU.",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -579,7 +579,7 @@ class Miscelaneo {
579
579
 
580
580
  async obtenerDetalleDelModulo() {
581
581
  const Modulos = await ejecutarConsultaSIGU("SELECT `a`.`Nombre`, `a`.`Padre`, `a`.`Descripcion`, `a`.`Detalle`,\
582
- `a`.`Tipo`, CONCAT('https://storage.sigu.utn.ac.cr/images/cards/', `a`.`Icono`) AS `Icono`, `a`.`Color`, `a`.`Correo`,\
582
+ `a`.`Tipo`, IF(`a`.`Icono` <> '', CONCAT('https://storage.sigu.utn.ac.cr/images/cards/', `a`.`Icono`), '') AS `Icono`, `a`.`Color`, `a`.`Correo`,\
583
583
  `a`.`Version`, `a`.`FechaDePublicacion`, `a`.`AcuerdoDeNivelDeServicio`, `a`.`DiccionarioDeDatos`, `a`.`Repositorios`,\
584
584
  `a`.`EnlaceDelVideo`,`a`.`EnlaceDelManual`\
585
585
  , `a`.`Estado`, REGEXP_SUBSTR(`a`.`Repositorios`, '[^,]*front[^,]*') AS `Frontend`\
@@ -645,7 +645,7 @@ class Miscelaneo {
645
645
  const Permisos = await ejecutarConsultaSIGU("SELECT `PermisoId` FROM `SIGU`.`SIGU_PermisosPersonasV2` WHERE `Identificador` = ?"
646
646
  , [Resultado.uid]);
647
647
  const Modulos = await ejecutarConsultaSIGU("SELECT `a`.`Nombre`, `a`.`Padre`, `a`.`Descripcion`, `a`.`Detalle`,\
648
- `a`.`Tipo`, CONCAT('https://storage.sigu.utn.ac.cr/images/cards/', `a`.`Icono`) AS `Icono`, `a`.`Color`, `a`.`Correo`,\
648
+ `a`.`Tipo`, IF(`a`.`Icono` <> '', CONCAT('https://storage.sigu.utn.ac.cr/images/cards/', `a`.`Icono`), '') AS `Icono`, `a`.`Color`, `a`.`Correo`,\
649
649
  `a`.`Version`, `a`.`FechaDePublicacion`, `a`.`AcuerdoDeNivelDeServicio`, `a`.`DiccionarioDeDatos`, `a`.`Repositorios`,\
650
650
  `a`.`EnlaceDelVideo`,`a`.`EnlaceDelManual`\
651
651
  , `a`.`Estado`, REGEXP_SUBSTR(`a`.`Repositorios`, '[^,]*front[^,]*') AS `Frontend`\
@@ -26,7 +26,7 @@
26
26
  <p>Archivo seleccionado: {{ Archivo.name }}</p>
27
27
  }
28
28
  <!-- Input oculto para seleccionar archivos manualmente -->
29
- <input type="file" #EntradDeArchivo hidden (change)="ArchivoSeleccionado($event)">
29
+ <input type="file" #EntradDeArchivo hidden (change)="ArchivoSeleccionado($event)" [accept]="FormatosPermitidos.join(',')">
30
30
  </div>
31
31
  } @else {
32
32
  @if(ListaArchivos.length === 0) {
@@ -20,6 +20,7 @@ export class SubirArchivoComponent implements OnInit {
20
20
  Permiso = '--Permiso=' + this.data.Permiso;
21
21
  Etiqueta = this.data.Etiqueta + this.Permiso;
22
22
  EsEditable = this.data.EsEditable;
23
+ FormatosPermitidos: string[] = [];
23
24
  Token: any;
24
25
  public RutaParaListar: string = 'misc/listarArchivos/';
25
26
  public RutaParaDescargar: string = 'misc/descargarArchivo/';
@@ -32,6 +33,9 @@ export class SubirArchivoComponent implements OnInit {
32
33
  if (this.data.RutaParaDescargar) {
33
34
  this.RutaParaDescargar = this.data.RutaParaDescargar;
34
35
  }
36
+ if (this.data.FormatosPermitidos) {
37
+ this.FormatosPermitidos = this.data.FormatosPermitidos;
38
+ }
35
39
  this.ListarArchivos(this.Etiqueta)
36
40
  }
37
41
 
@@ -53,15 +57,34 @@ export class SubirArchivoComponent implements OnInit {
53
57
  const archivoZona = event.target as HTMLElement;
54
58
  archivoZona.classList.remove('arrastrar');
55
59
  if (event.dataTransfer?.files.length && this.EsEditable) {
56
- this.Archivo = event.dataTransfer.files[0];
60
+ const archivoArrastrado = event.dataTransfer.files[0];
61
+ if (this.ValidarFormato(archivoArrastrado)) {
62
+ this.Archivo = archivoArrastrado;
63
+ } else {
64
+ alert('Formato de archivo no permitido. Los formatos permitidos son: ' + this.FormatosPermitidos.join(', '));
65
+ }
57
66
  }
58
67
  }
59
68
 
60
69
  ArchivoSeleccionado(event: Event) {
61
70
  const entrada = event.target as HTMLInputElement;
62
71
  if (entrada.files?.length) {
63
- this.Archivo = entrada.files[0];
72
+ const archivoSeleccionado = entrada.files[0];
73
+ if (this.ValidarFormato(archivoSeleccionado)) {
74
+ this.Archivo = archivoSeleccionado;
75
+ } else {
76
+ alert('Formato de archivo no permitido. Los formatos permitidos son: ' + this.FormatosPermitidos.join(', '));
77
+ entrada.value = ''; // Limpiar el input
78
+ }
79
+ }
80
+ }
81
+
82
+ ValidarFormato(archivo: File): boolean {
83
+ if (this.FormatosPermitidos.length === 0) {
84
+ return true;
64
85
  }
86
+ const nombreArchivo = archivo.name.toLowerCase();
87
+ return this.FormatosPermitidos.some(formato => nombreArchivo.endsWith(formato.toLowerCase()));
65
88
  }
66
89
 
67
90
  AbrirGestorDeArchivos() {
@@ -37,7 +37,7 @@
37
37
  background-color: #0069B4 !important;
38
38
  }
39
39
 
40
- .Activa, .Activo, .Finalizado, .Aprobada, .Aprobado, .Ejecutando, .Autorizado, .Aperturado, .Ejecutada {
40
+ .Activa, .Activo, .Finalizado, .Aprobada, .Aprobado, .Ejecutando, .Autorizado, .Aperturado, .Ejecutada, .Confirmada {
41
41
  background-color: #518a5f;
42
42
  color: white;
43
43
  padding: 8px 16px;
@@ -123,7 +123,10 @@ export class ContenedorComponentesComponent {
123
123
  }
124
124
 
125
125
  irAtras(): void {
126
- this.location.back();
126
+ const rutaActual = this.location.path();
127
+ if (rutaActual !== '' && !rutaActual.includes('accesov2')) {
128
+ this.location.back();
129
+ }
127
130
  }
128
131
 
129
132
  irAlMenuDeModulo(): void {