Skip to content

Commit

Permalink
Add quicklink compatibility for oc10, changelog item
Browse files Browse the repository at this point in the history
  • Loading branch information
pascalwengerter committed Apr 28, 2022
1 parent da4c9e3 commit 8c94b91
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
6 changes: 6 additions & 0 deletions changelog/unreleased/enhancement-introduce-quicklink
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Enhancement: Introduce quicklinks

We have added quicklinks to the link share section in the right sidebar. Clicking the link quickaction and the link menu item in the files table contextmenu now always copy the quick link instead of creating a new link (and create it first, if it didn't exist before).

https://github.com/owncloud/web/pull/6820
https://github.com/owncloud/web/issues/6605
8 changes: 6 additions & 2 deletions packages/web-app-files/src/helpers/resources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,11 @@ function _buildLink(link): Share {
description = role.label
}

const attributes = JSON.parse(link.attributes) || []
const oc10QuickLink = attributes.find(attr => attr.key === "isQuickLink")?.enabled
const ocisQuickLink = link.quicklink === 'true'
const quicklink = oc10QuickLink || ocisQuickLink

return {
shareType: parseInt(link.share_type),
id: link.id,
Expand All @@ -441,8 +446,7 @@ function _buildLink(link): Share {
path: link.path,
permissions: link.permissions,
description,
// TODO: May need OC10 differentiation
quicklink: link.quicklink === 'true',
quicklink,
stime: link.stime,
name: typeof link.name === 'string' ? link.name : (link.token as string),
password: !!(link.share_with && link.share_with_displayname),
Expand Down

0 comments on commit 8c94b91

Please sign in to comment.