-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Allow setting default location for weather widget #35270
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.
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 <tuomas.nurmi@opinsys.fi>
Was 'lat' instead of 'lon', thanks for catching! Co-authored-by: Côme Chilliet <91878298+come-nc@users.noreply.github.com> Signed-off-by: Tuomas Nurmi <tuomas.nurmi@opinsys.fi>
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 Note
$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 Note
$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 Note
$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 Note
$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 Note
$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 Note
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 tuomas.nurmi@opinsys.fi