Skip to content
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

Closed
wants to merge 2 commits into from

Conversation

Mazhoon
Copy link

@Mazhoon Mazhoon commented Nov 18, 2022

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

@szaimen szaimen added enhancement 3. to review Waiting for reviews labels Nov 18, 2022
@szaimen szaimen added this to the Nextcloud 26 milestone Nov 18, 2022
@szaimen szaimen requested review from a team, icewind1991, blizzz and come-nc and removed request for a team November 18, 2022 23:42
Copy link
Contributor

@come-nc come-nc left a 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

apps/weather_status/lib/Service/WeatherStatusService.php Outdated Show resolved Hide resolved
@PVince81
Copy link
Member

@jancborchardt thoughts on this ? note: this requires occ commands to set the values, there's no UI

@blizzz blizzz mentioned this pull request Feb 1, 2023
@skjnldsv skjnldsv mentioned this pull request Feb 23, 2023
@blizzz blizzz mentioned this pull request Mar 7, 2023
@blizzz blizzz modified the milestones: Nextcloud 26, Nextcloud 27 Mar 9, 2023
This was referenced May 3, 2023
@blizzz blizzz mentioned this pull request May 17, 2023
@blizzz blizzz modified the milestones: Nextcloud 27, Nextcloud 28 May 23, 2023
@skjnldsv skjnldsv mentioned this pull request Nov 1, 2023
This was referenced Nov 6, 2023
This was referenced Nov 14, 2023
@blizzz blizzz modified the milestones: Nextcloud 28, Nextcloud 29 Nov 23, 2023
Mazhoon and others added 2 commits February 27, 2024 14:16
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>
$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

The method OCP\IConfig::getAppValue has been marked as deprecated
$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

The method OCP\IConfig::getAppValue has been marked as deprecated
$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

The method OCP\IConfig::getAppValue has been marked as deprecated
$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

The method OCP\IConfig::getAppValue has been marked as deprecated
$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

The method OCP\IConfig::getAppValue has been marked as deprecated
$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

The method OCP\IConfig::getAppValue has been marked as deprecated
This was referenced Mar 12, 2024
This was referenced Mar 20, 2024
@skjnldsv skjnldsv mentioned this pull request Mar 28, 2024
81 tasks
@skjnldsv skjnldsv modified the milestones: Nextcloud 29, Nextcloud 30 Mar 28, 2024
@skjnldsv skjnldsv added 2. developing Work in progress stale Ticket or PR with no recent activity and removed 3. to review Waiting for reviews labels Jul 27, 2024
This was referenced Jul 30, 2024
This was referenced Aug 5, 2024
@skjnldsv skjnldsv mentioned this pull request Aug 13, 2024
@skjnldsv skjnldsv closed this Aug 14, 2024
@skjnldsv skjnldsv removed this from the Nextcloud 30 milestone Aug 14, 2024
@jancborchardt

This comment was marked as outdated.

@skjnldsv
Copy link
Member

@jancborchardt thoughts on this ? note: this requires occ commands to set the values, there's no UI

@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.
(though my comment came late because yesterday was public holiday, sorry for the confusion @Mazhoon 🌞)
That doesn't mean we do not want that feature, but it seems incomplete for now.

@skjnldsv
Copy link
Member

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 🤔

'default_timezone' => 'Europe/Berlin',

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2. developing Work in progress enhancement stale Ticket or PR with no recent activity
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants