utn-cli 2.1.26 → 2.1.28
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/commands/frontend.js +10 -0
- package/package.json +1 -1
- package/templates/backend/servicios/Nucleo/Miscelaneas.js +15 -15
- package/templates/frontend/src/app/Paginas/contenedor-principal/AccionesPersonalizadas.ts +2 -0
- package/templates/frontend/src/app/Paginas/contenedor-principal/contenedor-principal.component.ts +3 -2
package/commands/frontend.js
CHANGED
|
@@ -55,6 +55,16 @@ export async function updateFrontend(opciones = { cerrarAlFinalizar: true }) {
|
|
|
55
55
|
// Copiar archivos base
|
|
56
56
|
copiarDirectorios(directoriodePlantillas, directorioDestino, archivosAExcluir);
|
|
57
57
|
|
|
58
|
+
// Copiar AccionesPersonalizadas.ts solo si no existe en el destino
|
|
59
|
+
const rutaAccionesDestino = path.join(directorioDestino, 'src', 'app', 'Paginas', 'contenedor-principal', 'AccionesPersonalizadas.ts');
|
|
60
|
+
if (!fs.existsSync(rutaAccionesDestino)) {
|
|
61
|
+
const rutaAccionesTemplate = path.join(directoriodePlantillas, 'src', 'app', 'Paginas', 'contenedor-principal', 'AccionesPersonalizadas.ts');
|
|
62
|
+
if (fs.existsSync(rutaAccionesTemplate)) {
|
|
63
|
+
fs.copyFileSync(rutaAccionesTemplate, rutaAccionesDestino);
|
|
64
|
+
console.log('AccionesPersonalizadas.ts no encontrado, se copió desde la plantilla.');
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
58
68
|
// Merge de app.routes.ts
|
|
59
69
|
const rutaRoutesTemplate = path.join(directoriodePlantillas, 'src', 'app', 'app.routes.ts');
|
|
60
70
|
const rutaRoutesDestino = path.join(directorioDestino, 'src', 'app', 'app.routes.ts');
|
package/package.json
CHANGED
|
@@ -1101,21 +1101,21 @@ class Miscelaneo {
|
|
|
1101
1101
|
(SELECT `Identificador` FROM `SIGU`.`SIGU_Personas` WHERE `Identificacion` = '111050570'), NOW(4), USER()) ON DUPLICATE KEY UPDATE `LastUser` = USER()"
|
|
1102
1102
|
, [await this.permisoIdV2()]);
|
|
1103
1103
|
|
|
1104
|
-
// Asginación inicial de permisos
|
|
1105
|
-
if (this.UsuariosConAccesoInicial.length > 0) {
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
}
|
|
1104
|
+
// // Asginación inicial de permisos
|
|
1105
|
+
// if (this.UsuariosConAccesoInicial.length > 0) {
|
|
1106
|
+
// const permisoId = await this.permisoIdV2();
|
|
1107
|
+
// const permisoIdDelPadre = await this.permisoIdDelPadreV2();
|
|
1108
|
+
// this.UsuariosConAccesoInicial.forEach(async (dato) => {
|
|
1109
|
+
// await ejecutarConsultaSIGU("INSERT INTO `SIGU`.`SIGU_PermisosPersonasV2` VALUES (?,\
|
|
1110
|
+
// (SELECT `Identificador` FROM `SIGU`.`SIGU_Personas` WHERE `Identificacion` = ?), NOW(4), USER())\
|
|
1111
|
+
// ON DUPLICATE KEY UPDATE `LastUpdate` = NOW(4)"
|
|
1112
|
+
// , [permisoIdDelPadre, dato]);
|
|
1113
|
+
// await ejecutarConsultaSIGU("INSERT INTO `SIGU`.`SIGU_PermisosPersonasV2` VALUES (?,\
|
|
1114
|
+
// (SELECT `Identificador` FROM `SIGU`.`SIGU_Personas` WHERE `Identificacion` = ?), NOW(4), USER())\
|
|
1115
|
+
// ON DUPLICATE KEY UPDATE `LastUpdate` = NOW(4)"
|
|
1116
|
+
// , [permisoId, dato]);
|
|
1117
|
+
// });
|
|
1118
|
+
// }
|
|
1119
1119
|
|
|
1120
1120
|
// Validación de que sólo el front especificado pueda consumir este backend
|
|
1121
1121
|
const uuidTemporal = await ejecutarConsultaSIGU("SELECT UUID() AS `UUID`");
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { HttpClient } from '@angular/common/http';
|
|
2
|
+
import { MatDialog } from '@angular/material/dialog';
|
|
2
3
|
import { DatosGlobalesService } from '../../datos-globales.service';
|
|
3
4
|
|
|
4
5
|
export interface DependenciasDeAccion {
|
|
5
6
|
http: HttpClient;
|
|
6
7
|
datosGlobalesService: DatosGlobalesService;
|
|
8
|
+
dialog: MatDialog;
|
|
7
9
|
}
|
|
8
10
|
|
|
9
11
|
export const AccionesPersonalizadas: Record<string, (deps: DependenciasDeAccion) => void> = {
|
package/templates/frontend/src/app/Paginas/contenedor-principal/contenedor-principal.component.ts
CHANGED
|
@@ -7,6 +7,7 @@ import { TarjetaMultipleComponent } from "../../Componentes/Nucleo/tarjeta-multi
|
|
|
7
7
|
import { TarjetaReporteComponent } from "../../Componentes/Nucleo/tarjeta-reporte/tarjeta-reporte.component";
|
|
8
8
|
import { TarjetaPersonalizadaComponent } from "../../Componentes/Nucleo/tarjeta-personalizada/tarjeta-personalizada.component";
|
|
9
9
|
import { MatIconModule } from "@angular/material/icon";
|
|
10
|
+
import { MatDialog } from "@angular/material/dialog";
|
|
10
11
|
import { HttpClient } from "@angular/common/http";
|
|
11
12
|
import { DatosGlobalesService } from '../../datos-globales.service';
|
|
12
13
|
import { DragDropModule, CdkDragDrop, moveItemInArray } from '@angular/cdk/drag-drop';
|
|
@@ -75,7 +76,7 @@ export class ContenedorPrincipalComponent implements OnInit, OnDestroy {
|
|
|
75
76
|
this.isMobile = window.innerWidth <= 768;
|
|
76
77
|
}
|
|
77
78
|
|
|
78
|
-
constructor(private http: HttpClient, private datosGlobalesService: DatosGlobalesService) {
|
|
79
|
+
constructor(private http: HttpClient, private datosGlobalesService: DatosGlobalesService, private dialog: MatDialog) {
|
|
79
80
|
this.cantidad = 0;
|
|
80
81
|
this.cantidadMaxima = 0;
|
|
81
82
|
}
|
|
@@ -168,7 +169,7 @@ export class ContenedorPrincipalComponent implements OnInit, OnDestroy {
|
|
|
168
169
|
EjecutarAccionPersonalizada(accion: string) {
|
|
169
170
|
const fn = AccionesPersonalizadas[accion];
|
|
170
171
|
if (fn) {
|
|
171
|
-
fn({ http: this.http, datosGlobalesService: this.datosGlobalesService });
|
|
172
|
+
fn({ http: this.http, datosGlobalesService: this.datosGlobalesService, dialog: this.dialog });
|
|
172
173
|
}
|
|
173
174
|
}
|
|
174
175
|
|