utn-cli 2.1.27 → 2.1.29
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/backend.js +9 -9
- package/package.json +1 -1
- package/templates/backend/servicios/Nucleo/InformacionDelModulo.js +0 -3
- package/templates/backend/servicios/Nucleo/Miscelaneas.js +4 -40
- 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/backend.js
CHANGED
|
@@ -43,7 +43,7 @@ async function inicializarProyectoBackend() {
|
|
|
43
43
|
await askAndReplace('DESCRIPCION_DEL_PROYECTO', '¿Cuál es la descripción del proyecto?: ');
|
|
44
44
|
await askAndReplace('DETALLE_DEL_PROYECTO', '¿Cuál es el detalle del proyecto?: ');
|
|
45
45
|
|
|
46
|
-
const NOMBRE_DEL_CANONICO_DEL_PROYECTO = await askAndReplace('NOMBRE_DEL_CANONICO_DEL_PROYECTO', '¿Cuál es el nombre canónico del proyecto?: ', null,
|
|
46
|
+
const NOMBRE_DEL_CANONICO_DEL_PROYECTO = await askAndReplace('NOMBRE_DEL_CANONICO_DEL_PROYECTO', '¿Cuál es el nombre canónico del proyecto?: ', null, NOMBRE_DEL_CANONICO_DEL_PROYECTO, (val) => {
|
|
47
47
|
const oldFileName = path.join(process.cwd(), 'NOMBRE_DEL_CANONICO_DEL_PROYECTO.rest');
|
|
48
48
|
const newFileName = path.join(process.cwd(), `${val}.rest`);
|
|
49
49
|
if (fs.existsSync(newFileName)) {
|
|
@@ -62,7 +62,7 @@ async function inicializarProyectoBackend() {
|
|
|
62
62
|
await askAndReplace('TIPO_DE_TARJETA', '¿Cuál es el tipo de tarjeta? Posibles valores: Área, Proceso, Servicio: ');
|
|
63
63
|
// await askAndReplace('NOMBRE_DEL_ROL', '¿Cuál es el nombre del rol?: ', rutaDeInformacionDelModulo, 'NOMBRE_DEL_ROL');
|
|
64
64
|
|
|
65
|
-
const NOMBRE_DEL_REPOSITORIO_DE_BASE_DE_DATOS = await askAndReplace('NOMBRE_DEL_REPOSITORIO_DE_BASE_DE_DATOS', '¿Cuál es el nombre del repositorio de base de datos?: ', null,
|
|
65
|
+
const NOMBRE_DEL_REPOSITORIO_DE_BASE_DE_DATOS = await askAndReplace('NOMBRE_DEL_REPOSITORIO_DE_BASE_DE_DATOS', '¿Cuál es el nombre del repositorio de base de datos?: ', null, NOMBRE_DEL_REPOSITORIO_DE_BASE_DE_DATOS, (val) => {
|
|
66
66
|
const rutaDeVariablesDeCalidad = path.join(process.cwd(), 'variables-calidad.env');
|
|
67
67
|
reemplazarContenidoEnArchivo(rutaDeVariablesDeCalidad, 'NOMBRE_DEL_REPOSITORIO_DE_BASE_DE_DATOS', val);
|
|
68
68
|
const rutaDeVariablesDeDesarrollo = path.join(process.cwd(), 'variables-desarrollo.env');
|
|
@@ -73,19 +73,19 @@ async function inicializarProyectoBackend() {
|
|
|
73
73
|
reemplazarContenidoEnArchivo(rutaDeDB, 'NOMBRE_DEL_REPOSITORIO_DE_BASE_DE_DATOS', val.slice(0, -3));
|
|
74
74
|
});
|
|
75
75
|
|
|
76
|
-
const NOMBRE_DEL_REPOSITORIO_DE_BACKEND = await askAndReplace('NOMBRE_DEL_REPOSITORIO_DE_BACKEND', '¿Cuál es el nombre del repositorio de backend?: ', null,
|
|
76
|
+
const NOMBRE_DEL_REPOSITORIO_DE_BACKEND = await askAndReplace('NOMBRE_DEL_REPOSITORIO_DE_BACKEND', '¿Cuál es el nombre del repositorio de backend?: ', null, NOMBRE_DEL_REPOSITORIO_DE_BACKEND, (val) => {
|
|
77
77
|
const rutaPackage = path.join(process.cwd(), 'package.json');
|
|
78
78
|
reemplazarContenidoEnArchivo(rutaPackage, 'nombre_del_repositorio_backend', val);
|
|
79
79
|
const rutaDeserver = path.join(process.cwd(), 'server.js');
|
|
80
80
|
reemplazarContenidoEnArchivo(rutaDeserver, 'NOMBRE_DEL_REPOSITORIO_DE_BACKEND', `${val} corriendo en el puerto 80.`);
|
|
81
81
|
});
|
|
82
82
|
|
|
83
|
-
await askAndReplace('NOMBRE_DEL_REPOSITORIO_DE_FRONTEND', '¿Cuál es el nombre del repositorio de frontend?: ');
|
|
84
|
-
await askAndReplace('NOMBRE_DEL_PERMISO', '¿Cuál es el nombre del permiso?: ');
|
|
85
|
-
await askAndReplace('DESCRIPCION_DEL_PERMISO', '¿Cuál es la descripción del permiso?: ');
|
|
83
|
+
await askAndReplace('NOMBRE_DEL_REPOSITORIO_DE_FRONTEND', '¿Cuál es el nombre del repositorio de frontend?: ', null, NOMBRE_DEL_REPOSITORIO_DE_FRONTEND);
|
|
84
|
+
await askAndReplace('NOMBRE_DEL_PERMISO', '¿Cuál es el nombre del permiso?: ', null, NOMBRE_DEL_PERMISO);
|
|
85
|
+
await askAndReplace('DESCRIPCION_DEL_PERMISO', '¿Cuál es la descripción del permiso?: ', null, DESCRIPCION_DEL_PERMISO);
|
|
86
86
|
// await askAndReplace('MENU_PADRE', '¿Cuál es el nombre canónico del menú padre?: ', rutaDeInformacionDelModulo, 'MENU_PADRE');
|
|
87
87
|
// await askAndReplace('COLOR_DEL_MODULO', '¿Cuál es el color del módulo?: ', rutaDeInformacionDelModulo, 'COLOR_DEL_MODULO');
|
|
88
|
-
await askAndReplace('CORREO_PARA_REPORTES', '¿Cuál es el correo para reportes?: ');
|
|
88
|
+
await askAndReplace('CORREO_PARA_REPORTES', '¿Cuál es el correo para reportes?: ', null, CORREO_PARA_REPORTES);
|
|
89
89
|
|
|
90
90
|
const nombre_de_desarrollador = await askAndReplace('nombre_de_desarrollador', '¿Cuál es el nombre del desarrollador?: ', path.join(process.cwd(), 'package.json'), 'nombre_de_desarrollador', (val) => {
|
|
91
91
|
reemplazarContenidoEnArchivo(path.join(process.cwd(), 'package.json'), 'nombre_de_desarrollador', `Para la Universidad Técnica Nacional por: ${val}`);
|
|
@@ -93,7 +93,7 @@ async function inicializarProyectoBackend() {
|
|
|
93
93
|
|
|
94
94
|
await askAndReplace('CEDULA_DEL_DESARROLLADOR', '¿Cuál es el número de cédula del desarrollador?: ', rutaDeInformacionDelModulo, 'CEDULA_DEL_DESARROLLADOR');
|
|
95
95
|
|
|
96
|
-
const url_del_grupo = await askAndReplace('url_del_grupo', '¿Cuál es la URL del grupo en el Git?: ', null,
|
|
96
|
+
const url_del_grupo = await askAndReplace('url_del_grupo', '¿Cuál es la URL del grupo en el Git?: ', null, url_del_grupo, (val) => {
|
|
97
97
|
reemplazarContenidoEnArchivo(path.join(process.cwd(), 'package.json'), 'url_del_grupo', val);
|
|
98
98
|
});
|
|
99
99
|
|
|
@@ -118,7 +118,7 @@ async function inicializarProyectoBackend() {
|
|
|
118
118
|
// reemplazarContenidoEnArchivo(rutaDeInformacionDelModulo, 'BACKENDS_QUE_CONSUME_ESTE_MODULO', '');
|
|
119
119
|
// }
|
|
120
120
|
|
|
121
|
-
await askAndReplace('VERSION', '¿Cuál es la versión del módulo?: ');
|
|
121
|
+
await askAndReplace('VERSION', '¿Cuál es la versión del módulo?: ', null, VERSION);
|
|
122
122
|
|
|
123
123
|
fs.writeFileSync(rutaDeInformacionDelModuloJson, JSON.stringify(informacionDelModuloJson, null, 2));
|
|
124
124
|
}
|
package/package.json
CHANGED
|
@@ -79,9 +79,6 @@ class InformacionDelModulo {
|
|
|
79
79
|
getBackEndsQueConsumeEsteModulo() {
|
|
80
80
|
return info.BACKENDS_QUE_CONSUME_ESTE_MODULO.split(',');
|
|
81
81
|
};
|
|
82
|
-
getUsuariosConAccesoInicial() {
|
|
83
|
-
return ['111050570', '204540859', '602990078', '109840817', '206860639', '801680123', '111050570'];
|
|
84
|
-
};
|
|
85
82
|
getCorreoParaReportes() {
|
|
86
83
|
return this._correo;
|
|
87
84
|
};
|
|
@@ -24,7 +24,6 @@ class Miscelaneo {
|
|
|
24
24
|
this.MenuPadre = InformacionDelModulo.getMenuPadre();
|
|
25
25
|
this.BackEndsQueConsumeEsteModulo = InformacionDelModulo.getBackEndsQueConsumeEsteModulo();
|
|
26
26
|
// this.PerfilGeneral = InformacionDelModulo.getPerfilGeneral();
|
|
27
|
-
this.UsuariosConAccesoInicial = InformacionDelModulo.getUsuariosConAccesoInicial();
|
|
28
27
|
this.IconoDelModulo = this.NombreCanonicoDelModulo + '.svg';
|
|
29
28
|
// this.ColorDelModulo = InformacionDelModulo.getColorDelModulo();
|
|
30
29
|
this.CorreoParaReportes = InformacionDelModulo.getCorreoParaReportes();
|
|
@@ -192,15 +191,11 @@ class Miscelaneo {
|
|
|
192
191
|
, [Permiso, this.NombreCanonicoDelModulo, Descripcion, Permiso, Descripcion]);
|
|
193
192
|
|
|
194
193
|
// Asginación inicial de permisos
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
await ejecutarConsultaSIGU("INSERT INTO `SIGU`.`SIGU_PermisosExtraPersonasV2` VALUES (?,\
|
|
199
|
-
(SELECT `Identificador` FROM `SIGU`.`SIGU_Personas` WHERE `Identificacion` = ?), NOW(4), USER())\
|
|
194
|
+
const PermisoExtraIdValor = await this.PermisoExtraId(Permiso);
|
|
195
|
+
await ejecutarConsultaSIGU("INSERT INTO `SIGU`.`SIGU_PermisosExtraPersonasV2` VALUES (?,\
|
|
196
|
+
(SELECT `Identificador` FROM `SIGU`.`SIGU_Personas` WHERE `Identificacion` = '111050570'), NOW(4), USER())\
|
|
200
197
|
ON DUPLICATE KEY UPDATE `LastUpdate` = NOW(4)"
|
|
201
|
-
|
|
202
|
-
});
|
|
203
|
-
}
|
|
198
|
+
, [PermisoExtraIdValor]);
|
|
204
199
|
}
|
|
205
200
|
|
|
206
201
|
async PermisoExtraId(Permiso) {
|
|
@@ -1101,22 +1096,6 @@ class Miscelaneo {
|
|
|
1101
1096
|
(SELECT `Identificador` FROM `SIGU`.`SIGU_Personas` WHERE `Identificacion` = '111050570'), NOW(4), USER()) ON DUPLICATE KEY UPDATE `LastUser` = USER()"
|
|
1102
1097
|
, [await this.permisoIdV2()]);
|
|
1103
1098
|
|
|
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
|
-
|
|
1120
1099
|
// Validación de que sólo el front especificado pueda consumir este backend
|
|
1121
1100
|
const uuidTemporal = await ejecutarConsultaSIGU("SELECT UUID() AS `UUID`");
|
|
1122
1101
|
await ejecutarConsultaSIGU("INSERT INTO `SIGU`.`SIGU_Repositorios` VALUES (?, ?) ON DUPLICATE KEY UPDATE `Identificador` = ?"
|
|
@@ -1304,21 +1283,6 @@ class Miscelaneo {
|
|
|
1304
1283
|
});
|
|
1305
1284
|
}
|
|
1306
1285
|
|
|
1307
|
-
// // Asginación inicial de permisos
|
|
1308
|
-
// if (this.UsuariosConAccesoInicial.length > 0) {
|
|
1309
|
-
// const rolPermisoIdDelPadre = await this.rolPermisoIdDelMenuPadre();
|
|
1310
|
-
// this.UsuariosConAccesoInicial.forEach(async (dato) => {
|
|
1311
|
-
// await ejecutarConsultaSIGU("INSERT INTO `SIGU`.`SIGU_RolesPersonas` VALUES (?, ?,\
|
|
1312
|
-
// (SELECT `Identificador` FROM `SIGU`.`SIGU_Personas` WHERE `Identificacion` = ?), NOW(4), USER())\
|
|
1313
|
-
// ON DUPLICATE KEY UPDATE `LastUpdate` = NOW(4)"
|
|
1314
|
-
// , [this.RolPermisoId, perfilGeneralId, dato]);
|
|
1315
|
-
// await ejecutarConsultaSIGU("INSERT INTO `SIGU`.`SIGU_RolesPersonas` VALUES (?, ?,\
|
|
1316
|
-
// (SELECT `Identificador` FROM `SIGU`.`SIGU_Personas` WHERE `Identificacion` = ?), NOW(4), USER())\
|
|
1317
|
-
// ON DUPLICATE KEY UPDATE `LastUpdate` = NOW(4)"
|
|
1318
|
-
// , [rolPermisoIdDelPadre, perfilGeneralId, dato]);
|
|
1319
|
-
// });
|
|
1320
|
-
// }
|
|
1321
|
-
|
|
1322
1286
|
// // Impresión de la información de registro
|
|
1323
1287
|
// console.log(new Date());
|
|
1324
1288
|
// console.log(`Módulo registrado correctamente en SIGU. Módulo: ${this.NombreCanonicoDelModulo}`);
|
|
@@ -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
|
|