Skip to content

Commit 862e9e7

Browse files
authored
refactor: remove one feature flag and change default for another (#20010)
Removed feature flag: storeFrontLibCardParagraphTruncated Feature flag with default 'true' : productConfiguratorDeltaRendering
1 parent b1de4c3 commit 862e9e7

File tree

4 files changed

+16
-41
lines changed

4 files changed

+16
-41
lines changed

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

+1-8
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,6 @@ export interface FeatureTogglesInterface {
7777
*/
7878
pdfInvoicesSortByInvoiceDate?: boolean;
7979

80-
/**
81-
* In `CardComponent` it truncates the paragraph text
82-
* (analogically to the existing truncating of the label).
83-
*/
84-
storeFrontLibCardParagraphTruncated?: boolean;
85-
8680
/**
8781
* When enabled, the batch API is used `ProductCarouselComponent` to load products. It increases the component's performance.
8882
*
@@ -997,12 +991,11 @@ export const defaultFeatureToggles: Required<FeatureTogglesInterface> = {
997991
searchBoxV2: false,
998992
trendingSearches: false,
999993
pdfInvoicesSortByInvoiceDate: true,
1000-
storeFrontLibCardParagraphTruncated: true,
1001994
useProductCarouselBatchApi: false,
1002995
productConfiguratorAttributeTypesV2: true,
1003996
propagateErrorsToServer: false,
1004997
ssrStrictErrorHandlingForHttpAndNgrx: false,
1005-
productConfiguratorDeltaRendering: false,
998+
productConfiguratorDeltaRendering: true,
1006999
a11yRequiredAsterisks: true,
10071000
a11yQuantityOrderTabbing: true,
10081001
a11yNavigationUiKeyboardControls: true,

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

-1
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,6 @@ if (environment.cpq) {
299299
searchBoxV2: false,
300300
trendingSearches: false,
301301
pdfInvoicesSortByInvoiceDate: true,
302-
storeFrontLibCardParagraphTruncated: true,
303302
useProductCarouselBatchApi: true,
304303
productConfiguratorAttributeTypesV2: true,
305304
propagateErrorsToServer: true,

Diff for: projects/storefrontlib/shared/components/card/card.component.html

+12-20
Original file line numberDiff line numberDiff line change
@@ -58,27 +58,19 @@
5858
>
5959
<div class="cx-card-paragraph-title">{{ item.title }}</div>
6060
<div *ngFor="let text of item.text">
61-
<ng-container *cxFeature="'storeFrontLibCardParagraphTruncated'">
62-
<ng-container
63-
*ngTemplateOutlet="
64-
showText;
65-
context: {
66-
content: content,
67-
truncateText: truncateParagraphText,
68-
charactersLimit: charactersLimit,
69-
class: 'cx-card-paragraph-text',
70-
text: text,
71-
}
72-
"
73-
>
74-
</ng-container
75-
></ng-container>
76-
<div
77-
*cxFeature="'!storeFrontLibCardParagraphTruncated'"
78-
class="cx-card-paragraph-text"
61+
<ng-container
62+
*ngTemplateOutlet="
63+
showText;
64+
context: {
65+
content: content,
66+
truncateText: truncateParagraphText,
67+
charactersLimit: charactersLimit,
68+
class: 'cx-card-paragraph-text',
69+
text: text,
70+
}
71+
"
7972
>
80-
{{ text }}
81-
</div>
73+
</ng-container>
8274
</div>
8375
</div>
8476
<ng-content select="[label_container_bottom]"></ng-content>

Diff for: projects/storefrontlib/shared/components/card/card.component.spec.ts

+3-12
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class MockCxTruncateTextPopoverComponent {
4444
function getTruncatedPopover(elem: DebugElement) {
4545
return elem.queryAll(By.css('cx-truncate-text-popover'));
4646
}
47-
let isActiveStoreFrontLibCardParagraphTruncated: boolean;
47+
4848
@Directive({
4949
selector: '[cxFeature]',
5050
standalone: false,
@@ -56,10 +56,8 @@ class MockFeatureDirective {
5656
) {}
5757

5858
@Input() set cxFeature(feature: string) {
59-
const featureDesiredAndPresent =
60-
isActiveStoreFrontLibCardParagraphTruncated && !feature.startsWith('!');
61-
const featureNotDesiredAndNotPresent =
62-
!isActiveStoreFrontLibCardParagraphTruncated && feature.startsWith('!');
59+
const featureDesiredAndPresent = !feature.startsWith('!');
60+
const featureNotDesiredAndNotPresent = feature.startsWith('!');
6361
if (featureDesiredAndPresent || featureNotDesiredAndNotPresent) {
6462
this.viewContainer.createEmbeddedView(this.templateRef);
6563
} else {
@@ -98,7 +96,6 @@ describe('CardComponent', () => {
9896
spyOn(component.setDefaultCard, 'emit').and.callThrough();
9997
spyOn(component.sendCard, 'emit').and.callThrough();
10098
spyOn(component.editCard, 'emit').and.callThrough();
101-
isActiveStoreFrontLibCardParagraphTruncated = false;
10299
});
103100

104101
it('should create', () => {
@@ -225,13 +222,7 @@ describe('CardComponent', () => {
225222
checkParagraph(component, fixture, el);
226223
});
227224

228-
it('should render passed paragraph in case isActiveStoreFrontLibCardParagraphTruncated is active', () => {
229-
isActiveStoreFrontLibCardParagraphTruncated = true;
230-
checkParagraph(component, fixture, el);
231-
});
232-
233225
it('should render passed paragraph with text for truncated text popover for a long text', () => {
234-
isActiveStoreFrontLibCardParagraphTruncated = true;
235226
const mockCard: Card = {
236227
paragraphs: [
237228
{ title: 'paragraph1', text: ['text1'] },

0 commit comments

Comments
 (0)