- moving files fix

This commit is contained in:
Čarodej
2021-09-22 16:41:55 +02:00
parent a9556896ca
commit f715cd897f
6 changed files with 51 additions and 19 deletions

View File

@@ -1,11 +1,12 @@
<template>
<!--Folder Icon-->
<div class="folder-item-wrapper" :class="{'is-inactive': disabledById && disabledById.data.id === nodes.id || !disableId} ">
<div class="folder-item-wrapper" :class="{'is-inactive': disabledById && disabledById.data.id === nodes.id || !disableId}">
<div class="folder-item text-theme dark-text-theme" :class="{'is-selected': isSelected}" @click="getFolder" :style="indent">
<chevron-right-icon @click.stop="showTree" size="17" class="icon-arrow" :class="{'is-opened': isVisible, 'is-visible': nodes.folders.length !== 0}"/>
<hard-drive-icon v-if="nodes.location === 'base'" size="17" class="icon text-theme dark-text-theme"/>
<folder-icon v-if="nodes.location !== 'base'" size="17" class="icon text-theme dark-text-theme"/>
<div @click="getFolder" :class="{'is-selected': isSelected, 'is-disabled-item': nodes.location === 'team-folders'}" :style="indent" class="folder-item text-theme dark-text-theme">
<chevron-right-icon @click.stop="showTree" :class="{'is-opened': isVisible, 'is-visible': nodes.folders.length !== 0}" size="17" class="icon-arrow"/>
<hard-drive-icon v-if="nodes.location === 'files'" size="17" class="icon text-theme dark-text-theme"/>
<users-icon v-if="nodes.location === 'team-folders'" size="17" class="icon text-theme dark-text-theme"/>
<folder-icon v-if="! nodes.location" size="17" class="icon text-theme dark-text-theme"/>
<span class="label">{{ nodes.name }}</span>
</div>
@@ -15,28 +16,34 @@
<script>
import TreeMenu from '/resources/js/components/Others/TreeMenu'
import {FolderIcon, ChevronRightIcon, HardDriveIcon} from 'vue-feather-icons'
import {FolderIcon, ChevronRightIcon, HardDriveIcon, UsersIcon} from 'vue-feather-icons'
import {events} from '/resources/js/bus'
import {mapGetters} from 'vuex'
export default {
name: 'TreeMenu',
props: [
'nodes', 'depth', 'disabledById'
'disabledById',
'nodes',
'depth',
],
components: {
ChevronRightIcon,
HardDriveIcon,
FolderIcon,
UsersIcon,
TreeMenu,
},
computed: {
...mapGetters(['clipboard']),
...mapGetters([
'clipboard'
]),
indent() {
return { paddingLeft: this.depth * 20 + 'px' }
},
disableId() {
let canBeShow = true
if(this.clipboard.includes(this.disabledById)){
this.clipboard.map(item => {
if(item.data.id === this.nodes.id) {
@@ -92,7 +99,8 @@
@import '/resources/sass/vuefilemanager/_variables';
@import '/resources/sass/vuefilemanager/_mixins';
.is-inactive {
.is-inactive,
.is-disabled-item {
opacity: 0.5;
pointer-events: none;
}

View File

@@ -2,7 +2,7 @@
<div class="team-folder-preview">
<div class="info">
<b class="title">{{ teamFolder.data.attributes.name }}</b>
<span class="subtitle">Last update a week ago</span>
<span class="subtitle">Created at {{ teamFolder.data.attributes.created_at }}</span>
<TeamMembersPreview :folder="teamFolder" :avatar-size="32" class="members" />
</div>
</div>

View File

@@ -58,7 +58,7 @@ const actions = {
? `/api/editor/move/${router.currentRoute.params.token}`
: '/api/move'
let moveToId = undefined
let moveToId = null
if (to_item.data)
moveToId = to_item.data.id
@@ -73,7 +73,7 @@ const actions = {
.then(() => {
itemsToMove.forEach(item => {
commit('REMOVE_ITEM', item.id)
commit('INCREASE_FOLDER_ITEM', to_item.data.id)
commit('INCREASE_FOLDER_ITEM', moveToId)
if (item.type === 'folder')
dispatch('getAppData')