Skip to content

Commit b1de4c3

Browse files
lasohlasoh1985
andauthored
refactor: cxcds-14235 remove recent searches feature flag (#19978)
Co-authored-by: Artur Lasocha <[email protected]>
1 parent c4c2deb commit b1de4c3

File tree

4 files changed

+9
-24
lines changed

4 files changed

+9
-24
lines changed

Diff for: projects/core/src/features-config/feature-toggles/config/feature-toggles.ts

-6
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,6 @@ export interface FeatureTogglesInterface {
6666
*/
6767
showStyleChangesInASM?: boolean;
6868

69-
/**
70-
* In `SearchBoxComponent` it shows the recent searches.
71-
*/
72-
recentSearches?: boolean;
73-
7469
/**
7570
* In `SearchBoxComponent` it shows the trending searches.
7671
*/
@@ -1000,7 +995,6 @@ export const defaultFeatureToggles: Required<FeatureTogglesInterface> = {
1000995
showBillingAddressInDigitalPayments: true,
1001996
showDownloadProposalButton: true,
1002997
searchBoxV2: false,
1003-
recentSearches: true,
1004998
trendingSearches: false,
1005999
pdfInvoicesSortByInvoiceDate: true,
10061000
storeFrontLibCardParagraphTruncated: true,

Diff for: projects/storefrontapp/src/app/spartacus/spartacus-features.module.ts

-1
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,6 @@ if (environment.cpq) {
297297
showBillingAddressInDigitalPayments: false,
298298
showDownloadProposalButton: false,
299299
searchBoxV2: false,
300-
recentSearches: true,
301300
trendingSearches: false,
302301
pdfInvoicesSortByInvoiceDate: true,
303302
storeFrontLibCardParagraphTruncated: true,

Diff for: projects/storefrontlib/cms-components/navigation/search-box/search-box-features.model.ts

-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,5 @@
66

77
export enum SearchBoxFeatures {
88
SEARCH_BOX_V2 = 'searchBoxV2',
9-
RECENT_SEARCHES_FEATURE = 'recentSearches',
109
TRENDING_SEARCHES_FEATURE = 'trendingSearches',
1110
}

Diff for: projects/storefrontlib/cms-components/navigation/search-box/search-box.component.html

+9-16
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,6 @@
136136
(click)="close($any($event), true)"
137137
role="listbox"
138138
[class.no-headers]="
139-
!isEnabledFeature(searchBoxFeatures.RECENT_SEARCHES_FEATURE) &&
140139
!isEnabledFeature(searchBoxFeatures.TRENDING_SEARCHES_FEATURE) &&
141140
!isEnabledFeature(searchBoxFeatures.SEARCH_BOX_V2)
142141
"
@@ -157,7 +156,6 @@ <h3 *ngIf="result.message" [innerHTML]="result.message"></h3>
157156
>
158157
<ng-container
159158
*ngIf="
160-
isEnabledFeature(searchBoxFeatures.RECENT_SEARCHES_FEATURE) ||
161159
isEnabledFeature(searchBoxFeatures.TRENDING_SEARCHES_FEATURE) ||
162160
isEnabledFeature(searchBoxFeatures.SEARCH_BOX_V2)
163161
"
@@ -171,7 +169,6 @@ <h3>
171169
attr.aria-label="{{ 'searchBox.ariaLabelSuggestions' | cxTranslate }}"
172170
role="listbox"
173171
[class.no-headers]="
174-
!isEnabledFeature(searchBoxFeatures.RECENT_SEARCHES_FEATURE) &&
175172
!isEnabledFeature(searchBoxFeatures.TRENDING_SEARCHES_FEATURE) &&
176173
!isEnabledFeature(searchBoxFeatures.SEARCH_BOX_V2)
177174
"
@@ -228,23 +225,19 @@ <h3>
228225
</div>
229226

230227
<!-- RECENT SEARCHES-->
231-
<ng-container *cxFeature="searchBoxFeatures.RECENT_SEARCHES_FEATURE">
232-
<ng-template
233-
*ngIf="config.recentSearches"
234-
[cxOutlet]="searchBoxOutlets.RECENT_SEARCHES"
235-
[cxOutletContext]="{
236-
search: searchInputEl?.nativeElement?.value ?? '',
237-
searchBoxActive: searchBoxActive,
238-
maxRecentSearches: config.maxRecentSearches,
239-
}"
240-
></ng-template>
241-
</ng-container>
242-
228+
<ng-template
229+
*ngIf="config.recentSearches"
230+
[cxOutlet]="searchBoxOutlets.RECENT_SEARCHES"
231+
[cxOutletContext]="{
232+
search: searchInputEl?.nativeElement?.value ?? '',
233+
searchBoxActive: searchBoxActive,
234+
maxRecentSearches: config.maxRecentSearches,
235+
}"
236+
></ng-template>
243237
<!--RESULT PRODUCTS-->
244238
<div class="products">
245239
<ng-container
246240
*ngIf="
247-
isEnabledFeature(searchBoxFeatures.RECENT_SEARCHES_FEATURE) ||
248241
isEnabledFeature(searchBoxFeatures.TRENDING_SEARCHES_FEATURE) ||
249242
isEnabledFeature(searchBoxFeatures.SEARCH_BOX_V2)
250243
"

0 commit comments

Comments
 (0)