Skip to content

Commit

Permalink
fix dataset subtypes permissions and properties (#477)
Browse files Browse the repository at this point in the history
  • Loading branch information
allyoucanmap authored Aug 27, 2021
1 parent 0f5254f commit 8ed5faa
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 4 deletions.
19 changes: 17 additions & 2 deletions geonode_mapstore_client/client/js/utils/ResourceUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,29 @@ export const resourceToLayerConfig = (resource) => {
featureinfo_custom_template: template,
title,
perms,
pk
pk,
has_time: hasTime
} = resource;

const bbox = getExtentFromResource(resource);

const { url: wfsUrl } = links.find(({ link_type: linkType }) => linkType === 'OGC:WFS') || {};
const { url: wmsUrl } = links.find(({ link_type: linkType }) => linkType === 'OGC:WMS') || {};
const { url: wmtsUrl } = links.find(({ link_type: linkType }) => linkType === 'OGC:WMTS') || {};

const dimensions = [
...(hasTime ? [{
name: 'time',
source: {
type: 'multidim-extension',
url: wmtsUrl || (wmsUrl || '').split('/geoserver/')[0] + '/geoserver/gwc/service/wmts'
}
}] : [])
];

const params = wmsUrl && url.parse(wmsUrl, true).query;
const format = getConfigProp('defaultLayerFormat') || 'image/png';

return {
perms,
id: uuid(),
Expand All @@ -77,7 +91,8 @@ export const resourceToLayerConfig = (resource) => {
style: '',
title,
visibility: true,
...(params && { params })
...(params && { params }),
...(dimensions.length > 0 && ({ dimensions }))
};
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -841,12 +841,24 @@
{
"type": "link",
"href": "{'#/dataset/' + (state('gnResourceData') || {}).pk + '/edit/style'}",
"labelId": "gnviewer.editStyle"
"labelId": "gnviewer.editStyle",
"perms": [
{
"type": "resource",
"value": "change_dataset_style"
}
]
},
{
"type": "link",
"href": "{'#/dataset/' + (state('gnResourceData') || {}).pk + '/edit/data'}",
"labelId": "gnviewer.editData"
"labelId": "gnviewer.editData",
"perms": [
{
"type": "resource",
"value": "change_dataset_data"
}
]
}
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
#navigationBar-container {
z-index: 5;
}
.timeline-plugin {
z-index: 5;
}

.gn-embed {
// fix position of dashboard full screen button
Expand Down

0 comments on commit 8ed5faa

Please sign in to comment.