aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorFerdinand Thiessen <opensource@fthiessen.de>2024-06-28 15:37:18 +0200
committerFerdinand Thiessen <opensource@fthiessen.de>2024-09-06 03:38:47 +0200
commit563f8e7c5d4c44d6f17abe615885b3564e23c193 (patch)
tree687249399e09da6b2a550b6fce6157466f53b291 /apps
parentf0a765ee4645458d4781739f6d63a7326423d244 (diff)
downloadnextcloud-server-563f8e7c5d4c44d6f17abe615885b3564e23c193.tar.gz
nextcloud-server-563f8e7c5d4c44d6f17abe615885b3564e23c193.zip
refactor(files_sharing): Make file structure more clear
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Diffstat (limited to 'apps')
-rw-r--r--apps/files_sharing/src/files_actions/acceptShareAction.spec.ts (renamed from apps/files_sharing/src/actions/acceptShareAction.spec.ts)3
-rw-r--r--apps/files_sharing/src/files_actions/acceptShareAction.ts (renamed from apps/files_sharing/src/actions/acceptShareAction.ts)2
-rw-r--r--apps/files_sharing/src/files_actions/openInFilesAction.spec.ts (renamed from apps/files_sharing/src/actions/openInFilesAction.spec.ts)4
-rw-r--r--apps/files_sharing/src/files_actions/openInFilesAction.ts (renamed from apps/files_sharing/src/actions/openInFilesAction.ts)2
-rw-r--r--apps/files_sharing/src/files_actions/rejectShareAction.spec.ts (renamed from apps/files_sharing/src/actions/rejectShareAction.spec.ts)0
-rw-r--r--apps/files_sharing/src/files_actions/rejectShareAction.ts (renamed from apps/files_sharing/src/actions/rejectShareAction.ts)4
-rw-r--r--apps/files_sharing/src/files_actions/restoreShareAction.spec.ts (renamed from apps/files_sharing/src/actions/restoreShareAction.spec.ts)2
-rw-r--r--apps/files_sharing/src/files_actions/restoreShareAction.ts (renamed from apps/files_sharing/src/actions/restoreShareAction.ts)2
-rw-r--r--apps/files_sharing/src/files_actions/sharingStatusAction.scss (renamed from apps/files_sharing/src/actions/sharingStatusAction.scss)2
-rw-r--r--apps/files_sharing/src/files_actions/sharingStatusAction.ts (renamed from apps/files_sharing/src/actions/sharingStatusAction.ts)0
-rw-r--r--apps/files_sharing/src/files_filters/AccountFilter.ts (renamed from apps/files_sharing/src/filters/AccountFilter.ts)0
-rw-r--r--apps/files_sharing/src/files_headers/noteToRecipient.ts4
-rw-r--r--apps/files_sharing/src/files_newMenu/newFileRequest.ts (renamed from apps/files_sharing/src/new/newFileRequest.ts)5
-rw-r--r--apps/files_sharing/src/files_views/publicFileDrop.ts (renamed from apps/files_sharing/src/views/publicFileDrop.ts)0
-rw-r--r--apps/files_sharing/src/files_views/publicFileShare.ts (renamed from apps/files_sharing/src/views/publicFileShare.ts)0
-rw-r--r--apps/files_sharing/src/files_views/publicShare.ts (renamed from apps/files_sharing/src/views/publicShare.ts)0
-rw-r--r--apps/files_sharing/src/files_views/shares.spec.ts (renamed from apps/files_sharing/src/views/shares.spec.ts)0
-rw-r--r--apps/files_sharing/src/files_views/shares.ts (renamed from apps/files_sharing/src/views/shares.ts)0
-rw-r--r--apps/files_sharing/src/init-public.ts12
-rw-r--r--apps/files_sharing/src/init.ts16
20 files changed, 31 insertions, 27 deletions
diff --git a/apps/files_sharing/src/actions/acceptShareAction.spec.ts b/apps/files_sharing/src/files_actions/acceptShareAction.spec.ts
index 04199f998d0..4003e0799ac 100644
--- a/apps/files_sharing/src/actions/acceptShareAction.spec.ts
+++ b/apps/files_sharing/src/files_actions/acceptShareAction.spec.ts
@@ -9,7 +9,8 @@ import { File, Permission, View, FileAction } from '@nextcloud/files'
import { ShareType } from '@nextcloud/sharing'
import * as eventBus from '@nextcloud/event-bus'
import axios from '@nextcloud/axios'
-import '../main'
+
+import '../main.ts'
vi.mock('@nextcloud/axios')
diff --git a/apps/files_sharing/src/actions/acceptShareAction.ts b/apps/files_sharing/src/files_actions/acceptShareAction.ts
index 6584d1860f4..f2177fdec1a 100644
--- a/apps/files_sharing/src/actions/acceptShareAction.ts
+++ b/apps/files_sharing/src/files_actions/acceptShareAction.ts
@@ -11,7 +11,7 @@ import { translatePlural as n } from '@nextcloud/l10n'
import axios from '@nextcloud/axios'
import CheckSvg from '@mdi/svg/svg/check.svg?raw'
-import { pendingSharesViewId } from '../views/shares'
+import { pendingSharesViewId } from '../files_views/shares'
export const action = new FileAction({
id: 'accept-share',
diff --git a/apps/files_sharing/src/actions/openInFilesAction.spec.ts b/apps/files_sharing/src/files_actions/openInFilesAction.spec.ts
index 36e4b7ae3c9..95bd2812db7 100644
--- a/apps/files_sharing/src/actions/openInFilesAction.spec.ts
+++ b/apps/files_sharing/src/files_actions/openInFilesAction.spec.ts
@@ -4,10 +4,10 @@
*/
import { File, Permission, View, DefaultType, FileAction } from '@nextcloud/files'
import { describe, expect, test, vi } from 'vitest'
+import { deletedSharesViewId, pendingSharesViewId, sharedWithOthersViewId, sharedWithYouViewId, sharesViewId, sharingByLinksViewId } from '../files_views/shares'
+import { action } from './openInFilesAction'
import '../main'
-import { action } from './openInFilesAction'
-import { deletedSharesViewId, pendingSharesViewId, sharedWithOthersViewId, sharedWithYouViewId, sharesViewId, sharingByLinksViewId } from '../views/shares'
const view = {
id: 'files',
diff --git a/apps/files_sharing/src/actions/openInFilesAction.ts b/apps/files_sharing/src/files_actions/openInFilesAction.ts
index 7c74e819dbd..e9e07179fc4 100644
--- a/apps/files_sharing/src/actions/openInFilesAction.ts
+++ b/apps/files_sharing/src/files_actions/openInFilesAction.ts
@@ -7,7 +7,7 @@ import type { Node } from '@nextcloud/files'
import { registerFileAction, FileAction, DefaultType, FileType } from '@nextcloud/files'
import { translate as t } from '@nextcloud/l10n'
-import { sharesViewId, sharedWithYouViewId, sharedWithOthersViewId, sharingByLinksViewId } from '../views/shares'
+import { sharesViewId, sharedWithYouViewId, sharedWithOthersViewId, sharingByLinksViewId } from '../files_views/shares'
export const action = new FileAction({
id: 'open-in-files',
diff --git a/apps/files_sharing/src/actions/rejectShareAction.spec.ts b/apps/files_sharing/src/files_actions/rejectShareAction.spec.ts
index 51ded69d1c5..51ded69d1c5 100644
--- a/apps/files_sharing/src/actions/rejectShareAction.spec.ts
+++ b/apps/files_sharing/src/files_actions/rejectShareAction.spec.ts
diff --git a/apps/files_sharing/src/actions/rejectShareAction.ts b/apps/files_sharing/src/files_actions/rejectShareAction.ts
index ce47e0b5f13..22f77262ef2 100644
--- a/apps/files_sharing/src/actions/rejectShareAction.ts
+++ b/apps/files_sharing/src/files_actions/rejectShareAction.ts
@@ -9,11 +9,11 @@ import { generateOcsUrl } from '@nextcloud/router'
import { registerFileAction, FileAction } from '@nextcloud/files'
import { translatePlural as n } from '@nextcloud/l10n'
import { ShareType } from '@nextcloud/sharing'
+import { pendingSharesViewId } from '../files_views/shares'
+
import axios from '@nextcloud/axios'
import CloseSvg from '@mdi/svg/svg/close.svg?raw'
-import { pendingSharesViewId } from '../views/shares'
-
export const action = new FileAction({
id: 'reject-share',
displayName: (nodes: Node[]) => n('files_sharing', 'Reject share', 'Reject shares', nodes.length),
diff --git a/apps/files_sharing/src/actions/restoreShareAction.spec.ts b/apps/files_sharing/src/files_actions/restoreShareAction.spec.ts
index d6628810064..015aa8aa95d 100644
--- a/apps/files_sharing/src/actions/restoreShareAction.spec.ts
+++ b/apps/files_sharing/src/files_actions/restoreShareAction.spec.ts
@@ -9,7 +9,7 @@ import { beforeAll, beforeEach, describe, expect, test, vi } from 'vitest'
import axios from '@nextcloud/axios'
import * as eventBus from '@nextcloud/event-bus'
import { action } from './restoreShareAction'
-import '../main'
+import '../main.ts'
vi.mock('@nextcloud/auth')
vi.mock('@nextcloud/axios')
diff --git a/apps/files_sharing/src/actions/restoreShareAction.ts b/apps/files_sharing/src/files_actions/restoreShareAction.ts
index 17de09ba349..2d51de387ee 100644
--- a/apps/files_sharing/src/actions/restoreShareAction.ts
+++ b/apps/files_sharing/src/files_actions/restoreShareAction.ts
@@ -11,7 +11,7 @@ import { translatePlural as n } from '@nextcloud/l10n'
import ArrowULeftTopSvg from '@mdi/svg/svg/arrow-u-left-top.svg?raw'
import axios from '@nextcloud/axios'
-import { deletedSharesViewId } from '../views/shares'
+import { deletedSharesViewId } from '../files_views/shares'
export const action = new FileAction({
id: 'restore-share',
diff --git a/apps/files_sharing/src/actions/sharingStatusAction.scss b/apps/files_sharing/src/files_actions/sharingStatusAction.scss
index dee247932e6..12f4b806f6a 100644
--- a/apps/files_sharing/src/actions/sharingStatusAction.scss
+++ b/apps/files_sharing/src/files_actions/sharingStatusAction.scss
@@ -6,7 +6,7 @@
.action-items > .files-list__row-action-sharing-status {
// put icon at the end of the button
direction: rtl;
- // align icons with textless inline actions
+ // align icons with text-less inline actions
padding-inline-end: 0 !important;
}
diff --git a/apps/files_sharing/src/actions/sharingStatusAction.ts b/apps/files_sharing/src/files_actions/sharingStatusAction.ts
index 635e9e0d572..635e9e0d572 100644
--- a/apps/files_sharing/src/actions/sharingStatusAction.ts
+++ b/apps/files_sharing/src/files_actions/sharingStatusAction.ts
diff --git a/apps/files_sharing/src/filters/AccountFilter.ts b/apps/files_sharing/src/files_filters/AccountFilter.ts
index 29e8088dc23..29e8088dc23 100644
--- a/apps/files_sharing/src/filters/AccountFilter.ts
+++ b/apps/files_sharing/src/files_filters/AccountFilter.ts
diff --git a/apps/files_sharing/src/files_headers/noteToRecipient.ts b/apps/files_sharing/src/files_headers/noteToRecipient.ts
index 31e383d3634..7cf859172c5 100644
--- a/apps/files_sharing/src/files_headers/noteToRecipient.ts
+++ b/apps/files_sharing/src/files_headers/noteToRecipient.ts
@@ -23,7 +23,9 @@ export default function registerNoteToRecipient() {
enabled: (folder: Folder) => Boolean(folder.attributes.note),
// Update the root folder if needed
updated: (folder: Folder) => {
- instance.updateFolder(folder)
+ if (instance) {
+ instance.updateFolder(folder)
+ }
},
// render simply spawns the component
render: async (el: HTMLElement, folder: Folder) => {
diff --git a/apps/files_sharing/src/new/newFileRequest.ts b/apps/files_sharing/src/files_newMenu/newFileRequest.ts
index 55b7f534610..fb65a82a12f 100644
--- a/apps/files_sharing/src/new/newFileRequest.ts
+++ b/apps/files_sharing/src/files_newMenu/newFileRequest.ts
@@ -10,6 +10,7 @@ import { translate as t } from '@nextcloud/l10n'
import FileUploadSvg from '@mdi/svg/svg/file-upload.svg?raw'
import Config from '../services/ConfigService'
+import { isPublicShare } from '@nextcloud/sharing/public'
const sharingConfig = new Config()
const NewFileRequestDialogVue = defineAsyncComponent(() => import('../components/NewFileRequestDialog.vue'))
@@ -22,6 +23,10 @@ export const entry = {
iconSvgInline: FileUploadSvg,
order: 10,
enabled(): boolean {
+ // not on public shares
+ if (isPublicShare()) {
+ return false
+ }
// We will check for the folder permission on the dialog
return sharingConfig.isPublicShareAllowed
},
diff --git a/apps/files_sharing/src/views/publicFileDrop.ts b/apps/files_sharing/src/files_views/publicFileDrop.ts
index 0d782d48fc7..0d782d48fc7 100644
--- a/apps/files_sharing/src/views/publicFileDrop.ts
+++ b/apps/files_sharing/src/files_views/publicFileDrop.ts
diff --git a/apps/files_sharing/src/views/publicFileShare.ts b/apps/files_sharing/src/files_views/publicFileShare.ts
index b2b9de9ea5f..b2b9de9ea5f 100644
--- a/apps/files_sharing/src/views/publicFileShare.ts
+++ b/apps/files_sharing/src/files_views/publicFileShare.ts
diff --git a/apps/files_sharing/src/views/publicShare.ts b/apps/files_sharing/src/files_views/publicShare.ts
index 118973f54f5..118973f54f5 100644
--- a/apps/files_sharing/src/views/publicShare.ts
+++ b/apps/files_sharing/src/files_views/publicShare.ts
diff --git a/apps/files_sharing/src/views/shares.spec.ts b/apps/files_sharing/src/files_views/shares.spec.ts
index 153057bc0ad..153057bc0ad 100644
--- a/apps/files_sharing/src/views/shares.spec.ts
+++ b/apps/files_sharing/src/files_views/shares.spec.ts
diff --git a/apps/files_sharing/src/views/shares.ts b/apps/files_sharing/src/files_views/shares.ts
index 7aec0dbeafb..7aec0dbeafb 100644
--- a/apps/files_sharing/src/views/shares.ts
+++ b/apps/files_sharing/src/files_views/shares.ts
diff --git a/apps/files_sharing/src/init-public.ts b/apps/files_sharing/src/init-public.ts
index 400ee73d2a1..1b4765960aa 100644
--- a/apps/files_sharing/src/init-public.ts
+++ b/apps/files_sharing/src/init-public.ts
@@ -2,11 +2,11 @@
* SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
-import { getNavigation, registerDavProperty } from '@nextcloud/files'
+import { getNavigation } from '@nextcloud/files'
import { loadState } from '@nextcloud/initial-state'
-import registerFileDropView from './views/publicFileDrop.ts'
-import registerPublicShareView from './views/publicShare.ts'
-import registerPublicFileShareView from './views/publicFileShare.ts'
+import registerFileDropView from './files_views/publicFileDrop.ts'
+import registerPublicShareView from './files_views/publicShare.ts'
+import registerPublicFileShareView from './files_views/publicFileShare.ts'
import RouterService from '../../files/src/services/RouterService'
import router from './router'
@@ -14,10 +14,6 @@ registerFileDropView()
registerPublicShareView()
registerPublicFileShareView()
-registerDavProperty('nc:share-attributes', { nc: 'http://nextcloud.org/ns' })
-registerDavProperty('oc:share-types', { oc: 'http://owncloud.org/ns' })
-registerDavProperty('ocs:share-permissions', { ocs: 'http://open-collaboration-services.org/ns' })
-
// Get the current view from state and set it active
const view = loadState<string>('files_sharing', 'view')
const navigation = getNavigation()
diff --git a/apps/files_sharing/src/init.ts b/apps/files_sharing/src/init.ts
index 36f0a7c31a1..5a2b93c6ea3 100644
--- a/apps/files_sharing/src/init.ts
+++ b/apps/files_sharing/src/init.ts
@@ -3,17 +3,17 @@
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
import { addNewFileMenuEntry, registerDavProperty } from '@nextcloud/files'
-import { registerAccountFilter } from './filters/AccountFilter'
-import { entry as newFileRequest } from './new/newFileRequest.ts'
+import { registerAccountFilter } from './files_filters/AccountFilter'
+import { entry as newFileRequest } from './files_newMenu/newFileRequest'
import registerNoteToRecipient from './files_headers/noteToRecipient'
-import registerSharingViews from './views/shares'
+import registerSharingViews from './files_views/shares'
-import './actions/acceptShareAction'
-import './actions/openInFilesAction'
-import './actions/rejectShareAction'
-import './actions/restoreShareAction'
-import './actions/sharingStatusAction'
+import './files_actions/acceptShareAction'
+import './files_actions/openInFilesAction'
+import './files_actions/rejectShareAction'
+import './files_actions/restoreShareAction'
+import './files_actions/sharingStatusAction'
registerSharingViews()