Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 | 2x 2x 2x 2x 2x 4x 4x 4x 4x 4x | import { ChangeDetectionStrategy, Component, EventEmitter, OnInit, Output } from '@angular/core';
import { UntypedFormGroup } from '@angular/forms';
import { FormlyFieldConfig } from '@ngx-formly/core';
import { Observable, combineLatest, map } from 'rxjs';
import { AppFacade } from 'ish-core/facades/app.facade';
import { PasswordReminder } from 'ish-core/models/password-reminder/password-reminder.model';
/**
* The Request Reminder Form Component displays a Forgot Password Request Reminder form and triggers the submit.
*
* @example
* <ish-request-reminder-form
* (submitPasswordReminder)="requestPasswordReminder($event)"
* ></ish-request-reminder-form>
*/
@Component({
selector: 'ish-request-reminder-form',
templateUrl: './request-reminder-form.component.html',
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class RequestReminderFormComponent implements OnInit {
/**
* Submit the form data to trigger the request for a password reminder.
*/
@Output() submitPasswordReminder = new EventEmitter<PasswordReminder>();
requestReminderForm = new UntypedFormGroup({});
fields$: Observable<FormlyFieldConfig[]>;
constructor(private appFacade: AppFacade) {}
ngOnInit(): void {
this.fields$ = combineLatest([
this.appFacade.serverSetting$<boolean>('captcha.forgotPassword'),
this.appFacade.serverSetting$<boolean>('services.ReCaptchaV2ServiceDefinition.runnable'),
]).pipe(
map(([isCaptchaV2, isCaptchaTopicEnabled]) => [
{
key: 'email',
type: 'ish-email-field',
props: {
label: 'account.forgotdata.email.label',
hideRequiredMarker: true,
required: true,
},
},
{
type: 'ish-captcha-field',
props: {
topic: 'forgotPassword',
required: isCaptchaV2 && isCaptchaTopicEnabled,
fieldClass: 'offset-md-4 col-md-8',
},
},
])
);
}
submitForm() {
Iif (this.requestReminderForm.valid) {
this.submitPasswordReminder.emit(this.requestReminderForm.value);
}
}
}
|