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

Update notification ("Update to Nextcloud ... is available") is not clickable #1038

Closed
caugner opened this issue Apr 9, 2021 · 9 comments
Closed

Comments

@caugner
Copy link

caugner commented Apr 9, 2021

How to use GitHub

  • Please use the 👍 reaction to show that you are interested into the same feature.
  • Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
  • Subscribe to receive notifications on status change and new comments.

Is your feature request related to a problem? Please describe.
When a Nextcloud update is available, Nextcloud shows a notification to admins. However, this notification is purely informative and is not interactive.

Describe the solution you'd like
It would be nice if the Nextcloud update notification would be a link to the "Settings" > "Overview" page (which includes the "Open updater" and "Download now" buttons).

Describe alternatives you've considered
(None.)

Additional context
grafik

In this screenshot:

  • the "Update to Ransomware protection to version 1.10.0 is available." notification is clickable and gets me to the "Your apps" / "Updates" page.
  • the "Update to Nextcloud 20.0.9 is available." notification is not clickable.
@szaimen
Copy link
Contributor

szaimen commented Jul 2, 2021

@nickvergessen do you have maybe some pointers or an example how to implement clickable links in notifications? If it is easy, I would have a look. Thanks!

@nickvergessen
Copy link
Member

https://github.com/nextcloud/server/blob/master/apps/updatenotification/lib/Notification/Notifier.php#L127-L135

it's already linking there for admins. Maybe the route was changed?

@szaimen
Copy link
Contributor

szaimen commented Jul 2, 2021

@caugner did you get the notification as "normal user" or as admin?

@caugner
Copy link
Author

caugner commented Jul 2, 2021

@caugner did you get the notification as "normal user" or as admin?

Admin.

edit: I guess this is the route that it should link to?

https://github.com/nextcloud/server/blob/0447b53bda9fe95ea0cbed765aa332584605d652/apps/settings/appinfo/routes.php#L69

And to be clear, the HTML doesn't contain anything link-ish:

grafik

@caugner
Copy link
Author

caugner commented Jul 2, 2021

Luckily, I have one instance that has both a Nextcloud update and app update notification, the only difference being the missing subjectRichParameters for the Nextcloud update notification.

(This is the response of GET /ocs/v2.php/apps/notifications/api/v2/notifications, by the way:)

{
  "ocs": {
    "meta": {
      "status": "ok",
      "statuscode": 200,
      "message": "OK"
    },
    "data": [
      {
        "notification_id": 18,
        "app": "updatenotification",
        "user": "***",
        "datetime": "2021-07-01T22:20:01+00:00",
        "object_type": "core",
        "object_id": "20.0.11.1",
        "subject": "Update to Nextcloud 20.0.11 is available.",
        "message": "",
        "link": "https:\/\/nextcloud.example.com\/index.php\/settings\/admin\/overview#version",
        "subjectRich": "",
        "subjectRichParameters": [],
        "messageRich": "",
        "messageRichParameters": [],
        "icon": "https:\/\/nextcloud.example.com\/apps\/updatenotification\/img\/notification.svg",
        "actions": []
      },
      {
        "notification_id": 17,
        "app": "updatenotification",
        "user": "***",
        "datetime": "2021-06-29T17:50:12+00:00",
        "object_type": "calendar",
        "object_id": "2.3.0",
        "subject": "Update for Calendar to version 2.3.0 is available.",
        "message": "",
        "link": "https:\/\/nextcloud.example.com\/index.php\/settings\/apps\/updates#app-calendar",
        "subjectRich": "Update for {app} to version 2.3.0 is available.",
        "subjectRichParameters": {
          "app": {
            "type": "app",
            "id": "calendar",
            "name": "Calendar"
          }
        },
        "messageRich": "",
        "messageRichParameters": [],
        "icon": "https:\/\/nextcloud.example.com\/apps\/updatenotification\/img\/notification.svg",
        "actions": []
      }
    ]
  }
}

@caugner
Copy link
Author

caugner commented Jul 2, 2021

The culprit may be in https://github.com/nextcloud/notifications:

useLink() {
if (!this.link) {
return false
}
let parametersHaveLink = false
Object.keys(this.subjectRichParameters).forEach(p => {
if (p.link) {
parametersHaveLink = true
}
})
return !parametersHaveLink
},

edit: Possibly related: #1029

@caugner caugner changed the title Make "Update to Nextcloud ... is available" notification link to the Settings / Overview page Update notification ("Update to Nextcloud ... is available") is not clickable Jul 2, 2021
@szaimen
Copy link
Contributor

szaimen commented Jul 2, 2021

Looks like it. So needs to be fixed in the notifications app, afaics.

@szaimen szaimen transferred this issue from nextcloud/server Jul 2, 2021
@nickvergessen
Copy link
Member

Fix is in #883 -.-

Someone forgot to backport 👯

@caugner
Copy link
Author

caugner commented Jul 2, 2021

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants