Trigger events before and after a file action is executed#7591
Merged
MorrisJobke merged 3 commits intomasterfrom Dec 22, 2017
Merged
Conversation
In the same way that other elements can know when a FileAction is registered or a default action is set this commit makes possible to be notified before and after a FileAction is executed. This is achieved by wrapping the registered action handler in a custom function that notifies the listeners before and after executing the handler itself. Due to this approach only FileActions registered through "registerAction" trigger the events, although that is not a problem as this is how the actions should be added to the FileActions anyway. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Clicking on an empty space in a file row causes the details view to be shown. As it is a user initiated action on the file list now it is done by triggering the Details action instead of directly calling "_updateDetailsView"; the result is the same in both cases, but using the action is more consistent (clicking on the file name triggers the default action, and clicking on the inline actions triggers those actions) and also makes possible to use the "beforeTriggerAction" and "afterTriggerAction" listeners. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Codecov Report
@@ Coverage Diff @@
## master #7591 +/- ##
=========================================
Coverage 51.17% 51.17%
Complexity 24886 24886
=========================================
Files 1602 1602
Lines 94750 94750
Branches 1368 1368
=========================================
Hits 48485 48485
Misses 46265 46265 |
MorrisJobke
approved these changes
Dec 22, 2017
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In the same way that other elements can know when a
FileActionis registered or a default action is set this pull request makes possible to be notified before and after aFileActionis executed.This change should not negatively affect any existing app (except if they rely on the executed action handler to be exactly the same that was originally set, which is an unlikely behaviour), and it will give more control to apps over the file actions (for example, to intercept them before they are executed).