Skip to content

Commit ac5aec4

Browse files
authored
Configurable view resource button in the detail panel (#2078)
1 parent a20a91e commit ac5aec4

File tree

4 files changed

+11
-5
lines changed

4 files changed

+11
-5
lines changed

geonode_mapstore_client/client/js/plugins/ResourceDetails/ResourceDetails.jsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,8 @@ function ResourceDetailsPanel({
268268
pendingChanges,
269269
enablePreview,
270270
editingOverlay,
271-
closeOnClickOut
271+
closeOnClickOut,
272+
showViewerButton
272273
}, context) {
273274

274275
const [confirmModal, setConfirmModal] = useState(false);
@@ -341,6 +342,7 @@ function ResourceDetailsPanel({
341342
tabs={tabs}
342343
tabComponents={tabComponents}
343344
resourcesGridId={resourcesGridId}
345+
showViewerButton={showViewerButton}
344346
/>
345347
</ResourcesPanelWrapper>
346348
<PendingStatePrompt

geonode_mapstore_client/client/js/plugins/ResourceDetails/components/DetailsToolbar.jsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ function formatResourceLinkUrl(resource) {
6363

6464
function DetailsToolbar({
6565
resource,
66-
items = []
66+
items = [],
67+
showViewerButton = false
6768
}) {
6869

6970
const {
@@ -126,7 +127,7 @@ function DetailsToolbar({
126127
<Icon glyph="globe" />
127128
</Button>
128129
</CopyToClipboard>}
129-
{info?.viewerUrl
130+
{!showViewerButton ? null : info?.viewerUrl
130131
? (
131132
<Button
132133
variant="primary"

geonode_mapstore_client/client/js/plugins/ResourceDetails/containers/DetailsPanel.jsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,8 @@ function DetailsPanel({
7575
resourcesGridId,
7676
monitoredState,
7777
location,
78-
panelRef
78+
panelRef,
79+
showViewerButton
7980
}, context) {
8081

8182
const resource = parseCatalogResource(resourceProp);
@@ -100,6 +101,7 @@ function DetailsPanel({
100101
tools={<DetailsToolbar
101102
resource={resource}
102103
items={toolbarItems}
104+
showViewerButton={showViewerButton}
103105
/>}
104106
onClose={onClose}
105107
thumbnailComponent={ConnectedDetailsThumbnail}

geonode_mapstore_client/static/mapstore/configs/localConfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3312,7 +3312,8 @@
33123312
"headerNodeSelector": ".gn-main-header",
33133313
"enableFilters": true,
33143314
"enablePreview": true,
3315-
"editingOverlay": true
3315+
"editingOverlay": true,
3316+
"showViewerButton": true
33163317
}
33173318
},
33183319
{

0 commit comments

Comments
 (0)