From be968a8841587f6e4034ff32880d1ceca4a827bd Mon Sep 17 00:00:00 2001
From: Louis Chemineau <louis@chmn.me>
Date: Wed, 26 Jan 2022 15:33:36 +0100
Subject: Use @nextcloud/sharing in files and files_sharing

Signed-off-by: Louis Chemineau <louis@chmn.me>

Update tests

Signed-off-by: Louis Chemineau <louis@chmn.me>
---
 apps/files_sharing/src/components/SharingEntryLink.vue | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

(limited to 'apps/files_sharing/src/components/SharingEntryLink.vue')

diff --git a/apps/files_sharing/src/components/SharingEntryLink.vue b/apps/files_sharing/src/components/SharingEntryLink.vue
index 5a49a1d4976..9fefa9b6f90 100644
--- a/apps/files_sharing/src/components/SharingEntryLink.vue
+++ b/apps/files_sharing/src/components/SharingEntryLink.vue
@@ -329,6 +329,7 @@
 
 <script>
 import { generateUrl } from '@nextcloud/router'
+import { Type as ShareTypes } from '@nextcloud/sharing'
 import Vue from 'vue'
 
 import ActionButton from '@nextcloud/vue/dist/Components/ActionButton'
@@ -662,8 +663,8 @@ export default {
 		externalLinkActions() {
 			// filter only the registered actions for said link
 			return this.ExternalShareActions.actions
-				.filter(action => action.shareType.includes(OC.Share.SHARE_TYPE_LINK)
-					|| action.shareType.includes(OC.Share.SHARE_TYPE_EMAIL))
+				.filter(action => action.shareType.includes(ShareTypes.SHARE_TYPE_LINK)
+					|| action.shareType.includes(ShareTypes.SHARE_TYPE_EMAIL))
 		},
 
 		isPasswordPolicyEnabled() {
@@ -682,7 +683,7 @@ export default {
 			}
 
 			const shareDefaults = {
-				share_type: OC.Share.SHARE_TYPE_LINK,
+				share_type: ShareTypes.SHARE_TYPE_LINK,
 			}
 			if (this.config.isDefaultExpireDateEnforced) {
 				// default is empty string if not set
@@ -756,7 +757,7 @@ export default {
 				const path = (this.fileInfo.path + '/' + this.fileInfo.name).replace('//', '/')
 				const newShare = await this.createShare({
 					path,
-					shareType: OC.Share.SHARE_TYPE_LINK,
+					shareType: ShareTypes.SHARE_TYPE_LINK,
 					password: share.password,
 					expireDate: share.expireDate,
 					// we do not allow setting the publicUpload
-- 
cgit v1.2.3

