Skip to content

Commit 0eae957

Browse files
Fix geosolutions-it#11794 the layout for modal, dialog due to the change in MapViewerLayout (geosolutions-it#11956)
1 parent 9272d15 commit 0eae957

8 files changed

Lines changed: 78 additions & 65 deletions

File tree

web/client/components/export/ExportPanel.jsx

Lines changed: 50 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import { Glyphicon } from 'react-bootstrap';
1313
import Button from '../misc/Button';
1414
import HTML from '../I18N/HTML';
1515
import Message from '../I18N/Message';
16+
import Portal from '../misc/Portal';
1617

1718
export default ({
1819
show = false,
@@ -24,58 +25,60 @@ export default ({
2425
onExport = () => {},
2526
onClose = () => {}
2627
}) => (show &&
27-
<div className="export-panel">
28-
<Button
29-
style={{
30-
border: "none",
31-
background: "transparent",
32-
color: "white",
33-
fontSize: 35,
34-
top: 0,
35-
right: 0,
36-
position: 'absolute'
37-
}}
38-
onClick={()=> onClose()}
39-
><Glyphicon glyph="1-close" />
40-
</Button>
41-
<div style={{
42-
margin: 'auto',
43-
maxWidth: 550
44-
}}>
45-
<div>
46-
<div className="export-panel-heading-icon">
47-
<Glyphicon glyph="upload"/>
48-
</div>
28+
<Portal>
29+
<div className="export-panel">
30+
<Button
31+
style={{
32+
border: "none",
33+
background: "transparent",
34+
color: "white",
35+
fontSize: 35,
36+
top: 0,
37+
right: 0,
38+
position: 'absolute'
39+
}}
40+
onClick={()=> onClose()}
41+
><Glyphicon glyph="1-close" />
42+
</Button>
43+
<div style={{
44+
margin: 'auto',
45+
maxWidth: 550
46+
}}>
4947
<div>
50-
{exportPanelTitle}
51-
</div>
52-
<br/>
53-
<div className="export-panel-formats-container">
54-
{toPairs(formats).map(([format, {label, glyph}]) =>
55-
<Button
56-
key={format}
57-
bsStyle="default"
58-
className={selectedFormat === format ? "format-selected" : ""}
59-
onClick={() => onSelect(format)}>
60-
<div>
61-
<Glyphicon style={{marginRight: '4px'}} glyph={glyph}/>
62-
{label}
63-
</div>
64-
</Button>
65-
)}
66-
</div>
67-
<br/>
68-
<Button bsStyle="primary" onClick={() => onExport(selectedFormat)}>{exportButtonLabel}</Button>
69-
<br/>
70-
<br/>
71-
{get(formats, `${selectedFormat}.description`, null)}
72-
{get(formats, `${selectedFormat}.note`) &&
48+
<div className="export-panel-heading-icon">
49+
<Glyphicon glyph="upload"/>
50+
</div>
51+
<div>
52+
{exportPanelTitle}
53+
</div>
54+
<br/>
55+
<div className="export-panel-formats-container">
56+
{toPairs(formats).map(([format, {label, glyph}]) =>
57+
<Button
58+
key={format}
59+
bsStyle="default"
60+
className={selectedFormat === format ? "format-selected" : ""}
61+
onClick={() => onSelect(format)}>
62+
<div>
63+
<Glyphicon style={{marginRight: '4px'}} glyph={glyph}/>
64+
{label}
65+
</div>
66+
</Button>
67+
)}
68+
</div>
69+
<br/>
70+
<Button bsStyle="primary" onClick={() => onExport(selectedFormat)}>{exportButtonLabel}</Button>
71+
<br/>
72+
<br/>
73+
{get(formats, `${selectedFormat}.description`, null)}
74+
{get(formats, `${selectedFormat}.note`) &&
7375
<>
7476
<hr/>
7577
{get(formats, `${selectedFormat}.note`)}
7678
</>
77-
}
79+
}
80+
</div>
7881
</div>
7982
</div>
80-
</div>
83+
</Portal>
8184
);

web/client/components/import/ImportDragZone.jsx

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import processFiles from './dragZone/enhancers/processFiles';
1313
import useFiles from './dragZone/enhancers/useFiles';
1414
import dropZoneHandlers from './dragZone/enhancers/dropZoneHandlers';
1515
import { compose } from 'recompose';
16+
import Portal from '../misc/Portal';
1617

1718
export default compose(
1819
processFiles,
@@ -24,12 +25,14 @@ export default compose(
2425
onDrop = () => {},
2526
onRef = () => {},
2627
...props
27-
}) => <DragZone
28-
onClose={onClose}
29-
onDrop={(files) => {
30-
return onDrop({ files, options: { importedVectorFileMaxSizeInMB: props.importedVectorFileMaxSizeInMB} });
31-
}}
32-
onRef={onRef}
33-
>
34-
<Content {...props} />
35-
</DragZone>);
28+
}) => <Portal>
29+
<DragZone
30+
onClose={onClose}
31+
onDrop={(files) => {
32+
return onDrop({ files, options: { importedVectorFileMaxSizeInMB: props.importedVectorFileMaxSizeInMB} });
33+
}}
34+
onRef={onRef}
35+
>
36+
<Content {...props} />
37+
</DragZone>
38+
</Portal>);

