-
Notifications
You must be signed in to change notification settings - Fork 159
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add default actions extension point (#11515)
* feat: introduce default actions extension point
- Loading branch information
Showing
13 changed files
with
125 additions
and
147 deletions.
There are no files selected for viewing
5 changes: 5 additions & 0 deletions
5
changelog/unreleased/enhancement-default-actions-extension-point
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Enhancement: Add default actions extension point | ||
|
||
We've added a new extension point `global.files.default-action` for allowing action extensions to register themselves for the left click default action. | ||
|
||
https://github.com/owncloud/web/pull/11515 |
This file contains 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
This file contains 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
39 changes: 39 additions & 0 deletions
39
packages/web-app-files/src/composables/extensions/useFileActions.ts
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import { | ||
ActionExtension, | ||
useFileActionsCopyQuickLink, | ||
useFileActionsOpenShortcut, | ||
useFileActionsShowShares | ||
} from '@ownclouders/web-pkg' | ||
import { | ||
contextActionsExtensionPoint, | ||
defaultActionsExtensionPoint, | ||
quickActionsExtensionPoint | ||
} from '../../extensionPoints' | ||
import { unref } from 'vue' | ||
|
||
export const useFileActions = (): ActionExtension[] => { | ||
const { actions: openShortcutActions } = useFileActionsOpenShortcut() | ||
const { actions: showSharesActions } = useFileActionsShowShares() | ||
const { actions: quickLinkActions } = useFileActionsCopyQuickLink() | ||
|
||
return [ | ||
{ | ||
id: 'com.github.owncloud.web.files.context-action.open-shortcut', | ||
extensionPointIds: [contextActionsExtensionPoint.id, defaultActionsExtensionPoint.id], | ||
type: 'action', | ||
action: unref(openShortcutActions)[0] | ||
}, | ||
{ | ||
id: 'com.github.owncloud.web.files.quick-action.collaborator', | ||
extensionPointIds: [quickActionsExtensionPoint.id], | ||
type: 'action', | ||
action: unref(showSharesActions)[0] | ||
}, | ||
{ | ||
id: 'com.github.owncloud.web.files.quick-action.quicklink', | ||
extensionPointIds: [quickActionsExtensionPoint.id], | ||
type: 'action', | ||
action: unref(quickLinkActions)[0] | ||
} | ||
] | ||
} |
This file contains 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
This file contains 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
This file contains 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
50 changes: 0 additions & 50 deletions
50
.../web-app-files/tests/unit/components/FilesList/__snapshots__/ResourceDetails.spec.ts.snap
This file was deleted.
Oops, something went wrong.
This file contains 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
Oops, something went wrong.