Skip to content

Improve FileActions JS to allow for custom rendering - #12394

Merged
LukasReschke merged 1 commit into
masterfrom
files-fileactionsimprovements
Dec 8, 2014
Merged

LukasReschke merged 1 commit into
masterfrom
files-fileactionsimprovements

Conversation

@PVince81

Copy link
Copy Markdown
Contributor

This improves the OCA.Files.FileActions class to support passing a
"render" function in the action object.

The default function "_defaultRenderFunction" is used by default and
renders actions in the usual actions container.

Moved "Rename" and "Delete" to custom render functions.

Note: this change will be needed when adding the "Favorite" action (mostly to avoid additional ugly hard-codings...)

Please review @MorrisJobke @icewind1991 @schiesbn @th3fallen

This improves the OCA.Files.FileActions class to support passing a
"render" function in the action object.

The default function "_defaultRenderFunction" is used by default and
renders actions in the usual actions container.

Moved "Rename" and "Delete" to custom render functions.
@PVince81

Copy link
Copy Markdown
Contributor Author

or @nickvergessen

@scrutinizer-notifier

Copy link
Copy Markdown

The inspection completed: 1 new issues

@ghost

ghost commented Nov 24, 2014

Copy link
Copy Markdown

🚀 Test PASSed. 🚀
Refer to this link for build results (access rights to CI server needed):
https://ci.owncloud.org//job/pull-request-analyser-ng-simple/3148/
🚀 Test PASSed. 🚀

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about the action.render === false for disabled idea?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea was conditionally disabled actions.
In such case the implementer of the "render()" function must make it return false/null and not render anything to disable the action based on the context condition.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@PVince81 PVince81 added this to the 8.0-current milestone Nov 25, 2014
@PVince81

Copy link
Copy Markdown
Contributor Author

Set milestone to OC 8 as it's a requirement to be able to implement files favorites.

@icewind1991

Copy link
Copy Markdown
Contributor

Code looks good, things still seem to work 👍

@PVince81

PVince81 commented Dec 3, 2014

Copy link
Copy Markdown
Contributor Author

@nickvergessen can you have another look ?

@LukasReschke

Copy link
Copy Markdown
Contributor

👍

LukasReschke added a commit that referenced this pull request Dec 8, 2014
Improve FileActions JS to allow for custom rendering
@LukasReschke
LukasReschke merged commit d318815 into master Dec 8, 2014
@LukasReschke
LukasReschke deleted the files-fileactionsimprovements branch December 8, 2014 10:30
@MorrisJobke

Copy link
Copy Markdown
Contributor

That was quick :D

@lock lock Bot locked as resolved and limited conversation to collaborators Aug 15, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants