Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dobri1408 committed Aug 6, 2024
1 parent 27a2c86 commit f0a55c0
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions src/Widgets/VisualizationWidget.jsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
import React, { useState, useRef, useEffect } from 'react';

import React, { useState, useRef, useEffect, useCallback } from 'react';
import { Modal, Button, Grid } from 'semantic-ui-react';
import { toast } from 'react-toastify';
import { FormFieldWrapper, Icon, Toast } from '@plone/volto/components';

import MapBuilder from '@eeacms/volto-eea-map/Arcgis/Map/MapBuilder';
import {
initEditor,
destroyEditor,
validateEditor,
onPasteEditor,
} from '@eeacms/volto-eea-map/jsoneditor';

import editSVG from '@plone/volto/icons/editing.svg';

import '@eeacms/volto-eea-map/styles/editor.less';
import MapEditor from '../Arcgis/Editor/Editor';
import { debounce } from '../Arcgis/helpers';
Expand Down Expand Up @@ -170,7 +166,7 @@ const VisualizationWidget = (props) => {
const { id, title, description, value } = props;
const [showMapEditor, setShowMapEditor] = useState(false);

function onConnect() {
const onConnect = useCallback(() => {
if (controller.current.multiple && !props.block) return;
props.onChange(props.id, {
...value,
Expand All @@ -195,12 +191,12 @@ const VisualizationWidget = (props) => {
);
},
);
}
}, [props, value]);

function onDisconnect() {
const onDisconnect = useCallback(() => {
if (!controller.current.agReactive) return;
controller.current.agReactive.remove();
}
}, []);

useEffect(() => {
const map = $map.current;
Expand Down

0 comments on commit f0a55c0

Please sign in to comment.