Skip to content

Commit

Permalink
geosolutions-it#6495 fix for widgets width when adding them on the ma…
Browse files Browse the repository at this point in the history
…p viewer (geosolutions-it#6500)

* geosolutions-it#6495 fix for widgets width when adding them on the map viewer

* remvoe test

* refactor of the fix
  • Loading branch information
MV88 authored Feb 18, 2021
1 parent 0e64ecb commit e5200d2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
10 changes: 7 additions & 3 deletions web/client/components/widgets/enhancers/emptyTextState.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@ import emptyState from '../../misc/enhancers/emptyState';

export default emptyState(
({text} = {}) => !text,
({iconFit} = {}) => ({
iconFit,
tooltip: <Message msgId="widgets.errors.notext" />
() => ({
iconFit: false,
glyph: false,
style: {
margin: "auto"
},
title: <Message msgId="widgets.errors.notext" />
})
);
7 changes: 5 additions & 2 deletions web/client/plugins/Widgets.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,18 +78,21 @@ compose(
breakpoints: { xxs: 0 },
cols: { xxs: 1 }
} : {};

const viewWidth = width && width > 800 ? width - (500 + RIGHT_MARGIN) : width - RIGHT_MARGIN;
const widthOptions = width ? {width: viewWidth - 1} : {};
return ({
rowHeight,
className: "on-map",
breakpoints: { md: 480, xxs: 0 },
cols: { md: 6, xxs: 1 },
...widthOptions,
useDefaultWidthProvider: false,
style: {
left: (width && width > 800) ? "500px" : "0",
marginTop: 52,
bottom: 65,
height: Math.floor((height - 100) / (rowHeight + 10)) * (rowHeight + 10),
width: width && width > 800 ? `calc(100% - ${500 + RIGHT_MARGIN}px)` : `calc(100% - ${RIGHT_MARGIN}px)`,
width: viewWidth + 'px',
position: 'absolute',
zIndex: 50,
...maximizedStyle
Expand Down

0 comments on commit e5200d2

Please sign in to comment.