Allow setting default location for weather widget#35270
Allow setting default location for weather widget#35270Mazhoon wants to merge 2 commits intonextcloud:masterfrom
Conversation
come-nc
left a comment
There was a problem hiding this comment.
No strong opinion about this
|
@jancborchardt thoughts on this ? note: this requires occ commands to set the values, there's no UI |
In cases where all of the users are from the same geographical area, it would be extremely useful to be able to set a default location for the dashboard weather widget. With these changes, this option becomes available, as default values can be set with occ config:app:set weather_status [lat,lon,altitude,address] --value 'value' These changes also implement the path 2 described in feature request nextcloud#27908 denied in 2021 Signed-off-by: Tuomas Nurmi <[email protected]>
Was 'lat' instead of 'lon', thanks for catching! Co-authored-by: Côme Chilliet <[email protected]> Signed-off-by: Tuomas Nurmi <[email protected]>
e2b75a0 to
357f073
Compare
| $lat = $this->config->getUserValue($this->userId, Application::APP_ID, 'lat', ''); | ||
| $lon = $this->config->getUserValue($this->userId, Application::APP_ID, 'lon', ''); | ||
| $address = $this->config->getUserValue($this->userId, Application::APP_ID, 'address', ''); | ||
| $lat = $this->config->getUserValue($this->userId, Application::APP_ID, 'lat', $this->config->getAppValue(Application::APP_ID, 'lat', '')); |
Check notice
Code scanning / Psalm
DeprecatedMethod
| $lon = $this->config->getUserValue($this->userId, Application::APP_ID, 'lon', ''); | ||
| $address = $this->config->getUserValue($this->userId, Application::APP_ID, 'address', ''); | ||
| $lat = $this->config->getUserValue($this->userId, Application::APP_ID, 'lat', $this->config->getAppValue(Application::APP_ID, 'lat', '')); | ||
| $lon = $this->config->getUserValue($this->userId, Application::APP_ID, 'lon', $this->config->getAppValue(Application::APP_ID, 'lon', '')); |
Check notice
Code scanning / Psalm
DeprecatedMethod
| $address = $this->config->getUserValue($this->userId, Application::APP_ID, 'address', ''); | ||
| $lat = $this->config->getUserValue($this->userId, Application::APP_ID, 'lat', $this->config->getAppValue(Application::APP_ID, 'lat', '')); | ||
| $lon = $this->config->getUserValue($this->userId, Application::APP_ID, 'lon', $this->config->getAppValue(Application::APP_ID, 'lon', '')); | ||
| $address = $this->config->getUserValue($this->userId, Application::APP_ID, 'address', $this->config->getAppValue(Application::APP_ID, 'address', '')); |
Check notice
Code scanning / Psalm
DeprecatedMethod
| $lat = $this->config->getUserValue($this->userId, Application::APP_ID, 'lat', ''); | ||
| $lon = $this->config->getUserValue($this->userId, Application::APP_ID, 'lon', ''); | ||
| $alt = $this->config->getUserValue($this->userId, Application::APP_ID, 'altitude', ''); | ||
| $lat = $this->config->getUserValue($this->userId, Application::APP_ID, 'lat', $this->config->getAppValue(Application::APP_ID, 'lat', '')); |
Check notice
Code scanning / Psalm
DeprecatedMethod
| $lon = $this->config->getUserValue($this->userId, Application::APP_ID, 'lon', ''); | ||
| $alt = $this->config->getUserValue($this->userId, Application::APP_ID, 'altitude', ''); | ||
| $lat = $this->config->getUserValue($this->userId, Application::APP_ID, 'lat', $this->config->getAppValue(Application::APP_ID, 'lat', '')); | ||
| $lon = $this->config->getUserValue($this->userId, Application::APP_ID, 'lon', $this->config->getAppValue(Application::APP_ID, 'lon', '')); |
Check notice
Code scanning / Psalm
DeprecatedMethod
| $alt = $this->config->getUserValue($this->userId, Application::APP_ID, 'altitude', ''); | ||
| $lat = $this->config->getUserValue($this->userId, Application::APP_ID, 'lat', $this->config->getAppValue(Application::APP_ID, 'lat', '')); | ||
| $lon = $this->config->getUserValue($this->userId, Application::APP_ID, 'lon', $this->config->getAppValue(Application::APP_ID, 'lon', '')); | ||
| $alt = $this->config->getUserValue($this->userId, Application::APP_ID, 'altitude', $this->config->getAppValue(Application::APP_ID, 'altitude', '')); |
Check notice
Code scanning / Psalm
DeprecatedMethod
This comment was marked as outdated.
This comment was marked as outdated.
@jancborchardt Can you reply to this? Regarding the closure, this doesn't mean this is a bad idea, we're just cleaing old stale PR. |
|
If we want to stay code-only, (there isn't really an admin settings UI location), we could have this as a config option like the default timezone 🤔 server/config/config.sample.php Line 269 in 2ea6713 |
In cases where all of the users are from the same geographical area, it would be extremely useful to be able to set a default location for the dashboard weather widget. With these changes, this option becomes available, as default values can be set with occ config:app:set weather_status [lat,lon,altitude,address] --value 'value'
These changes also implement the path 2 described in feature request #27908 denied in 2021
Signed-off-by: Tuomas Nurmi [email protected]