Skip to content
Snippets Groups Projects
Commit 68e7340f authored by Piotr Gawron's avatar Piotr Gawron
Browse files

Merge branch '295-default-value-for-radio-button-of-image-format-and-submap' into 'main'

Resolve "Default value for radio button of image format and Submap"

See merge request !250
parents 7778a33e 98f45699
No related branches found
No related tags found
2 merge requests!264Resolve "add support for matomo",!250Resolve "Default value for radio button of image format and Submap"
Checking pipeline status
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)
-- Piotr Gawron <piotr.gawron@uni.lu> Fri, 04 Oct 2024 13:00:00 +0200
minerva-front (18.0.0~beta.4) stable; urgency=medium
* Bugfix: connectivity issue should report a problem with network instead of
submitting error report(#293)
......
......@@ -2,6 +2,6 @@ window.config = {
BASE_API_URL: 'https://lux1.atcomp.pl/minerva/api',
BASE_NEW_API_URL: 'https://lux1.atcomp.pl/minerva/new_api/',
BASE_MAP_IMAGES_URL: 'https://lux1.atcomp.pl/',
DEFAULT_PROJECT_ID: 'pdmap_appu_test',
DEFAULT_PROJECT_ID: 'sample',
ADMIN_PANEL_URL: 'https://lux1.atcomp.pl/minerva/admin.xhtml',
};
......@@ -4,7 +4,8 @@ import {
loadingConfigurationMainSelector,
} from '@/redux/configuration/configuration.selectors';
import { useAppSelector } from '@/redux/hooks/useAppSelector';
import { useContext } from 'react';
import { useContext, useState } from 'react';
import { CheckboxItem } from '@/components/Map/Drawer/ExportDrawer/CheckboxFilter/CheckboxFilter.types';
import { CheckboxFilter } from '../../CheckboxFilter';
import { CollapsibleSection } from '../../CollapsibleSection';
import { ExportContext } from '../ExportCompound.context';
......@@ -23,6 +24,16 @@ export const ImageFormat = (): React.ReactNode => {
label: name,
}));
const options = useState<CheckboxItem[]>(mappedElementAnnotations);
if (
!isPending &&
currentImageFormats.length === ZERO &&
options.length > ZERO &&
options[ZERO].length > ZERO
) {
setImageFormats([options[ZERO][ZERO]]);
}
return (
<CollapsibleSection title="Image format">
{isPending && <p>Loading...</p>}
......
import { ZERO } from '@/constants/common';
import { useAppSelector } from '@/redux/hooks/useAppSelector';
import { loadingModelsSelector, modelsDataSelector } from '@/redux/models/models.selectors';
import { useContext } from 'react';
import { useContext, useState } from 'react';
import { CheckboxItem } from '@/components/Map/Drawer/ExportDrawer/CheckboxFilter/CheckboxFilter.types';
import { CheckboxFilter } from '../../CheckboxFilter';
import { CollapsibleSection } from '../../CollapsibleSection';
import { ExportContext } from '../ExportCompound.context';
......@@ -18,6 +19,16 @@ export const Submap = (): React.ReactNode => {
label: name,
}));
const options = useState<CheckboxItem[]>(mappedElementAnnotations);
if (
!isPending &&
currentSelectedModels.length === ZERO &&
options.length > ZERO &&
options[ZERO].length > ZERO
) {
setModels([options[ZERO][ZERO]]);
}
return (
<CollapsibleSection title="Submap">
{isPending && <p>Loading...</p>}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment