Skip to content

Commit d0d6209

Browse files
committed
fix collapse for RangeFacet
1 parent 40502dd commit d0d6209

File tree

5 files changed

+26
-20
lines changed

5 files changed

+26
-20
lines changed

packages/frontend/src/components/facets/RangeFacet.tsx

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ const RangeFacet = ({
111111
<div
112112
className={`flex flex-col ${
113113
width ? width : 'mx-1'
114-
} bg-base-max relative shadow-lg border-base-lighter border-1 rounded-b-md text-xs transition`}
114+
} bg-base-max relative border-base-lighter border-1 rounded-b-md text-xs transition`}
115115
id={field}
116116
>
117117
<FacetControlsHeader
@@ -127,7 +127,9 @@ const RangeFacet = ({
127127
<div className="card-face bg-base-max">
128128
<div className="overflow-hidden px-3.5 h-auto">
129129
<LoadingOverlay visible={!isSuccess} />
130-
<div className="flex flex-col gap-y-2 pb-2">
130+
<div
131+
className={`flex flex-col gap-y-2 pb-2 ${showFilters ? 'h-full' : 'h-0 invisible'}`}
132+
>
131133
<div className="flex gap-x-4 items-center">
132134
<NumberInput
133135
label="Min"
@@ -167,22 +169,17 @@ const RangeFacet = ({
167169
*/
168170
}
169171
</div>
170-
<div
171-
className={showFilters ? 'h-full' : 'h-0 invisible'}
172-
aria-hidden={!showFilters}
173-
>
174-
<RangeSlider
175-
mt="md"
176-
color="accent.5"
177-
thumbSize={20}
178-
value={[minMaxValue.from ?? minimum, minMaxValue.to ?? maximum]}
179-
min={minimum}
180-
max={maximum}
181-
onChange={(value) => {
182-
updateFilters(value[0], value[1]);
183-
}}
184-
/>
185-
</div>
172+
<RangeSlider
173+
mt="md"
174+
color="accent.5"
175+
thumbSize={20}
176+
value={[minMaxValue.from ?? minimum, minMaxValue.to ?? maximum]}
177+
min={minimum}
178+
max={maximum}
179+
onChange={(value) => {
180+
updateFilters(value[0], value[1]);
181+
}}
182+
/>
186183
</div>
187184
</div>
188185
</div>

packages/frontend/src/features/CohortBuilder/CohortBuilder.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ export const CohortBuilder = ({
4040
);
4141
}
4242

43+
console.log(TabsLayoutToComponentProp(tabsLayout));
44+
4345
return (
4446
<div className="w-full">
4547
<Tabs

packages/frontend/src/features/CohortBuilder/CohortPanel.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ export const CohortPanel = ({
239239
{/* Flex container to ensure proper 25/75 split */}
240240
<div className="flex w-full">
241241
{/* Left panel - 25% */}
242-
<div id="cohort-filters-content" className="flex-shrink-0 w-1/4 ">
242+
<div id="cohort-builder-filters" className="flex-shrink-0 w-1/4 ">
243243
{filters?.tabs && (
244244
<DropdownPanel
245245
index={index}

packages/frontend/src/features/CohortBuilder/types.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@ export interface ManifestFieldsConfig {
3636
referenceIdFieldInDataIndex: string;
3737
}
3838

39+
export interface SharedFilter {
40+
filter: string;
41+
sharedWith: Record<string, string>;
42+
}
43+
3944
export interface DataTypeConfig {
4045
dataType: string;
4146
nodeCountTitle?: string;
@@ -75,6 +80,7 @@ export interface CohortPanelConfig {
7580

7681
export interface CohortBuilderConfiguration extends ConfigVersionAndName {
7782
tabsLayout?: 'left' | 'right' | 'center'; // top level tabs layout
83+
sharedFilters?: Record<string, SharedFilter>; // enabled for sharing filters across indexes for denormalized data.
7884
explorerConfig: Array<CohortPanelConfig>;
7985
}
8086

packages/frontend/src/pages/Explorer/Explorer.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ const ExplorerPage = ({
88
headerProps,
99
footerProps,
1010
explorerConfig,
11+
tabsLayout,
1112
}: ExplorerPageProps): JSX.Element => {
1213
if (explorerConfig === undefined) {
1314
return (
@@ -26,7 +27,7 @@ const ExplorerPage = ({
2627
key: 'gen3-explorer-page',
2728
}}
2829
>
29-
<CohortBuilder explorerConfig={explorerConfig} />
30+
<CohortBuilder tabsLayout={tabsLayout} explorerConfig={explorerConfig} />
3031
</NavPageLayout>
3132
);
3233
};

0 commit comments

Comments
 (0)