mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-05 18:23:48 +00:00
Move item grid to folder bug
This commit is contained in:
@@ -3,6 +3,8 @@
|
||||
- Wasabi region list updated
|
||||
- The delay after first upload in file request when the interface wasn't showing was removed
|
||||
- If adsense banner location isn't filled, the ads space won't be showed
|
||||
- Fixed issue when in grid view you tried to move image into another folder
|
||||
- Fixed issue when you can't move or delete items via mobile multiselect function
|
||||
|
||||
## Version 2.0.14
|
||||
#### Release date: 5. April 2022
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"/js/main.js": "/js/main.js",
|
||||
"/chunks/request.js": "/chunks/request.js?id=9c9e321a1cbd2e92",
|
||||
"/chunks/request-upload.js": "/chunks/request-upload.js?id=21fea06cd44919f6",
|
||||
"/chunks/request.js": "/chunks/request.js?id=2f43ec2bb19876d4",
|
||||
"/chunks/request-upload.js": "/chunks/request-upload.js?id=9d36f99397dfbfe7",
|
||||
"/chunks/setup-wizard.js": "/chunks/setup-wizard.js?id=19a0784e59d768ec",
|
||||
"/chunks/status-check.js": "/chunks/status-check.js?id=f82f9939c1326fe2",
|
||||
"/chunks/purchase-code.js": "/chunks/purchase-code.js?id=df5bd89528649783",
|
||||
@@ -9,8 +9,8 @@
|
||||
"/chunks/environment.js": "/chunks/environment.js?id=166cd302ba7338ae",
|
||||
"/chunks/app-setup.js": "/chunks/app-setup.js?id=15938ff1ad2d6ed2",
|
||||
"/chunks/admin-account.js": "/chunks/admin-account.js?id=916450217130f3b8",
|
||||
"/chunks/shared.js": "/chunks/shared.js?id=45101b95a6bb6060",
|
||||
"/chunks/shared/browser.js": "/chunks/shared/browser.js?id=76bae44fa3b68b60",
|
||||
"/chunks/shared.js": "/chunks/shared.js?id=e65e38133f6111e1",
|
||||
"/chunks/shared/browser.js": "/chunks/shared/browser.js?id=e252d9d8ff7e90c9",
|
||||
"/chunks/shared/single-file.js": "/chunks/shared/single-file.js?id=83a29818c408b4de",
|
||||
"/chunks/shared/authenticate.js": "/chunks/shared/authenticate.js?id=672e931a9fb0b672",
|
||||
"/chunks/not-found.js": "/chunks/not-found.js?id=9f6ce23ce5d969f1",
|
||||
@@ -62,13 +62,13 @@
|
||||
"/chunks/settings-password.js": "/chunks/settings-password.js?id=3755d41eaf50a5b1",
|
||||
"/chunks/settings-storage.js": "/chunks/settings-storage.js?id=994b669a56fd417b",
|
||||
"/chunks/billing.js": "/chunks/billing.js?id=40e758c87bcf6e89",
|
||||
"/chunks/platform.js": "/chunks/platform.js?id=739f35bbaea97a36",
|
||||
"/chunks/files.js": "/chunks/files.js?id=91dc4c194ffc137b",
|
||||
"/chunks/recent-uploads.js": "/chunks/recent-uploads.js?id=f4cd670f9728bd31",
|
||||
"/chunks/my-shared-items.js": "/chunks/my-shared-items.js?id=0d3dc1e73f3d4cc2",
|
||||
"/chunks/trash.js": "/chunks/trash.js?id=f4fc87e9f3ce9e19",
|
||||
"/chunks/team-folders.js": "/chunks/team-folders.js?id=cf7f5578ddef5277",
|
||||
"/chunks/shared-with-me.js": "/chunks/shared-with-me.js?id=ba5a1267a4d55b29",
|
||||
"/chunks/platform.js": "/chunks/platform.js?id=46be2cb036e63cb9",
|
||||
"/chunks/files.js": "/chunks/files.js?id=337db6462c828af4",
|
||||
"/chunks/recent-uploads.js": "/chunks/recent-uploads.js?id=a072d7081a0f48a1",
|
||||
"/chunks/my-shared-items.js": "/chunks/my-shared-items.js?id=38912afeb4e4c733",
|
||||
"/chunks/trash.js": "/chunks/trash.js?id=b94ddc072e787b30",
|
||||
"/chunks/team-folders.js": "/chunks/team-folders.js?id=4cde9804a042eb10",
|
||||
"/chunks/shared-with-me.js": "/chunks/shared-with-me.js?id=b73ccd51d4913073",
|
||||
"/chunks/invitation.js": "/chunks/invitation.js?id=9ed8456c9d6d5ce1",
|
||||
"/css/tailwind.css": "/css/tailwind.css",
|
||||
"/css/app.css": "/css/app.css"
|
||||
|
||||
@@ -97,7 +97,7 @@ export default {
|
||||
if (!this.clipboard.includes(this.draggingId)) {
|
||||
this.$store.dispatch('moveItem', {
|
||||
to_item: data,
|
||||
noSelectedItem: this.draggingId,
|
||||
item: this.draggingId,
|
||||
})
|
||||
}
|
||||
|
||||
@@ -105,7 +105,7 @@ export default {
|
||||
if (this.clipboard.length > 0 && this.clipboard.includes(this.draggingId)) {
|
||||
this.$store.dispatch('moveItem', {
|
||||
to_item: data,
|
||||
noSelectedItem: null,
|
||||
item: null,
|
||||
})
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -96,7 +96,7 @@ export default {
|
||||
// Move item
|
||||
this.$store.dispatch('moveItem', {
|
||||
to_item: this.selectedFolder,
|
||||
noSelectedItem: this.isSelectedItem ? this.pickedItem : null,
|
||||
item: this.isSelectedItem ? this.pickedItem : undefined,
|
||||
})
|
||||
|
||||
// Close popup
|
||||
|
||||
@@ -108,7 +108,7 @@ export default {
|
||||
if (!this.clipboard.includes(this.draggedItem[0])) {
|
||||
this.$store.dispatch('moveItem', {
|
||||
to_item: this.nodes,
|
||||
noSelectedItem: this.draggedItem[0],
|
||||
item: this.draggedItem[0],
|
||||
})
|
||||
}
|
||||
|
||||
@@ -116,7 +116,7 @@ export default {
|
||||
if (this.clipboard.includes(this.draggedItem[0])) {
|
||||
this.$store.dispatch('moveItem', {
|
||||
to_item: this.nodes,
|
||||
noSelectedItem: null,
|
||||
item: null,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
87
resources/js/store/modules/fileFunctions.js
vendored
87
resources/js/store/modules/fileFunctions.js
vendored
@@ -40,22 +40,22 @@ const actions = {
|
||||
// Download zip
|
||||
Vue.prototype.$downloadFile(route, 'files.zip')
|
||||
},
|
||||
moveItem: ({ commit, getters, dispatch }, { to_item, noSelectedItem }) => {
|
||||
let itemsToMove = []
|
||||
let items = [noSelectedItem]
|
||||
moveItem: ({ commit, getters, dispatch }, { to_item, item }) => {
|
||||
let items = item
|
||||
? [item]
|
||||
: getters.clipboard
|
||||
|
||||
// If coming no selected item dont get items to move from clipboard
|
||||
if (!noSelectedItem) items = getters.clipboard
|
||||
|
||||
items.forEach((data) =>
|
||||
itemsToMove.push({
|
||||
let itemsToMove = items.map((data) => {
|
||||
return {
|
||||
id: data.data.id,
|
||||
type: data.data.type,
|
||||
})
|
||||
)
|
||||
}
|
||||
})
|
||||
|
||||
// Remove file preview
|
||||
if (!noSelectedItem) commit('CLIPBOARD_CLEAR')
|
||||
if (!item) {
|
||||
commit('CLIPBOARD_CLEAR')
|
||||
}
|
||||
|
||||
// Get route
|
||||
let route = {
|
||||
@@ -63,14 +63,11 @@ const actions = {
|
||||
Public: `/api/editor/move/${router.currentRoute.params.token}`,
|
||||
}[router.currentRoute.name] || '/api/move'
|
||||
|
||||
let moveToId = null
|
||||
|
||||
if (to_item.data) moveToId = to_item.data.id
|
||||
else if (to_item.id) moveToId = to_item.id
|
||||
let moveToId = to_item.data ? to_item.data.id : to_item.id
|
||||
|
||||
axios
|
||||
.post(route, {
|
||||
to_id: moveToId,
|
||||
to_id: moveToId || null,
|
||||
items: itemsToMove,
|
||||
})
|
||||
.then(() => {
|
||||
@@ -78,9 +75,11 @@ const actions = {
|
||||
commit('REMOVE_ITEM', item.id)
|
||||
commit('INCREASE_FOLDER_ITEM', moveToId)
|
||||
|
||||
if (item.type === 'folder') dispatch('getAppData')
|
||||
if (item.type === 'folder')
|
||||
dispatch('getAppData')
|
||||
|
||||
if (Vue.prototype.$isThisRoute(router.currentRoute, ['Public'])) dispatch('getFolderTree')
|
||||
if (Vue.prototype.$isThisRoute(router.currentRoute, ['Public']))
|
||||
dispatch('getFolderTree')
|
||||
})
|
||||
})
|
||||
.catch(() => Vue.prototype.$isSomethingWrong())
|
||||
@@ -270,19 +269,18 @@ const actions = {
|
||||
})
|
||||
},
|
||||
restoreItem: ({ commit, getters }, item) => {
|
||||
let itemToRestore = []
|
||||
let items = [item]
|
||||
let items = item
|
||||
? [item]
|
||||
: getters.clipboard
|
||||
|
||||
let restoreToHome = Vue.prototype.$isThisRoute(router.currentRoute, ['Trash'])
|
||||
|
||||
// If coming no selected item dont get items to restore from clipboard
|
||||
if (!item) items = getters.clipboard
|
||||
|
||||
items.forEach((data) =>
|
||||
itemToRestore.push({
|
||||
let itemToRestore = items.map((data) => {
|
||||
return {
|
||||
type: data.data.type,
|
||||
id: data.data.id,
|
||||
})
|
||||
)
|
||||
}
|
||||
})
|
||||
|
||||
// Remove file preview
|
||||
commit('CLIPBOARD_CLEAR')
|
||||
@@ -292,31 +290,28 @@ const actions = {
|
||||
to_home: restoreToHome,
|
||||
items: itemToRestore,
|
||||
})
|
||||
.then(items.forEach((item) => commit('REMOVE_ITEM', item.data.id)))
|
||||
.then(() => items.forEach((item) => commit('REMOVE_ITEM', item.data.id)))
|
||||
.catch(() => Vue.prototype.$isSomethingWrong())
|
||||
},
|
||||
deleteItem: ({ commit, getters, dispatch }, noSelectedItem) => {
|
||||
let itemsToDelete = []
|
||||
let items = [noSelectedItem]
|
||||
deleteItem: ({ commit, getters, dispatch }, item) => {
|
||||
let items = item
|
||||
? [item]
|
||||
: getters.clipboard
|
||||
|
||||
// If coming no selected item dont get items to move from clipboard
|
||||
if (!noSelectedItem) items = getters.clipboard
|
||||
|
||||
items.forEach((data) => {
|
||||
itemsToDelete.push({
|
||||
force_delete: !!data.data.attributes.deleted_at,
|
||||
type: data.data.type,
|
||||
id: data.data.id,
|
||||
})
|
||||
|
||||
// Remove file
|
||||
let deletedItems = items.map((data) => {
|
||||
// Remove file from view
|
||||
commit('REMOVE_ITEM', data.data.id)
|
||||
commit('REMOVE_ITEM_FROM_CLIPBOARD', data.data.id)
|
||||
events.$emit('file:deleted', data.data.id)
|
||||
|
||||
// Remove item from sidebar
|
||||
if (! ['Public', 'RequestUpload'].includes(router.currentRoute.name)) {
|
||||
if (data.data.type === 'folder') commit('REMOVE_ITEM_FROM_FAVOURITES', data)
|
||||
if (! ['Public', 'RequestUpload'].includes(router.currentRoute.name) && data.data.type === 'folder')
|
||||
commit('REMOVE_ITEM_FROM_FAVOURITES', data)
|
||||
|
||||
return {
|
||||
force_delete: !!data.data.attributes.deleted_at,
|
||||
type: data.data.type,
|
||||
id: data.data.id,
|
||||
}
|
||||
})
|
||||
|
||||
@@ -328,10 +323,10 @@ const actions = {
|
||||
|
||||
axios
|
||||
.post(route, {
|
||||
items: itemsToDelete,
|
||||
items: deletedItems,
|
||||
})
|
||||
.then(() => {
|
||||
itemsToDelete.forEach((data) => {
|
||||
deletedItems.forEach((data) => {
|
||||
// If is folder, update app data
|
||||
if (data.type === 'folder' && getters.currentFolder && data.id === getters.currentFolder.data.id) {
|
||||
router.back()
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
:class="{ 'is-inactive': clipboard.length < 1 }"
|
||||
/>
|
||||
<ToolbarButton
|
||||
@click.native="$deleteFileOrFolder(clipboard)"
|
||||
@click.native="$deleteFileOrFolder()"
|
||||
class="mr-4"
|
||||
source="trash"
|
||||
:class="{ 'is-inactive': clipboard.length < 1 }"
|
||||
|
||||
@@ -69,7 +69,7 @@
|
||||
:class="{ 'is-inactive': clipboard.length < 1 }"
|
||||
/>
|
||||
<ToolbarButton
|
||||
@click.native="$deleteFileOrFolder(clipboard)"
|
||||
@click.native="$deleteFileOrFolder()"
|
||||
class="mr-4"
|
||||
source="trash"
|
||||
:class="{ 'is-inactive': clipboard.length < 1 }"
|
||||
|
||||
@@ -95,7 +95,7 @@
|
||||
|
||||
<MobileMultiSelectToolbar>
|
||||
<ToolbarButton
|
||||
@click.native="$deleteFileOrFolder(clipboard)"
|
||||
@click.native="$deleteFileOrFolder()"
|
||||
class="mr-4"
|
||||
source="trash"
|
||||
:class="{ 'is-inactive': clipboard.length < 1 }"
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
/>
|
||||
<ToolbarButton
|
||||
v-if="canEdit"
|
||||
@click.native="$deleteFileOrFolder(clipboard)"
|
||||
@click.native="$deleteFileOrFolder()"
|
||||
class="mr-4"
|
||||
source="trash"
|
||||
:class="{ 'is-inactive': clipboard.length < 1 }"
|
||||
|
||||
@@ -68,7 +68,7 @@
|
||||
:class="{ 'is-inactive': clipboard.length < 1 }"
|
||||
/>
|
||||
<ToolbarButton
|
||||
@click.native="$deleteFileOrFolder(clipboard)"
|
||||
@click.native="$deleteFileOrFolder()"
|
||||
class="mr-4"
|
||||
source="trash"
|
||||
:class="{ 'is-inactive': clipboard.length < 1 }"
|
||||
|
||||
@@ -92,7 +92,7 @@
|
||||
|
||||
<MobileMultiSelectToolbar>
|
||||
<ToolbarButton
|
||||
@click.native="$deleteFileOrFolder(clipboard)"
|
||||
@click.native="$deleteFileOrFolder()"
|
||||
class="mr-4"
|
||||
source="trash"
|
||||
:class="{ 'is-inactive': clipboard.length < 1 }"
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
:class="{ 'is-inactive': clipboard.length < 1 }"
|
||||
/>
|
||||
<ToolbarButton
|
||||
@click.native="$deleteFileOrFolder(clipboard)"
|
||||
@click.native="$deleteFileOrFolder()"
|
||||
source="trash"
|
||||
:class="{ 'is-inactive': clipboard.length < 1 }"
|
||||
:action="$t('delete')"
|
||||
|
||||
Reference in New Issue
Block a user