Skip to content

Commit

Permalink
forgot to push this commit
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonMilord committed Aug 14, 2024
1 parent c004b57 commit acd71fb
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ describe('quantic-refine-content', () => {

describe('when using custom sort options', () => {
it('should render the same custom sort options in the sort component and in the refine modal', () => {
visitRefineContent({});
visitRefineContent();
Expect.sortCriteriaInSearchRequest(defaultCustomOptionValue);

scope(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,15 +269,7 @@ export default class QuanticRefineModalContent extends LightningElement {
* @returns {Array<SortOption>}
*/
get sortOptions() {
return this.isSortComponentReady ? this.sortData : [];
}

/**
* Whether custom sort options are found in the store.
* @returns {boolean}
*/
get hasSortOptions() {
return this.sortData.length > 0;
return this.sortData.length > 0 ? this.sortData : [];
}

get shouldDisplayFiltersTitle() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,14 @@
<div class="slds-var-m-bottom_small slds-clearfix">
<template lwc:if={isSortComponentReady}>
<c-quantic-sort class="slds-float_left" engine-id={engineId}>
<template lwc:if={hasSortOptions}>
<template for:each={sortOptions} for:item="sortOption">
<c-quantic-sort-option
key={sortOption.value}
value={sortOption.value}
criterion={sortOption.criterion}
label={sortOption.label}
slot="sortOption"
></c-quantic-sort-option>
</template>
<template for:each={sortOptions} for:item="sortOption">
<c-quantic-sort-option
key={sortOption.value}
value={sortOption.value}
criterion={sortOption.criterion}
label={sortOption.label}
slot="sortOption"
></c-quantic-sort-option>
</template>
</c-quantic-sort>
</template>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,14 @@
<div class="slds-var-m-bottom_small slds-clearfix">
<template lwc:if={isSortComponentReady}>
<c-quantic-sort class="slds-float_left" engine-id={engineId}>
<template lwc:if={hasSortOptions}>
<template for:each={sortOptions} for:item="sortOption">
<c-quantic-sort-option
key={sortOption.value}
value={sortOption.value}
criterion={sortOption.criterion}
label={sortOption.label}
slot="sortOption"
></c-quantic-sort-option>
</template>
<template for:each={sortOptions} for:item="sortOption">
<c-quantic-sort-option
key={sortOption.value}
value={sortOption.value}
criterion={sortOption.criterion}
label={sortOption.label}
slot="sortOption"
></c-quantic-sort-option>
</template>
</c-quantic-sort>
</template>
Expand Down

0 comments on commit acd71fb

Please sign in to comment.