mirror of
https://dev.azure.com/hugendubel/ISA/_git/ISA-Frontend
synced 2025-12-28 22:42:11 +01:00
Merged PR 2010: fix(reward-shopping-cart-item, filter-service): exclude downloads and text in...
fix(reward-shopping-cart-item, filter-service): exclude downloads and text inputs from counts Hide low stock warning for download items in reward shopping cart, as downloads don't have physical inventory constraints. Exclude text/searchbox inputs from selected filter count calculation to prevent search queries from inflating the filter badge counter. Remove unused isIconButtonActive computed property in filter menu button. Ref: #5441
This commit is contained in:
committed by
Lorenz Hilpert
parent
731df8414d
commit
11e2aaff8d
@@ -37,7 +37,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if (quantityControl.maxQuantity() < 2) {
|
||||
@if (quantityControl.maxQuantity() < 2 && !isDownload()) {
|
||||
<div
|
||||
class="text-isa-accent-red isa-text-body-2-bold flex flex-row items-center gap-2"
|
||||
>
|
||||
|
||||
@@ -8,6 +8,7 @@ import {
|
||||
} from '@angular/core';
|
||||
import { breakpoint, Breakpoint } from '@isa/ui/layout';
|
||||
import {
|
||||
hasOrderTypeFeature,
|
||||
SelectedRewardShoppingCartResource,
|
||||
ShoppingCartItem,
|
||||
} from '@isa/checkout/data-access';
|
||||
@@ -67,6 +68,10 @@ export class RewardShoppingCartItemComponent {
|
||||
|
||||
shoppingCartId = computed(() => this.#rewardShoppingCartResource.value()?.id);
|
||||
|
||||
isDownload = computed(() =>
|
||||
hasOrderTypeFeature(this.item().features, ['Download']),
|
||||
);
|
||||
|
||||
async updatePurchaseOption() {
|
||||
const shoppingCartItemId = this.itemId();
|
||||
const shoppingCartId = this.shoppingCartId();
|
||||
|
||||
@@ -493,7 +493,8 @@ export class FilterService {
|
||||
return currentState.inputs.reduce((count, input) => {
|
||||
// Simply check if input differs from default state
|
||||
// This handles all cases including NumberRange with default values
|
||||
if (!this.isDefaultFilterInput(input)) {
|
||||
// Excluding Text (Searchbox) inputs from the count
|
||||
if (!this.isDefaultFilterInput(input) && input.type !== InputType.Text) {
|
||||
return count + 1;
|
||||
}
|
||||
return count;
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#trigger="cdkOverlayOrigin"
|
||||
(click)="toggle()"
|
||||
type="button"
|
||||
[class.active]="isIconButtonActive()"
|
||||
[class.active]="!!selected"
|
||||
data-what="filter-button"
|
||||
>
|
||||
@if (selected > 0) {
|
||||
|
||||
@@ -28,8 +28,6 @@ export class FilterMenuButtonComponent {
|
||||
|
||||
#filter = inject(FilterService);
|
||||
|
||||
isIconButtonActive = computed(() => !this.#filter.isDefaultFilter());
|
||||
|
||||
selectedFilters = this.#filter.selectedFilterCount;
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user