From ae9ee51c12557f1801a2c01e75e94acb36fc7b00 Mon Sep 17 00:00:00 2001 From: renanarosario Date: Wed, 8 Jan 2025 14:13:22 -0300 Subject: [PATCH] ajuste geral --- .../interfaces/po-i18n-config-context.interface.ts | 2 +- .../services/po-i18n/po-i18n-base.service.spec.ts | 14 +++++++------- .../ui/src/lib/services/po-i18n/po-i18n.module.ts | 1 - .../ui/src/lib/services/po-i18n/po-i18n.service.ts | 4 +--- 4 files changed, 9 insertions(+), 12 deletions(-) diff --git a/projects/ui/src/lib/services/po-i18n/interfaces/po-i18n-config-context.interface.ts b/projects/ui/src/lib/services/po-i18n/interfaces/po-i18n-config-context.interface.ts index 5a969760a0..e8f5184c38 100644 --- a/projects/ui/src/lib/services/po-i18n/interfaces/po-i18n-config-context.interface.ts +++ b/projects/ui/src/lib/services/po-i18n/interfaces/po-i18n-config-context.interface.ts @@ -8,5 +8,5 @@ * @usedBy PoI18nModule */ export interface PoI18nConfigContext { - [name: string]: { [language: string]: { [literal: string]: string } } | { url: string }; + [name: string]: { [language: string]: { [literal: string]: string } } | { url: string }; } diff --git a/projects/ui/src/lib/services/po-i18n/po-i18n-base.service.spec.ts b/projects/ui/src/lib/services/po-i18n/po-i18n-base.service.spec.ts index 05dc678a8b..b91b561bd3 100644 --- a/projects/ui/src/lib/services/po-i18n/po-i18n-base.service.spec.ts +++ b/projects/ui/src/lib/services/po-i18n/po-i18n-base.service.spec.ts @@ -380,7 +380,7 @@ describe('PoI18nService:', () => { describe('getLiteralsFromContextService', () => { it(`should call 'observer.next' with translations if translations keys length is greater than 0 and call 'getLiteralsLocalStorageAndCache'`, () => { - const observer = { next: val => { } }; + const observer = { next: val => {} }; const translations = { car: 'Carro', people: 'Pessoas' }; const spyGetLiteralsLocalStorageAndCache = spyOn(service, 'getLiteralsLocalStorageAndCache'); @@ -396,7 +396,7 @@ describe('PoI18nService:', () => { it(`shouldn't call 'observer.next' with translations if translations keys length is 0 and call 'getLiteralsLocalStorageAndCache'`, () => { - const observer = { next: val => { } }; + const observer = { next: val => {} }; const spyGetLiteralsLocalStorageAndCache = spyOn(service, 'getLiteralsLocalStorageAndCache'); const spyMergeObject = spyOn(service, 'mergeObject').and.returnValue({}); @@ -413,7 +413,7 @@ describe('PoI18nService:', () => { describe('getLiteralsLocalStorageAndCache', () => { it(`should call 'searchInLocalStorage' and call 'observer.next' with mergedObject if 'useCache' is true`, fakeAsync(() => { - const observer = { next: val => { } }; + const observer = { next: val => {} }; const translations = { car: 'Car' }; const storageTranslations = { soccer: 'Soccer' }; @@ -437,7 +437,7 @@ describe('PoI18nService:', () => { it(`should call 'searchInLocalStorage' and not call 'observer.next' with mergedObject if 'useCache' is true and localstorage is empty`, fakeAsync(() => { - const observer = { next: val => { } }; + const observer = { next: val => {} }; const translations = { car: 'Car' }; @@ -458,7 +458,7 @@ describe('PoI18nService:', () => { it(`should call 'getHttpService' and call 'observer.next' with mergedObject from returned translations with current translation`, fakeAsync(() => { - const observer = { next: val => { } }; + const observer = { next: val => {} }; const translations = { car: 'Car' }; const translationsService = { people: 'People' }; @@ -477,7 +477,7 @@ describe('PoI18nService:', () => { })); it(`should search for literals in portuguese if not all literals was found`, fakeAsync(() => { - const observer = { next: val => { } }; + const observer = { next: val => {} }; const translations = { car: 'Car' }; const translationsService = { people: 'People' }; @@ -506,7 +506,7 @@ describe('PoI18nService:', () => { })); it(`should search for literals in portuguese if not all literals was found and languageAlternative is undefined`, fakeAsync(() => { - const observer = { next: val => { } }; + const observer = { next: val => {} }; const translations = { car: 'Car' }; const translationsService = { people: 'People' }; diff --git a/projects/ui/src/lib/services/po-i18n/po-i18n.module.ts b/projects/ui/src/lib/services/po-i18n/po-i18n.module.ts index 5c16df8503..10e341d501 100644 --- a/projects/ui/src/lib/services/po-i18n/po-i18n.module.ts +++ b/projects/ui/src/lib/services/po-i18n/po-i18n.module.ts @@ -206,4 +206,3 @@ export function initializeLanguageDefault(configs: Array, language }; return setDefaultLanguage; } - diff --git a/projects/ui/src/lib/services/po-i18n/po-i18n.service.ts b/projects/ui/src/lib/services/po-i18n/po-i18n.service.ts index e80c3e610d..fe74035e31 100644 --- a/projects/ui/src/lib/services/po-i18n/po-i18n.service.ts +++ b/projects/ui/src/lib/services/po-i18n/po-i18n.service.ts @@ -12,7 +12,7 @@ import { PoI18nConfig } from './interfaces/po-i18n-config.interface'; */ @Injectable({ providedIn: 'root' }) -export class PoI18nService extends PoI18nBaseService { } +export class PoI18nService extends PoI18nBaseService {} // Função usada para retornar instância para o módulo po-i18n.module export function returnPoI18nService( @@ -27,7 +27,5 @@ export function returnPoI18nService( })); const mergedConfig = deepmergeAll(validatedConfigs); - console.log('Configurações Mescladas:', mergedConfig); - return new PoI18nService(mergedConfig, http, languageService); }