Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #10631 New MapStore Home Page #10731

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
4 changes: 2 additions & 2 deletions binary/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,13 @@
<id>get-untar-jre-copy-db</id>
<phase>package</phase>
<configuration>
<tasks>
<target>
<echo message="Downloading JRE..." />
<get src="https://www.dropbox.com/scl/fi/1joi5d3ol2zeex5cle2tg/jdk_11_0_23.tar.gz?rlkey=4vsmejq23xkpctsw6qifs6of6&amp;st=k4xtzt68&amp;dl=1" dest="${project.build.directory}/jre.tar.gz" />
<echo message="Untar JRE..." />
<gunzip src="${project.build.directory}/jre.tar.gz" dest="${project.build.directory}/jre.tar" />
<untar src="${project.build.directory}/jre.tar" dest="${project.build.directory}/jre" />
</tasks>
</target>
</configuration>
<goals>
<goal>run</goal>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<mapstore2.version>DEV</mapstore2.version>
<tomcat.version>9.0.90</tomcat.version>
<tomcat.port>8080</tomcat.port>
<geostore-webapp.version>2.2-SNAPSHOT</geostore-webapp.version>
<geostore-webapp.version>2.3-SNAPSHOT</geostore-webapp.version>
<print-lib.version>2.3.1</print-lib.version>
<http_proxy.version>1.6-SNAPSHOT</http_proxy.version>
<spring.version>5.3.18</spring.version>
Expand Down
2 changes: 1 addition & 1 deletion project/standard/templates/configs/pluginsConfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@
]
},
{
"name": "DeleteMap",
"name": "DeleteResource",
"glyph": "trash",
"title": "plugins.DeleteMap.title",
"hidden": false,
Expand Down
2 changes: 2 additions & 0 deletions web/client/components/I18N/LangBar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ class LangBar extends React.Component {
className={this.props.className}>
<DropdownButton
pullRight
noCaret
id={this.props.id}
className="square-button-md _border-transparent"
title={
<FlagButton
componentAsButton={false}
Expand Down
4 changes: 2 additions & 2 deletions web/client/components/contextcreator/ContextCreator.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ export default class ContextCreator extends React.Component {
allAvailablePlugins: [],
isCfgValidated: false,
curStepId: 'general-settings',
saveDestLocation: '/context-manager',
saveDestLocation: '/',
onInit: () => { },
onSetStep: () => { },
onShowTutorial: () => { },
Expand All @@ -267,7 +267,7 @@ export default class ContextCreator extends React.Component {
pluginsToUpload: [],
onShowBackToPageConfirmation: () => { },
showBackToPageConfirmation: false,
backToPageDestRoute: '/context-manager',
backToPageDestRoute: '/',
backToPageConfirmationMessage: 'contextCreator.undo',
tutorials: CONTEXT_TUTORIALS,
tutorialsList: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ describe('ContextCreator component', () => {
expect(saveBtn.childNodes[0].innerHTML).toBe('save');
ReactTestUtils.Simulate.click(saveBtn); // <-- trigger event callback
// check destination path
expect(spyonSave).toHaveBeenCalledWith("/context-manager");
expect(spyonSave).toHaveBeenCalledWith("/");
});
it('custom destination', () => {
const eng = {
Expand Down
55 changes: 11 additions & 44 deletions web/client/components/home/Home.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,13 @@ import PropTypes from 'prop-types';
import { Glyphicon, Tooltip } from 'react-bootstrap';
import OverlayTrigger from '../misc/OverlayTrigger';
import Message from '../../components/I18N/Message';
import ConfirmModal from '../../components/misc/ResizableModal';
import { pick } from "lodash";
import { goToHomePage } from '../../actions/router';

class Home extends React.Component {
static propTypes = {
icon: PropTypes.string,
onCheckMapChanges: PropTypes.func,
onCloseUnsavedDialog: PropTypes.func,
displayUnsavedDialog: PropTypes.bool,
renderUnsavedMapChangesDialog: PropTypes.bool,
tooltipPosition: PropTypes.string,
bsStyle: PropTypes.string,
hidden: PropTypes.bool
Expand All @@ -36,9 +32,6 @@ class Home extends React.Component {

static defaultProps = {
icon: "home",
onCheckMapChanges: () => {},
onCloseUnsavedDialog: () => {},
renderUnsavedMapChangesDialog: true,
tooltipPosition: 'left',
bsStyle: 'primary',
hidden: false
Expand All @@ -48,47 +41,21 @@ class Home extends React.Component {
const { tooltipPosition, hidden, ...restProps} = this.props;
let tooltip = <Tooltip id="toolbar-home-button">{<Message msgId="gohome"/>}</Tooltip>;
return hidden ? false : (
<React.Fragment>
<OverlayTrigger overlay={tooltip} placement={tooltipPosition}>
<Button
id="home-button"
className="square-button"
bsStyle={this.props.bsStyle}
onClick={this.checkUnsavedChanges}
tooltip={tooltip}
{...pick(restProps, ['disabled', 'active', 'block', 'componentClass', 'href', 'children', 'icon', 'bsStyle', 'className'])}
><Glyphicon glyph={this.props.icon}/></Button>
</OverlayTrigger>
<ConfirmModal
ref="unsavedMapModal"
show={this.props.displayUnsavedDialog || false}
onClose={this.props.onCloseUnsavedDialog}
title={<Message msgId="resources.maps.unsavedMapConfirmTitle" />}
buttons={[{
bsStyle: "primary",
text: <Message msgId="resources.maps.unsavedMapConfirmButtonText" />,
onClick: this.goHome
}, {
text: <Message msgId="resources.maps.unsavedMapCancelButtonText" />,
onClick: this.props.onCloseUnsavedDialog
}]}
fitContent
>
<div className="ms-detail-body">
<Message msgId="resources.maps.unsavedMapConfirmMessage" />
</div>
</ConfirmModal>
</React.Fragment>
<OverlayTrigger overlay={tooltip} placement={tooltipPosition}>
<Button
id="home-button"
className="square-button"
bsStyle={this.props.bsStyle}
onClick={this.checkUnsavedChanges}
tooltip={tooltip}
{...pick(restProps, ['disabled', 'active', 'block', 'componentClass', 'href', 'children', 'icon', 'bsStyle', 'className'])}
><Glyphicon glyph={this.props.icon}/></Button>
</OverlayTrigger>
);
}

checkUnsavedChanges = () => {
if (this.props.renderUnsavedMapChangesDialog) {
this.props.onCheckMapChanges(this.goHome);
} else {
this.props.onCloseUnsavedDialog();
this.goHome();
}
this.goHome();
}

goHome = () => {
Expand Down
4 changes: 2 additions & 2 deletions web/client/components/layout/BorderLayout.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ export default ({id, children, header, footer, columns, height, style = {}, clas
flex: 1,
overflowY: "auto"
}}>
<main className="ms2-border-layout-content" style={{flex: 1, overflowX: 'hidden'}}>
<div className="ms2-border-layout-content" style={{flex: 1, overflowX: 'hidden'}}>
{height ? <div style={{height}}>{children}</div> : children}
</main>
</div>
{height ? <div style={{height}}>{columns}</div> : columns}
</div>
{footer}
Expand Down
7 changes: 4 additions & 3 deletions web/client/components/misc/enhancers/tooltip.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import { omit } from 'lodash';
* @prop {string} [tooltipId] if present will show a localized tooltip using the tooltipId as msgId
* @prop {string} [tooltipPosition="top"]
* @prop {string} tooltipTrigger see react overlay trigger
* @prop {object} tooltipParams parameter to pass to the tooltip message id
* @example
* render() {
* const Cmp = tooltip((props) =><El {...props}></El>); // or simply tooltip(El);
Expand All @@ -32,12 +33,12 @@ import { omit } from 'lodash';
*/
export default branch(
({tooltip, tooltipId} = {}) => tooltip || tooltipId,
(Wrapped) => ({tooltip, tooltipId, tooltipPosition = "top", tooltipTrigger, keyProp, idDropDown, args, ...props} = {}) => (<OverlayTrigger
(Wrapped) => ({tooltip, tooltipId, tooltipPosition = "top", tooltipTrigger, keyProp, idDropDown, tooltipParams, args, ...props} = {}) => (<OverlayTrigger
trigger={tooltipTrigger}
id={idDropDown}
key={keyProp}
placement={tooltipPosition}
overlay={<Tooltip id={"tooltip-" + keyProp}>{tooltipId ? <Message msgId={tooltipId} msgParams={{data: args}} /> : tooltip}</Tooltip>}><Wrapped {...props}/></OverlayTrigger>),
overlay={<Tooltip id={"tooltip-" + keyProp}>{tooltipId ? <Message msgId={tooltipId} msgParams={{data: args, ...tooltipParams}} /> : tooltip}</Tooltip>}><Wrapped {...props}/></OverlayTrigger>),
// avoid to pass non needed props
(Wrapped) => (props) => <Wrapped {...(omit(props, ["tooltipId", "tooltip", "tooltipPosition"]))}>{props.children}</Wrapped>
(Wrapped) => (props) => <Wrapped {...(omit(props, ["tooltipId", "tooltip", "tooltipPosition", "tooltipParams"]))}>{props.children}</Wrapped>
);
9 changes: 7 additions & 2 deletions web/client/components/share/SharePanel.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ class SharePanel extends React.Component {
addMarker: PropTypes.func,
viewerOptions: PropTypes.object,
mapType: PropTypes.string,
updateMapView: PropTypes.func
updateMapView: PropTypes.func,
onClearShareResource: PropTypes.func
};

static defaultProps = {
Expand All @@ -118,7 +119,8 @@ class SharePanel extends React.Component {
isScrollPosition: false,
hideMarker: () => {},
addMarker: () => {},
updateMapView: () => {}
updateMapView: () => {},
onClearShareResource: () => {}
};

static contextTypes = {
Expand Down Expand Up @@ -182,6 +184,9 @@ class SharePanel extends React.Component {
});
}
}
componentWillUnmount() {
this.props.onClearShareResource();
}

initializeDefaults = (props) => {
const coordinate = this.getCoordinates(props);
Expand Down
Loading
Loading