Skip to content

Commit

Permalink
chore(atomic): remove unreachable condition (#4045)
Browse files Browse the repository at this point in the history
The condition is already present in the FacetGuard component
https://coveord.atlassian.net/browse/KIT-3238

---------

Co-authored-by: Olivier Lamothe <olamothe@coveo.com>
Co-authored-by: GitHub Actions Bot <>
Co-authored-by: Frederic Beaudoin <fbeaudoin@coveo.com>
Co-authored-by: Louis Bompart <lbompart@coveo.com>
Co-authored-by: Felix Perron-Brault <fpbrault@coveo.com>
  • Loading branch information
5 people authored Jun 4, 2024
1 parent 6144b86 commit c25a4bc
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ import {FacetInfo} from '../../../common/facets/facet-common-store';
import {FacetContainer} from '../../../common/facets/facet-container/facet-container';
import {FacetGuard} from '../../../common/facets/facet-guard';
import {FacetHeader} from '../../../common/facets/facet-header/facet-header';
import {FacetPlaceholder} from '../../../common/facets/facet-placeholder/facet-placeholder';
import {announceFacetSearchResultsWithAriaLive} from '../../../common/facets/facet-search/facet-search-aria-live';
import {FacetSearchInput} from '../../../common/facets/facet-search/facet-search-input';
import {FacetSearchMatches} from '../../../common/facets/facet-search/facet-search-matches';
Expand Down Expand Up @@ -403,7 +402,7 @@ export class AtomicCategoryFacet implements InitializableComponent<Bindings> {
hasError={hasError}
hasResults={values.length > 0}
>
{firstSearchExecuted ? (
{
<FacetContainer>
{this.renderHeader()}
{!this.isCollapsed && [
Expand Down Expand Up @@ -445,9 +444,7 @@ export class AtomicCategoryFacet implements InitializableComponent<Bindings> {
),
]}
</FacetContainer>
) : (
<FacetPlaceholder isCollapsed={this.isCollapsed} numberOfValues={8} />
)}
}
</FacetGuard>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import {FacetInfo} from '../../../common/facets/facet-common-store';
import {FacetContainer} from '../../../common/facets/facet-container/facet-container';
import {FacetGuard} from '../../../common/facets/facet-guard';
import {FacetHeader} from '../../../common/facets/facet-header/facet-header';
import {FacetPlaceholder} from '../../../common/facets/facet-placeholder/facet-placeholder';
import {announceFacetSearchResultsWithAriaLive} from '../../../common/facets/facet-search/facet-search-aria-live';
import {FacetSearchInput} from '../../../common/facets/facet-search/facet-search-input';
import {FacetSearchInputGuard} from '../../../common/facets/facet-search/facet-search-input-guard';
Expand Down Expand Up @@ -114,7 +113,7 @@ export class AtomicCommerceFacet implements InitializableComponent<Bindings> {
firstSearchExecuted={firstSearchExecuted}
hasResults={this.facetState.values.length > 0}
>
{firstSearchExecuted ? (
{
<FacetContainer>
<FacetHeader
i18n={this.bindings.i18n}
Expand All @@ -131,9 +130,7 @@ export class AtomicCommerceFacet implements InitializableComponent<Bindings> {
></FacetHeader>
{this.renderBody()}
</FacetContainer>
) : (
<FacetPlaceholder numberOfValues={8} isCollapsed={this.isCollapsed} />
)}
}
</FacetGuard>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import {FacetInfo} from '../../../common/facets/facet-common-store';
import {FacetContainer} from '../../../common/facets/facet-container/facet-container';
import {FacetGuard} from '../../../common/facets/facet-guard';
import {FacetHeader} from '../../../common/facets/facet-header/facet-header';
import {FacetPlaceholder} from '../../../common/facets/facet-placeholder/facet-placeholder';
import {formatHumanReadable} from '../../../common/facets/numeric-facet/formatter';
import {NumericFacetValueLink} from '../../../common/facets/numeric-facet/value-link';
import {NumericFacetValuesContainer} from '../../../common/facets/numeric-facet/values-container';
Expand Down Expand Up @@ -132,7 +131,7 @@ export class AtomicCommerceNumericFacet
hasError={hasError}
hasResults={this.shouldRenderFacet}
>
{firstSearchExecuted ? (
{
<FacetContainer>
<FacetHeader
i18n={i18n}
Expand Down Expand Up @@ -160,9 +159,7 @@ export class AtomicCommerceNumericFacet
),
]}
</FacetContainer>
) : (
<FacetPlaceholder isCollapsed={this.isCollapsed} numberOfValues={8} />
)}
}
</FacetGuard>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import {FacetInfo} from '../../../common/facets/facet-common-store';
import {FacetContainer} from '../../../common/facets/facet-container/facet-container';
import {FacetGuard} from '../../../common/facets/facet-guard';
import {FacetHeader} from '../../../common/facets/facet-header/facet-header';
import {FacetPlaceholder} from '../../../common/facets/facet-placeholder/facet-placeholder';
import {FacetValueLabelHighlight} from '../../../common/facets/facet-value-label-highlight/facet-value-label-highlight';
import {FacetValueLink} from '../../../common/facets/facet-value-link/facet-value-link';
import {FacetValuesGroup} from '../../../common/facets/facet-values-group/facet-values-group';
Expand Down Expand Up @@ -293,17 +292,15 @@ export class AtomicCommerceTimeframeFacet
hasError={hasError}
hasResults={this.shouldRenderFacet}
>
{firstSearchExecuted ? (
{
<FacetContainer>
{this.renderHeader()}
{!this.isCollapsed && [
this.shouldRenderValues && this.renderValues(),
this.shouldRenderInput && this.renderDateInput(),
]}
</FacetContainer>
) : (
<FacetPlaceholder isCollapsed={this.isCollapsed} numberOfValues={8} />
)}
}
</FacetGuard>
);
}
Expand Down

0 comments on commit c25a4bc

Please sign in to comment.