Skip to content

Commit 04b4112

Browse files
authored
FIX QA tickets (#119)
* FIX catalogs pagination * FIX dashboard product limit * FIX Ticket#831737 unable to add free product to cart from details * FIX Ticket#831423 - Update search url when changing keywords filter * ADD estimated price when priceType is usage on cart and checkout
1 parent f8e35b3 commit 04b4112

3 files changed

Lines changed: 26 additions & 2 deletions

File tree

src/app/pages/checkout/checkout.component.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,11 @@ <h1 class="mb-4 pb-2 mt-4 text-4xl font-extrabold leading-none tracking-tight te
135135
@for (price of item.options.pricing; track price) {
136136
<div class="flex place-content-center flex-col">
137137
<span class="font-bold text-gray-900 dark:text-primary-50 mr-3">{{ price['priceType'] }}:</span>
138-
<span class="text-xs text-gray-900 dark:text-primary-50">{{ price['price']['taxIncludedAmount']['value'] }} {{ price['price']['taxIncludedAmount']['unit'] }}
138+
<span class="text-xs text-gray-900 dark:text-primary-50">
139+
@if(price['priceType'] == 'usage'){
140+
Estimated price:
141+
}
142+
{{ price['price']['taxIncludedAmount']['value'] }} {{ price['price']['taxIncludedAmount']['unit'] }}
139143
@if(hasKey(price, 'recurringChargePeriod')){
140144
/ {{ price['recurringChargePeriod'] }}
141145
}

src/app/pages/search/search.component.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ export class SearchComponent implements OnInit {
8787
console.log(`Input updated`)
8888
if(this.searchField.value==''){
8989
this.keywords=undefined;
90+
this.updateQueryParams(this.keywords)
9091
console.log('EVENT CLEAR')
9192
await this.getProducts(false);
9293
}
@@ -142,16 +143,31 @@ export class SearchComponent implements OnInit {
142143
if(this.searchField.value!='' && this.searchField.value != null){
143144
console.log('FILTER KEYWORDS')
144145
this.keywords=this.searchField.value;
146+
this.updateQueryParams(this.keywords)
145147
//let filters = this.localStorage.getObject('selected_categories') as Category[] || [] ;
146148
await this.getProducts(false);
147149
} else {
148150
console.log('EMPTY FILTER KEYWORDS')
149151
this.keywords=undefined;
152+
this.updateQueryParams(this.keywords)
150153
//let filters = this.localStorage.getObject('selected_categories') as Category[] || [] ;
151154
await this.getProducts(false);
152155
}
153156
}
154157

158+
updateQueryParams(keywords: string | null) {
159+
if (keywords) {
160+
// Add/update the matrix param
161+
this.router.navigate(
162+
['/search', { keywords }],
163+
{ replaceUrl: true }
164+
);
165+
} else {
166+
// Navigate without the param
167+
this.router.navigate(['/search'], { replaceUrl: true });
168+
}
169+
}
170+
155171
checkPanel() {
156172
const filters = this.localStorage.getObject('selected_categories') as Category[] || [] ;
157173
const oldState = this.showPanel;

src/app/shared/cart-drawer/cart-drawer.component.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,11 @@
6969
<div class="flex place-content-center flex-col">
7070
<span class="font-bold text-gray-900 dark:text-primary-50 mr-3">{{ price['priceType'] }}:</span>
7171
<span
72-
class="text-xs text-gray-900 dark:text-primary-50">{{ price['price']['taxIncludedAmount']['value'] }}
72+
class="text-xs text-gray-900 dark:text-primary-50">
73+
@if(price['priceType'] == 'usage'){
74+
Estimated price:
75+
}
76+
{{ price['price']['taxIncludedAmount']['value'] }}
7377
{{ price['price']['taxIncludedAmount']['unit'] }}
7478
@if(hasKey(price, 'recurringChargePeriod')){
7579
/ {{ price['recurringChargePeriod'] }}

0 commit comments

Comments
 (0)