Skip to content

Commit

Permalink
Show msg only for maps (#920)
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidQuartz authored Apr 13, 2022
1 parent 83224cd commit e30776d
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions geonode_mapstore_client/client/js/plugins/VisualStyleEditor.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ import GNButton from '@js/components/Button';
import Portal from '@mapstore/framework/components/misc/Portal';
import ResizableModal from '@mapstore/framework/components/misc/ResizableModal';
import StylesAPI from '@mapstore/framework/api/geoserver/Styles';
import { getResourcePerms, isNewResource } from '@js/selectors/resource';
import { getResourcePerms, isNewResource, getViewedResourceType } from '@js/selectors/resource';
import { mapLayoutValuesSelector } from '@mapstore/framework/selectors/maplayout';
import tooltip from '@mapstore/framework/components/misc/enhancers/tooltip';
import { getSelectedLayer, layersSelector } from '@mapstore/framework/selectors/layers';
Expand Down Expand Up @@ -131,7 +131,8 @@ function VisualStyleEditor({
enabled,
onClose,
style: styleProp,
isStyleChanged
isStyleChanged,
resourceType
}) {

const [closing, setClosing] = useState(false);
Expand Down Expand Up @@ -193,7 +194,7 @@ function VisualStyleEditor({
<Glyphicon glyph="1-close"/>
</Button>
</div>}
{(!notificationClose && !dismissStyleNotification) && <div className="gn-visual-style-editor-alert alert-info">
{(!notificationClose && !dismissStyleNotification) && resourceType === 'map' && <div className="gn-visual-style-editor-alert alert-info">
<div className="gn-visual-style-editor-alert-message">
<Message msgId="gnviewer.stylesFirstClone" />
<Button size="xs" variant="transparent" onClick={dismissNotification}>
Expand Down Expand Up @@ -262,16 +263,18 @@ const VisualStyleEditorPlugin = connect(
state => state?.controls?.visualStyleEditor?.enabled,
state => mapLayoutValuesSelector(state, { height: true }),
getSelectedLayer,
codeStyleSelector
], (layer, temporaryStyleId, styleService, initialCode, enabled, style, originalLayer, code) => ({
codeStyleSelector,
getViewedResourceType
], (layer, temporaryStyleId, styleService, initialCode, enabled, style, originalLayer, code, resourceType) => ({
layer,
temporaryStyleId,
styleService,
initialCode,
enabled,
style,
originalStyle: originalLayer?.style,
isStyleChanged: initialCode !== undefined && code !== undefined && initialCode !== code
isStyleChanged: initialCode !== undefined && code !== undefined && initialCode !== code,
resourceType
})),
{
onUpdateStatus: updateStatus,
Expand Down

0 comments on commit e30776d

Please sign in to comment.