-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Add LoadAdditionalScriptsEvent for files_sharing #21815
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
Conversation
apps/files_sharing/lib/Listener/LegacyLoadAdditionalScriptsAdapter.php
Outdated
Show resolved
Hide resolved
apps/files_sharing/lib/Listener/LegacyLoadAdditionalScriptsAdapter.php
Outdated
Show resolved
Hide resolved
|
I just noticed that you still use the newer old way. The newest one is the |
MorrisJobke
left a comment
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.
Code looks good and works 👍
16ce985 to
b329c95
Compare
|
Rebased and autosquashed 🚀 |
b329c95 to
aa5e98a
Compare
|
And I fixed the unit tests 🙈 |
ChristophWurst
left a comment
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.
A theoretical concern but it's easy to fix now than having another migration path for a public event that takes three years to get rid of.
aa5e98a to
fb01f17
Compare
|
Fixed, rebased and squashed. |
MorrisJobke
left a comment
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.
Beside my little comment this looks good 👍
fb01f17 to
6c8ba1c
Compare
|
Ready for merge 🚀 |
| // Load Viewer scripts | ||
| if (class_exists(LoadViewer::class)) { | ||
| $this->eventDispatcher->dispatch(LoadViewer::class, new LoadViewer()); | ||
| $this->eventDispatcher->dispatchTyped(new LoadViewer()); |
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.
We can do that? :O
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.
Yep - that's the new way and makes things fully typed and thus allows the be a bit more safe.
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.
Also you just register for the ::class and then the IDE finds properly all usages ;)
6c8ba1c to
1aff8d7
Compare
Signed-off-by: Julius Härtl <jus@bitgrid.net>
1aff8d7 to
217a69e
Compare
rullzer
left a comment
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!
Move old the
OCA\Files::loadAdditionalScriptsandOCA\Files::loadAdditionalScripts::publicShareAuthevents to our the public event API. An adapter is added as well to still dispatch the old events on the until the old ones are removed completely.Add to Critical changes for developers & admins for Nextcloud 20 #20953 if the old event is dropped