Skip to content

Commit 048a043

Browse files
authored
Fix #2129 Upgrade MapStore to include the fix for Download (#2130)
* Fix #2129 Upgrade MapStore to include the fix for Download * fix failing tests
1 parent 57d1127 commit 048a043

30 files changed

+99
-35
lines changed
Submodule MapStore2 updated 124 files
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
/*
2+
* Copyright 2024, GeoSolutions Sas.
3+
* All rights reserved.
4+
*
5+
* This source code is licensed under the BSD-style license found in the
6+
* LICENSE file in the root directory of this source tree.
7+
*/
8+
9+
import React, { useState, useEffect } from 'react';
10+
import { Glyphicon } from 'react-bootstrap';
11+
import { loadFontAwesome } from '@mapstore/framework/utils/FontUtils';
12+
import useIsMounted from '@mapstore/framework/hooks/useIsMounted';
13+
import PropTypes from 'prop-types';
14+
15+
function FaIcon({
16+
name,
17+
className,
18+
style
19+
}) {
20+
const [loading, setLoading] = useState(true);
21+
const isMounted = useIsMounted();
22+
useEffect(() => {
23+
loadFontAwesome()
24+
.then(() => {
25+
isMounted(() => {
26+
setLoading(false);
27+
});
28+
});
29+
}, []);
30+
if (loading) {
31+
return null;
32+
}
33+
return <i className={`fa fa-${name}${className ? ` ${className}` : ''}`} style={style}/>;
34+
}
35+
/**
36+
* Icon component that allows to use icon from `font-awesome` and `glyphicon`
37+
* @prop {string} glyph html identifier
38+
* @prop {string} type one of `font-awesome` or `glyphicon`
39+
*/
40+
function Icon({
41+
glyph,
42+
type,
43+
...props
44+
}) {
45+
if (type === 'font-awesome') {
46+
return <FaIcon {...props} name={glyph} />;
47+
}
48+
if (type === 'glyphicon') {
49+
return <Glyphicon {...props} glyph={glyph} />;
50+
}
51+
return null;
52+
}
53+
54+
Icon.propTypes = {
55+
glyph: PropTypes.string,
56+
type: PropTypes.string
57+
};
58+
59+
Icon.defaultProps = {
60+
type: 'font-awesome'
61+
};
62+
63+
export default Icon;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { default } from './Icon';

geonode_mapstore_client/client/js/components/MainEventView/MainEventView.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
import React from 'react';
1010
import Message from '@mapstore/framework/components/I18N/Message';
11-
import Icon from '@mapstore/framework/plugins/ResourcesCatalog/components/Icon';
11+
import Icon from '@js/components/Icon';
1212

1313
function MainEventView({
1414
msgId,

geonode_mapstore_client/client/js/components/ResourcesCompactCatalog/ResourcesCompactCatalog.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { Glyphicon } from 'react-bootstrap';
1212
import Message from '@mapstore/framework/components/I18N/Message';
1313
import Button from '@mapstore/framework/components/layout/Button';
1414
import useInfiniteScroll from '@js/hooks/useInfiniteScroll';
15-
import Icon from '@mapstore/framework/plugins/ResourcesCatalog/components/Icon';
15+
import Icon from '@js/components/Icon';
1616
import Spinner from '@mapstore/framework/components/layout/Spinner';
1717
import Loader from '@mapstore/framework/components/misc/Loader';
1818
import ResourceCard from '@mapstore/framework/plugins/ResourcesCatalog/components/ResourceCard';

geonode_mapstore_client/client/js/plugins/ActionNavbar/buttons.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import {
1919
import { Dropdown, MenuItem, Glyphicon } from 'react-bootstrap';
2020
import Message from '@mapstore/framework/components/I18N/Message';
2121
import Button from '@mapstore/framework/components/layout/Button';
22-
import Icon from '@mapstore/framework/plugins/ResourcesCatalog/components/Icon';
22+
import Icon from '@js/components/Icon';
2323
import tooltip from '@mapstore/framework/components/misc/enhancers/tooltip';
2424
import { openQueryBuilder } from '@mapstore/framework/actions/layerFilter';
2525
import { getSelectedLayer } from '@mapstore/framework/selectors/layers';

geonode_mapstore_client/client/js/plugins/ActionNavbar/index.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import FlexBox from '@mapstore/framework/components/layout/FlexBox';
2323
import Spinner from '@mapstore/framework/components/layout/Spinner';
2424
import Button from '@mapstore/framework/components/layout/Button';
2525
import Menu from '@mapstore/framework/plugins/ResourcesCatalog/components/Menu';
26-
import Icon from '@mapstore/framework/plugins/ResourcesCatalog/components/Icon';
26+
import Icon from '@js/components/Icon';
2727
import tooltip from '@mapstore/framework/components/misc/enhancers/tooltip';
2828

2929
const ButtonWithTooltip = tooltip(Button);

geonode_mapstore_client/client/js/plugins/DeleteResource.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import React from 'react';
1010
import { createPlugin } from '@mapstore/framework/utils/PluginsUtils';
1111
import { connect } from 'react-redux';
1212
import { createSelector } from 'reselect';
13-
import Icon from '@mapstore/framework/plugins/ResourcesCatalog/components/Icon';
13+
import Icon from '@js/components/Icon';
1414
import Message from '@mapstore/framework/components/I18N/Message';
1515
import Button from '@mapstore/framework/components/layout/Button';
1616
import ConfirmDialog from '@mapstore/framework/components/layout/ConfirmDialog';

geonode_mapstore_client/client/js/plugins/DownloadResource.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import Message from '@mapstore/framework/components/I18N/Message';
1616
import Button from '@mapstore/framework/components/layout/Button';
1717
import tooltip from '@mapstore/framework/components/misc/enhancers/tooltip';
1818
import { MenuItem } from 'react-bootstrap';
19-
import Icon from '@mapstore/framework/plugins/ResourcesCatalog/components/Icon';
19+
import Icon from '@js/components/Icon';
2020
import {
2121
getResourceData
2222
} from '@js/selectors/resource';

geonode_mapstore_client/client/js/plugins/LayerDetailViewer.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { createPlugin } from '@mapstore/framework/utils/PluginsUtils';
1111
import { connect } from 'react-redux';
1212
import { createSelector } from 'reselect';
1313
import DetailsPanel from './ResourceDetails/containers/DetailsPanel';
14-
import Icon from '@mapstore/framework/plugins/ResourcesCatalog/components/Icon';
14+
import Icon from '@js/components/Icon';
1515
import controls from '@mapstore/framework/reducers/controls';
1616
import { setControlProperty } from '@mapstore/framework/actions/controls';
1717
import gnresource from '@js/reducers/gnresource';

0 commit comments

Comments
 (0)