mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-29 03:10:51 +00:00
merge local with remote
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
<template>
|
||||
<div :style="{ top: positionY + 'px', left: positionX + 'px' }" @click="closeAndResetContextMenu" class="contextmenu" v-show="isVisible || showFromPreview" ref="contextmenu" :class="{ 'filePreviewFixed' : showFromPreview}">
|
||||
<!-- ContextMenu for File Preview -->
|
||||
|
||||
<!-- File Preview -->
|
||||
<div class="menu-options" id="menu-list" v-if="showFromPreview">
|
||||
|
||||
<OptionGroup class="menu-option-group">
|
||||
@@ -20,7 +21,7 @@
|
||||
|
||||
</div>
|
||||
|
||||
<!--ContextMenu for trash location-->
|
||||
<!-- Trash location-->
|
||||
<div v-if="$isThisLocation(['trash', 'trash-root']) && $checkPermission('master') && !showFromPreview" id="menu-list" class="menu-options">
|
||||
|
||||
<!-- Single options -->
|
||||
@@ -48,7 +49,7 @@
|
||||
|
||||
</div>
|
||||
|
||||
<!--ContextMenu for Base location with MASTER permission-->
|
||||
<!-- Shared location with MASTER permission-->
|
||||
<div v-if="$isThisLocation(['shared']) && $checkPermission('master') && !showFromPreview" id="menu-list" class="menu-options">
|
||||
|
||||
<!-- Single options -->
|
||||
@@ -94,8 +95,8 @@
|
||||
|
||||
|
||||
|
||||
<!--ContextMenu for Base location with MASTER permission-->
|
||||
<div v-if="$isThisLocation(['base', 'participant_uploads', 'latest']) &&$checkPermission('master') && !showFromPreview" id="menu-list" class="menu-options">
|
||||
<!-- Base location with MASTER permission-->
|
||||
<div v-if="$isThisLocation(['base', 'participant_uploads', 'latest']) && $checkPermission('master') && !showFromPreview" id="menu-list" class="menu-options">
|
||||
|
||||
<!-- Single options -->
|
||||
<OptionGroup v-if="!$isThisLocation(['participant_uploads', 'latest']) && multiSelectContextMenu">
|
||||
@@ -145,7 +146,7 @@
|
||||
|
||||
</div>
|
||||
|
||||
<!--ContextMenu for Base location with EDITOR permission-->
|
||||
<!-- Base & Public location with EDITOR permission-->
|
||||
<div v-if="$isThisLocation(['base', 'public']) && $checkPermission('editor') && !showFromPreview " id="menu-list" class="menu-options">
|
||||
|
||||
<!-- Single options -->
|
||||
@@ -180,7 +181,7 @@
|
||||
|
||||
</div>
|
||||
|
||||
<!--ContextMenu for Base location with VISITOR permission-->
|
||||
<!-- Base & Public location with VISITOR permission-->
|
||||
<div v-if="$isThisLocation(['base', 'public']) && $checkPermission('visitor') && !showFromPreview" id="menu-list" class="menu-options">
|
||||
|
||||
<!-- Single options -->
|
||||
@@ -298,7 +299,7 @@ export default {
|
||||
// Check if folder is in favourites and then add/remove from favourites
|
||||
if (
|
||||
this.favourites &&
|
||||
!this.favourites.find((el) => el.unique_id == this.item.unique_id)
|
||||
!this.favourites.find(el => el.unique_id == this.item.unique_id)
|
||||
) {
|
||||
// Add to favourite folder that is not selected
|
||||
if (!this.fileInfoDetail.includes(this.item)) {
|
||||
@@ -328,7 +329,6 @@ export default {
|
||||
this.$store.dispatch('fileInfoToggle', true)
|
||||
},
|
||||
deleteItem() {
|
||||
// Dispatch remove item
|
||||
// If is context menu open on non selected item delete this single item
|
||||
if (!this.fileInfoDetail.includes(this.item)) {
|
||||
this.$store.dispatch('deleteItem', this.item)
|
||||
|
||||
@@ -19,7 +19,7 @@ export default {
|
||||
width: 100%;
|
||||
height: 5px;
|
||||
background: $light_background;
|
||||
margin-top: 5px;
|
||||
margin-top: 6px;
|
||||
border-radius: 10px;
|
||||
|
||||
span {
|
||||
|
||||
+9
-15
@@ -2,6 +2,7 @@ import axios from 'axios'
|
||||
import {events} from '@/bus'
|
||||
import i18n from '@/i18n/index.js'
|
||||
import router from '@/router'
|
||||
import Vue from 'vue'
|
||||
|
||||
const defaultState = {
|
||||
authorized: undefined,
|
||||
@@ -53,13 +54,14 @@ const actions = {
|
||||
let items = [folder]
|
||||
|
||||
// If dont coming single folder get folders to add to favourites from fileInfoDetail
|
||||
if(!folder){
|
||||
if(!folder)
|
||||
items = context.getters.fileInfoDetail
|
||||
}
|
||||
|
||||
items.forEach((data) => {
|
||||
if(data.type === 'folder' ) {
|
||||
|
||||
if(context.getters.user.relationships.favourites.data.attributes.folders.find(folder => folder.unique_id === data.unique_id)) return
|
||||
|
||||
addFavourites.push({
|
||||
'unique_id': data.unique_id
|
||||
})
|
||||
@@ -88,28 +90,20 @@ const actions = {
|
||||
folders: addFavourites
|
||||
})
|
||||
.catch(() => {
|
||||
// Show error message
|
||||
events.$emit('alert:open', {
|
||||
title: i18n.t('popup_error.title'),
|
||||
message: i18n.t('popup_error.message'),
|
||||
})
|
||||
Vue.prototype.$isSomethingWrong()
|
||||
})
|
||||
},
|
||||
removeFromFavourites: (context, folder) => {
|
||||
removeFromFavourites: ({commit, getters, dispatch}, folder) => {
|
||||
|
||||
// Remove from storage
|
||||
context.commit('REMOVE_ITEM_FROM_FAVOURITES', folder)
|
||||
commit('REMOVE_ITEM_FROM_FAVOURITES', folder)
|
||||
|
||||
axios
|
||||
.post(context.getters.api + '/folders/favourites/' + folder.unique_id, {
|
||||
.post(getters.api + '/folders/favourites/' + folder.unique_id, {
|
||||
_method: 'delete'
|
||||
})
|
||||
.catch(() => {
|
||||
// Show error message
|
||||
events.$emit('alert:open', {
|
||||
title: i18n.t('popup_error.title'),
|
||||
message: i18n.t('popup_error.message'),
|
||||
})
|
||||
Vue.prototype.$isSomethingWrong()
|
||||
})
|
||||
},
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
{{ $t('sidebar.favourites_empty') }}
|
||||
</span>
|
||||
|
||||
<a @click.stop="openFolder(folder)" class="menu-list-item" :class="{'is-current': (folder && currentFolder) && (currentFolder.unique_id === folder.unique_id)}" v-for="folder in favourites" :key="folder.unique_id">
|
||||
<a @click.stop="openFolder(folder)" class="menu-list-item" :class="{'is-current': (folder && currentFolder) && (currentFolder.unique_id === folder.unique_id)}" v-for="(folder, i) in favourites" :key="i">
|
||||
<div>
|
||||
<folder-icon size="17" class="folder-icon"></folder-icon>
|
||||
<span class="label">{{ folder.name }}</span>
|
||||
|
||||
Reference in New Issue
Block a user