
Security News
npm ‘is’ Package Hijacked in Expanding Supply Chain Attack
The ongoing npm phishing campaign escalates as attackers hijack the popular 'is' package, embedding malware in multiple versions.
gitlab.com/qor2/notification
QOR Notification provides a way to send notifications to QOR Admin administrators. Notifications can be anything your system needs, like order update, delivery notices, whatever.
Notification := notification.New(¬ification.Config{})
// Add to Admin
Admin.NewResource(Notification)
// Register Database Channel
Notification.RegisterChannel(database.New(&database.Config{DB: db.DB}))
// Send Notification
Notification.Send(message *Message, context *qor.Context)
// Get Notification
Notification.GetNotification(user interface{}, messageID string, context *qor.Context)
// Get Notifications
Notification.GetNotifications(user interface{}, context *qor.Context)
// Get Unresolved Notifications Count
Notification.GetUnresolvedNotificationsCount(user interface{}, context *qor.Context)
The Notifications List in QOR Admin looks a bit like this when populated:
This example shows how to add a "Dismiss" button to notification. The button will appears in the notification which ResolvedAt
is nil. Please read the Action documentation for more details.
Notification.Action(¬ification.Action{
Name: "Dismiss",
MessageTypes: []string{"info", "order_processed", "order_returned"},
Visible: func(data *notification.QorNotification, context *admin.Context) bool {
return data.ResolvedAt == nil
},
Handle: func(argument *notification.ActionArgument) error {
return argument.Context.GetDB().Model(argument.Message).Update("resolved_at", time.Now()).Error
},
})
Released under the MIT License.
FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The ongoing npm phishing campaign escalates as attackers hijack the popular 'is' package, embedding malware in multiple versions.
Security News
A critical flaw in the popular npm form-data package could allow HTTP parameter pollution, affecting millions of projects until patched versions are adopted.
Security News
Bun 1.2.19 introduces isolated installs for smoother monorepo workflows, along with performance boosts, new tooling, and key compatibility fixes.