mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-23 01:32:15 +00:00
removed backspace functionality for team folder and sharedwithme homepage
This commit is contained in:
@@ -60,7 +60,7 @@
|
||||
<!--File Controls-->
|
||||
<div class="ml-5 flex items-center xl:ml-8">
|
||||
<!--Team Heads-->
|
||||
<PopoverWrapper v-if="$isThisRoute($route, ['TeamFolders', 'SharedWithMe'])">
|
||||
<PopoverWrapper v-if="$isThisRoute(['TeamFolders', 'SharedWithMe'])">
|
||||
<TeamMembersButton
|
||||
@click.stop.native="showTeamFolderMenu"
|
||||
size="32"
|
||||
@@ -70,7 +70,7 @@
|
||||
<PopoverItem name="team-folder" side="left">
|
||||
<TeamFolderPreview />
|
||||
|
||||
<OptionGroup v-if="$isThisRoute($route, ['TeamFolders'])" :title="$t('Options')">
|
||||
<OptionGroup v-if="$isThisRoute(['TeamFolders'])" :title="$t('Options')">
|
||||
<Option
|
||||
@click.native="$updateTeamFolder(teamFolder)"
|
||||
:title="$t('Edit Members')"
|
||||
@@ -83,7 +83,7 @@
|
||||
/>
|
||||
</OptionGroup>
|
||||
|
||||
<OptionGroup v-if="$isThisRoute($route, ['SharedWithMe'])" :title="$t('Options')">
|
||||
<OptionGroup v-if="$isThisRoute(['SharedWithMe'])" :title="$t('Options')">
|
||||
<Option
|
||||
@click.native="$detachMeFromTeamFolder(teamFolder)"
|
||||
:title="$t('Leave the Team Folder')"
|
||||
@@ -105,7 +105,7 @@
|
||||
:action="$t('actions.convert_into_team_folder')"
|
||||
/>
|
||||
<ToolbarButton
|
||||
v-if="!$isThisRoute($route, ['SharedWithMe', 'Public'])"
|
||||
v-if="!$isThisRoute(['SharedWithMe', 'Public'])"
|
||||
@click.native="$shareFileOrFolder(clipboard[0])"
|
||||
:class="{
|
||||
'is-inactive': canShareInView,
|
||||
@@ -213,41 +213,41 @@ export default {
|
||||
return this.currentTeamFolder ? this.currentTeamFolder : this.clipboard[0]
|
||||
},
|
||||
isTeamFolderHomepage() {
|
||||
return this.$isThisRoute(this.$route, ['TeamFolders']) && !this.$route.params.id
|
||||
return this.$isThisRoute(['TeamFolders']) && !this.$route.params.id
|
||||
},
|
||||
isSharedWithMe() {
|
||||
return this.$isThisRoute(this.$route, ['SharedWithMe'])
|
||||
return this.$isThisRoute(['SharedWithMe'])
|
||||
},
|
||||
isSharedWithMeHomepage() {
|
||||
return this.$isThisRoute(this.$route, ['SharedWithMe']) && !this.$route.params.id
|
||||
return this.$isThisRoute(['SharedWithMe']) && !this.$route.params.id
|
||||
},
|
||||
canCreateFolder() {
|
||||
return !this.$isThisRoute(this.$route, ['Files', 'Public', 'TeamFolders', 'SharedWithMe'])
|
||||
return !this.$isThisRoute(['Files', 'Public', 'TeamFolders', 'SharedWithMe'])
|
||||
},
|
||||
canShowConvertToTeamFolder() {
|
||||
return this.$isThisRoute(this.$route, ['Files', 'MySharedItems'])
|
||||
return this.$isThisRoute(['Files', 'MySharedItems'])
|
||||
},
|
||||
canUploadInView() {
|
||||
return !this.$isThisRoute(this.$route, ['Files', 'RecentUploads', 'Public', 'TeamFolders', 'SharedWithMe'])
|
||||
return !this.$isThisRoute(['Files', 'RecentUploads', 'Public', 'TeamFolders', 'SharedWithMe'])
|
||||
},
|
||||
canUploadFolderInView() {
|
||||
return !this.$isThisRoute(this.$route, ['Files', 'Public', 'TeamFolders', 'SharedWithMe'])
|
||||
return !this.$isThisRoute(['Files', 'Public', 'TeamFolders', 'SharedWithMe'])
|
||||
},
|
||||
canDeleteInView() {
|
||||
let routes = ['TeamFolders', 'SharedWithMe', 'RecentUploads', 'MySharedItems', 'Trash', 'Public', 'Files']
|
||||
return !this.$isThisRoute(this.$route, routes) || this.clipboard.length === 0
|
||||
return !this.$isThisRoute(routes) || this.clipboard.length === 0
|
||||
},
|
||||
canMoveInView() {
|
||||
let routes = ['SharedWithMe', 'RecentUploads', 'MySharedItems', 'Public', 'Files', 'TeamFolders']
|
||||
return !this.$isThisRoute(this.$route, routes) || this.clipboard.length === 0
|
||||
return !this.$isThisRoute(routes) || this.clipboard.length === 0
|
||||
},
|
||||
canShareInView() {
|
||||
let routes = ['TeamFolders', 'RecentUploads', 'MySharedItems', 'Public', 'Files']
|
||||
return !this.$isThisRoute(this.$route, routes) || this.clipboard.length > 1 || this.clipboard.length === 0
|
||||
return !this.$isThisRoute(routes) || this.clipboard.length > 1 || this.clipboard.length === 0
|
||||
},
|
||||
canCreateTeamFolder() {
|
||||
return (
|
||||
this.$isThisRoute(this.$route, ['MySharedItems', 'Files']) &&
|
||||
this.$isThisRoute(['MySharedItems', 'Files']) &&
|
||||
this.clipboard.length === 1 &&
|
||||
this.clipboard[0].data.type === 'folder'
|
||||
)
|
||||
|
||||
@@ -38,7 +38,7 @@ export default {
|
||||
ItemHandler,
|
||||
},
|
||||
computed: {
|
||||
...mapGetters(['isVisibleSidebar', 'currentFolder', 'itemViewType', 'clipboard', 'entries', 'config']),
|
||||
...mapGetters(['isVisibleSidebar', 'currentFolder', 'itemViewType', 'clipboard', 'entries', 'config', 'currentTeamFolder', 'user']),
|
||||
draggedItems() {
|
||||
// Set opacity for dragged items
|
||||
if (!this.clipboard.includes(this.draggingId)) {
|
||||
@@ -58,10 +58,27 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
deleteItems() {
|
||||
// Prevent delete in SharedWithMe and TeamFolders homepage
|
||||
if ((this.$isThisRoute(['SharedWithMe', 'TeamFolders']) && !this.$route.params.id)) return
|
||||
|
||||
// Prevent delete in SharedWithMe with visit privileges
|
||||
if ((this.$isThisRoute(['SharedWithMe']) && ! this.canEdit())) return
|
||||
|
||||
if ((this.clipboard.length > 0 && this.$checkPermission('master')) || this.$checkPermission('editor')) {
|
||||
this.$store.dispatch('deleteItem')
|
||||
}
|
||||
},
|
||||
canEdit() {
|
||||
if (this.currentTeamFolder && this.user) {
|
||||
let member = this.currentTeamFolder.data.relationships.members.data.find(
|
||||
(member) => member.data.id === this.user.data.id
|
||||
)
|
||||
|
||||
return member.data.attributes.permission === 'can-edit'
|
||||
}
|
||||
|
||||
return false
|
||||
},
|
||||
uploadDroppedItems(event) {
|
||||
this.$uploadDraggedFiles(event, this.currentFolder.data.id)
|
||||
|
||||
|
||||
@@ -6,28 +6,28 @@
|
||||
@click.native="goToFiles"
|
||||
:title="$t('sidebar.home')"
|
||||
icon="hard-drive"
|
||||
:is-active="$isThisRoute($route, 'Files')"
|
||||
:is-active="$isThisRoute('Files')"
|
||||
:is-hover-disabled="true"
|
||||
/>
|
||||
<Option
|
||||
@click.native="goToLatest"
|
||||
:title="$t('menu.latest')"
|
||||
icon="upload-cloud"
|
||||
:is-active="$isThisRoute($route, 'RecentUploads')"
|
||||
:is-active="$isThisRoute('RecentUploads')"
|
||||
:is-hover-disabled="true"
|
||||
/>
|
||||
<Option
|
||||
@click.native="goToShared"
|
||||
:title="$t('sidebar.my_shared')"
|
||||
icon="share"
|
||||
:is-active="$isThisRoute($route, 'MySharedItems')"
|
||||
:is-active="$isThisRoute('MySharedItems')"
|
||||
:is-hover-disabled="true"
|
||||
/>
|
||||
<Option
|
||||
@click.native="goToTrash"
|
||||
:title="$t('menu.trash')"
|
||||
icon="trash"
|
||||
:is-active="$isThisRoute($route, 'Trash')"
|
||||
:is-active="$isThisRoute('Trash')"
|
||||
:is-hover-disabled="true"
|
||||
/>
|
||||
</OptionGroup>
|
||||
@@ -36,14 +36,14 @@
|
||||
@click.native="goToTeamFolders"
|
||||
:title="$t('Team Folders')"
|
||||
icon="users"
|
||||
:is-active="$isThisRoute($route, 'TeamFolders')"
|
||||
:is-active="$isThisRoute('TeamFolders')"
|
||||
:is-hover-disabled="true"
|
||||
/>
|
||||
<Option
|
||||
@click.native="goToSharedWithMe"
|
||||
:title="$t('Shared with Me')"
|
||||
icon="user-check"
|
||||
:is-active="$isThisRoute($route, 'SharedWithMe')"
|
||||
:is-active="$isThisRoute('SharedWithMe')"
|
||||
:is-hover-disabled="true"
|
||||
/>
|
||||
</OptionGroup>
|
||||
|
||||
@@ -158,7 +158,7 @@ import { mapGetters } from 'vuex'
|
||||
},
|
||||
canShowAuthor() {
|
||||
return (
|
||||
this.$isThisRoute(this.$route, ['SharedWithMe', 'TeamFolders']) &&
|
||||
this.$isThisRoute(['SharedWithMe', 'TeamFolders']) &&
|
||||
this.clipboard[0].data.type !== 'folder' &&
|
||||
this.user.data.id !== this.clipboard[0].data.relationships.owner.data.id
|
||||
)
|
||||
|
||||
@@ -189,7 +189,7 @@ export default {
|
||||
canEditName() {
|
||||
return (
|
||||
!this.$isMobile() &&
|
||||
!this.$isThisRoute(this.$route, ['Trash', 'SharedSingleFile']) &&
|
||||
!this.$isThisRoute(['Trash', 'SharedSingleFile']) &&
|
||||
!this.$checkPermission('visitor')
|
||||
)
|
||||
},
|
||||
@@ -200,13 +200,13 @@ export default {
|
||||
},
|
||||
canShowAuthor() {
|
||||
return (
|
||||
this.$isThisRoute(this.$route, ['SharedWithMe', 'TeamFolders']) &&
|
||||
this.$isThisRoute(['SharedWithMe', 'TeamFolders']) &&
|
||||
!this.isFolder &&
|
||||
this.user.data.id !== this.entry.data.relationships.owner.data.id
|
||||
)
|
||||
},
|
||||
canShowLinkIcon() {
|
||||
return this.entry.data.relationships.shared && !this.$isThisRoute(this.$route, ['SharedSingleFile'])
|
||||
return this.entry.data.relationships.shared && !this.$isThisRoute(['SharedSingleFile'])
|
||||
},
|
||||
canDrag() {
|
||||
return !this.isDeleted && this.$checkPermission(['master', 'editor'])
|
||||
|
||||
@@ -162,7 +162,7 @@ export default {
|
||||
canEditName() {
|
||||
return (
|
||||
!this.$isMobile() &&
|
||||
!this.$isThisRoute(this.$route, ['Trash']) &&
|
||||
!this.$isThisRoute(['Trash']) &&
|
||||
!this.$checkPermission('visitor') &&
|
||||
!(this.sharedDetail && this.sharedDetail.attributes.type === 'file')
|
||||
)
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
<div class="relative flex items-center">
|
||||
<TeamMembersButton
|
||||
v-if="$isThisRoute($route, ['TeamFolders', 'SharedWithMe'])"
|
||||
v-if="$isThisRoute(['TeamFolders', 'SharedWithMe'])"
|
||||
size="28"
|
||||
@click.stop.native="$showMobileMenu('team-menu')"
|
||||
class="absolute right-9"
|
||||
|
||||
@@ -54,7 +54,7 @@ export default {
|
||||
computed: {
|
||||
...mapGetters(['isVisibleNavigationBars', 'currentFolder', 'sharedDetail']),
|
||||
isNotHomepage() {
|
||||
if (this.$isThisRoute(this.$route, ['Public'])) {
|
||||
if (this.$isThisRoute(['Public'])) {
|
||||
return this.sharedDetail && this.sharedDetail.data.attributes.item_id !== this.$route.params.id
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user