-
Notifications
You must be signed in to change notification settings - Fork 383
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
#8545 LayerDownload: service selector #8607
#8545 LayerDownload: service selector #8607
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should add a cfg option called defaultSelectedService
that defines the initial selected service in the dropdown when a user opens the download dialog and they have the possibility to select the two options.
We can add a new argument to checkWPSAvailability(url, selectedService)
action.
The defaultSelectedService
will be wps
by default as the current behaviour.
ecample of the expected configuration aviability in mapstore
{
"name": "LayerDownload",
"cfg": {
"defaultSelectedService": "wfs"
}
}
constructor(props) { | ||
super(props); | ||
|
||
this.services = [ | ||
{ value: "wps", label: "WPS" }, | ||
{ value: "wfs", label: "WFS" } | ||
]; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove this and move this.services
as props this.props.services
and in defaultProps
services: [
{ value: "wps", label: "WPS" },
{ value: "wfs", label: "WFS" }
]
<label><Message msgId="layerdownload.service" /></label> | ||
<Select | ||
value={this.props.service} | ||
disabled={!this.props.wpsAvailable} | ||
onChange={(sel) => this.props.setService(sel.value)} | ||
options={this.services} /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest to hide the select input when wps is not available Instead of disabled it
@@ -1732,6 +1732,7 @@ | |||
}, | |||
"layerdownload": { | |||
"title": "Exportar los datos", | |||
"service": "Service", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"service": "Service", | |
"service": "Servicio", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Please complete the PR with unit tests on actions, reducers, epics and components of the implemented parts, thanks
this.props.onCheckWPSAvailability(this.props.url || this.props.layer.url); | ||
this.props.onCheckWPSAvailability( | ||
this.props.url || this.props.layer.url, | ||
this.props.defaultSelectedService || 'wps' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add defaultSelectedService to propTypes and the default value wps in defaultProps
web/client/configs/localConfig.json
Outdated
@@ -358,7 +358,12 @@ | |||
} | |||
} | |||
}, "Home", "FeatureEditor", | |||
"LayerDownload", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please restore "LayerDownload" config because by default is already "wps"
…Store2 into 8545-wps-wfs-export-selector
@ElenaGallo please test on dev and let us know when we can backport on the stable branch 2022.02.xx, thanks |
@belom88 the English translation of the option title is incorrect. It should be |
@ElenaGallo that should be browser cache issue. Please, clean the cache in your web browser. |
@belom88 Now I see the right title. |
@tdipisa @belom88 I also noticed that for raster layers there is the possibility to change from WPS to WFS but then the WFS service is not enabled and the note report 'The server doesn't support WFS or WPS download for this layer!' (the message is incorrect because WPS is supported). How to reproduce |
@belom88 (FYI @allyoucanmap) this should not be allowed. A fix is needed for this. |
Description
New selector to select service.
Please check if the PR fulfills these requirements
What kind of change does this PR introduce? (check one with "x", remove the others)
Issue
#8545
What is the new behavior?
New selector for download dialog has been added to select service from list: "WPS", "WFS".
If "WPS" is unavailable, the selector is disabled with selected option "WFS".
Breaking change
Does this PR introduce a breaking change? (check one with "x", remove the other)