Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

View menu for users without edit permissions #501

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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