Introducing broken map context state #11140#11429
Introducing broken map context state #11140#11429allyoucanmap merged 6 commits intogeosolutions-it:masterfrom
Conversation
| style={contextMapWithoutContextPermission ? { | ||
| border: '2px solid #f0ad4e', | ||
| borderRadius: '4px' | ||
| } : undefined} |
There was a problem hiding this comment.
We should avoid inline hardcoded style and we should think on a different way to represent this not sure yet on the usage of a yellow border for a broken link
| const CardWrapper = contextMapWithoutContextPermission ? tooltip(FlexBox) : FlexBox; | ||
| const tooltipProps = contextMapWithoutContextPermission ? { | ||
| tooltipId: "resourcesCatalog.warningForContextMapWithoutContextPermssion" | ||
| } : {}; |
There was a problem hiding this comment.
The contextMapWithoutContextPermission prop and the warningForContextMapWithoutContextPermssion message are too specific for the GeoStore backend we should avoid this kind of naming and keep things generic
| ...props | ||
| }) => { | ||
| const showViewerLink = !!(!readOnly && viewerUrl); | ||
| const CardWrapper = contextMapWithoutContextPermission ? tooltip(FlexBox) : FlexBox; |
There was a problem hiding this comment.
We should not define a component inside the render function of another component. This should be declared outside
| contextMapWithoutContextPermission | ||
| } = getResourceInfo(resource); |
There was a problem hiding this comment.
In addition to the previous comment we should use status object instead of info
MapStore2/web/client/utils/GeostoreUtils.js
Lines 102 to 120 in e6f0797
If we want we could use the already available items that are icon visible on the grid card but we could also expose new property e.g.:
{
cardClassNames: ['ms-broken-resource-card'], // based on condition
cardTooltipId: 'resourcesCatalog.warningForContextMapWithoutContextPermssion' // based on condition
items: [...]
}if we include something cardClassNames and cardTooltipId we can avoid to have hardcoded inline style and too specific name for props inside the generic component.
|
@rowheat02 there are failing eslint checks. Can you please fix? |
|
|
@ElenaGallo please test this enhancement on dev, thanks |
Description
Please check if the PR fulfills these requirements
What kind of change does this PR introduce? (check one with "x", remove the others)
fixes #11140
What is the current behavior?
#11140
When a user attempts to open a context map without the context permission to the user, they can open the map on the viewer route /viewer/id, which is incorrect.
What is the new behavior?
On the homepage, the warning tooltip will be shown for the context map without context permission (yellow border line). The user can not open this map

If the user tries to access this type of map, it already shows the context permission message.

Breaking change
Does this PR introduce a breaking change? (check one with "x", remove the other)
Other useful information