Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions web/client/plugins/DynamicLegend/components/DynamicLegend.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ const DynamicLegend = ({
});
}, [isFloating, flatLegend, setConfiguration]);


return (
<ContainerComponent
{...(isFloating ? {
Expand All @@ -76,7 +75,6 @@ const DynamicLegend = ({
draggable: true,
style: { zIndex: 1993 }
} : {
containerStyle: dockStyle,
containerId: "dynamic-legend-container",
containerClassName: "dock-container",
className: "dynamic-legend-dock-panel",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { testEpic, addTimeoutEpic, TEST_TIMEOUT } from '../../../../epics/__test
import { dynamicLegendMapLayoutEpic } from '../dynamiclegend';
import { UPDATE_MAP_LAYOUT, updateMapLayout } from '../../../../actions/maplayout';
import { CONTROL_NAME } from '../../constants';
import { DEFAULT_PANEL_WIDTH } from '../../../../utils/LayoutUtils';

describe('dynamiclegend epics', () => {

Expand All @@ -28,9 +29,9 @@ describe('dynamiclegend epics', () => {
actions => {
expect(actions[0].type).toBe(UPDATE_MAP_LAYOUT);
expect(actions[0].source).toBe(CONTROL_NAME);
expect(actions[0].layout.right).toBe(620);
expect(actions[0].layout.right).toBe(DEFAULT_PANEL_WIDTH + (layout?.boundingSidebarRect?.right ?? 0));
expect(actions[0].layout.rightPanel).toBe(true);
expect(actions[0].layout.boundingMapRect.right).toBe(620);
expect(actions[0].layout.boundingMapRect.right).toBe(DEFAULT_PANEL_WIDTH);
expect(actions[0].layout.boundingSidebarRect.right).toBe(200);
done();
},
Expand Down
11 changes: 7 additions & 4 deletions web/client/plugins/DynamicLegend/epics/dynamiclegend.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,20 @@ const OFFSET = DEFAULT_PANEL_WIDTH;
*/
export const dynamicLegendMapLayoutEpic = (action$, store) =>
action$.ofType(UPDATE_MAP_LAYOUT)
.filter(({source}) => !isFloatingSelector(store.getState()) && enabledSelector(store.getState()) && isNil(source))
.filter(({source}) => {
return !isFloatingSelector(store.getState()) && enabledSelector(store.getState()) && isNil(source);
})
.map(({layout}) => {
const action = updateMapLayout({
const newLayout = {
...layout,
right: OFFSET + (layout?.boundingSidebarRect?.right ?? 0),
boundingMapRect: {
...(layout.boundingMapRect || {}),
right: OFFSET + (layout?.boundingSidebarRect?.right ?? 0)
right: OFFSET
},
rightPanel: true
});
};
const action = updateMapLayout(newLayout);
return { ...action, source: CONTROL_NAME };
});

Expand Down
Loading