utn-cli 2.1.25 → 2.1.26

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.
@@ -42,7 +42,7 @@ export async function initFrontend() {
42
42
 
43
43
  export async function updateFrontend(opciones = { cerrarAlFinalizar: true }) {
44
44
  console.log('Actualizando el proyecto de frontend...');
45
- const archivosAExcluir = ['app.routes.ts', '.vscode', 'dist', 'Manual.md'];
45
+ const archivosAExcluir = ['app.routes.ts', '.vscode', 'dist', 'Manual.md', 'AccionesPersonalizadas.ts'];
46
46
  const directoriodePlantillas = path.join(__dirname, '../templates/frontend');
47
47
  const directorioDestino = process.cwd();
48
48
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "utn-cli",
3
- "version": "2.1.25",
3
+ "version": "2.1.26",
4
4
  "description": "Herramienta CLI unificada para la gestión de plantillas en SIGU.",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -1296,9 +1296,11 @@ class Miscelaneo {
1296
1296
  process.env.UUID = this.UUID;
1297
1297
  if (this.BackEndsQueConsumeEsteModulo.length > 0) {
1298
1298
  this.BackEndsQueConsumeEsteModulo.forEach(async (dato) => {
1299
- await ejecutarConsultaSIGU("INSERT INTO `SIGU`.`SIGU_RepositoriosAccesos` VALUES (?, ?)\
1299
+ if (dato) {
1300
+ await ejecutarConsultaSIGU("INSERT INTO `SIGU`.`SIGU_RepositoriosAccesos` VALUES (?, ?)\
1300
1301
  ON DUPLICATE KEY UPDATE `RepositorioDestino` = ?,`RepositorioOrigen` = ?"
1301
- , [dato, this.NombreDelRepositorioDelBackend, dato, this.NombreDelRepositorioDelBackend]);
1302
+ , [dato, this.NombreDelRepositorioDelBackend, dato, this.NombreDelRepositorioDelBackend]);
1303
+ }
1302
1304
  });
1303
1305
  }
1304
1306
 
@@ -1,3 +1,8 @@
1
+ .icono-atenuado {
2
+ opacity: 0.50;
3
+ filter: grayscale(50%);
4
+ }
5
+
1
6
  .encabezado {
2
7
  display: flex;
3
8
  justify-content: space-between;
@@ -37,7 +42,17 @@
37
42
  background-color: #0069B4 !important;
38
43
  }
39
44
 
40
- .Activa, .Activo, .Finalizado, .Aprobada, .Aprobado, .Ejecutando, .Autorizado, .Aperturado, .Ejecutada, .Confirmada, .Enviado {
45
+ .Activa,
46
+ .Activo,
47
+ .Finalizado,
48
+ .Aprobada,
49
+ .Aprobado,
50
+ .Ejecutando,
51
+ .Autorizado,
52
+ .Aperturado,
53
+ .Ejecutada,
54
+ .Confirmada,
55
+ .Enviado {
41
56
  background-color: #518a5f;
42
57
  color: white;
43
58
  padding: 8px 16px;
@@ -50,7 +65,9 @@
50
65
  cursor: pointer;
51
66
  }
52
67
 
53
- .Inactiva, .Inactivo, .Cerrado {
68
+ .Inactiva,
69
+ .Inactivo,
70
+ .Cerrado {
54
71
  background-color: #7d7d7d;
55
72
  color: white;
56
73
  padding: 8px 16px;
@@ -63,7 +80,8 @@
63
80
  cursor: pointer;
64
81
  }
65
82
 
66
- .Pendiente, .Enviada {
83
+ .Pendiente,
84
+ .Enviada {
67
85
  background-color: #FFA757;
68
86
  color: white;
69
87
  padding: 8px 16px;
@@ -76,7 +94,9 @@
76
94
  cursor: pointer;
77
95
  }
78
96
 
79
- .Formalizado, .Procesando, .Borrador {
97
+ .Formalizado,
98
+ .Procesando,
99
+ .Borrador {
80
100
  background-color: rgb(163, 156, 156);
81
101
  color: white;
82
102
  padding: 8px 16px;
@@ -88,7 +108,9 @@
88
108
  display: inline-block;
89
109
  cursor: pointer;
90
110
  }
91
- .Tramitando, .revisión {
111
+
112
+ .Tramitando,
113
+ .revisión {
92
114
  background-color: #F87600;
93
115
  color: white;
94
116
  padding: 8px 16px;
@@ -101,7 +123,8 @@
101
123
  cursor: pointer;
102
124
  }
103
125
 
104
- .Tramitada, .Detenida {
126
+ .Tramitada,
127
+ .Detenida {
105
128
  background-color: #FDC652;
106
129
  color: white;
107
130
  padding: 8px 16px;
@@ -114,7 +137,9 @@
114
137
  cursor: pointer;
115
138
  }
116
139
 
117
- .Recibido, .Espera, .Revisión {
140
+ .Recibido,
141
+ .Espera,
142
+ .Revisión {
118
143
  background-color: #0069B4;
119
144
  color: white;
120
145
  padding: 8px 16px;
@@ -127,7 +152,14 @@
127
152
  cursor: pointer;
128
153
  }
129
154
 
130
- .Rechazado, .Rechazada, .Excedido, .Cancelada, .Cancelado, .Fallida, .Incompleto, .Incompleta {
155
+ .Rechazado,
156
+ .Rechazada,
157
+ .Excedido,
158
+ .Cancelada,
159
+ .Cancelado,
160
+ .Fallida,
161
+ .Incompleto,
162
+ .Incompleta {
131
163
  background-color: #F82617;
132
164
  color: white;
133
165
  padding: 8px 16px;
@@ -226,7 +258,8 @@ tr.example-element-row:not(.example-expanded-row):active {
226
258
  }
227
259
 
228
260
  tr.example-element-row:hover {
229
- filter: brightness(0.9); /* Oscurece un poco el color de fondo al pasar el mouse */
261
+ filter: brightness(0.9);
262
+ /* Oscurece un poco el color de fondo al pasar el mouse */
230
263
  }
231
264
 
232
265
  /* --- Ajustes para Mobile (Pantallas menores a 768px) --- */
@@ -253,7 +286,7 @@ tr.example-element-row:hover {
253
286
  border-radius: 10px !important;
254
287
  margin-bottom: 20px !important;
255
288
  padding: 15px !important;
256
- box-shadow: 0 4px 6px rgba(0,0,0,0.1) !important;
289
+ box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1) !important;
257
290
  height: auto !important;
258
291
  border: 1px solid #eee !important;
259
292
  width: 100% !important;
@@ -297,27 +330,30 @@ tr.example-element-row:hover {
297
330
  padding: 0 10px;
298
331
  }
299
332
 
300
- .izquierda, .derecha {
333
+ .izquierda,
334
+ .derecha {
301
335
  width: 100% !important;
302
336
  flex-direction: column !important;
303
- gap: 10px !important; /* Espacio uniforme entre elementos */
337
+ gap: 10px !important;
338
+ /* Espacio uniforme entre elementos */
304
339
  }
305
340
 
306
341
  .contenedor-columnas {
307
342
  width: 100%;
308
343
  justify-content: center;
309
344
  }
310
-
345
+
311
346
  /* Forzamos que Input, Select y Botón sean idénticos en ancho */
312
- .custom-input,
313
- mat-select.custom-input,
347
+ .custom-input,
348
+ mat-select.custom-input,
314
349
  .descargar {
315
350
  width: 100% !important;
316
351
  min-width: 100% !important;
317
352
  max-width: 100% !important;
318
353
  box-sizing: border-box !important;
319
354
  margin: 0 !important;
320
- height: 45px !important; /* Altura uniforme para mejor tacto */
355
+ height: 45px !important;
356
+ /* Altura uniforme para mejor tacto */
321
357
  display: flex !important;
322
358
  align-items: center !important;
323
359
  }
@@ -338,4 +374,4 @@ tr.example-element-row:hover {
338
374
  .detalle-oculto {
339
375
  display: none !important;
340
376
  }
341
- }
377
+ }
@@ -68,7 +68,8 @@
68
68
  <button mat-icon-button (click)="accion.ejecutar(element)" [matTooltip]="accion.textoAyuda"
69
69
  [matBadge]="accion.badge?.(element)" [matBadgeHidden]="!accion.badge || !accion.badge(element)"
70
70
  matBadgeColor="warn" matBadgeSize="large">
71
- <mat-icon [class]="accion.color">{{accion.icono}}</mat-icon>
71
+ <mat-icon [class]="accion.color"
72
+ [class.icono-atenuado]="estaAtenuado(element, accion.textoAyuda)">{{accion.icono}}</mat-icon>
72
73
  </button>
73
74
  }
74
75
  }
@@ -76,8 +77,8 @@
76
77
  <button mat-icon-button (click)="accion.ejecutar(element)" [matTooltip]="accion.textoAyuda"
77
78
  [disabled]="!estadosQuePermitenEdicion.includes(element.Estado)" [matBadge]="accion.badge?.(element)"
78
79
  [matBadgeHidden]="!accion.badge || !accion.badge(element)" matBadgeColor="warn" matBadgeSize="large">
79
- <mat-icon
80
- [class]="!estadosQuePermitenEdicion.includes(element.Estado) ? 'color: gray' : accion.color">{{accion.icono}}</mat-icon>
80
+ <mat-icon [class]="!estadosQuePermitenEdicion.includes(element.Estado) ? 'color: gray' : accion.color"
81
+ [class.icono-atenuado]="estaAtenuado(element, accion.textoAyuda)">{{accion.icono}}</mat-icon>
81
82
  </button>
82
83
  }
83
84
  @for(accionSiempreClickeable of accionesSiempreClickeable; track $index){
@@ -85,7 +86,8 @@
85
86
  [matTooltip]="accionSiempreClickeable.textoAyuda" [matBadge]="accionSiempreClickeable.badge?.(element)"
86
87
  [matBadgeHidden]="!accionSiempreClickeable.badge || !accionSiempreClickeable.badge(element)"
87
88
  matBadgeColor="warn" matBadgeSize="large">
88
- <mat-icon [class]="accionSiempreClickeable.color">{{accionSiempreClickeable.icono}}</mat-icon>
89
+ <mat-icon [class]="accionSiempreClickeable.color"
90
+ [class.icono-atenuado]="estaAtenuado(element, accionSiempreClickeable.textoAyuda)">{{accionSiempreClickeable.icono}}</mat-icon>
89
91
  </button>
90
92
  }
91
93
  </ng-container>
@@ -170,7 +172,8 @@
170
172
  </tr>
171
173
  @if(desplegable){
172
174
  <tr mat-row *matRowDef="let row; columns: ['expandedDetail']" class="example-detail-row"
173
- [class.detalle-oculto]="row !== elementoExpandible" [style.background-color]="row.ColorDeFondo ? row.ColorDeFondo : null">
175
+ [class.detalle-oculto]="row !== elementoExpandible"
176
+ [style.background-color]="row.ColorDeFondo ? row.ColorDeFondo : null">
174
177
  </tr>
175
178
  }
176
179
  </table>
@@ -249,6 +249,18 @@ export class TablaComponent implements OnInit, OnChanges, OnDestroy {
249
249
  }));
250
250
  }
251
251
 
252
+ estaAtenuado(element: any, textoAyuda: string): boolean {
253
+ if (!element?.SeccionesTrabajadas) return false;
254
+ try {
255
+ const secciones = typeof element.SeccionesTrabajadas === 'string'
256
+ ? JSON.parse(element.SeccionesTrabajadas)
257
+ : element.SeccionesTrabajadas;
258
+ return secciones?.[textoAyuda] === 'Sí';
259
+ } catch {
260
+ return false;
261
+ }
262
+ }
263
+
252
264
  ngOnDestroy() {
253
265
  this.subscriptions.unsubscribe();
254
266
  }
@@ -0,0 +1,26 @@
1
+ import { HttpClient } from '@angular/common/http';
2
+ import { DatosGlobalesService } from '../../datos-globales.service';
3
+
4
+ export interface DependenciasDeAccion {
5
+ http: HttpClient;
6
+ datosGlobalesService: DatosGlobalesService;
7
+ }
8
+
9
+ export const AccionesPersonalizadas: Record<string, (deps: DependenciasDeAccion) => void> = {
10
+ // Agregar aquí las acciones personalizadas con el mismo nombre que viene en el campo Acción de la tarjeta.
11
+ // Ejemplo:
12
+ // DescargarInformacionSociodemografica: (deps) => {
13
+ // deps.http.get(`${deps.datosGlobalesService.ObtenerURL()}misc/sociodemografica`, { responseType: 'blob' })
14
+ // .subscribe({
15
+ // next: (blob) => {
16
+ // const url = window.URL.createObjectURL(blob);
17
+ // const a = document.createElement('a');
18
+ // a.href = url;
19
+ // a.download = 'sociodemografica.xlsx';
20
+ // a.click();
21
+ // window.URL.revokeObjectURL(url);
22
+ // },
23
+ // error: (error) => console.error('Error al descargar:', error)
24
+ // });
25
+ // },
26
+ };
@@ -10,6 +10,7 @@ import { MatIconModule } from "@angular/material/icon";
10
10
  import { HttpClient } from "@angular/common/http";
11
11
  import { DatosGlobalesService } from '../../datos-globales.service';
12
12
  import { DragDropModule, CdkDragDrop, moveItemInArray } from '@angular/cdk/drag-drop';
13
+ import { AccionesPersonalizadas } from './AccionesPersonalizadas';
13
14
 
14
15
  interface BaseTarjetaConfig {
15
16
  type: 'single' | 'multiple' | 'report' | 'custom';
@@ -165,9 +166,10 @@ export class ContenedorPrincipalComponent implements OnInit, OnDestroy {
165
166
  }
166
167
 
167
168
  EjecutarAccionPersonalizada(accion: string) {
168
- // if (accion === 'DescargarInformacionSociodemografica') {
169
- // this.DescargarInformacionSociodemografica();
170
- // }
169
+ const fn = AccionesPersonalizadas[accion];
170
+ if (fn) {
171
+ fn({ http: this.http, datosGlobalesService: this.datosGlobalesService });
172
+ }
171
173
  }
172
174
 
173
175
  GenerarReporte(event: { reporte: string }) {