Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 16 additions & 12 deletions apps/files_sharing/src/files_views/shares.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { loadState } from '@nextcloud/initial-state'
import { t } from '@nextcloud/l10n'
import { ShareType } from '@nextcloud/sharing'
import { getContents, isFileRequest } from '../services/SharingService.ts'
import { getCapabilities } from '@nextcloud/capabilities'

export const sharesViewId = 'shareoverview'
export const sharedWithYouViewId = 'sharingin'
Expand Down Expand Up @@ -80,22 +81,25 @@ export default () => {
}))
}

Navigation.register(new View({
id: sharingByLinksViewId,
name: t('files_sharing', 'Shared by link'),
caption: t('files_sharing', 'List of files that are shared by link.'),
// Don't show this view if sharing by link is disabled.
if (getCapabilities().files_sharing.public.enabled) {
Navigation.register(new View({
id: sharingByLinksViewId,
name: t('files_sharing', 'Shared by link'),
caption: t('files_sharing', 'List of files that are shared by link.'),

emptyTitle: t('files_sharing', 'No shared links'),
emptyCaption: t('files_sharing', 'Files and folders you shared by link will show up here'),
emptyTitle: t('files_sharing', 'No shared links'),
emptyCaption: t('files_sharing', 'Files and folders you shared by link will show up here'),

icon: LinkSvg,
order: 3,
parent: sharesViewId,
icon: LinkSvg,
order: 3,
parent: sharesViewId,

columns: [],
columns: [],

getContents: () => getContents(false, true, false, false, [ShareType.Link]),
}))
getContents: () => getContents(false, true, false, false, [ShareType.Link]),
}))
}

Navigation.register(new View({
id: fileRequestViewId,
Expand Down
Loading