utn-cli 2.0.23 → 2.0.24
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
|
@@ -60,6 +60,12 @@ Authorization: Bearer {{ AUTH_TOKEN }}
|
|
|
60
60
|
Content-Type: application/json
|
|
61
61
|
Origin: {{ BASE_URL }}
|
|
62
62
|
|
|
63
|
+
###
|
|
64
|
+
GET {{ BASE_URL }}/misc/obtenerMensajesModulares HTTP/1.1
|
|
65
|
+
Authorization: Bearer {{ AUTH_TOKEN }}
|
|
66
|
+
Content-Type: application/json
|
|
67
|
+
Origin: {{ BASE_URL }}
|
|
68
|
+
|
|
63
69
|
###
|
|
64
70
|
GET {{ BASE_URL }}/misc/obtenerMensajesInstitucionales HTTP/1.1
|
|
65
71
|
Authorization: Bearer {{ AUTH_TOKEN }}
|
|
@@ -168,6 +168,23 @@ Router.get('/obtenerDatosDelUsuario', async (solicitud, respuesta, next) => {
|
|
|
168
168
|
}
|
|
169
169
|
});
|
|
170
170
|
|
|
171
|
+
Router.get('/obtenerMensajesModulares', async (solicitud, respuesta, next) => {
|
|
172
|
+
try {
|
|
173
|
+
if (await Miscelaneo.validarTokenV2(solicitud.headers.authorization) && await Miscelaneo.validarAccesoDelOrigen(solicitud)) {
|
|
174
|
+
try {
|
|
175
|
+
return respuesta.json({ body: await Miscelaneo.obtenerMensajesModulares(), error: undefined });
|
|
176
|
+
} catch (error) {
|
|
177
|
+
const MensajeDeError = 'No fue posible obtener los mensajes modulares';
|
|
178
|
+
console.error(new ManejadorDeErrores(MensajeDeError, ManejadorDeErrores.obtenerNumeroDeLinea(), true, `Dirección IP: ${solicitud.ip}`));
|
|
179
|
+
return respuesta.status(500).json({ body: undefined, error: MensajeDeError });
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
return respuesta.status(401).json({ body: undefined, error: ManejadorDeErrores.mensajeDeError401() });
|
|
183
|
+
} catch (error) {
|
|
184
|
+
next(error);
|
|
185
|
+
}
|
|
186
|
+
});
|
|
187
|
+
|
|
171
188
|
Router.get('/obtenerMensajesInstitucionales', async (solicitud, respuesta, next) => {
|
|
172
189
|
try {
|
|
173
190
|
if (await Miscelaneo.validarTokenV2(solicitud.headers.authorization) && await Miscelaneo.validarAccesoDelOrigen(solicitud)) {
|
|
@@ -428,6 +428,11 @@ class Miscelaneo {
|
|
|
428
428
|
});
|
|
429
429
|
}
|
|
430
430
|
|
|
431
|
+
async obtenerMensajesModulares() {
|
|
432
|
+
return await ejecutarConsultaSIGU("SELECT `MensajeModularId`, `Titulo`, `Texto`, `FechaYHoraDeInicio`, `FechaYHoraDeFinalizacion` FROM `SIGU`.`SIGU_MensajesModulares` WHERE NOW(4) BETWEEN `FechaYHoraDeInicio` AND `FechaYHoraDeFinalizacion` AND `Modulo` = ?"
|
|
433
|
+
, [this.NombreCanonicoDelModulo]);
|
|
434
|
+
}
|
|
435
|
+
|
|
431
436
|
async obtenerMensajesInstitucionales() {
|
|
432
437
|
return await ejecutarConsultaSIGU("SELECT `MensajeInstitucionalId`, `Titulo`, `Texto`, `FechaYHoraDeInicio`, `FechaYHoraDeFinalizacion` FROM `SIGU`.`SIGU_MensajesInstitucionales` WHERE NOW(4) BETWEEN `FechaYHoraDeInicio` AND `FechaYHoraDeFinalizacion`");
|
|
433
438
|
}
|
|
@@ -33,6 +33,11 @@ export class ContenedorComponentesComponent {
|
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
+
obtenerMensajesModularesVisualizados(): string[] {
|
|
37
|
+
const datos = localStorage.getItem('MensajesModularesVisualizados');
|
|
38
|
+
return datos ? JSON.parse(datos) : [];
|
|
39
|
+
}
|
|
40
|
+
|
|
36
41
|
ngOnInit() {
|
|
37
42
|
const url = window.location.href.toLowerCase();
|
|
38
43
|
if (url.includes('calidad')) {
|
|
@@ -79,7 +84,7 @@ export class ContenedorComponentesComponent {
|
|
|
79
84
|
onClose: () => { this.datosGlobalesService.RedirigirALogin() },
|
|
80
85
|
onAccept: () => {
|
|
81
86
|
this.http.post(`${this.datosGlobalesService.ObtenerURL()}ConsentimientoInformado/AceptarConsentimientoInformado`
|
|
82
|
-
|
|
87
|
+
, { ConsentimientoInformadoId })
|
|
83
88
|
.subscribe({
|
|
84
89
|
next: (datos: any) => {
|
|
85
90
|
// this.obtenerDatosParaPoblarLaTabla();
|
|
@@ -93,6 +98,27 @@ export class ContenedorComponentesComponent {
|
|
|
93
98
|
});
|
|
94
99
|
}
|
|
95
100
|
});
|
|
101
|
+
this.http.get(this.datosGlobalesService.ObtenerURL() + 'misc/obtenerMensajesModulares').subscribe((datos: any) => {
|
|
102
|
+
let mensajesVisualizados = this.obtenerMensajesModularesVisualizados();
|
|
103
|
+
for (let contador = 0; contador < datos.body.length; contador++) {
|
|
104
|
+
const index = mensajesVisualizados.indexOf(datos.body[contador]['MensajeModularlId']);
|
|
105
|
+
if (index === -1) {
|
|
106
|
+
this.dialog.open(MensajeConfirmacionHTMLComponent, {
|
|
107
|
+
data: {
|
|
108
|
+
titulo: datos.body[contador]['Titulo'],
|
|
109
|
+
mensaje: datos.body[contador]['Texto'],
|
|
110
|
+
textoAceptar: 'Cerrar',
|
|
111
|
+
onClose: () => { },
|
|
112
|
+
onAccept: () => {
|
|
113
|
+
let mensajesVisualizados = this.obtenerMensajesModularesVisualizados();
|
|
114
|
+
mensajesVisualizados.push(datos.body[contador]['MensajeModularlId']);
|
|
115
|
+
localStorage.setItem('MensajesModularesVisualizados', JSON.stringify(mensajesVisualizados));
|
|
116
|
+
},
|
|
117
|
+
},
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
});
|
|
96
122
|
}
|
|
97
123
|
|
|
98
124
|
irAtras(): void {
|