Skip to content
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

Allow Owncloud apps to add new items to the “new” file menu. #20051

Merged
merged 1 commit into from
Oct 29, 2015
Merged

Allow Owncloud apps to add new items to the “new” file menu. #20051

merged 1 commit into from
Oct 29, 2015

Conversation

otetard
Copy link
Contributor

@otetard otetard commented Oct 26, 2015

A new addMenuEntry() was added to NewFileMenu. To add a new item, you have to attach a plugin to OCA.Files.NewFileMenu that will call addMenuEntry().

This fixes #19945


/* Find the right actionHandler that should be called.
* Actions is retrieved by using `actionSpec.id` */
action = self._menuItems.filter(function(item) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Please use _.filter() instead, because Array's filter will not work in IE8... (yes, we all hate that browser)

Copy link
Contributor

Choose a reason for hiding this comment

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

@PVince81
Copy link
Contributor

Great stuff!

@PVince81
Copy link
Contributor

👍

@PVince81
Copy link
Contributor

@otetard is this the final form or did you intend to add additional things ? I'm fine with having this merged in its current form 😄

@PVince81
Copy link
Contributor

Also some formalities:

Thanks a lot for your contribution!
Contributions to the core repo require a signed contributors agreement http://owncloud.org/about/contributor-agreement/

Alternatively you can add a comment here where you state that this contribution is MIT licensed.

Some more details about out pull request workflow can be found here: http://owncloud.org/code-reviews-on-github/

Owncloud apps can now add new items to the “new” file menu. A new
`addMenuEntry()` was added to `NewFileMenu`. To add a new item, you
have to attach a plugin to `OCA.Files.NewFileMenu` that will call
`addMenuEntry()`.
@otetard
Copy link
Contributor Author

otetard commented Oct 26, 2015

Thanks @PVince81 for the feedback, I’ve just refreshed the PR in order to use _.filter(). It’s fine for me if this PR is merged in this form.

I will sign the CLA quickly.

@PVince81
Copy link
Contributor

@otetard thanks. I haven't tested the plugin part, I assume you did with your own app maybe. From looking at the code it should work fine.

@PVince81
Copy link
Contributor

@karlitschek @otetard any update on the CLA ? Alternatively you can state the MIT license here.

@PVince81 PVince81 added this to the 9.0-current milestone Oct 29, 2015
@otetard
Copy link
Contributor Author

otetard commented Oct 29, 2015

Hi @PVince81. Everything should be ok, I’ve signed and sent the CLA to @karlitschek.

@karlitschek
Copy link
Contributor

Yes. confirmed :-)

@PVince81
Copy link
Contributor

Needs a second reviewer @rullzer @nickvergessen @MorrisJobke @blizzz

@MorrisJobke
Copy link
Contributor

I just tested this and it works.

I also directly documented it: owncloud-archive/documentation#1839

👍

@blizzz
Copy link
Contributor

blizzz commented Oct 29, 2015

Cool stuff! 🚀

DeepDiver1975 added a commit that referenced this pull request Oct 29, 2015
Allow Owncloud apps to add new items to the “new” file menu.
@DeepDiver1975 DeepDiver1975 merged commit 17dc482 into owncloud:master Oct 29, 2015
@PVince81
Copy link
Contributor

CC @jancborchardt FYI

@jancborchardt
Copy link
Member

Is there already an example of an app using this? I’d say it’s good, similar to how Google Drive does it actually.

@otetard
Copy link
Contributor Author

otetard commented Oct 30, 2015

Hi @jancborchardt. I’m using this functionality in my OwnPad app (which add the ability to create links to etherpad from ownCloud). The code that use this addMenuEntry() is available in the features/port-to-owncloud9 branch.

@jancborchardt
Copy link
Member

@otetard so does it then open the app with a fresh document on click? That’s what I would expect to happen at least.

@lock lock bot locked as resolved and limited conversation to collaborators Aug 9, 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.

Allow apps to add new actions in the “New” filemenu
7 participants