import { Component, Input } from '@angular/core'; import { Router } from '@angular/router'; import { TranslationService } from '@core/services/translation.service'; import { MyApplicationFormUI } from '@features/configure-forms/form.typing'; import { I18nService } from '@yourcause/common/i18n'; @Component({ selector: 'gc-form-alerts', templateUrl: './form-alerts.component.html', styleUrls: ['./form-alerts.component.scss'] }) export class FormAlertsComponent { @Input() formAlerts: MyApplicationFormUI[]; @Input() alertHeaderText = this.i18n.translate( 'APPLY:textYouHaveAFormPastDue', {}, 'You have a form past due' ); // these options are to handle a simple version on apply page // vs a detailed view on my-applications page @Input() hideProgram = false; @Input() hideForm = false; @Input() hideAppId = false; @Input() hideFormAction = false; portalTranslations = this.translationService.viewTranslations; programTranslationMap = this.portalTranslations.Grant_Program; formTranslationMap = this.portalTranslations.FormTranslation; constructor ( private router: Router, private translationService: TranslationService, private i18n: I18nService ) { } goToForm (form: MyApplicationFormUI) { this.router.navigateByUrl( `/apply/application/${form.applicationId}/forms/${form.formId}` ); } }