Merge pull request #49351 from nextcloud/fix/no-issue/no-reshare-perms-4-email-shares

enh: Improvements on sharing details
This commit is contained in:
F. E Noel Nfebe 2024-12-03 15:16:53 +01:00 committed by GitHub
commit 5ee4c9effa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
68 changed files with 170 additions and 193 deletions

View file

@ -141,7 +141,7 @@ export default {
async getSuggestions(search) {
const shareType = [
ShareType.SHARE_TYPE_USER,
ShareType.User,
]
let request = null

View file

@ -39,6 +39,7 @@
import type { IAccountData } from '../filters/AccountFilter.ts'
import { translate as t } from '@nextcloud/l10n'
import { ShareType } from '@nextcloud/sharing'
import { mdiAccountMultiple } from '@mdi/js'
import { useBrowserLocation } from '@vueuse/core'
import { computed, ref, watch } from 'vue'
@ -49,7 +50,6 @@ import NcActionButton from '@nextcloud/vue/dist/Components/NcActionButton.js'
import NcActionInput from '@nextcloud/vue/dist/Components/NcActionInput.js'
import NcAvatar from '@nextcloud/vue/dist/Components/NcAvatar.js'
import NcIconSvgWrapper from '@nextcloud/vue/dist/Components/NcIconSvgWrapper.js'
import { ShareType } from '@nextcloud/sharing'
interface IUserSelectData {
id: string

View file

@ -6,7 +6,7 @@
<template>
<li class="sharing-entry">
<NcAvatar class="sharing-entry__avatar"
:is-no-user="share.type !== SHARE_TYPES.SHARE_TYPE_USER"
:is-no-user="share.type !== ShareType.User"
:user="share.shareWith"
:display-name="share.shareWithDisplayName"
:menu-position="'left'"
@ -41,6 +41,8 @@
</template>
<script>
import { ShareType } from '@nextcloud/sharing'
import NcButton from '@nextcloud/vue/dist/Components/NcButton.js'
import NcSelect from '@nextcloud/vue/dist/Components/NcSelect.js'
import NcAvatar from '@nextcloud/vue/dist/Components/NcAvatar.js'
@ -67,15 +69,15 @@ export default {
computed: {
title() {
let title = this.share.shareWithDisplayName
if (this.share.type === this.SHARE_TYPES.SHARE_TYPE_GROUP) {
if (this.share.type === ShareType.Group) {
title += ` (${t('files_sharing', 'group')})`
} else if (this.share.type === this.SHARE_TYPES.SHARE_TYPE_ROOM) {
} else if (this.share.type === ShareType.Room) {
title += ` (${t('files_sharing', 'conversation')})`
} else if (this.share.type === this.SHARE_TYPES.SHARE_TYPE_REMOTE) {
} else if (this.share.type === ShareType.Remote) {
title += ` (${t('files_sharing', 'remote')})`
} else if (this.share.type === this.SHARE_TYPES.SHARE_TYPE_REMOTE_GROUP) {
} else if (this.share.type === ShareType.RemoteGroup) {
title += ` (${t('files_sharing', 'remote group')})`
} else if (this.share.type === this.SHARE_TYPES.SHARE_TYPE_GUEST) {
} else if (this.share.type === ShareType.Guest) {
title += ` (${t('files_sharing', 'guest')})`
}
if (!this.isShareOwner && this.share.ownerDisplayName) {
@ -93,9 +95,9 @@ export default {
user: this.share.shareWithDisplayName,
owner: this.share.ownerDisplayName,
}
if (this.share.type === this.SHARE_TYPES.SHARE_TYPE_GROUP) {
if (this.share.type === ShareType.Group) {
return t('files_sharing', 'Shared with the group {user} by {owner}', data)
} else if (this.share.type === this.SHARE_TYPES.SHARE_TYPE_ROOM) {
} else if (this.share.type === ShareType.Room) {
return t('files_sharing', 'Shared with the conversation {user} by {owner}', data)
}
@ -108,7 +110,7 @@ export default {
* @return {boolean}
*/
hasStatus() {
if (this.share.type !== this.SHARE_TYPES.SHARE_TYPE_USER) {
if (this.share.type !== ShareType.User) {
return false
}

View file

@ -446,7 +446,7 @@ export default {
*/
isEmailShareType() {
return this.share
? this.share.type === this.SHARE_TYPES.SHARE_TYPE_EMAIL
? this.share.type === ShareType.Email
: false
},

View file

@ -27,10 +27,10 @@
</template>
<script>
import { ShareType } from '@nextcloud/sharing'
import DropdownIcon from 'vue-material-design-icons/TriangleSmallDown.vue'
import SharesMixin from '../mixins/SharesMixin.js'
import ShareDetails from '../mixins/ShareDetails.js'
import ShareTypes from '../mixins/ShareTypes.js'
import NcActions from '@nextcloud/vue/dist/Components/NcActions.js'
import NcActionButton from '@nextcloud/vue/dist/Components/NcActionButton.js'
import IconEyeOutline from 'vue-material-design-icons/EyeOutline.vue'
@ -52,7 +52,7 @@ export default {
NcActionButton,
},
mixins: [SharesMixin, ShareDetails, ShareTypes],
mixins: [SharesMixin, ShareDetails],
props: {
share: {
@ -122,7 +122,7 @@ export default {
supportsFileDrop() {
if (this.isFolder && this.config.isPublicUploadEnabled) {
const shareType = this.share.type ?? this.share.shareType
return [this.SHARE_TYPES.SHARE_TYPE_LINK, this.SHARE_TYPES.SHARE_TYPE_EMAIL].includes(shareType)
return [ShareType.Link, ShareType.Email].includes(shareType)
}
return false
},

View file

@ -38,8 +38,8 @@ import NcSelect from '@nextcloud/vue/dist/Components/NcSelect.js'
import Config from '../services/ConfigService.ts'
import Share from '../models/Share.ts'
import ShareRequests from '../mixins/ShareRequests.js'
import ShareTypes from '../mixins/ShareTypes.js'
import ShareDetails from '../mixins/ShareDetails.js'
import { ShareType } from '@nextcloud/sharing'
export default {
name: 'SharingInput',
@ -48,7 +48,7 @@ export default {
NcSelect,
},
mixins: [ShareTypes, ShareRequests, ShareDetails],
mixins: [ShareRequests, ShareDetails],
props: {
shares: {
@ -168,20 +168,10 @@ export default {
lookup = true
}
const shareType = [
this.SHARE_TYPES.SHARE_TYPE_USER,
this.SHARE_TYPES.SHARE_TYPE_GROUP,
this.SHARE_TYPES.SHARE_TYPE_REMOTE,
this.SHARE_TYPES.SHARE_TYPE_REMOTE_GROUP,
this.SHARE_TYPES.SHARE_TYPE_CIRCLE,
this.SHARE_TYPES.SHARE_TYPE_ROOM,
this.SHARE_TYPES.SHARE_TYPE_GUEST,
this.SHARE_TYPES.SHARE_TYPE_DECK,
this.SHARE_TYPES.SHARE_TYPE_SCIENCEMESH,
]
const shareType = Object.values(ShareType)
if (getCapabilities().files_sharing.public.enabled === true) {
shareType.push(this.SHARE_TYPES.SHARE_TYPE_EMAIL)
shareType.push(ShareType.Email)
}
let request = null
@ -318,7 +308,7 @@ export default {
return arr
}
try {
if (share.value.shareType === this.SHARE_TYPES.SHARE_TYPE_USER) {
if (share.value.shareType === ShareType.User) {
// filter out current user
if (share.value.shareWith === getCurrentUser().uid) {
return arr
@ -331,7 +321,7 @@ export default {
}
// filter out existing mail shares
if (share.value.shareType === this.SHARE_TYPES.SHARE_TYPE_EMAIL) {
if (share.value.shareType === ShareType.Email) {
const emails = this.linkShares.map(elem => elem.shareWith)
if (emails.indexOf(share.value.shareWith.trim()) !== -1) {
return arr
@ -369,42 +359,42 @@ export default {
*/
shareTypeToIcon(type) {
switch (type) {
case this.SHARE_TYPES.SHARE_TYPE_GUEST:
case ShareType.Guest:
// default is a user, other icons are here to differentiate
// themselves from it, so let's not display the user icon
// case this.SHARE_TYPES.SHARE_TYPE_REMOTE:
// case this.SHARE_TYPES.SHARE_TYPE_USER:
// case ShareType.Remote:
// case ShareType.User:
return {
icon: 'icon-user',
iconTitle: t('files_sharing', 'Guest'),
}
case this.SHARE_TYPES.SHARE_TYPE_REMOTE_GROUP:
case this.SHARE_TYPES.SHARE_TYPE_GROUP:
case ShareType.RemoteGroup:
case ShareType.Group:
return {
icon: 'icon-group',
iconTitle: t('files_sharing', 'Group'),
}
case this.SHARE_TYPES.SHARE_TYPE_EMAIL:
case ShareType.Email:
return {
icon: 'icon-mail',
iconTitle: t('files_sharing', 'Email'),
}
case this.SHARE_TYPES.SHARE_TYPE_CIRCLE:
case ShareType.Team:
return {
icon: 'icon-teams',
iconTitle: t('files_sharing', 'Team'),
}
case this.SHARE_TYPES.SHARE_TYPE_ROOM:
case ShareType.Room:
return {
icon: 'icon-room',
iconTitle: t('files_sharing', 'Talk conversation'),
}
case this.SHARE_TYPES.SHARE_TYPE_DECK:
case ShareType.Deck:
return {
icon: 'icon-deck',
iconTitle: t('files_sharing', 'Deck board'),
}
case this.SHARE_TYPES.SHARE_TYPE_SCIENCEMESH:
case ShareType.Sciencemesh:
return {
icon: 'icon-sciencemesh',
iconTitle: t('files_sharing', 'ScienceMesh'),
@ -422,13 +412,13 @@ export default {
*/
formatForMultiselect(result) {
let subname
if (result.value.shareType === this.SHARE_TYPES.SHARE_TYPE_USER && this.config.shouldAlwaysShowUnique) {
if (result.value.shareType === ShareType.User && this.config.shouldAlwaysShowUnique) {
subname = result.shareWithDisplayNameUnique ?? ''
} else if ((result.value.shareType === this.SHARE_TYPES.SHARE_TYPE_REMOTE
|| result.value.shareType === this.SHARE_TYPES.SHARE_TYPE_REMOTE_GROUP
} else if ((result.value.shareType === ShareType.Remote
|| result.value.shareType === ShareType.RemoteGroup
) && result.value.server) {
subname = t('files_sharing', 'on {server}', { server: result.value.server })
} else if (result.value.shareType === this.SHARE_TYPES.SHARE_TYPE_EMAIL) {
} else if (result.value.shareType === ShareType.Email) {
subname = result.value.shareWith
} else {
subname = result.shareWithDescription ?? ''
@ -438,7 +428,7 @@ export default {
shareWith: result.value.shareWith,
shareType: result.value.shareType,
user: result.uuid || result.value.shareWith,
isNoUser: result.value.shareType !== this.SHARE_TYPES.SHARE_TYPE_USER,
isNoUser: result.value.shareType !== ShareType.User,
displayName: result.name || result.label,
subname,
shareWithDisplayNameUnique: result.shareWithDisplayNameUnique || '',

View file

@ -1,14 +0,0 @@
/**
* SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
import { Type as ShareTypes } from '@nextcloud/sharing'
export default {
data() {
return {
SHARE_TYPES: ShareTypes,
}
},
}

View file

@ -5,6 +5,7 @@
import { getCurrentUser } from '@nextcloud/auth'
import { showError, showSuccess } from '@nextcloud/dialogs'
import { ShareType } from '@nextcloud/sharing'
import { emit } from '@nextcloud/event-bus'
import { fetchNode } from '../services/WebdavClient.ts'
@ -13,7 +14,6 @@ import debounce from 'debounce'
import Share from '../models/Share.ts'
import SharesRequests from './ShareRequests.js'
import ShareTypes from './ShareTypes.js'
import Config from '../services/ConfigService.ts'
import logger from '../services/logger.ts'
@ -22,7 +22,7 @@ import {
} from '../lib/SharePermissionsToolBox.js'
export default {
mixins: [SharesRequests, ShareTypes],
mixins: [SharesRequests],
props: {
fileInfo: {
@ -44,6 +44,7 @@ export default {
return {
config: new Config(),
node: null,
ShareType,
// errors helpers
errors: {},
@ -114,10 +115,10 @@ export default {
},
isPublicShare() {
const shareType = this.share.shareType ?? this.share.type
return [this.SHARE_TYPES.SHARE_TYPE_LINK, this.SHARE_TYPES.SHARE_TYPE_EMAIL].includes(shareType)
return [ShareType.Link, ShareType.Email].includes(shareType)
},
isRemoteShare() {
return this.share.type === this.SHARE_TYPES.SHARE_TYPE_REMOTE_GROUP || this.share.type === this.SHARE_TYPES.SHARE_TYPE_REMOTE
return this.share.type === ShareType.RemoteGroup || this.share.type === ShareType.Remote
},
isShareOwner() {
return this.share && this.share.owner === getCurrentUser().uid

View file

@ -48,7 +48,7 @@ export default class ExternalShareActions {
if (typeof action !== 'object'
|| typeof action.id !== 'string'
|| typeof action.data !== 'function' // () => {disabled: true}
|| !Array.isArray(action.shareType) // [\@nextcloud/sharing.Types.SHARE_TYPE_LINK, ...]
|| !Array.isArray(action.shareType) // [\@nextcloud/sharing.Types.Link, ...]
|| typeof action.handlers !== 'object' // {click: () => {}, ...}
|| !Object.values(action.handlers).every(handler => typeof handler === 'function')) {
console.error('Invalid action provided', action)

View file

@ -7,7 +7,7 @@
/* eslint-disable */
import escapeHTML from 'escape-html'
import { Type as ShareTypes } from '@nextcloud/sharing'
import { ShareType } from '@nextcloud/sharing'
import { getCapabilities } from '@nextcloud/capabilities'
(function() {
@ -155,25 +155,23 @@ import { getCapabilities } from '@nextcloud/capabilities'
var hasShares = false
_.each(shareTypesStr.split(',') || [], function(shareTypeStr) {
let shareType = parseInt(shareTypeStr, 10)
if (shareType === ShareTypes.SHARE_TYPE_LINK) {
if (shareType === ShareType.Link) {
hasLink = true
} else if (shareType === ShareTypes.SHARE_TYPE_EMAIL) {
} else if (shareType === ShareType.Email) {
hasLink = true
} else if (shareType === ShareTypes.SHARE_TYPE_USER) {
} else if (shareType === ShareType.User) {
hasShares = true
} else if (shareType === ShareTypes.SHARE_TYPE_GROUP) {
} else if (shareType === ShareType.Group) {
hasShares = true
} else if (shareType === ShareTypes.SHARE_TYPE_REMOTE) {
} else if (shareType === ShareType.Remote) {
hasShares = true
} else if (shareType === ShareTypes.SHARE_TYPE_REMOTE_GROUP) {
} else if (shareType === ShareType.RemoteGroup) {
hasShares = true
} else if (shareType === ShareTypes.SHARE_TYPE_CIRCLE) {
} else if (shareType === ShareType.Team) {
hasShares = true
} else if (shareType === ShareTypes.SHARE_TYPE_ROOM) {
} else if (shareType === ShareType.Room) {
hasShares = true
} else if (shareType === ShareTypes.SHARE_TYPE_DECK) {
hasShares = true
} else if (shareType === ShareTypes.SHARE_TYPE_SCIENCEMESH) {
} else if (shareType === ShareType.Deck) {
hasShares = true
}
})
@ -204,8 +202,8 @@ import { getCapabilities } from '@nextcloud/capabilities'
permissions: OC.PERMISSION_ALL,
iconClass: function(fileName, context) {
var shareType = parseInt(context.$file.data('share-types'), 10)
if (shareType === ShareTypes.SHARE_TYPE_EMAIL
|| shareType === ShareTypes.SHARE_TYPE_LINK) {
if (shareType === ShareType.Email
|| shareType === ShareType.Link) {
return 'icon-public'
}
return 'icon-shared'

View file

@ -3,7 +3,7 @@
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
import { Type as ShareTypes } from '@nextcloud/sharing'
import { ShareType } from '@nextcloud/sharing'
(function() {
'use strict'
@ -23,7 +23,7 @@ import { Type as ShareTypes } from '@nextcloud/sharing'
this.$el.removeClass('shared icon-public icon-shared')
if (isShared) {
this.$el.addClass('shared')
if (data.dirInfo.shareTypes.indexOf(ShareTypes.SHARE_TYPE_LINK) !== -1) {
if (data.dirInfo.shareTypes.indexOf(ShareType.Link) !== -1) {
this.$el.addClass('icon-public')
} else {
this.$el.addClass('icon-shared')

View file

@ -5,7 +5,7 @@
import { getCurrentUser } from '@nextcloud/auth'
import type { Node } from '@nextcloud/files'
import { Type } from '@nextcloud/sharing'
import { ShareType } from '@nextcloud/sharing'
type Share = {
/** The recipient display name */
@ -13,7 +13,7 @@ type Share = {
/** The recipient user id */
id: string
/** The share type */
type: Type
type: ShareType
}
const getSharesAttribute = function(node: Node) {
@ -31,10 +31,10 @@ export const isNodeSharedWithMe = function(node: Node) {
return shares.length > 0 && (
// If some shares are shared with you as a direct user share
shares.some(share => share.id === uid && share.type === Type.SHARE_TYPE_USER)
shares.some(share => share.id === uid && share.type === ShareType.User)
// Or of the file is shared with a group you're in
// (if it's returned by the backend, we assume you're in it)
|| shares.some(share => share.type === Type.SHARE_TYPE_GROUP)
|| shares.some(share => share.type === ShareType.Group)
)
}
@ -49,7 +49,7 @@ export const isNodeSharedWithOthers = function(node: Node) {
return shares.length > 0
// If some shares are shared with you as a direct user share
&& shares.some(share => share.id !== uid && share.type !== Type.SHARE_TYPE_GROUP)
&& shares.some(share => share.id !== uid && share.type !== ShareType.Group)
}
export const isNodeShared = function(node: Node) {

View file

@ -3,10 +3,10 @@
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
import { Type as ShareTypes } from '@nextcloud/sharing'
import { ShareType } from '@nextcloud/sharing'
const shareWithTitle = function(share) {
if (share.type === ShareTypes.SHARE_TYPE_GROUP) {
if (share.type === ShareType.Group) {
return t(
'files_sharing',
'Shared with you and the group {group} by {owner}',
@ -17,7 +17,7 @@ const shareWithTitle = function(share) {
undefined,
{ escape: false },
)
} else if (share.type === ShareTypes.SHARE_TYPE_CIRCLE) {
} else if (share.type === ShareType.Team) {
return t(
'files_sharing',
'Shared with you and {circle} by {owner}',
@ -28,7 +28,7 @@ const shareWithTitle = function(share) {
undefined,
{ escape: false },
)
} else if (share.type === ShareTypes.SHARE_TYPE_ROOM) {
} else if (share.type === ShareType.Room) {
if (share.shareWithDisplayName) {
return t(
'files_sharing',

View file

@ -8,7 +8,7 @@
<span>
<NcAvatar v-if="isUserShare"
class="sharing-entry__avatar"
:is-no-user="share.shareType !== SHARE_TYPES.SHARE_TYPE_USER"
:is-no-user="share.shareType !== ShareType.User"
:user="share.shareWith"
:display-name="share.shareWithDisplayName"
:menu-position="'left'"
@ -195,7 +195,7 @@
data-cy-files-sharing-share-permissions-checkbox="update">
{{ t('files_sharing', 'Edit') }}
</NcCheckboxRadioSwitch>
<NcCheckboxRadioSwitch v-if="config.isResharingAllowed && share.type !== SHARE_TYPES.SHARE_TYPE_LINK"
<NcCheckboxRadioSwitch v-if="resharingIsPossible"
:disabled="!canSetReshare"
:checked.sync="canReshare"
data-cy-files-sharing-share-permissions-checkbox="share">
@ -277,7 +277,6 @@ import ExternalShareAction from '../components/ExternalShareAction.vue'
import GeneratePassword from '../utils/GeneratePassword.ts'
import Share from '../models/Share.ts'
import ShareRequests from '../mixins/ShareRequests.js'
import ShareTypes from '../mixins/ShareTypes.js'
import SharesMixin from '../mixins/SharesMixin.js'
import logger from '../services/logger.ts'
@ -312,7 +311,7 @@ export default {
MenuUpIcon,
DotsHorizontalIcon,
},
mixins: [ShareTypes, ShareRequests, SharesMixin],
mixins: [ShareRequests, SharesMixin],
props: {
shareRequestValue: {
type: Object,
@ -347,23 +346,23 @@ export default {
computed: {
title() {
switch (this.share.type) {
case this.SHARE_TYPES.SHARE_TYPE_USER:
case ShareType.User:
return t('files_sharing', 'Share with {userName}', { userName: this.share.shareWithDisplayName })
case this.SHARE_TYPES.SHARE_TYPE_EMAIL:
return t('files_sharing', 'Share with email {email}', { email: this.share.shareWith })
case this.SHARE_TYPES.SHARE_TYPE_LINK:
case ShareType.Email:
return t('files_sharing', 'Share with email {email}', { email: this.share.shareWith })
case ShareType.Link:
return t('files_sharing', 'Share link')
case this.SHARE_TYPES.SHARE_TYPE_GROUP:
case ShareType.Group:
return t('files_sharing', 'Share with group')
case this.SHARE_TYPES.SHARE_TYPE_ROOM:
case ShareType.Room:
return t('files_sharing', 'Share in conversation')
case this.SHARE_TYPES.SHARE_TYPE_REMOTE: {
case ShareType.Remote: {
const [user, server] = this.share.shareWith.split('@')
return t('files_sharing', 'Share with {user} on remote server {server}', { user, server })
}
case this.SHARE_TYPES.SHARE_TYPE_REMOTE_GROUP:
case ShareType.RemoteGroup:
return t('files_sharing', 'Share with remote group')
case this.SHARE_TYPES.SHARE_TYPE_GUEST:
case ShareType.Guest:
return t('files_sharing', 'Share with guest')
default: {
if (this.share.id) {
@ -531,17 +530,17 @@ export default {
return new Date(new Date().setDate(new Date().getDate() + 1))
},
isUserShare() {
return this.share.type === this.SHARE_TYPES.SHARE_TYPE_USER
return this.share.type === ShareType.User
},
isGroupShare() {
return this.share.type === this.SHARE_TYPES.SHARE_TYPE_GROUP
return this.share.type === ShareType.Group
},
isNewShare() {
return !this.share.id
},
allowsFileDrop() {
if (this.isFolder && this.config.isPublicUploadEnabled) {
if (this.share.type === this.SHARE_TYPES.SHARE_TYPE_LINK || this.share.type === this.SHARE_TYPES.SHARE_TYPE_EMAIL) {
if (this.share.type === ShareType.Link || this.share.type === ShareType.Email) {
return true
}
}
@ -557,6 +556,9 @@ export default {
return t('files_sharing', 'Update share')
},
resharingIsPossible() {
return this.config.isResharingAllowed && this.share.type !== ShareType.Link && this.share.type !== ShareType.Email
},
/**
* Can the sharer set whether the sharee can edit the file ?
*
@ -616,8 +618,8 @@ export default {
},
canRemoveReadPermission() {
return this.allowsFileDrop && (
this.share.type === this.SHARE_TYPES.SHARE_TYPE_LINK
|| this.share.type === this.SHARE_TYPES.SHARE_TYPE_EMAIL
this.share.type === ShareType.Link
|| this.share.type === ShareType.Email
)
},
// if newPassword exists, but is empty, it means
@ -676,7 +678,7 @@ export default {
*/
isEmailShareType() {
return this.share
? this.share.type === this.SHARE_TYPES.SHARE_TYPE_EMAIL
? this.share.type === ShareType.Email
: false
},
canTogglePasswordProtectedByTalkAvailable() {
@ -706,7 +708,7 @@ export default {
[ATOMIC_PERMISSIONS.DELETE]: this.t('files_sharing', 'Delete'),
}
return [ATOMIC_PERMISSIONS.READ, ATOMIC_PERMISSIONS.CREATE, ATOMIC_PERMISSIONS.UPDATE, ATOMIC_PERMISSIONS.SHARE, ATOMIC_PERMISSIONS.DELETE]
return [ATOMIC_PERMISSIONS.READ, ATOMIC_PERMISSIONS.CREATE, ATOMIC_PERMISSIONS.UPDATE, ...(this.resharingIsPossible ? [ATOMIC_PERMISSIONS.SHARE] : []), ATOMIC_PERMISSIONS.DELETE]
.filter((permission) => hasPermissions(this.share.permissions, permission))
.map((permission, index) => index === 0
? translatedPermissions[permission]
@ -1024,22 +1026,22 @@ export default {
},
getShareTypeIcon(type) {
switch (type) {
case this.SHARE_TYPES.SHARE_TYPE_LINK:
case ShareType.Link:
return LinkIcon
case this.SHARE_TYPES.SHARE_TYPE_GUEST:
case ShareType.Guest:
return UserIcon
case this.SHARE_TYPES.SHARE_TYPE_REMOTE_GROUP:
case this.SHARE_TYPES.SHARE_TYPE_GROUP:
case ShareType.RemoteGroup:
case ShareType.Group:
return GroupIcon
case this.SHARE_TYPES.SHARE_TYPE_EMAIL:
case ShareType.Email:
return EmailIcon
case this.SHARE_TYPES.SHARE_TYPE_CIRCLE:
case ShareType.Team:
return CircleIcon
case this.SHARE_TYPES.SHARE_TYPE_ROOM:
case ShareType.Room:
return ShareIcon
case this.SHARE_TYPES.SHARE_TYPE_DECK:
case ShareType.Deck:
return ShareIcon
case this.SHARE_TYPES.SHARE_TYPE_SCIENCEMESH:
case ShareType.ScienceMesh:
return ShareIcon
default:
return null // Or a default icon component if needed

View file

@ -32,12 +32,13 @@
<script>
import { getCapabilities } from '@nextcloud/capabilities'
import { t } from '@nextcloud/l10n'
import Share from '../models/Share.js'
import ShareTypes from '../mixins/ShareTypes.js'
import SharingEntryLink from '../components/SharingEntryLink.vue'
import ShareDetails from '../mixins/ShareDetails.js'
import { ShareType } from '@nextcloud/sharing'
export default {
name: 'SharingLinkList',
@ -46,7 +47,7 @@ export default {
SharingEntryLink,
},
mixins: [ShareTypes, ShareDetails],
mixins: [ShareDetails],
props: {
fileInfo: {
@ -80,7 +81,7 @@ export default {
* @return {Array}
*/
hasLinkShares() {
return this.shares.filter(share => share.type === this.SHARE_TYPES.SHARE_TYPE_LINK).length > 0
return this.shares.filter(share => share.type === ShareType.Link).length > 0
},
/**

View file

@ -17,8 +17,8 @@
<script>
import { t } from '@nextcloud/l10n'
import SharingEntry from '../components/SharingEntry.vue'
import ShareTypes from '../mixins/ShareTypes.js'
import ShareDetails from '../mixins/ShareDetails.js'
import { ShareType } from '@nextcloud/sharing'
export default {
name: 'SharingList',
@ -27,7 +27,7 @@ export default {
SharingEntry,
},
mixins: [ShareTypes, ShareDetails],
mixins: [ShareDetails],
props: {
fileInfo: {
@ -54,7 +54,7 @@ export default {
isUnique() {
return (share) => {
return [...this.shares].filter((item) => {
return share.type === this.SHARE_TYPES.SHARE_TYPE_USER && share.shareWithDisplayName === item.shareWithDisplayName
return share.type === ShareType.User && share.shareWithDisplayName === item.shareWithDisplayName
}).length <= 1
}
},

View file

@ -87,6 +87,7 @@ import { orderBy } from '@nextcloud/files'
import { loadState } from '@nextcloud/initial-state'
import { generateOcsUrl } from '@nextcloud/router'
import { CollectionList } from 'nextcloud-vue-collections'
import { ShareType } from '@nextcloud/sharing'
import axios from '@nextcloud/axios'
import moment from '@nextcloud/moment'
@ -96,7 +97,6 @@ import { shareWithTitle } from '../utils/SharedWithMe.js'
import Config from '../services/ConfigService.ts'
import Share from '../models/Share.ts'
import ShareTypes from '../mixins/ShareTypes.js'
import SharingEntryInternal from '../components/SharingEntryInternal.vue'
import SharingEntrySimple from '../components/SharingEntrySimple.vue'
import SharingInput from '../components/SharingInput.vue'
@ -121,8 +121,6 @@ export default {
SharingDetailsTab,
},
mixins: [ShareTypes],
data() {
return {
config: new Config(),
@ -277,8 +275,8 @@ export default {
],
)
this.linkShares = shares.filter(share => share.type === this.SHARE_TYPES.SHARE_TYPE_LINK || share.type === this.SHARE_TYPES.SHARE_TYPE_EMAIL)
this.shares = shares.filter(share => share.type !== this.SHARE_TYPES.SHARE_TYPE_LINK && share.type !== this.SHARE_TYPES.SHARE_TYPE_EMAIL)
this.linkShares = shares.filter(share => share.type === ShareType.Link || share.type === ShareType.Email)
this.shares = shares.filter(share => share.type !== ShareType.Link && share.type !== ShareType.Email)
console.debug('Processed', this.linkShares.length, 'link share(s)')
console.debug('Processed', this.shares.length, 'share(s)')
@ -340,7 +338,7 @@ export default {
addShare(share, resolve = () => { }) {
// only catching share type MAIL as link shares are added differently
// meaning: not from the ShareInput
if (share.type === this.SHARE_TYPES.SHARE_TYPE_EMAIL) {
if (share.type === ShareType.Email) {
this.linkShares.unshift(share)
} else {
this.shares.unshift(share)
@ -355,8 +353,8 @@ export default {
removeShare(share) {
// Get reference for this.linkShares or this.shares
const shareList
= share.type === this.SHARE_TYPES.SHARE_TYPE_EMAIL
|| share.type === this.SHARE_TYPES.SHARE_TYPE_LINK
= share.type === ShareType.Email
|| share.type === ShareType.Link
? this.linkShares
: this.shares
const index = shareList.findIndex(item => item.id === share.id)
@ -377,7 +375,7 @@ export default {
let listComponent = this.$refs.shareList
// Only mail shares comes from the input, link shares
// are managed internally in the SharingLinkList component
if (share.type === this.SHARE_TYPES.SHARE_TYPE_EMAIL) {
if (share.type === ShareType.Email) {
listComponent = this.$refs.linkShareList
}
const newShare = listComponent.$children.find(component => component.share === share)

2
dist/146-146.js vendored

File diff suppressed because one or more lines are too long

1
dist/146-146.js.map vendored

File diff suppressed because one or more lines are too long

View file

@ -1 +0,0 @@
146-146.js.license

2
dist/3608-3608.js vendored Normal file

File diff suppressed because one or more lines are too long

View file

@ -108,7 +108,7 @@ This file is generated from multiple sources. Included packages:
- version: 3.0.1
- license: GPL-3.0-or-later
- @nextcloud/sharing
- version: 0.2.3
- version: 0.2.4
- license: GPL-3.0-or-later
- @nextcloud/vue-select
- version: 3.25.1

1
dist/3608-3608.js.map vendored Normal file

File diff suppressed because one or more lines are too long

1
dist/3608-3608.js.map.license vendored Symbolic link
View file

@ -0,0 +1 @@
3608-3608.js.license

View file

@ -123,7 +123,7 @@ This file is generated from multiple sources. Included packages:
- version: 3.0.1
- license: GPL-3.0-or-later
- @nextcloud/sharing
- version: 0.2.3
- version: 0.2.4
- license: GPL-3.0-or-later
- @nextcloud/vue-select
- version: 3.25.1

View file

@ -93,7 +93,7 @@ This file is generated from multiple sources. Included packages:
- version: 3.0.1
- license: GPL-3.0-or-later
- @nextcloud/sharing
- version: 0.2.3
- version: 0.2.4
- license: GPL-3.0-or-later
- @nextcloud/vue-select
- version: 3.25.1

View file

@ -79,7 +79,7 @@ This file is generated from multiple sources. Included packages:
- version: 3.0.1
- license: GPL-3.0-or-later
- @nextcloud/sharing
- version: 0.2.3
- version: 0.2.4
- license: GPL-3.0-or-later
- eventemitter3
- version: 5.0.1

View file

@ -144,7 +144,7 @@ This file is generated from multiple sources. Included packages:
- version: 3.0.1
- license: GPL-3.0-or-later
- @nextcloud/sharing
- version: 0.2.3
- version: 0.2.4
- license: GPL-3.0-or-later
- @nextcloud/vue-select
- version: 3.25.1

View file

@ -81,7 +81,7 @@ This file is generated from multiple sources. Included packages:
- version: 3.0.1
- license: GPL-3.0-or-later
- @nextcloud/sharing
- version: 0.2.3
- version: 0.2.4
- license: GPL-3.0-or-later
- @nextcloud/vue
- version: 8.20.0

View file

@ -79,7 +79,7 @@ This file is generated from multiple sources. Included packages:
- version: 3.0.1
- license: GPL-3.0-or-later
- @nextcloud/sharing
- version: 0.2.3
- version: 0.2.4
- license: GPL-3.0-or-later
- eventemitter3
- version: 5.0.1

View file

@ -83,7 +83,7 @@ This file is generated from multiple sources. Included packages:
- version: 3.0.1
- license: GPL-3.0-or-later
- @nextcloud/sharing
- version: 0.2.3
- version: 0.2.4
- license: GPL-3.0-or-later
- eventemitter3
- version: 5.0.1

View file

@ -53,7 +53,7 @@ This file is generated from multiple sources. Included packages:
- version: 3.0.1
- license: GPL-3.0-or-later
- @nextcloud/sharing
- version: 0.2.3
- version: 0.2.4
- license: GPL-3.0-or-later
- cancelable-promise
- version: 4.3.1

4
dist/core-common.js vendored

File diff suppressed because one or more lines are too long

View file

@ -175,7 +175,7 @@ This file is generated from multiple sources. Included packages:
- version: 3.0.1
- license: GPL-3.0-or-later
- @nextcloud/sharing
- version: 0.2.3
- version: 0.2.4
- license: GPL-3.0-or-later
- eventemitter3
- version: 5.0.1

File diff suppressed because one or more lines are too long

View file

@ -89,7 +89,7 @@ This file is generated from multiple sources. Included packages:
- version: 3.0.1
- license: GPL-3.0-or-later
- @nextcloud/sharing
- version: 0.2.3
- version: 0.2.4
- license: GPL-3.0-or-later
- @nextcloud/vue
- version: 8.20.0

View file

@ -102,7 +102,7 @@ This file is generated from multiple sources. Included packages:
- version: 3.0.1
- license: GPL-3.0-or-later
- @nextcloud/sharing
- version: 0.2.3
- version: 0.2.4
- license: GPL-3.0-or-later
- @nextcloud/vue
- version: 8.20.0

View file

@ -67,7 +67,7 @@ This file is generated from multiple sources. Included packages:
- version: 3.0.1
- license: GPL-3.0-or-later
- @nextcloud/sharing
- version: 0.2.3
- version: 0.2.4
- license: GPL-3.0-or-later
- @nextcloud/vue
- version: 8.20.0

View file

@ -110,7 +110,7 @@ This file is generated from multiple sources. Included packages:
- version: 3.0.1
- license: GPL-3.0-or-later
- @nextcloud/sharing
- version: 0.2.3
- version: 0.2.4
- license: GPL-3.0-or-later
- @nextcloud/vue-select
- version: 3.25.1

View file

@ -110,7 +110,7 @@ This file is generated from multiple sources. Included packages:
- version: 3.0.1
- license: GPL-3.0-or-later
- @nextcloud/sharing
- version: 0.2.3
- version: 0.2.4
- license: GPL-3.0-or-later
- @nextcloud/vue-select
- version: 3.25.1

File diff suppressed because one or more lines are too long

View file

@ -111,7 +111,7 @@ This file is generated from multiple sources. Included packages:
- version: 3.0.1
- license: GPL-3.0-or-later
- @nextcloud/sharing
- version: 0.2.3
- version: 0.2.4
- license: GPL-3.0-or-later
- @nextcloud/vue-select
- version: 3.25.1

File diff suppressed because one or more lines are too long

View file

@ -88,7 +88,7 @@ This file is generated from multiple sources. Included packages:
- version: 3.0.1
- license: GPL-3.0-or-later
- @nextcloud/sharing
- version: 0.2.3
- version: 0.2.4
- license: GPL-3.0-or-later
- eventemitter3
- version: 5.0.1

View file

@ -108,7 +108,7 @@ This file is generated from multiple sources. Included packages:
- version: 3.0.1
- license: GPL-3.0-or-later
- @nextcloud/sharing
- version: 0.2.3
- version: 0.2.4
- license: GPL-3.0-or-later
- eventemitter3
- version: 5.0.1

View file

@ -109,7 +109,7 @@ This file is generated from multiple sources. Included packages:
- version: 3.0.1
- license: GPL-3.0-or-later
- @nextcloud/sharing
- version: 0.2.3
- version: 0.2.4
- license: GPL-3.0-or-later
- @nextcloud/vue-select
- version: 3.25.1

View file

@ -120,7 +120,7 @@ This file is generated from multiple sources. Included packages:
- version: 3.0.1
- license: GPL-3.0-or-later
- @nextcloud/sharing
- version: 0.2.3
- version: 0.2.4
- license: GPL-3.0-or-later
- @nextcloud/vue-select
- version: 3.25.1

View file

@ -72,7 +72,7 @@ This file is generated from multiple sources. Included packages:
- version: 3.0.1
- license: GPL-3.0-or-later
- @nextcloud/sharing
- version: 0.2.3
- version: 0.2.4
- license: GPL-3.0-or-later
- @nextcloud/vue
- version: 8.20.0

View file

@ -72,7 +72,7 @@ This file is generated from multiple sources. Included packages:
- version: 3.0.1
- license: GPL-3.0-or-later
- @nextcloud/sharing
- version: 0.2.3
- version: 0.2.4
- license: GPL-3.0-or-later
- @nextcloud/vue
- version: 8.20.0

File diff suppressed because one or more lines are too long

View file

@ -16,7 +16,7 @@ This file is generated from multiple sources. Included packages:
- version: 2.2.0
- license: GPL-3.0-or-later
- @nextcloud/sharing
- version: 0.2.3
- version: 0.2.4
- license: GPL-3.0-or-later
- css-loader
- version: 7.1.2

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -60,7 +60,7 @@ This file is generated from multiple sources. Included packages:
- version: 3.0.1
- license: GPL-3.0-or-later
- @nextcloud/sharing
- version: 0.2.3
- version: 0.2.4
- license: GPL-3.0-or-later
- cancelable-promise
- version: 4.3.1

File diff suppressed because one or more lines are too long

View file

@ -99,7 +99,7 @@ This file is generated from multiple sources. Included packages:
- version: 3.0.1
- license: GPL-3.0-or-later
- @nextcloud/sharing
- version: 0.2.3
- version: 0.2.4
- license: GPL-3.0-or-later
- @nextcloud/vue-select
- version: 3.25.1

File diff suppressed because one or more lines are too long

View file

@ -79,7 +79,7 @@ This file is generated from multiple sources. Included packages:
- version: 3.0.1
- license: GPL-3.0-or-later
- @nextcloud/sharing
- version: 0.2.3
- version: 0.2.4
- license: GPL-3.0-or-later
- eventemitter3
- version: 5.0.1

View file

@ -82,7 +82,7 @@ This file is generated from multiple sources. Included packages:
- version: 3.0.1
- license: GPL-3.0-or-later
- @nextcloud/sharing
- version: 0.2.3
- version: 0.2.4
- license: GPL-3.0-or-later
- @nextcloud/vue
- version: 8.20.0

View file

@ -121,7 +121,7 @@ This file is generated from multiple sources. Included packages:
- version: 3.0.1
- license: GPL-3.0-or-later
- @nextcloud/sharing
- version: 0.2.3
- version: 0.2.4
- license: GPL-3.0-or-later
- @nextcloud/vue
- version: 8.20.0

View file

@ -104,7 +104,7 @@ This file is generated from multiple sources. Included packages:
- version: 3.0.1
- license: GPL-3.0-or-later
- @nextcloud/sharing
- version: 0.2.3
- version: 0.2.4
- license: GPL-3.0-or-later
- @nextcloud/vue-select
- version: 3.25.1

View file

@ -107,7 +107,7 @@ This file is generated from multiple sources. Included packages:
- version: 3.0.1
- license: GPL-3.0-or-later
- @nextcloud/sharing
- version: 0.2.3
- version: 0.2.4
- license: GPL-3.0-or-later
- @nextcloud/vue-select
- version: 3.25.1

View file

@ -115,7 +115,7 @@ This file is generated from multiple sources. Included packages:
- version: 3.0.1
- license: GPL-3.0-or-later
- @nextcloud/sharing
- version: 0.2.3
- version: 0.2.4
- license: GPL-3.0-or-later
- @nextcloud/vue-select
- version: 3.25.1

View file

@ -88,7 +88,7 @@ This file is generated from multiple sources. Included packages:
- version: 3.0.1
- license: GPL-3.0-or-later
- @nextcloud/sharing
- version: 0.2.3
- version: 0.2.4
- license: GPL-3.0-or-later
- @nextcloud/vue
- version: 8.20.0

View file

@ -98,7 +98,7 @@ This file is generated from multiple sources. Included packages:
- version: 3.0.1
- license: GPL-3.0-or-later
- @nextcloud/sharing
- version: 0.2.3
- version: 0.2.4
- license: GPL-3.0-or-later
- @nextcloud/vue
- version: 8.20.0

9
package-lock.json generated
View file

@ -28,7 +28,7 @@
"@nextcloud/password-confirmation": "^5.3.0",
"@nextcloud/paths": "^2.2.1",
"@nextcloud/router": "^3.0.1",
"@nextcloud/sharing": "^0.2.3",
"@nextcloud/sharing": "^0.2.4",
"@nextcloud/upload": "^1.7.0",
"@nextcloud/vue": "^8.20.0",
"@simplewebauthn/browser": "^12.0.0",
@ -4107,10 +4107,9 @@
}
},
"node_modules/@nextcloud/sharing": {
"version": "0.2.3",
"resolved": "https://registry.npmjs.org/@nextcloud/sharing/-/sharing-0.2.3.tgz",
"integrity": "sha512-hxQFOBBahbJkcmAGZFVS3943pQGSafNF6LMHmgcj0JPqExu1DWKuZvsCXZnGkaRJVcewHnZFcLAhpOf+VfcZmA==",
"license": "GPL-3.0-or-later",
"version": "0.2.4",
"resolved": "https://registry.npmjs.org/@nextcloud/sharing/-/sharing-0.2.4.tgz",
"integrity": "sha512-kOLAr0w4NDUGPF42L22i9iSs6Z3ylTsE0RudAGDBzw/pnxGY8PEwZI2j0IMAFRfQ7XFNcpV/EVHI5YCMxtxGMQ==",
"dependencies": {
"@nextcloud/initial-state": "^2.2.0"
},

View file

@ -59,7 +59,7 @@
"@nextcloud/password-confirmation": "^5.3.0",
"@nextcloud/paths": "^2.2.1",
"@nextcloud/router": "^3.0.1",
"@nextcloud/sharing": "^0.2.3",
"@nextcloud/sharing": "^0.2.4",
"@nextcloud/upload": "^1.7.0",
"@nextcloud/vue": "^8.20.0",
"@simplewebauthn/browser": "^12.0.0",
@ -204,4 +204,4 @@
"overrides": {
"colors": "1.4.0"
}
}
}