Skip to content

Commit 59a64b6

Browse files
committed
Merge branch 'hotfix-18.1' into develop
2 parents 932b1e8 + 98eef72 commit 59a64b6

2 files changed

Lines changed: 17 additions & 8 deletions

File tree

Rock.JavaScript.Obsidian/Framework/Controls/fieldFilterContainer.obs

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,17 @@
2929
const slots = useSlots();
3030

3131
/** True if the compare column should be displayed. */
32-
const hasCompareColumn = computed((): boolean => (!!slots.compare || !!props.compareLabel) && props.filterMode !== FilterMode.SimpleFilter);
32+
const hasCompareColumn = computed((): boolean => {
33+
if (slots.compare) {
34+
return true;
35+
}
36+
37+
if (props.compareLabel) {
38+
return props.filterMode !== FilterMode.SimpleFilter;
39+
}
40+
41+
return false;
42+
});
3343

3444
/** True if we have a plain text label to display in the compare column. */
3545
const hasCompareLabel = computed((): boolean => !!props.compareLabel);
@@ -53,7 +63,9 @@
5363
return "col-xs-12 col-md-8";
5464
}
5565
else if (props.compareLabel) {
56-
return "col-xs-12 col-md-10";
66+
return props.filterMode !== FilterMode.SimpleFilter
67+
? "col-xs-12 col-md-10"
68+
: "col-xs-12 col-md-12";
5769
}
5870
else {
5971
return "col-xs-12 col-md-12";

Rock.JavaScript.Obsidian/Framework/FieldTypes/utils.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,6 @@ export function getStandardFilterComponent(comparisonLabelOrTypes: ComparisonTyp
249249
/** True if the compare component should be visible. */
250250
const hasCompareComponent = computed(() => {
251251
return comparisonTypes !== null
252-
&& props.filterMode !== FilterMode.SimpleFilter
253252
&& !isSingleComparisonType(comparisonTypes)
254253
&& isCompareVisibleForComparisonFilter(comparisonTypes, props.filterMode);
255254
});
@@ -280,9 +279,8 @@ export function getStandardFilterComponent(comparisonLabelOrTypes: ComparisonTyp
280279
type = comparisonTypes;
281280
}
282281
else {
283-
// If the filter mode is simple, then the comparison type is
284-
// not shown so we come up with a sane default.
285-
if (props.filterMode === FilterMode.SimpleFilter) {
282+
// If the compare component is not visible, then come up with a sane default.
283+
if (!hasCompareComponent.value) {
286284
if (comparisonTypes === binaryComparisonTypes) {
287285
type = ComparisonType.EqualTo;
288286
}
@@ -294,8 +292,7 @@ export function getStandardFilterComponent(comparisonLabelOrTypes: ComparisonTyp
294292
}
295293
}
296294
else {
297-
// Get the comparison type selected by the user if we are
298-
// in advanced mode.
295+
// When the compare component is visible, get the comparison type selected by the user.
299296
type = toNumberOrNull(internalComparisonType.value);
300297
}
301298
}

0 commit comments

Comments
 (0)