Skip to content

Commit

Permalink
feat(vac): variable para deshabilitar control de captcha (#2155)
Browse files Browse the repository at this point in the history
  • Loading branch information
juuliotero authored Mar 12, 2021
1 parent b30e044 commit 3099dbf
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/app/apps/vacunacion/components/inscripcion.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -132,12 +132,13 @@
label="Días en los que asiste al centro habitualmente" [(ngModel)]="diaSeleccion">
</plex-select>
</ng-container>
<div class="form-group mt-2">
<div class="form-group mt-2" *ngIf="captchaEnabled">
<re-captcha [(ngModel)]="recaptcha" name="mycaptcha" (resolved)="resolved($event)">
</re-captcha>
</div>
<div class="form-group mt-2" justify>
<plex-button label="Inscribirme" type="success" [disabled]="!recaptcha || !formulario.valid"
<plex-button label="Inscribirme" type="success"
[disabled]="(captchaEnabled && !recaptcha) || !formulario.valid"
[validateForm]="formulario" (click)="save($event)">
</plex-button>
</div>
Expand All @@ -164,4 +165,4 @@
<plex-button modal right type="success" (click)="limpiarForm()">
ACEPTAR
</plex-button>
</plex-modal>
</plex-modal>
3 changes: 3 additions & 0 deletions src/app/apps/vacunacion/components/inscripcion.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { ICiudadano } from '../interfaces/ICiudadano';
import { InscripcionService } from '../services/inscripcion.service';
import { ActivatedRoute } from '@angular/router';
import { map } from 'rxjs/operators';
import { captcha } from '../../../../environments/apiKeyMaps';

@Component({
selector: 'inscripcion',
Expand Down Expand Up @@ -85,6 +86,7 @@ export class InscripcionComponent implements OnInit {
public patronDocumento = /^[1-9]{1}[0-9]{4,7}$/;
public patronContactoNumerico = /^[0-9]{3,4}[0-9]{6}$/;
public grupoSelected;
public captchaEnabled = true;

constructor(
private plex: Plex,
Expand All @@ -94,6 +96,7 @@ export class InscripcionComponent implements OnInit {
private grupoPoblacionalService: GrupoPoblacionalService,
private route: ActivatedRoute
) {
this.captchaEnabled = captcha.enabled;
this.plex.updateTitle('Inscripción a vacunación COVID-19 - Provincia de Neuquén');
this.localidades$ = this.localidadService.get({ codigo: 15 }).pipe(
cache()
Expand Down
1 change: 1 addition & 0 deletions src/environments/apiKeyMaps.ts.example
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@ export const password_recovery = {
};

export const captcha = {
enabled: false,
key: 'XXXX'
};

0 comments on commit 3099dbf

Please sign in to comment.