Skip to content

Commit

Permalink
[Issue GeoNode#522]: Hide set map button in certain conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
tonym3nsa committed Dec 16, 2021
1 parent 665ca6e commit 5703a3c
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import Spinner from '@js/components/Spinner';
import Message from '@mapstore/framework/components/I18N/Message';
import tooltip from '@mapstore/framework/components/misc/enhancers/tooltip';
import moment from 'moment';
import { getResourceTypesInfo, getMetadataDetailUrl } from '@js/utils/ResourceUtils';
import { getResourceTypesInfo, getMetadataDetailUrl, ResourceTypes } from '@js/utils/ResourceUtils';
import debounce from 'lodash/debounce';
import CopyToClipboardCmp from 'react-copy-to-clipboard';
import { TextEditable, ThumbnailEditable } from '@js/components/ContentsEditable/';
Expand Down Expand Up @@ -540,27 +540,26 @@ function DetailsPanel({
onEdit={editThumbnail}
image={resource?.thumbnail_url}
/>

<MapThumbnailButtonToolTip
variant="default"
onClick={handleMapViewer}
className={"map-thumbnail"}
tooltip={<Message msgId="gnviewer.saveMapThumbnail" />}
tooltipPosition={"top"}

>
<FaIcon name="map" />

</MapThumbnailButtonToolTip></>
{
(resource.resource_type === ResourceTypes.MAP || resource.resource_type === ResourceTypes.DATASET) &&
( <MapThumbnailButtonToolTip
variant="default"
onClick={handleMapViewer}
className={"map-thumbnail"}
tooltip={<Message msgId="gnviewer.saveMapThumbnail" />}
tooltipPosition={"top"}
>
<FaIcon name="map" />
</MapThumbnailButtonToolTip>)
}
</>
: <MapThumbnailView
layers={layers}
onMapThumbnail={onMapThumbnail}
onClose={handleEnableMapViewer}
savingThumbnailMap={savingThumbnailMap}
/>

}

</div>}
</div>
}
Expand Down
2 changes: 1 addition & 1 deletion geonode_mapstore_client/client/js/utils/AppUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import axios from '@mapstore/framework/libs/ajax';

let actionListeners = {};
// Add a taget url here to fix proxy issue
const targetURL = '';
const targetURL = 'https://master.demo.geonode.org';

export function getVersion() {
if (!__DEVTOOLS__) {
Expand Down
4 changes: 2 additions & 2 deletions geonode_mapstore_client/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@
"geonode": {
"devServer": {
"host": "localhost",
"proxyTargetHost": "localhost:8000",
"protocol": "http"
"proxyTargetHost": "master.demo.geonode.org",
"protocol": "https"
}
},
"mapstore": {
Expand Down

0 comments on commit 5703a3c

Please sign in to comment.