web/client/components/share/SharePanel.jsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ import {set} from '../../utils/ImmutableUtils';
3535
import OverlayTrigger from '../misc/OverlayTrigger';
3636
import ResizableModal from '../misc/ResizableModal';
3737
import { MapLibraries } from '../../utils/MapTypeUtils';
38+
import Portal from '../misc/Portal';
3839

3940
/**
4041
* SharePanel allow to share the current map in some different ways.
@@ -300,7 +301,7 @@ class SharePanel extends React.Component {
300301
</Tabs>);
301302
const hideInTabs = this.getHideIntabs(itemTabs);
302303
let sharePanel =
303-
(<ResizableModal
304+
(<Portal><ResizableModal
304305
id={this.props.modal ? "share-panel-dialog-modal" : "share-panel-dialog"}
305306
title={getMessageById(this.context.messages, "share.title")}
306307
dialogClassName=" share-win"
@@ -316,7 +317,7 @@ class SharePanel extends React.Component {
316317
&& this.renderAdvancedSettings()
317318
}
318319
</div>
319-
</ResizableModal>);
320+
</ResizableModal></Portal>);
320321
return sharePanel;
321322
}
322323

web/client/plugins/Print.jsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ import FlexBox from '../components/layout/FlexBox';
3939
import Text from '../components/layout/Text';
4040
import Button from '../components/layout/Button';
4141
import { getResolutionMultiplier } from '../utils/PrintUtils';
42+
import Portal from '../components/misc/Portal';
4243

4344
/**
4445
* Print plugin. This plugin allows to print current map view. **note**: this plugin requires the **printing module** to work.
@@ -568,7 +569,7 @@ export default {
568569
{this.renderBody()}
569570
</Panel>);
570571
}
571-
return (<Dialog start={{x: 0, y: 80}} id="mapstore-print-panel" style={{ zIndex: 1990, ...this.props.style}}>
572+
return (<Portal><Dialog start={{x: 0, y: 80}} id="mapstore-print-panel" style={{ zIndex: 1990, ...this.props.style}}>
572573
<FlexBox role="header" centerChildrenVertically gap="sm">
573574
<FlexBox.Fill component={Text} ellipsis fontSize="md" className="print-panel-title _padding-lr-sm">
574575
<Message msgId="print.paneltitle"/>
@@ -578,7 +579,7 @@ export default {
578579
</Button>
579580
</FlexBox>
580581
{this.renderBody()}
581-
</Dialog>);
582+
</Dialog></Portal>);
582583
}
583584
return this.renderBody();
584585
}

web/client/plugins/Settings.jsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import Dialog from '../components/misc/Dialog';
2323
import { getSupportedLocales } from '../utils/LocaleUtils';
2424
import Message from './locale/Message';
2525
import SettingsPanel from './settings/SettingsPanel';
26+
import Portal from '../components/misc/Portal';
2627

2728
const LangBar = connect((state) => ({
2829
currentLocale: state.locale && state.locale.current
@@ -142,13 +143,13 @@ class SettingsButton extends React.Component {
142143
{settings}
143144
</Panel>);
144145
}
145-
return (<Dialog id={this.props.id} style={{...this.props.panelStyle, display: this.props.visible ? 'block' : 'none'}} className={this.props.panelClassName} draggable={false} modal>
146+
return (<Portal><Dialog id={this.props.id} style={{...this.props.panelStyle, display: this.props.visible ? 'block' : 'none'}} className={this.props.panelClassName} draggable={false} modal>
146147
<span role="header">
147148
<span className="modal-title settings-panel-title"><Message msgId="settings"/></span>
148149
<button onClick={this.props.toggleControl} className="settings-panel-close close">{this.props.closeGlyph ? <Glyphicon glyph={this.props.closeGlyph}/> : <span>×</span>}</button>
149150
</span>
150151
{settings}
151-
</Dialog>);
152+
</Dialog></Portal>);
152153
}
153154
} else {
154155
return settings;

web/client/product/components/viewer/about/About.jsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import { Message } from '../../../../components/I18N/I18N';
1616
import AboutContent from './AboutContent';
1717
import aboutImg from '../../../assets/img/Blank.gif';
1818
import VersionInfo from './VersionInfo';
19+
import Portal from '../../../../components/misc/Portal';
1920

2021

2122
class About extends React.Component {
@@ -78,7 +79,7 @@ class About extends React.Component {
7879
);
7980
}
8081
return (
81-
<Dialog
82+
<Portal><Dialog
8283
id="mapstore-about"
8384
style={{zIndex: 1992, paddingTop: 0}}
8485
modal
@@ -102,7 +103,7 @@ class About extends React.Component {
102103
/>}
103104
{this.props.showAboutContent && <AboutContent/>}
104105
</div>
105-
</Dialog>
106+
</Dialog></Portal>
106107
);
107108
}
108109
return null;

web/client/themes/default/less/featuregrid.less

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,10 +229,11 @@
229229
.background-color-var(@theme-vars[main-bg]);
230230
width: 100%;
231231
height: 100%;
232+
min-height: 300px;
232233
bottom: 0;
233234
display: flex;
234235
justify-content: center;
235236
align-items: center;
236-
position: absolute;
237+
position: relative;
237238
}
238239
}

web/client/themes/default/less/map-footer.less

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,8 @@
113113
// Layout
114114
// **************
115115
.mapstore-map-footer {
116+
min-height: 42px;
117+
z-index: 10;
116118
border: 1px solid transparent;
117119
.leaflet-control-attribution {
118120
display: flex;

0 commit comments

Comments
 (0)