Skip to content

Commit

Permalink
View menu for users without edit permissions (#501)
Browse files Browse the repository at this point in the history
  • Loading branch information
luorlandini authored Oct 13, 2021
1 parent e42130e commit d498b7a
Show file tree
Hide file tree
Showing 8 changed files with 113 additions and 107 deletions.
8 changes: 6 additions & 2 deletions geonode_mapstore_client/client/js/plugins/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ import {
AnnotationsActionButton,
FullScreenActionButton
} from '@js/plugins/actionnavbar/buttons';
import { getMetadataUrl } from '@js/utils/ResourceUtils';
import { getMetadataUrl,
getMetadataDetailUrl,
resourseHasPermission } from '@js/utils/ResourceUtils';

const EXCLUDED_EPICS_NAMES = [
'loadGeostoryEpic',
Expand Down Expand Up @@ -384,7 +386,9 @@ export const plugins = {
const pluginsDefinition = {
plugins,
requires: {
getMetadataUrl
getMetadataUrl,
getMetadataDetailUrl,
resourseHasPermission
},
epics: {},
reducers: {}
Expand Down
10 changes: 10 additions & 0 deletions geonode_mapstore_client/client/js/utils/ResourceUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,16 @@ export const getMetadataUrl = (resource) => {
return '';
};


export const getMetadataDetailUrl = (resource) => {
return (getMetadataUrl(resource)) ? getMetadataUrl(resource) + '_detail' : '';
};

export const resourseHasPermission = (resource, perm) => {
return resource?.perms?.includes(perm);
};


export const getResourceStatuses = (resource) => {
const { processes } = resource || {};
const isProcessing = processes
Expand Down
187 changes: 82 additions & 105 deletions geonode_mapstore_client/client/static/mapstore/configs/localConfig.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,9 @@
"editMetadata": "Metadaten bearbeiten",
"editStyle": "Stil Bearbeiten",
"editData": "Daten Bearbeiten",
"view": "Sicht",
"viewMetadata": "Metadaten anzeigen",
"viewData": "Daten anzeigen",
"backToDataset": "Zurück zum Datensatz",
"uploadImage": "Klicken oder ziehen Sie ein Bild und legen Sie es ab",
"save": "Speichern",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,9 @@
"editMetadata": "Edit Metadata",
"editStyle": "Edit Style",
"editData": "Edit Data",
"view": "View",
"viewMetadata": "View Metadata",
"viewData": "View Data",
"backToDataset": "Back to Dataset",
"uploadImage": "Click or drag and drop an image",
"save": "Save",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,9 @@
"editMetadata": "Editar Metadatos",
"editStyle": "Editar Estilo",
"editData": "Editar Datos",
"view": "Vista",
"viewMetadata": "Ver metadatos",
"viewData": "Ver datos",
"backToDataset": "Volver al Conjunto de Datos",
"uploadImage": "Haga clic o arrastre y suelte una imagen",
"save": "Ahorrar",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,9 @@
"gnviewer": {
"edit": "Éditer",
"editMetadata": "Modifier les Métadonnées",
"view": "Vue",
"viewMetadata": "Afficher les métadonnées",
"viewData": "Afficher les données",
"editStyle": "Modifier le Style",
"editData": "Modifier les Données",
"backToDataset": "Retour à l'Ensemble de Données",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,9 @@
"gnviewer": {
"edit": "Modifica",
"editMetadata": "Modifica Metadati",
"view": "Visualizza",
"viewMetadata": "Visualizza i metadati",
"viewData": "Visualizza i dati",
"editStyle": "Modifica Stile",
"editData": "Modifica Dati",
"backToDataset": "Torna al Dataset",
Expand Down

0 comments on commit d498b7a

Please sign in to comment.