Skip to content

Commit

Permalink
GeoNode#1657 - Add unadvertised identifier to the resource
Browse files Browse the repository at this point in the history
  • Loading branch information
dsuren1 committed Feb 7, 2024
1 parent dca69e6 commit fee5cba
Show file tree
Hide file tree
Showing 19 changed files with 79 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import { getUserName } from '@js/utils/SearchUtils';
import { useInView } from 'react-intersection-observer';
import DetailsResourcePreview from './DetailsResourcePreview';
import DetailsThumbnail from './DetailsThumbnail';
import Unadvertised from '@js/components/Unadvertised';

const CopyToClipboard = tooltip(CopyToClipboardCmp);

Expand Down Expand Up @@ -112,6 +113,7 @@ const DetailsPanelTools = ({

return (
<div className="gn-details-panel-tools">
<Unadvertised resource={resource}/>
<ResourceStatus resource={resource} />
{enableFavorite &&
<Button
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import ResourceStatus from '@js/components/ResourceStatus';
import ALink from '@js/components/ALink';
import AuthorInfo from '@js/components/AuthorInfo/AuthorInfo';
import ActionButtons from '@js/components/ActionButtons';
import Unadvertised from '@js/components/Unadvertised';


const ResourceCard = forwardRef(({
Expand Down Expand Up @@ -137,6 +138,9 @@ const ResourceCard = forwardRef(({
<div>
<ResourceStatus resource={res} />
</div>
<div>
<Unadvertised resource={res}/>
</div>
</div>
<p ref={abstractRef} className={`card-text gn-card-description ${layoutCardsStyle}`}>
{res.raw_abstract ? res.raw_abstract : '...'}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
* Copyright 2024, GeoSolutions Sas.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree.
*/

import React from 'react';
import isNil from 'lodash/isNil';

import tooltip from '@mapstore/framework/components/misc/enhancers/tooltip';
import FaIcon from '@js/components/FaIcon/FaIcon';

const Icon = (props) => {
return (<div {...props} className="gn-unadvertised"><FaIcon name="eye-slash" /></div> );
};

const IconWithTooltip = tooltip(Icon);

const Unadvertised = ({resource}) => {
if (isNil(resource.advertised) || resource.advertised) {
return null;
}
return (
<IconWithTooltip
tooltipId={"gnviewer.unadvertised"}
className={'gn-unadvertised'}
/>
);
};

export default Unadvertised;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from './Unadvertised';
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,11 @@
button {
margin: 4px;
}
.gn-unadvertised {
padding: 0.25rem 0.5rem;
font-size: 0.875rem;
line-height: 1.5;
}
}
.inEdit{
align-items: center;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@
.color-var(@theme-vars[primary]);
}
}
.gn-unadvertised {
.color-var(@theme-vars[warning])
}
}

// **************
Expand Down Expand Up @@ -323,3 +326,8 @@ button.btn.btn-default.gn-resource-status.gn-status-button {
}
}
}

.gn-unadvertised {
cursor: pointer;
pointer-events: auto;
}
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,8 @@
"createNewViewer": "Neuen Viewer erstellen",
"manageViewerConfiguration": "Viewer-Konfiguration verwalten",
"previewCustomViewer": "Vorschau des benutzerdefinierten Viewers",
"editMapConfiguration": "Kartenkonfiguration bearbeiten"
"editMapConfiguration": "Kartenkonfiguration bearbeiten",
"unadvertised": "Ressource wird nicht beworben. Es ist im Katalog und in den Suchergebnissen ausgeblendet"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,8 @@
"createNewViewer": "Create new viewer",
"manageViewerConfiguration": "Manage viewer configuration",
"previewCustomViewer": "Preview custom viewer",
"editMapConfiguration": "Edit map configuration"
"editMapConfiguration": "Edit map configuration",
"unadvertised": "Resource is not advertised. It is hidden from the catalog and search results"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,8 @@
"createNewViewer": "Crear nuevo visor",
"manageViewerConfiguration": "Administrar la configuración del visor",
"previewCustomViewer": "Vista previa del visor personalizado",
"editMapConfiguration": "Editar configuración del mapa"
"editMapConfiguration": "Editar configuración del mapa",
"unadvertised": "El recurso no se anuncia. Está oculto en el catálogo y en los resultados de búsqueda."
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,8 @@
"createNewViewer": "Create new viewer",
"manageViewerConfiguration": "Manage viewer configuration",
"previewCustomViewer": "Preview custom viewer",
"editMapConfiguration": "Edit map configuration"
"editMapConfiguration": "Edit map configuration",
"unadvertised": "Resource is not advertised. It is hidden from the catalog and search results"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,8 @@
"createNewViewer": "Créer une nouvelle visionneuse",
"manageViewerConfiguration": "Gérer la configuration de la visionneuse",
"previewCustomViewer": "Aperçu de la visionneuse personnalisée",
"editMapConfiguration": "Modifier la configuration de la carte"
"editMapConfiguration": "Modifier la configuration de la carte",
"unadvertised": "La ressource n'est pas annoncée. Il est masqué du catalogue et des résultats de recherche"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,8 @@
"createNewViewer": "Create new viewer",
"manageViewerConfiguration": "Manage viewer configuration",
"previewCustomViewer": "Preview custom viewer",
"editMapConfiguration": "Edit map configuration"
"editMapConfiguration": "Edit map configuration",
"unadvertised": "Resource is not advertised. It is hidden from the catalog and search results"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,8 @@
"createNewViewer": "Crea un nuovo visualizzatore",
"manageViewerConfiguration": "Gestisci la configurazione del visualizzatore",
"previewCustomViewer": "Anteprima del visualizzatore personalizzato",
"editMapConfiguration": "Modifica configurazione della mappa"
"editMapConfiguration": "Modifica configurazione della mappa",
"unadvertised": "La risorsa non è pubblicizzata. E' nascosta dal catalogo e dai risultati della ricerca"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,8 @@
"createNewViewer": "Create new viewer",
"manageViewerConfiguration": "Manage viewer configuration",
"previewCustomViewer": "Preview custom viewer",
"editMapConfiguration": "Edit map configuration"
"editMapConfiguration": "Edit map configuration",
"unadvertised": "Resource is not advertised. It is hidden from the catalog and search results"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,8 @@
"createNewViewer": "Create new viewer",
"manageViewerConfiguration": "Manage viewer configuration",
"previewCustomViewer": "Preview custom viewer",
"editMapConfiguration": "Edit map configuration"
"editMapConfiguration": "Edit map configuration",
"unadvertised": "Resource is not advertised. It is hidden from the catalog and search results"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,8 @@
"createNewViewer": "Create new viewer",
"manageViewerConfiguration": "Manage viewer configuration",
"previewCustomViewer": "Preview custom viewer",
"editMapConfiguration": "Edit map configuration"
"editMapConfiguration": "Edit map configuration",
"unadvertised": "Resource is not advertised. It is hidden from the catalog and search results"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,8 @@
"createNewViewer": "Create new viewer",
"manageViewerConfiguration": "Manage viewer configuration",
"previewCustomViewer": "Preview custom viewer",
"editMapConfiguration": "Edit map configuration"
"editMapConfiguration": "Edit map configuration",
"unadvertised": "Resource is not advertised. It is hidden from the catalog and search results"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,8 @@
"createNewViewer": "Create new viewer",
"manageViewerConfiguration": "Manage viewer configuration",
"previewCustomViewer": "Preview custom viewer",
"editMapConfiguration": "Edit map configuration"
"editMapConfiguration": "Edit map configuration",
"unadvertised": "Resource is not advertised. It is hidden from the catalog and search results"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,8 @@
"createNewViewer": "Create new viewer",
"manageViewerConfiguration": "Manage viewer configuration",
"previewCustomViewer": "Preview custom viewer",
"editMapConfiguration": "Edit map configuration"
"editMapConfiguration": "Edit map configuration",
"unadvertised": "Resource is not advertised. It is hidden from the catalog and search results"
}
}
}

0 comments on commit fee5cba

Please sign in to comment.