-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Add LoadAdditionalScriptsEvent for files_sharing #21815
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 |
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 🙈 |
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. |
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 🚀 |
@@ -478,7 +476,7 @@ public function showShare($path = ''): TemplateResponse { | |||
|
|||
// 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 <[email protected]>
1aff8d7
to
217a69e
Compare
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::loadAdditionalScripts
andOCA\Files::loadAdditionalScripts::publicShareAuth
events 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