From 8c94b913777405a042b2bcccb753ea9cc06deb8d Mon Sep 17 00:00:00 2001 From: Pascal Wengerter Date: Thu, 28 Apr 2022 16:52:03 +0200 Subject: [PATCH] Add quicklink compatibility for oc10, changelog item --- changelog/unreleased/enhancement-introduce-quicklink | 6 ++++++ packages/web-app-files/src/helpers/resources.ts | 8 ++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 changelog/unreleased/enhancement-introduce-quicklink diff --git a/changelog/unreleased/enhancement-introduce-quicklink b/changelog/unreleased/enhancement-introduce-quicklink new file mode 100644 index 00000000000..b305107365d --- /dev/null +++ b/changelog/unreleased/enhancement-introduce-quicklink @@ -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 diff --git a/packages/web-app-files/src/helpers/resources.ts b/packages/web-app-files/src/helpers/resources.ts index eb2647cd401..608f84295a0 100644 --- a/packages/web-app-files/src/helpers/resources.ts +++ b/packages/web-app-files/src/helpers/resources.ts @@ -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, @@ -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),