Skip to content

Commit 9081b4d

Browse files
Samir Hassan Ayoubalinelariguet
authored andcommitted
fix(build): corrige erros de compilação com --prod
Ao compilar uma aplicação com AOT que contem o atributo fullTemplateTypeCheck no tsconfig ocorriam erros de acesso no HTML. Fixes DTHFUI-1427
1 parent 402b3b0 commit 9081b4d

27 files changed

+160
-160
lines changed

projects/templates/src/lib/components/po-modal-password-recovery/po-modal-password-recovery-base.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ export abstract class PoModalPasswordRecoveryBaseComponent {
7676
emailSentConfirmationPhrase: string, emailSentTitle: string, forgotPasswordTitle: string,
7777
insertCode: string, insertEmail: string, insertPhone: string, phoneErrorMessagePhrase: string,
7878
prepositionIn: string, prepositionOr: string, recoveryPasswordPhrase: string, resendEmailButton: string,
79-
resendSmsCodePhrase: string, sendAgain: string, sendButton: string, sms: string, smsCode: string,
79+
resendSmsCodePhrase: string, sendAgain: string, sendAgainPhrase: string, sendButton: string, sms: string, smsCode: string,
8080
smsCodeErrorMessagePhrase: string, sentSmsCodePhrase: string, supportContact: string, telephone: string, typeCodeTitle: string } =
8181
{
8282
...poModalPasswordRecoveryLiterals[poLocaleDefault],

projects/templates/src/lib/components/po-modal-password-recovery/po-modal-password-recovery.component.spec.ts

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -994,9 +994,7 @@ describe('PoModalPasswordRecoveryComponent:', () => {
994994
});
995995

996996
it('should show `email/sms` fields content if modalType value is `Email`', () => {
997-
component.emailModalPhrases = {
998-
firstPhrase: 'Phrase'
999-
};
997+
component.emailModalPhrases.firstPhrase = 'Phrase';
1000998
component.modalType = PoModalPasswordRecoveryModalContent.Email;
1001999
component.type = PoModalPasswordRecoveryType.All;
10021000

@@ -1005,15 +1003,14 @@ describe('PoModalPasswordRecoveryComponent:', () => {
10051003

10061004
const expectedContent = fixture.debugElement.query(By.css('.po-modal-password-recovery-text')).nativeElement;
10071005

1008-
expect(expectedContent.innerHTML).toContain(component.emailModalPhrases['firstPhrase']);
1006+
expect(expectedContent.innerHTML).toContain(component.emailModalPhrases.firstPhrase);
10091007
expect(expectedContent.innerHTML).not.toContain(component.literals.sentSmsCodePhrase);
10101008
expect(expectedContent.innerHTML).not.toContain(component.literals.emailSentConfirmationPhrase);
10111009
});
10121010

10131011
it('should show `smsCode` field content if modalType value is `SMSCode`', () => {
1014-
component.emailModalPhrases = {
1015-
firstPhrase: 'Phrase'
1016-
};
1012+
component.emailModalPhrases.firstPhrase = 'Phrase';
1013+
10171014
component.modalType = PoModalPasswordRecoveryModalContent.SMSCode;
10181015
component.type = PoModalPasswordRecoveryType.Email;
10191016

@@ -1023,14 +1020,12 @@ describe('PoModalPasswordRecoveryComponent:', () => {
10231020
const expectedContent = fixture.debugElement.query(By.css('.po-modal-password-recovery-text')).nativeElement;
10241021

10251022
expect(expectedContent.innerHTML).toContain(component.literals.sentSmsCodePhrase);
1026-
expect(expectedContent.innerHTML).not.toContain(component.emailModalPhrases['firstPhrase']);
1023+
expect(expectedContent.innerHTML).not.toContain(component.emailModalPhrases.firstPhrase);
10271024
expect(expectedContent.innerHTML).not.toContain(component.literals.emailSentConfirmationPhrase);
10281025
});
10291026

10301027
it('should show `smsCode` field content if modalType value is `Confirmation`', () => {
1031-
component.emailModalPhrases = {
1032-
firstPhrase: 'Phrase'
1033-
};
1028+
component.emailModalPhrases.firstPhrase = 'Phrase';
10341029
component.modalType = PoModalPasswordRecoveryModalContent.Confirmation;
10351030
component.type = PoModalPasswordRecoveryType.Email;
10361031

@@ -1041,7 +1036,7 @@ describe('PoModalPasswordRecoveryComponent:', () => {
10411036

10421037
expect(expectedContent.innerHTML).toContain(component.literals.emailSentConfirmationPhrase);
10431038
expect(expectedContent.innerHTML).not.toContain(component.literals.sentSmsCodePhrase);
1044-
expect(expectedContent.innerHTML).not.toContain(component.emailModalPhrases['firstPhrase']);
1039+
expect(expectedContent.innerHTML).not.toContain(component.emailModalPhrases.firstPhrase);
10451040
});
10461041

10471042
it('should contain `po-field-container-error-text` class if `invalidEmail` and control are true', () => {

projects/templates/src/lib/components/po-modal-password-recovery/po-modal-password-recovery.component.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export class PoModalPasswordRecoveryComponent extends PoModalPasswordRecoveryBas
4444
codeMask: string = '9 9 9 9 9 9';
4545
control: AbstractControl;
4646
emailModal: boolean = true;
47-
emailModalPhrases = {};
47+
emailModalPhrases = { firstPhrase: null as string, secondPhrase: null as string };
4848
endpoint: string = '.';
4949
invalidCode: boolean = false;
5050
invalidEmail: boolean = false;
@@ -196,11 +196,11 @@ export class PoModalPasswordRecoveryComponent extends PoModalPasswordRecoveryBas
196196

197197
private pipeModalPhrases() {
198198
if (this.type === PoModalPasswordRecoveryType.SMS) {
199-
this.emailModalPhrases['firstPhrase'] = this.setPipeArguments(this.literals.recoveryPasswordPhrase, this.literals.sms);
200-
this.emailModalPhrases['secondPhrase'] = this.setPipeArguments(this.literals.supportContact, this.literals.telephone);
199+
this.emailModalPhrases.firstPhrase = this.setPipeArguments(this.literals.recoveryPasswordPhrase, this.literals.sms);
200+
this.emailModalPhrases.secondPhrase = this.setPipeArguments(this.literals.supportContact, this.literals.telephone);
201201
} else {
202-
this.emailModalPhrases['firstPhrase'] = this.setPipeArguments(this.literals.recoveryPasswordPhrase, this.literals.email);
203-
this.emailModalPhrases['secondPhrase'] = this.setPipeArguments(this.literals.supportContact, this.literals.email);
202+
this.emailModalPhrases.firstPhrase = this.setPipeArguments(this.literals.recoveryPasswordPhrase, this.literals.email);
203+
this.emailModalPhrases.secondPhrase = this.setPipeArguments(this.literals.supportContact, this.literals.email);
204204
}
205205
}
206206

projects/templates/src/lib/components/po-page-change-password/po-page-change-password.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ export class PoPageChangePasswordComponent extends PoPageChangePasswordBaseCompo
5858

5959
readonly literals: { backButton: string, confirmPassword: string, createNewPassword: string, createNewPasswordPhrase: string,
6060
currentPassword: string, enterSystemButton: string, forgotPassword: string, newPassword: string, passwordSuccessfullyCreated: string,
61-
passwordSuccessfullyUpdated: string, safetyTips: string, safetyTipsPhrase: string, safetyTipsFirst: string, safetyTipsSecond: string,
62-
safetyTipsThird: string, saveButton: string } =
61+
passwordSuccessfullyUpdated: string, requirements: string, safetyTips: string, safetyTipsPhrase: string, safetyTipsFirst: string,
62+
safetyTipsSecond: string, safetyTipsThird: string, saveButton: string } =
6363
{
6464
...poPageChangePasswordLiterals[poLocaleDefault],
6565
...poPageChangePasswordLiterals[browserLanguage()],

projects/templates/src/lib/components/po-page-dynamic-edit/po-page-dynamic-edit.component.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,10 @@ export class PoPageDynamicEditComponent implements OnInit {
299299
return this._detailFields;
300300
}
301301

302+
detailActionNew() {
303+
this.gridDetail.insertRow();
304+
}
305+
302306
private cancel(path) {
303307
if (this.dynamicForm && this.dynamicForm.form.dirty) {
304308
this.poDialogService.confirm({
@@ -369,10 +373,6 @@ export class PoPageDynamicEditComponent implements OnInit {
369373
}
370374
}
371375

372-
private detailActionNew() {
373-
this.gridDetail.insertRow();
374-
}
375-
376376
private resolveUrl(item: any, path: string) {
377377
const uniqueKey = this.formatUniqueKey(item);
378378

projects/templates/src/lib/components/po-page-login/interfaces/po-page-login-literals.interface.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@
77
*/
88
export interface PoPageLoginLiterals {
99

10+
/** Mensagem de erro apresentada quando o campo customizado está inválido */
11+
customFieldErrorPattern?: string;
12+
13+
/** Placeholder para o campo customizado. */
14+
customFieldPlaceholder?: string;
15+
1016
/** Título exibido no topo da página. */
1117
title?: string;
1218

projects/templates/src/lib/components/po-page-login/po-page-login-base.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ export abstract class PoPageLoginBaseComponent implements OnDestroy {
169169
customizedDefaultLiterals: PoPageLoginLiterals = {};
170170
loginSubscription: Subscription;
171171
password: string;
172+
rememberUser: boolean = false;
172173
selectedLanguage: string;
173174
showExceededAttemptsWarning = false;
174175

@@ -190,7 +191,6 @@ export abstract class PoPageLoginBaseComponent implements OnDestroy {
190191
private _registerUrl: string;
191192
private _urlRecovery: string;
192193

193-
protected rememberUser: boolean = false;
194194

195195
/**
196196
* @optional

projects/templates/src/lib/components/po-page-login/po-page-login.component.ts

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,23 @@ export class PoPageLoginComponent extends PoPageLoginBaseComponent implements Af
9696
}
9797
}
9898

99+
openUrl(recovery: any): void {
100+
switch (typeof recovery) {
101+
case 'string': {
102+
this.setUrlRedirect(recovery);
103+
break;
104+
}
105+
case 'function': {
106+
recovery();
107+
break;
108+
}
109+
case 'object': {
110+
this.createModalPasswordRecoveryComponent(recovery);
111+
break;
112+
}
113+
}
114+
}
115+
99116
private checkingForMetadataProperty(object, property) {
100117
if (Object.prototype.hasOwnProperty.call(object, property)) {
101118
return object[property];
@@ -187,23 +204,6 @@ export class PoPageLoginComponent extends PoPageLoginBaseComponent implements Af
187204
});
188205
}
189206

190-
protected openUrl(recovery: any): void {
191-
switch (typeof recovery) {
192-
case 'string': {
193-
this.setUrlRedirect(recovery);
194-
break;
195-
}
196-
case 'function': {
197-
recovery();
198-
break;
199-
}
200-
case 'object': {
201-
this.createModalPasswordRecoveryComponent(recovery);
202-
break;
203-
}
204-
}
205-
}
206-
207207
protected setLoginErrors(errors: Array<string>) {
208208
const control = this.loginForm.form.controls['login'];
209209
this.setControlErrors('allLoginErrors', control, errors, this.literals.loginErrorPattern);

projects/templates/tsconfig.lib.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"annotateForClosureCompiler": true,
1616
"skipTemplateCodegen": true,
1717
"strictMetadataEmit": true,
18-
"fullTemplateTypeCheck": false,
18+
"fullTemplateTypeCheck": true,
1919
"strictInjectionParameters": true,
2020
"enableResourceInlining": true
2121
},

projects/ui/src/lib/components/po-calendar/po-calendar-base.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,13 @@ export class PoCalendarBaseComponent {
4444
private _maxDate: Date;
4545
private _minDate: Date;
4646

47+
currentYear: number;
4748
dayVisible: boolean = false;
4849
displayDays: Array<number>;
4950
displayDecade: Array<number>;
5051
displayFinalDecade: number;
5152
displayMonth: any;
53+
displayMonthNumber: number;
5254
displayMonths: Array<any> = Array();
5355
displayStartDecade: number;
5456
displayWeekDays: Array<any> = Array();
@@ -57,10 +59,8 @@ export class PoCalendarBaseComponent {
5759
yearVisible: boolean = false;
5860

5961
protected currentMonthNumber: number;
60-
protected currentYear: number;
6162
protected date: Date;
6263
protected dateIso: string;
63-
protected displayMonthNumber: number;
6464
protected lastDisplay: string;
6565
protected onTouched: any = null;
6666
protected propagateChange: any = null;

0 commit comments

Comments
 (0)