From e747c2896b219f596f7122c3d0132d473fb21314 Mon Sep 17 00:00:00 2001 From: CSimoesJr Date: Tue, 29 Aug 2023 16:20:34 -0300 Subject: [PATCH] fix(lookup): ajustando property para letra maiuscula --- .../po-lookup-modal-base.component.spec.ts | 20 +++++++++---------- .../po-lookup-modal-base.component.ts | 4 ++-- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/projects/ui/src/lib/components/po-field/po-lookup/po-lookup-modal/po-lookup-modal-base.component.spec.ts b/projects/ui/src/lib/components/po-field/po-lookup/po-lookup-modal/po-lookup-modal-base.component.spec.ts index 52482b7991..18e8e83f74 100644 --- a/projects/ui/src/lib/components/po-field/po-lookup/po-lookup-modal/po-lookup-modal-base.component.spec.ts +++ b/projects/ui/src/lib/components/po-field/po-lookup/po-lookup-modal/po-lookup-modal-base.component.spec.ts @@ -518,11 +518,11 @@ describe('PoLookupModalBaseComponent:', () => { const expectedValueDisclaimer = { property: 'propertyTest', value: 'valueTest', - label: 'propertyTest: valueTest' + label: 'PropertyTest: valueTest' }; const expectedValueDisclaimerGroup = { title: 'titleTest', - disclaimers: [{ property: 'propertyTest', value: 'valueTest', label: 'propertyTest: valueTest' }] + disclaimers: [{ property: 'propertyTest', value: 'valueTest', label: 'PropertyTest: valueTest' }] }; component.addDisclaimer('valueTest', 'propertyTest'); @@ -534,10 +534,10 @@ describe('PoLookupModalBaseComponent:', () => { it("addDisclaimer: should return formated currency in locale default if field type is 'currency'", () => { component['language'] = 'pt'; component.advancedFilters = [{ property: 'value', type: 'currency' }]; - const expectedValueDisclaimer = { property: 'value', value: 321, label: 'value: 321,00' }; + const expectedValueDisclaimer = { property: 'value', value: 321, label: 'Value: 321,00' }; const expectedValueDisclaimerGroup = { title: 'titleTest', - disclaimers: [{ property: 'value', value: 321, label: 'value: 321,00' }] + disclaimers: [{ property: 'value', value: 321, label: 'Value: 321,00' }] }; component.addDisclaimer(321, 'value'); @@ -548,10 +548,10 @@ describe('PoLookupModalBaseComponent:', () => { it("addDisclaimer: should return formated currency in locale 'En' if field type is 'currency' and locale is 'en'", () => { component.advancedFilters = [{ property: 'value', type: 'currency', locale: 'en' }]; - const expectedValueDisclaimer = { property: 'value', value: 321, label: 'value: 321.00' }; + const expectedValueDisclaimer = { property: 'value', value: 321, label: 'Value: 321.00' }; const expectedValueDisclaimerGroup = { title: 'titleTest', - disclaimers: [{ property: 'value', value: 321, label: 'value: 321.00' }] + disclaimers: [{ property: 'value', value: 321, label: 'Value: 321.00' }] }; component.addDisclaimer(321, 'value'); @@ -570,10 +570,10 @@ describe('PoLookupModalBaseComponent:', () => { ] } ]; - const expectedValueDisclaimer = { property: 'company', value: 1, label: 'company: Totvs' }; + const expectedValueDisclaimer = { property: 'company', value: 1, label: 'Company: Totvs' }; const expectedValueDisclaimerGroup = { title: 'titleTest', - disclaimers: [{ property: 'company', value: 1, label: 'company: Totvs' }] + disclaimers: [{ property: 'company', value: 1, label: 'Company: Totvs' }] }; component.addDisclaimer(1, 'company'); @@ -589,10 +589,10 @@ describe('PoLookupModalBaseComponent:', () => { options: [{ value: 1 }, { value: 2 }] } ]; - const expectedValueDisclaimer = { property: 'company', value: 1, label: 'company: 1' }; + const expectedValueDisclaimer = { property: 'company', value: 1, label: 'Company: 1' }; const expectedValueDisclaimerGroup = { title: 'titleTest', - disclaimers: [{ property: 'company', value: 1, label: 'company: 1' }] + disclaimers: [{ property: 'company', value: 1, label: 'Company: 1' }] }; component.addDisclaimer(1, 'company'); diff --git a/projects/ui/src/lib/components/po-field/po-lookup/po-lookup-modal/po-lookup-modal-base.component.ts b/projects/ui/src/lib/components/po-field/po-lookup/po-lookup-modal/po-lookup-modal-base.component.ts index 99108974bf..c74c346775 100644 --- a/projects/ui/src/lib/components/po-field/po-lookup/po-lookup-modal/po-lookup-modal-base.component.ts +++ b/projects/ui/src/lib/components/po-field/po-lookup/po-lookup-modal/po-lookup-modal-base.component.ts @@ -5,7 +5,7 @@ import { catchError } from 'rxjs/operators'; import { InputBoolean } from '../../../../decorators'; -import { isTypeof } from '../../../../utils/util'; +import { capitalizeFirstLetter, isTypeof } from '../../../../utils/util'; import { poLocaleDefault } from '../../../../services/po-language/po-language.constant'; import { PoModalAction } from '../../../../components/po-modal'; import { PoModalComponent } from '../../../../components/po-modal/po-modal.component'; @@ -301,7 +301,7 @@ export abstract class PoLookupModalBaseComponent implements OnDestroy, OnInit { const fieldFilter = this.advancedFilters.find(filter => filter.property === property); this.disclaimer = { property: property }; this.disclaimer.value = value; - const labelProperty = fieldFilter.label ? fieldFilter.label : fieldFilter.property; + const labelProperty = fieldFilter.label || capitalizeFirstLetter(fieldFilter.property); if (fieldFilter.type === 'currency' && value) { this.formatValueToCurrency(fieldFilter, value);