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
[Vue] migrate notifications directive & service + UI.Notifications #18225
Conversation
…ty method (all untested)
…se v-model, add event parameters to createAngularAdapter, allow translate to use variadic args or one string array + rebuild
…s in between nodes while vue 3 does not
…ndling to just reset back to the previous date since it was easier in vue to do that)
@diosmosis could you please merge in the latest changes from 4.x-dev and resolve the conflicts. The diff currently also shows all changes from the previous PR, so it's hard to look through it. |
@sgiehl done |
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.
Overall this seems to work. The animation for appearing notifications looks slightly different, but imho that would be fine, as it doesn't make a big difference.
Left some small comments, besides that it would be good to merge.
Not sure if maybe @peterhashair wants to have a look as well.
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.
Looks good, maybe one mirror CSS change.
@@ -8,6 +8,10 @@ | |||
margin-top: 1em; | |||
} | |||
|
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.
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.
@peterhashair this looks strange, I agree, but I think it's a problem w/ admin pages, since it looks fine on the dashboard and other report pages (the widgets stretch as far as the notification). I checked on 4.x-dev and it's an issue there so I'm guessing this might be a good candidate for a new issue 👍
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.
LGTM. Merged in latest 4.x-dev changes. Will wait for the tests before merging.
Description:
This PR is based off of #18214.
This PR is fairly complicated since the original notifications code added and removed DOM nodes itself, where this management is meant to be done (in most cases) by the framework.
Changes:
Migrated notification angularjs directive to Vue (in Notification.vue).
Moved notification.js logic to new NotificationsStore class. This store houses a list of displayed notifications. Notifications are added to the store to display them, removed from the store to destroy them.
Created NotificationGroup component to display a list of notifications based on what's in the store. This approximates the
placeat
functionality except instead of directly adding DOM nodes to an element, we are adding notifications to the store which a NotificationGroup will see and display. The specific NotificationGroup that displays the notification is determined by a newgroup
property in client side notifications.Added toast functionality to NotificationsStore (the previous implementation appears to be completely broken).
Implemented the scrollToNotification() functionality using an attribute we select for, since we no longer have the actual DOM node for a notification.
Review