diff --git a/CHANGELOG b/CHANGELOG index 6be2d083938a389257ea878d2cbfe15e5e678926..e7e1ccbfa86d19020b6144736f30712738d83c6f 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,8 @@ minerva-front (18.0.0~beta.5) stable; urgency=medium * Small improvements: when exporting map as image provide default selections in for format and submap (#295) + * Small improvements: dropdown sections in exporting map as image are + unfolded permanently (#296) -- Piotr Gawron <piotr.gawron@uni.lu> Fri, 04 Oct 2024 13:00:00 +0200 diff --git a/src/components/Map/Drawer/ExportDrawer/CollapsibleSection/CollapsibleSection.component.tsx b/src/components/Map/Drawer/ExportDrawer/CollapsibleSection/CollapsibleSection.component.tsx index 2dc750a9bc35c59817b96191ed83478d7b453d84..0ac2e56dcd3bdaa1e888bd93665a65a82b9a0c5d 100644 --- a/src/components/Map/Drawer/ExportDrawer/CollapsibleSection/CollapsibleSection.component.tsx +++ b/src/components/Map/Drawer/ExportDrawer/CollapsibleSection/CollapsibleSection.component.tsx @@ -12,12 +12,14 @@ type CollapsibleSectionProps = { title: string; children: React.ReactNode; onOpened?(): void; + dangerouslySetExpanded?: boolean; }; export const CollapsibleSection = ({ title, children, onOpened, + dangerouslySetExpanded, }: CollapsibleSectionProps): React.ReactNode => { const handleOnChange = (ids: ID[]): void => { const hasBeenOpened = ids.length > ZERO; @@ -29,7 +31,7 @@ export const CollapsibleSection = ({ return ( <Accordion allowZeroExpanded onChange={handleOnChange}> - <AccordionItem> + <AccordionItem dangerouslySetExpanded={dangerouslySetExpanded}> <AccordionItemHeading> <AccordionItemButton>{title}</AccordionItemButton> </AccordionItemHeading> diff --git a/src/components/Map/Drawer/ExportDrawer/ExportCompound/ImageFormat/ImageFormat.component.test.tsx b/src/components/Map/Drawer/ExportDrawer/ExportCompound/ImageFormat/ImageFormat.component.test.tsx index e8c6df3921c6a70d96caeb543b922cd4e6de6ac8..33a1897e0ce24acfe01d55c03fabed60c191a44a 100644 --- a/src/components/Map/Drawer/ExportDrawer/ExportCompound/ImageFormat/ImageFormat.component.test.tsx +++ b/src/components/Map/Drawer/ExportDrawer/ExportCompound/ImageFormat/ImageFormat.component.test.tsx @@ -40,8 +40,6 @@ describe('ImageFormat - component', () => { }, }); - expect(screen.queryByTestId('checkbox-filter')).not.toBeVisible(); - const navigationButton = screen.getByTestId('accordion-item-button'); act(() => { diff --git a/src/components/Map/Drawer/ExportDrawer/ExportCompound/ImageFormat/ImageFormat.component.tsx b/src/components/Map/Drawer/ExportDrawer/ExportCompound/ImageFormat/ImageFormat.component.tsx index 3b735d200124c9e52ed3f8af67262a2fa2ab5ab4..84e59e239b00bd0769b97ecbcad0f4871e790688 100644 --- a/src/components/Map/Drawer/ExportDrawer/ExportCompound/ImageFormat/ImageFormat.component.tsx +++ b/src/components/Map/Drawer/ExportDrawer/ExportCompound/ImageFormat/ImageFormat.component.tsx @@ -35,7 +35,7 @@ export const ImageFormat = (): React.ReactNode => { } return ( - <CollapsibleSection title="Image format"> + <CollapsibleSection title="Image format" dangerouslySetExpanded> {isPending && <p>Loading...</p>} {!isPending && mappedElementAnnotations.length > ZERO && ( <CheckboxFilter diff --git a/src/components/Map/Drawer/ExportDrawer/ExportCompound/ImageSize/ImageSize.component.tsx b/src/components/Map/Drawer/ExportDrawer/ExportCompound/ImageSize/ImageSize.component.tsx index 1a66c44e45e0895fb78380222618fa74666cb59b..0847c46023efa0359df362fa47d60377f1ef0338 100644 --- a/src/components/Map/Drawer/ExportDrawer/ExportCompound/ImageSize/ImageSize.component.tsx +++ b/src/components/Map/Drawer/ExportDrawer/ExportCompound/ImageSize/ImageSize.component.tsx @@ -5,7 +5,7 @@ export const ImageSize = (): React.ReactNode => { const { width, height, handleChangeHeight, handleChangeWidth } = useImageSize(); return ( - <CollapsibleSection title="Image size"> + <CollapsibleSection title="Image size" dangerouslySetExpanded> <div className="flex flex-col gap-4"> <label className="flex h-9 items-center gap-4"> <span className="w-12">Width: </span> diff --git a/src/components/Map/Drawer/ExportDrawer/ExportCompound/Submap/Submap.component.test.tsx b/src/components/Map/Drawer/ExportDrawer/ExportCompound/Submap/Submap.component.test.tsx index 2374285dc947b4e0fa4c66e0ab8384f2ab58571f..6ee9cb42426c0d218bcf1922f0d4db5a0d6a41fd 100644 --- a/src/components/Map/Drawer/ExportDrawer/ExportCompound/Submap/Submap.component.test.tsx +++ b/src/components/Map/Drawer/ExportDrawer/ExportCompound/Submap/Submap.component.test.tsx @@ -39,8 +39,6 @@ describe('Submap - component', () => { }, }); - expect(screen.queryByTestId('checkbox-filter')).not.toBeVisible(); - const navigationButton = screen.getByTestId('accordion-item-button'); act(() => { diff --git a/src/components/Map/Drawer/ExportDrawer/ExportCompound/Submap/Submap.component.tsx b/src/components/Map/Drawer/ExportDrawer/ExportCompound/Submap/Submap.component.tsx index 1da3b420c5bbcca03697da82de237448d70913a6..422c4b7385fffdac8bde41a57f9c1ed0543986dd 100644 --- a/src/components/Map/Drawer/ExportDrawer/ExportCompound/Submap/Submap.component.tsx +++ b/src/components/Map/Drawer/ExportDrawer/ExportCompound/Submap/Submap.component.tsx @@ -30,7 +30,7 @@ export const Submap = (): React.ReactNode => { } return ( - <CollapsibleSection title="Submap"> + <CollapsibleSection title="Submap" dangerouslySetExpanded> {isPending && <p>Loading...</p>} {!isPending && mappedElementAnnotations && mappedElementAnnotations.length > ZERO && ( <CheckboxFilter