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 setting multiple default file actions #39541

Merged
merged 3 commits into from Dec 2, 2021

Conversation

JammingBen
Copy link
Contributor

@JammingBen JammingBen commented Nov 30, 2021

Description

This change allows a mime type to have multiple default file actions. In the past, registering an action as default would overwrite existing defaults.

In case multiple file actions apply to a mime type, clicking on a file will show the app drawer context menu.

This approach allows apps to control where their actions will be displayed and is also more clean than the old and confusing getActionsWithoutAll method.

Related Issue

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Database schema changes (next release will require increase of minor version instead of patch)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests only (no source changes)

Checklist:

@JammingBen JammingBen changed the base branch from master to release-10.9.0 November 30, 2021 12:36
@ownclouders
Copy link
Contributor

💥 Acceptance tests pipeline webUIFileActionsMenu-chrome-mariadb10.2-php7.4 failed. The build has been cancelled.

https://drone.owncloud.com/owncloud/core/33845/154/1

@ownclouders
Copy link
Contributor

💥 Acceptance tests pipeline apiProxySmoke-8-3-mariadb10.2-php7.4 failed. The build has been cancelled.

https://drone.owncloud.com/owncloud/core/33846/172/1

@JammingBen JammingBen changed the title Multiple default actions Allow setting multiple default file actions Nov 30, 2021
@JammingBen JammingBen marked this pull request as ready for review November 30, 2021 14:51
@JammingBen
Copy link
Contributor Author

The changes look more "drastic" than they actually are. Many of the things that were introduced with #38132 have been rolled back.

  • Remove _getActions(), use getActions() instead.
  • Remove getActionsWithoutAll() because not needed anymore.
  • Implement getDefaultFileActions().
  • Deprecate getDefaultFileAction(). It still behaves like before to ensure nothing breaks.

As discussed with @pmaier1 we'd like to have this in 10.9.

@phil-davis
Copy link
Contributor

Is there a combination of apps that we can use to test this, without having OnlyOffice installed?

@JammingBen
Copy link
Contributor Author

Is there a combination of apps that we can use to test this, without having OnlyOffice installed?

Gallery and Medaviewer should work. They both register their actions as default for images.

apps/files/js/fileactions.js Show resolved Hide resolved
apps/files/js/fileactions.js Outdated Show resolved Hide resolved
apps/files/js/fileactions.js Outdated Show resolved Hide resolved
@sonarcloud
Copy link

sonarcloud bot commented Dec 2, 2021

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

96.1% 96.1% Coverage
0.0% 0.0% Duplication

@JammingBen JammingBen merged commit 178d2c5 into release-10.9.0 Dec 2, 2021
@delete-merged-branch delete-merged-branch bot deleted the multiple-default-actions branch December 2, 2021 09:26
@mmattel
Copy link
Contributor

mmattel commented Dec 2, 2021

I guess that this is docs relevant...

@JammingBen
Copy link
Contributor Author

Thx for the hint, I created owncloud/docs#4439. It needs some groundwork first, I'll take care as this is quite technical.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants