|
|
@@ -101,8 +101,15 @@ export class ConfigurateInputComponent implements OnInit {
|
|
|
this.formGroup.controls['ICONO'].setValue(COMPONENTS.ICONO);
|
|
|
this.formGroup.controls['VALOR_DEFECTO'].setValue(COMPONENTS.VALOR_DEFECTO);
|
|
|
this.formGroup.controls['PATRON_VALIDACION'].setValue(COMPONENTS.PATRON_VALIDACION);
|
|
|
- this.formGroup.controls['MENSAJE_ERROR_VALIDACION'].setValue(COMPONENTS.MENSAJE_ERROR_VALIDACION);
|
|
|
- this.formGroup.controls['PERMISOS'].setValue(this.arrUsers);
|
|
|
+ this.formGroup.controls['MENSAJE_ERROR_VALIDACION'].setValue(COMPONENTS.MENSAJE_ERROR_VALIDACION);
|
|
|
+
|
|
|
+ let USER_PERMISSION: string[] = [];
|
|
|
+ for (const userPermission of COMPONENTS.PERMISOS) {
|
|
|
+ const USER: string = await this._encService.decrypt(userPermission);
|
|
|
+ USER_PERMISSION.push(USER);
|
|
|
+ }
|
|
|
+
|
|
|
+ this.formGroup.controls['PERMISOS'].setValue(USER_PERMISSION);
|
|
|
this.formGroup.controls['PERMISOS'].setValue(COMPONENTS.PERMISOS);
|
|
|
this.formGroup.controls['DESHABILITAR'].setValue(COMPONENTS.DESHABILITAR);
|
|
|
this.formGroup.controls['REQUERIDO'].setValue(COMPONENTS.REQUERIDO);
|
|
|
@@ -198,45 +205,9 @@ export class ConfigurateInputComponent implements OnInit {
|
|
|
this.formGroup.controls['TAMANO_COLUMNA'].setValue(columnNumber)
|
|
|
}
|
|
|
|
|
|
- public openExampleInput() {
|
|
|
+ public async openExampleInput() {
|
|
|
|
|
|
- let columna = this.formGroup.controls['COLUMNA'].value;
|
|
|
- let etiqueta = this.formGroup.controls['ETIQUETA'].value;
|
|
|
- let identificador = this.formGroup.controls['IDENTIFICADOR'].value;
|
|
|
- let tipoCampo = this.formGroup.controls['TIPO_CAMPO'].value;
|
|
|
- let nombreCampo = this.formGroup.controls['NOMBRE_CAMPO'].value;
|
|
|
- let placeholder = this.formGroup.controls['PLACEHOLDER'].value;
|
|
|
- let longitudCampoMinimo = this.formGroup.controls['LONGITUD_CAMPO_MINIMO'].value;
|
|
|
- let longitudCampoMaximo = this.formGroup.controls['LONGITUD_CAMPO_MAXIMO'].value;
|
|
|
- let icono = this.formGroup.controls['ICONO'].value;
|
|
|
- let valorDefecto = this.formGroup.controls['VALOR_DEFECTO'].value;
|
|
|
- let patronValidacion = this.formGroup.controls['PATRON_VALIDACION'].value;
|
|
|
- let mensajeErrorValidacion = this.formGroup.controls['MENSAJE_ERROR_VALIDACION'].value;
|
|
|
- let permisos = this.formGroup.controls['PERMISOS'].value;
|
|
|
- let deshabilitar = this.formGroup.controls['DESHABILITAR'].value;
|
|
|
- let requerido = this.formGroup.controls['REQUERIDO'].value;
|
|
|
- let soloLectura = this.formGroup.controls['SOLO_LECTURA'].value;
|
|
|
- let tamanoColumna = this.formGroup.controls['TAMANO_COLUMNA'].value;
|
|
|
-
|
|
|
- const COMPONENT_INPUT: ComponentInformationInput = {
|
|
|
- COLUMNA: columna,
|
|
|
- ETIQUETA: etiqueta,
|
|
|
- IDENTIFICADOR: identificador,
|
|
|
- TIPO_CAMPO: tipoCampo,
|
|
|
- NOMBRE_CAMPO: nombreCampo,
|
|
|
- PLACEHOLDER: placeholder,
|
|
|
- LONGITUD_CAMPO_MINIMO: longitudCampoMinimo,
|
|
|
- LONGITUD_CAMPO_MAXIMO: longitudCampoMaximo,
|
|
|
- ICONO: icono,
|
|
|
- VALOR_DEFECTO: valorDefecto,
|
|
|
- PATRON_VALIDACION: patronValidacion,
|
|
|
- MENSAJE_ERROR_VALIDACION: mensajeErrorValidacion,
|
|
|
- DESHABILITAR: deshabilitar,
|
|
|
- REQUERIDO: requerido,
|
|
|
- SOLO_LECTURA: soloLectura,
|
|
|
- PERMISOS: permisos,
|
|
|
- TAMANO_COLUMNA: tamanoColumna,
|
|
|
- }
|
|
|
+ const COMPONENT_INPUT: ComponentInformationInput = await this._createComponentInput();
|
|
|
|
|
|
this._dialog.open(ExampleComponentComponent, {
|
|
|
data: {
|
|
|
@@ -247,7 +218,7 @@ export class ConfigurateInputComponent implements OnInit {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- public saveComponent() {
|
|
|
+ public async saveComponent() {
|
|
|
this._dialog.open(AlertComponent, {
|
|
|
data: {
|
|
|
title: 'Confirmación',
|
|
|
@@ -255,9 +226,11 @@ export class ConfigurateInputComponent implements OnInit {
|
|
|
icon: 'warning',
|
|
|
},
|
|
|
disableClose: true,
|
|
|
- }).afterClosed().subscribe((response) => {
|
|
|
+ }).afterClosed().subscribe(async (response) => {
|
|
|
if (response) {
|
|
|
- this._dialogRef.close(this.formGroup.value);
|
|
|
+ const COMPONENT_INPUT: ComponentInformationInput = await this._createComponentInput();
|
|
|
+
|
|
|
+ this._dialogRef.close(COMPONENT_INPUT);
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
@@ -271,7 +244,7 @@ export class ConfigurateInputComponent implements OnInit {
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
- private _createComponentInput() {
|
|
|
+ private async _createComponentInput(): Promise<ComponentInformationInput> {
|
|
|
let columna = this.formGroup.controls['COLUMNA'].value;
|
|
|
columna = columna.toString().trim();
|
|
|
let etiqueta = this.formGroup.controls['ETIQUETA'].value;
|
|
|
@@ -319,6 +292,7 @@ export class ConfigurateInputComponent implements OnInit {
|
|
|
PERMISOS: PERMISOS_ENC,
|
|
|
TAMANO_COLUMNA: tamanoColumna,
|
|
|
}
|
|
|
+ return COMPONENT_INPUT;
|
|
|
}
|
|
|
|
|
|
}
|