diff --git a/client/src/components/map/MapComponent.tsx b/client/src/components/map/MapComponent.tsx
index 1f69a0a..0f8119d 100644
--- a/client/src/components/map/MapComponent.tsx
+++ b/client/src/components/map/MapComponent.tsx
@@ -33,7 +33,7 @@ import GisService from '../../services/GisService'
import MapMode from './MapMode'
import { satMapsProviders, schemas } from '../../constants/map'
import MapPrint from './MapPrint/MapPrint'
-import { Field, Menu, MenuButton, MenuList, MenuPopover, MenuTrigger, Combobox, Option, Button, Divider, Spinner, Portal, Dropdown, Tooltip, Drawer, DrawerHeader, DrawerBody, Text, Link } from '@fluentui/react-components'
+import { Field, Menu, MenuButton, MenuList, MenuPopover, MenuTrigger, Combobox, Option, Button, Divider, Spinner, Portal, Dropdown, Tooltip, Drawer, DrawerHeader, DrawerBody, Text, Link, List } from '@fluentui/react-components'
import { IRegion } from '../../interfaces/fuel'
import { useAppStore } from '../../store/app'
import { getDistrictData, getRegionData, setDistrictsData, setRegionsData } from '../../store/regions'
@@ -604,7 +604,7 @@ const MapComponent = ({
}, [selectedYear])
return (
-
+
{active &&
@@ -681,13 +681,121 @@ const MapComponent = ({
}
+
+
+
+ {!!selectedRegion && !selectedYear &&
+
+ } appearance='subtle' onClick={() => {
+ if (selectedDistrict) {
+ setSelectedDistrict(id, null)
+ districtSelect.getFeatures().clear()
+ regionsLayer.setOpacity(1)
+ } else {
+ setSelectedRegion(id, null)
+ regionSelect.getFeatures().clear()
-
-
- {!selectedRegion &&
-
+ if (map) {
+ const extent = regionsLayer.getSource()?.getExtent()
+
+ if (extent) {
+ map.getView().fit(fromExtent(extent), { duration: 100 })
+ regionsLayer.setOpacity(1)
+ }
+ }
+ }
+ }} />
+
+ {selectedDistrict ?
+ {getDistrictData(selectedDistrict)?.name}
+ :
+ {selectedRegion && getRegionData(selectedRegion)?.name}}
+
+ } onClick={() => {
+ setSelectedYear(id, null)
+ setSelectedDistrict(id, null)
+ setSelectedRegion(id, null)
+
+ if (map) {
+ const extent = regionsLayer.getSource()?.getExtent()
+
+ if (extent) {
+ map.getView().fit(fromExtent(extent), { duration: 100 })
+ regionsLayer.setOpacity(1)
+ }
+ }
+ }} />
+
+ }
+
+ {!!selectedRegion && !selectedYear ?
-
+
+ {selectedDistrict ?
+ selectedRegion && Object.entries(getRegionData(selectedRegion) as IRegion).map(([key, value]) => (
+
+ {key}
+ {value}
+
+ ))
+ :
+
+
+ {selectedRegion && Object.entries(getRegionData(selectedRegion) as IRegion).map(([key, value]) => (
+
+ {key}
+ {value}
+
+ ))}
+
+
+ {districtsData && districtsData.map((district: IDistrict) => (
+
{
+ setSelectedDistrict(id, district.id)
+ map?.removeInteraction(districtSelect)
+ }}
+ onMouseEnter={() => {
+ const feature = getFeatureByEntityId(district.id, districtsLayer)
+
+ if (feature) {
+ districtSelect.getFeatures().push(feature)
+ }
+ }}
+ onMouseLeave={() => {
+ districtSelect.getFeatures().clear()
+ }}
+ >{district.name}
+ ))}
+
+ }
+
+ {selectedDistrict &&
+
+ {
+ if (data.optionValue) {
+ setSelectedYear(id, Number(data.optionValue));
+ } else {
+ setSelectedYear(id, null);
+ }
+ }}
+ >
+ {schemas.map((el) => (
+
+ ))}
+
+
+ }
+
+
+ :
+
+
{regionsData && regionsData.map((region: IRegion) => (
{
setSelectedRegion(id, region.id)
@@ -707,117 +815,21 @@ const MapComponent = ({
))}
- }
+ }
-
-
- } appearance='subtle' onClick={() => {
- if (selectedDistrict) {
- setSelectedDistrict(id, null)
- districtSelect.getFeatures().clear()
- regionsLayer.setOpacity(1)
- } else {
- setSelectedRegion(id, null)
- regionSelect.getFeatures().clear()
-
- if (map) {
- const extent = regionsLayer.getSource()?.getExtent()
-
- if (extent) {
- map.getView().fit(fromExtent(extent), { duration: 100 })
- regionsLayer.setOpacity(1)
- }
- }
- }
- }} />
-
- {selectedDistrict ?
- {getDistrictData(selectedDistrict)?.name}
- :
- {selectedRegion && getRegionData(selectedRegion)?.name}}
-
- } onClick={() => {
- setSelectedYear(id, null)
- setSelectedDistrict(id, null)
- setSelectedRegion(id, null)
-
- if (map) {
- const extent = regionsLayer.getSource()?.getExtent()
-
- if (extent) {
- map.getView().fit(fromExtent(extent), { duration: 100 })
- regionsLayer.setOpacity(1)
- }
- }
- }} />
-
-
-
-
- {selectedDistrict ?
- selectedRegion && Object.entries(getRegionData(selectedRegion) as IRegion).map(([key, value]) => (
-
- {key}
- {value}
-
- ))
- :
-
-
- {selectedRegion && Object.entries(getRegionData(selectedRegion) as IRegion).map(([key, value]) => (
-
- {key}
- {value}
-
- ))}
-
-
- {districtsData && districtsData.map((district: IDistrict) => (
-
{
- setSelectedDistrict(id, district.id)
- map?.removeInteraction(districtSelect)
- }}
- onMouseEnter={() => {
- const feature = getFeatureByEntityId(district.id, districtsLayer)
-
- if (feature) {
- districtSelect.getFeatures().push(feature)
- }
- }}
- onMouseLeave={() => {
- districtSelect.getFeatures().clear()
- }}
- >{district.name}
- ))}
-
- }
-
- {selectedDistrict &&
-
- {
- if (data.optionValue) {
- setSelectedYear(id, Number(data.optionValue));
- } else {
- setSelectedYear(id, null);
- }
- }}
- >
- {schemas.map((el) => (
-
- ))}
-
-
- }
-
-
+
+ e.preventDefault()} onDrop={(e) => handleImageDrop(e, id)}>
+
+ {statusText && active && !selectedYear &&
+
+
+ {/* {statusText} */}
+
+
+ }
+
@@ -864,21 +876,8 @@ const MapComponent = ({
-
- e.preventDefault()} onDrop={(e) => handleImageDrop(e, id)}>
-
- {statusText && active && !selectedYear &&
-
-
- {/* {statusText} */}
-
-
- }
-
-
-
{(linesValidating || figuresValidating) && (