question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

notificationsService documentation specifies an "actions" option but value isn't used

See original GitHub issue

https://our.umbraco.com/apidocs/v8/ui/#/api/umbraco.services.notificationsService#methods_add

https://github.com/umbraco/Umbraco-CMS/blob/v8/contrib/src/Umbraco.Web.UI.Client/src/common/services/notifications.service.js#L56

The documentation mentions a actions option you can use to add one or more buttons to a notification. But neither the service, directive or view have any references to the actions option. At least when checking the latest code for both V7 and V8. So not sure if it was ever been supported 😮

So the million dollar questions now: should the option be removed from the documentation, or should support for these actions buttons be implemented?

When reading up on the documentation for the notificationsService for a package, my idea was that an error notification could feature a “read more” action/button leading to the package documentation or an overlay within Umbraco so that users can read more about what the error actually means.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
nul800sebastiaancommented, Jun 2, 2020

Got it! And your samples are great. Would be cool to be able to link to a specific error message in the log as well, related to this error… but I guess that would be a difficult one! 🤔

1reaction
abjernercommented, May 30, 2020

I still like the the idea of adding these actions - for instance the example with linking to the documentation on an overlay as I wrote about. So I’ve played a bit around with this.

So if I had something that resulted in an error, I could show a notification like this:

notificationsService.add({
    headline: "Oh noes",
    message: "Some weird error happened.",
    type: "error",
    sticky: true,
    actions: [
        {
            text: "Read more",
            click: function (notification) {
                notificationsService.remove(notification);
                editorService.open({ ... });
            }
        },
        {
            text: "Hello",
            url: "http://omgbacon.dk",
            target: "_blank",
            click: function (notification) {
                notificationsService.remove(notification);
            }
        }
    ]
});

The first action illustrates how to open a new editor via the editorService, as well as removing the notification when the action is triggered.

The second action opens url in a new tab, and also removes the notification once the action is clicked.

Using either <button /> or <umb-botton /> would take up more vertical space compared to a single line of text, which then looks a bit off. So for the screenshot below, I’ve gone with a regular link

image

Would this be worth pursuing as a PR? And if so, anything else an action ought to support?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Notifications overview
A notification is a message that Android displays outside your app's UI to provide the user with reminders, communication from other people, or...
Read more >
Chapter 4 - Requesting and Documenting Personnel Actions
Notifying Employees of Personnel Actions. ... Personnel Folder documentation should be either: ... Notifications of Personnel Action or on the.
Read more >
Service connections in Azure Pipelines
Pipeline permissions control which YAML pipelines are authorized to use the service connection. Pipeline permissions do not restrict access ...
Read more >
gcloud config set | Google Cloud CLI Documentation
When a location value is required but not provided, the command will fall back to this value, if set. If this value is...
Read more >
Configure Grafana | Grafana documentation
The X-Content-Type-Options response HTTP header is a marker used by the server to indicate that the MIME types advertised in the Content-Type headers...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found