mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-18 08:12:15 +00:00
disabled moving and deleting folders from root of TeamFolders
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div
|
<div
|
||||||
class="hidden w-[300px] shrink-0 overflow-y-auto overflow-x-hidden px-2.5 pt-2 lg:block xl:w-[320px] 2xl:w-[360px]"
|
class="hidden w-[300px] shrink-0 overflow-y-auto overflow-x-hidden px-2.5 pt-2 lg:block xl:w-[320px] 2xl:w-[360px]"
|
||||||
>
|
>
|
||||||
<!--Is empty clipboard-->
|
<!--Is empty clipboard-->
|
||||||
<div v-if="isEmpty" class="flex h-full items-center justify-center">
|
<div v-if="isEmpty" class="flex h-full items-center justify-center">
|
||||||
<div class="text-center">
|
<div class="text-center">
|
||||||
@@ -12,55 +12,55 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!--Multiple item selection-->
|
<!--Multiple item selection-->
|
||||||
<TitlePreview
|
<TitlePreview
|
||||||
v-if="!isSingleFile && !isEmpty"
|
v-if="!isSingleFile && !isEmpty"
|
||||||
class="mb-6"
|
class="mb-6"
|
||||||
icon="check-square"
|
icon="check-square"
|
||||||
:title="$t('selected_multiple')"
|
:title="$t('selected_multiple')"
|
||||||
:subtitle="this.clipboard.length + ' ' + $tc('items', this.clipboard.length)"
|
:subtitle="this.clipboard.length + ' ' + $tc('items', this.clipboard.length)"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<!--Single file preview-->
|
<!--Single file preview-->
|
||||||
<div v-if="isSingleFile && !isEmpty">
|
<div v-if="isSingleFile && !isEmpty">
|
||||||
<FilePreviewDetail />
|
<FilePreviewDetail />
|
||||||
|
|
||||||
<TitlePreview
|
<TitlePreview
|
||||||
class="mb-6"
|
class="mb-6"
|
||||||
:icon="clipboard[0].data.type"
|
:icon="clipboard[0].data.type"
|
||||||
:title="clipboard[0].data.attributes.name"
|
:title="clipboard[0].data.attributes.name"
|
||||||
:subtitle="clipboard[0].data.attributes.mimetype"
|
:subtitle="clipboard[0].data.attributes.mimetype"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<!--Filesize-->
|
<!--Filesize-->
|
||||||
<ListInfoItem
|
<ListInfoItem
|
||||||
v-if="singleFile.data.attributes.filesize"
|
v-if="singleFile.data.attributes.filesize"
|
||||||
:title="$t('size')"
|
:title="$t('size')"
|
||||||
:content="singleFile.data.attributes.filesize"
|
:content="singleFile.data.attributes.filesize"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<!--Created At-->
|
<!--Created At-->
|
||||||
<ListInfoItem :title="$t('created_at')" :content="singleFile.data.attributes.created_at" />
|
<ListInfoItem :title="$t('created_at')" :content="singleFile.data.attributes.created_at" />
|
||||||
|
|
||||||
<!--Location-->
|
<!--Location-->
|
||||||
<ListInfoItem v-if="$checkPermission(['master'])" :title="$t('where')">
|
<ListInfoItem v-if="$checkPermission(['master']) && !isTeamsHomepage" :title="$t('where')">
|
||||||
<div @click="$moveFileOrFolder(singleFile)" class="flex cursor-pointer items-center">
|
<div @click="$moveFileOrFolder(singleFile)" class="flex cursor-pointer items-center">
|
||||||
<b class="inline-block text-sm font-bold">
|
<b class="inline-block text-sm font-bold">
|
||||||
{{
|
{{
|
||||||
singleFile.data.relationships.parent
|
singleFile.data.relationships.parent
|
||||||
? singleFile.data.relationships.parent.data.attributes.name
|
? singleFile.data.relationships.parent.data.attributes.name
|
||||||
: $getCurrentLocationName()
|
: $getCurrentLocationName()
|
||||||
}}
|
}}
|
||||||
</b>
|
</b>
|
||||||
<Edit2Icon size="10" class="ml-2" />
|
<Edit2Icon size="10" class="ml-2" />
|
||||||
</div>
|
</div>
|
||||||
</ListInfoItem>
|
</ListInfoItem>
|
||||||
|
|
||||||
<!--Shared-->
|
<!--Shared-->
|
||||||
<ListInfoItem
|
<ListInfoItem
|
||||||
v-if="$checkPermission('master') && singleFile.data.relationships.shared"
|
v-if="$checkPermission('master') && singleFile.data.relationships.shared"
|
||||||
:title="$t('shared')"
|
:title="$t('shared')"
|
||||||
>
|
>
|
||||||
<div @click="$shareFileOrFolder(singleFile)" class="mb-2 flex cursor-pointer items-center">
|
<div @click="$shareFileOrFolder(singleFile)" class="mb-2 flex cursor-pointer items-center">
|
||||||
<span class="inline-block text-sm font-bold">
|
<span class="inline-block text-sm font-bold">
|
||||||
{{ sharedInfo }}
|
{{ sharedInfo }}
|
||||||
@@ -69,22 +69,22 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="flex w-full items-center">
|
<div class="flex w-full items-center">
|
||||||
<lock-icon
|
<lock-icon
|
||||||
v-if="isLocked"
|
v-if="isLocked"
|
||||||
@click="$shareFileOrFolder(singleFile)"
|
@click="$shareFileOrFolder(singleFile)"
|
||||||
size="17"
|
size="17"
|
||||||
class="hover-text-theme vue-feather cursor-pointer"
|
class="hover-text-theme vue-feather cursor-pointer"
|
||||||
/>
|
/>
|
||||||
<unlock-icon
|
<unlock-icon
|
||||||
v-if="!isLocked"
|
v-if="!isLocked"
|
||||||
@click="$shareFileOrFolder(singleFile)"
|
@click="$shareFileOrFolder(singleFile)"
|
||||||
size="17"
|
size="17"
|
||||||
class="hover-text-theme vue-feather cursor-pointer"
|
class="hover-text-theme vue-feather cursor-pointer"
|
||||||
/>
|
/>
|
||||||
<CopyShareLink :item="singleFile" size="small" class="w-full pl-2.5" />
|
<CopyShareLink :item="singleFile" size="small" class="w-full pl-2.5" />
|
||||||
</div>
|
</div>
|
||||||
</ListInfoItem>
|
</ListInfoItem>
|
||||||
|
|
||||||
<!--Author-->
|
<!--Author-->
|
||||||
<ListInfoItem v-if="canShowAuthor" :title="$t('author')">
|
<ListInfoItem v-if="canShowAuthor" :title="$t('author')">
|
||||||
<div class="mt-1.5 flex items-center">
|
<div class="mt-1.5 flex items-center">
|
||||||
<MemberAvatar :size="32" :member="singleFile.data.relationships.creator" />
|
<MemberAvatar :size="32" :member="singleFile.data.relationships.creator" />
|
||||||
@@ -94,7 +94,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</ListInfoItem>
|
</ListInfoItem>
|
||||||
|
|
||||||
<!--Metadata-->
|
<!--Metadata-->
|
||||||
<ListInfoItem v-if="canShowMetaData" :title="$t('meta_data')">
|
<ListInfoItem v-if="canShowMetaData" :title="$t('meta_data')">
|
||||||
<ImageMetaData />
|
<ImageMetaData />
|
||||||
</ListInfoItem>
|
</ListInfoItem>
|
||||||
@@ -105,64 +105,67 @@
|
|||||||
<script>
|
<script>
|
||||||
import FilePreviewDetail from '../Others/FilePreviewDetail'
|
import FilePreviewDetail from '../Others/FilePreviewDetail'
|
||||||
import CopyShareLink from '../Others/Forms/CopyShareLink'
|
import CopyShareLink from '../Others/Forms/CopyShareLink'
|
||||||
import { Edit2Icon, LockIcon, UnlockIcon, EyeOffIcon } from 'vue-feather-icons'
|
import {Edit2Icon, LockIcon, UnlockIcon, EyeOffIcon} from 'vue-feather-icons'
|
||||||
import ImageMetaData from './ImageMetaData'
|
import ImageMetaData from './ImageMetaData'
|
||||||
import TitlePreview from './TitlePreview'
|
import TitlePreview from './TitlePreview'
|
||||||
import TeamMembersPreview from '../Teams/Components/TeamMembersPreview'
|
import TeamMembersPreview from '../Teams/Components/TeamMembersPreview'
|
||||||
import ListInfoItem from '../Others/ListInfoItem'
|
import ListInfoItem from '../Others/ListInfoItem'
|
||||||
import MemberAvatar from './MemberAvatar'
|
import MemberAvatar from './MemberAvatar'
|
||||||
import { mapGetters } from 'vuex'
|
import {mapGetters} from 'vuex'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'InfoSidebar',
|
name: 'InfoSidebar',
|
||||||
components: {
|
components: {
|
||||||
TeamMembersPreview,
|
TeamMembersPreview,
|
||||||
FilePreviewDetail,
|
FilePreviewDetail,
|
||||||
ImageMetaData,
|
ImageMetaData,
|
||||||
CopyShareLink,
|
CopyShareLink,
|
||||||
MemberAvatar,
|
MemberAvatar,
|
||||||
TitlePreview,
|
TitlePreview,
|
||||||
ListInfoItem,
|
ListInfoItem,
|
||||||
UnlockIcon,
|
UnlockIcon,
|
||||||
EyeOffIcon,
|
EyeOffIcon,
|
||||||
Edit2Icon,
|
Edit2Icon,
|
||||||
LockIcon,
|
LockIcon,
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
...mapGetters([
|
||||||
|
'permissionOptions',
|
||||||
|
'clipboard',
|
||||||
|
'user',
|
||||||
|
]),
|
||||||
|
isEmpty() {
|
||||||
|
return this.clipboard.length === 0
|
||||||
},
|
},
|
||||||
computed: {
|
isSingleFile() {
|
||||||
...mapGetters([
|
return this.clipboard.length === 1
|
||||||
'permissionOptions',
|
},
|
||||||
'clipboard',
|
singleFile() {
|
||||||
'user',
|
return this.clipboard[0]
|
||||||
]),
|
},
|
||||||
isEmpty() {
|
canShowMetaData() {
|
||||||
return this.clipboard.length === 0
|
return this.clipboard[0].data.relationships.exif
|
||||||
},
|
},
|
||||||
isSingleFile() {
|
isLocked() {
|
||||||
return this.clipboard.length === 1
|
return this.clipboard[0].data.relationships.shared.protected
|
||||||
},
|
},
|
||||||
singleFile() {
|
sharedInfo() {
|
||||||
return this.clipboard[0]
|
let title = this.permissionOptions.find(option => {
|
||||||
},
|
return option.value === this.clipboard[0].data.relationships.shared.permission
|
||||||
canShowMetaData() {
|
})
|
||||||
return this.clipboard[0].data.relationships.exif
|
|
||||||
},
|
|
||||||
isLocked() {
|
|
||||||
return this.clipboard[0].data.relationships.shared.protected
|
|
||||||
},
|
|
||||||
sharedInfo() {
|
|
||||||
let title = this.permissionOptions.find(option => {
|
|
||||||
return option.value === this.clipboard[0].data.relationships.shared.permission
|
|
||||||
})
|
|
||||||
|
|
||||||
return title ? this.$t(title.label) : this.$t('can_download_file')
|
return title ? this.$t(title.label) : this.$t('can_download_file')
|
||||||
},
|
},
|
||||||
canShowAuthor() {
|
canShowAuthor() {
|
||||||
return (
|
return (
|
||||||
this.$isThisRoute(this.$route, ['SharedWithMe', 'TeamFolders']) &&
|
this.$isThisRoute(this.$route, ['SharedWithMe', 'TeamFolders']) &&
|
||||||
this.clipboard[0].data.type !== 'folder' &&
|
this.clipboard[0].data.type !== 'folder' &&
|
||||||
this.user.data.id !== this.clipboard[0].data.relationships.creator.data.id
|
this.user.data.id !== this.clipboard[0].data.relationships.creator.data.id
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
},
|
isTeamsHomepage() {
|
||||||
|
return this.$isThisRoute(this.$route, ['TeamFolders', 'SharedWithMe']) && !this.$route.params.id
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user