mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-18 08:12:15 +00:00
- fixed create menu items
- reload team folder after update team member
This commit is contained in:
@@ -13,29 +13,43 @@
|
||||
/>
|
||||
<PopoverItem name="desktop-create" side="left">
|
||||
<OptionGroup
|
||||
:title="$t('Upload')"
|
||||
:class="{
|
||||
'is-inactive': canUploadInView || isTeamFolderHomepage || isSharedWithMeHomepage,
|
||||
}"
|
||||
:title="$t('Frequently Used')"
|
||||
>
|
||||
<OptionUpload :title="$t('actions.upload')" type="file" />
|
||||
<OptionUpload :title="$t('actions.upload_folder')" type="folder" />
|
||||
</OptionGroup>
|
||||
<OptionGroup :title="$t('Create')">
|
||||
<OptionUpload
|
||||
:title="$t('actions.upload')"
|
||||
type="file"
|
||||
:class="{
|
||||
'is-inactive': (isSharedWithMe && !canEdit) || canUploadInView || isTeamFolderHomepage || isSharedWithMeHomepage,
|
||||
}"
|
||||
/>
|
||||
<Option
|
||||
@click.native="$createFolder"
|
||||
:class="{
|
||||
'is-inactive': canCreateFolder || isTeamFolderHomepage || isSharedWithMeHomepage,
|
||||
'is-inactive': (isSharedWithMe && !canEdit) || canCreateFolder || isTeamFolderHomepage || isSharedWithMeHomepage,
|
||||
}"
|
||||
:title="$t('actions.create_folder')"
|
||||
icon="folder-plus"
|
||||
/>
|
||||
</OptionGroup>
|
||||
<OptionGroup :title="$t('Others')">
|
||||
<OptionUpload
|
||||
:class="{
|
||||
'is-inactive': (isSharedWithMe && !canEdit) || canUploadFolderInView || isTeamFolderHomepage || isSharedWithMeHomepage,
|
||||
}"
|
||||
:title="$t('actions.upload_folder')"
|
||||
type="folder"
|
||||
/>
|
||||
<Option
|
||||
@click.stop.native="$createTeamFolder"
|
||||
:class="{ 'is-inactive': canCreateTeamFolder || isSharedWithMeHomepage }"
|
||||
:class="{ 'is-inactive': canCreateTeamFolder }"
|
||||
:title="$t('Create Team Folder')"
|
||||
icon="users"
|
||||
/>
|
||||
<Option
|
||||
@click.native="$createFileRequest"
|
||||
:title="$t('Create File Request')"
|
||||
icon="upload-cloud"
|
||||
/>
|
||||
</OptionGroup>
|
||||
</PopoverItem>
|
||||
</PopoverWrapper>
|
||||
@@ -185,7 +199,7 @@ export default {
|
||||
'user',
|
||||
]),
|
||||
canEdit() {
|
||||
if (this.currentTeamFolder && this.user && this.clipboard[0]) {
|
||||
if (this.currentTeamFolder && this.user) {
|
||||
let member = this.currentTeamFolder.data.relationships.members.data.find(
|
||||
(member) => member.data.id === this.user.data.id
|
||||
)
|
||||
@@ -201,6 +215,9 @@ export default {
|
||||
isTeamFolderHomepage() {
|
||||
return this.$isThisRoute(this.$route, ['TeamFolders']) && !this.$route.params.id
|
||||
},
|
||||
isSharedWithMe() {
|
||||
return this.$isThisRoute(this.$route, ['SharedWithMe'])
|
||||
},
|
||||
isSharedWithMeHomepage() {
|
||||
return this.$isThisRoute(this.$route, ['SharedWithMe']) && !this.$route.params.id
|
||||
},
|
||||
@@ -211,6 +228,9 @@ export default {
|
||||
return this.$isThisRoute(this.$route, ['Files', 'MySharedItems'])
|
||||
},
|
||||
canUploadInView() {
|
||||
return !this.$isThisRoute(this.$route, ['Files', 'RecentUploads', 'Public', 'TeamFolders', 'SharedWithMe'])
|
||||
},
|
||||
canUploadFolderInView() {
|
||||
return !this.$isThisRoute(this.$route, ['Files', 'Public', 'TeamFolders', 'SharedWithMe'])
|
||||
},
|
||||
canDeleteInView() {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<li
|
||||
class="flex items-center justify-between py-3.5 px-5"
|
||||
class="flex items-center justify-between lg:py-3.5 py-4 px-5"
|
||||
:class="{ 'group cursor-pointer hover:bg-light-background dark:hover:bg-4x-dark-foreground': !isHoverDisabled }"
|
||||
>
|
||||
<div class="flex items-center">
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<template>
|
||||
<label
|
||||
class="group flex cursor-pointer items-center py-4 px-5 hover:bg-light-background dark:hover:bg-4x-dark-foreground"
|
||||
class="flex items-center lg:py-3.5 py-4 px-5"
|
||||
:class="{'group cursor-pointer hover:bg-light-background dark:hover:bg-4x-dark-foreground': !isHoverDisabled }"
|
||||
>
|
||||
<div class="mr-4">
|
||||
<upload-cloud-icon v-if="type === 'file'" size="17" class="vue-feather group-hover-text-theme" />
|
||||
@@ -38,7 +39,7 @@ import { UploadCloudIcon } from 'vue-feather-icons'
|
||||
|
||||
export default {
|
||||
name: 'Option',
|
||||
props: ['title', 'type'],
|
||||
props: ['title', 'type', 'isHoverDisabled'],
|
||||
components: {
|
||||
FolderUploadIcon,
|
||||
UploadCloudIcon,
|
||||
|
||||
@@ -16,35 +16,6 @@
|
||||
v-slot="{ invalid }"
|
||||
tag="form"
|
||||
>
|
||||
<!--Send Request by Email-->
|
||||
<AppInputSwitch
|
||||
:title="$t('Send Request by Email')"
|
||||
:description="$t('Send your file request on recipients email')"
|
||||
>
|
||||
<SwitchInput v-model="shareViaEmail" :state="shareViaEmail" />
|
||||
</AppInputSwitch>
|
||||
|
||||
<!--Set email-->
|
||||
<ValidationProvider
|
||||
v-if="shareViaEmail"
|
||||
tag="div"
|
||||
mode="passive"
|
||||
name="Email"
|
||||
rules="required"
|
||||
v-slot="{ errors }"
|
||||
>
|
||||
<AppInputText :error="errors[0]" class="-mt-2">
|
||||
<input
|
||||
v-model="form.email"
|
||||
:class="{ '!border-rose-600': errors[0] }"
|
||||
type="text"
|
||||
ref="input"
|
||||
class="focus-border-theme input-dark"
|
||||
:placeholder="$t('Type email...')"
|
||||
/>
|
||||
</AppInputText>
|
||||
</ValidationProvider>
|
||||
|
||||
<!--Set name-->
|
||||
<ValidationProvider
|
||||
tag="div"
|
||||
@@ -52,7 +23,7 @@
|
||||
name="Name"
|
||||
v-slot="{ errors }"
|
||||
>
|
||||
<AppInputText :title="$t('Folder Name (optional)')" :description="$t('Created folder with files will be named with your own name.')" :error="errors[0]" class="-mt-2">
|
||||
<AppInputText :title="$t('Folder Name (optional)')" :description="$t('Created folder with files will be named with your own name.')" :error="errors[0]">
|
||||
<input
|
||||
v-model="form.name"
|
||||
:class="{ '!border-rose-600': errors[0] }"
|
||||
@@ -66,7 +37,7 @@
|
||||
|
||||
<!--Set note-->
|
||||
<ValidationProvider tag="div" mode="passive" name="Note" v-slot="{ errors }">
|
||||
<AppInputText :title="$t('Message (optional)')" :description="$t('This message will be showed for your email recipient or in the upload page.')" :error="errors[0]" :is-last="true">
|
||||
<AppInputText :title="$t('Message (optional)')" :description="$t('This message will be showed for your email recipient or in the upload page.')" :error="errors[0]">
|
||||
<textarea
|
||||
v-model="form.notes"
|
||||
rows="2"
|
||||
@@ -77,6 +48,36 @@
|
||||
:placeholder="$t('Type message for recipient...')"
|
||||
></textarea>
|
||||
</AppInputText>
|
||||
</ValidationProvider>
|
||||
|
||||
<!--Send Request by Email-->
|
||||
<AppInputSwitch
|
||||
:title="$t('Send Request by Email')"
|
||||
:description="$t('Send your file request on recipients email')"
|
||||
:is-last="! shareViaEmail"
|
||||
>
|
||||
<SwitchInput v-model="shareViaEmail" :state="shareViaEmail" />
|
||||
</AppInputSwitch>
|
||||
|
||||
<!--Set email-->
|
||||
<ValidationProvider
|
||||
v-if="shareViaEmail"
|
||||
tag="div"
|
||||
mode="passive"
|
||||
name="Email"
|
||||
rules="required"
|
||||
v-slot="{ errors }"
|
||||
>
|
||||
<AppInputText :error="errors[0]" class="-mt-2" :is-last="true">
|
||||
<input
|
||||
v-model="form.email"
|
||||
:class="{ '!border-rose-600': errors[0] }"
|
||||
type="text"
|
||||
ref="input"
|
||||
class="focus-border-theme input-dark"
|
||||
:placeholder="$t('Type email...')"
|
||||
/>
|
||||
</AppInputText>
|
||||
</ValidationProvider>
|
||||
</ValidationObserver>
|
||||
|
||||
|
||||
@@ -135,6 +135,7 @@ export default {
|
||||
})
|
||||
.then((response) => {
|
||||
this.$store.commit('UPDATE_ITEM', response.data)
|
||||
this.$store.commit('SET_CURRENT_TEAM_FOLDER', response.data)
|
||||
|
||||
events.$emit('toaster', {
|
||||
type: 'success',
|
||||
|
||||
@@ -1,17 +1,6 @@
|
||||
<template>
|
||||
<div>
|
||||
<MobileContextMenu>
|
||||
<OptionGroup v-if="item && isFolder">
|
||||
<Option
|
||||
@click.native="$toggleFavourites(item)"
|
||||
:title="
|
||||
isInFavourites
|
||||
? $t('context_menu.remove_from_favourites')
|
||||
: $t('context_menu.add_to_favourites')
|
||||
"
|
||||
icon="favourites"
|
||||
/>
|
||||
</OptionGroup>
|
||||
<OptionGroup v-if="item">
|
||||
<Option @click.native="$renameFileOrFolder(item)" :title="$t('context_menu.rename')" icon="rename" />
|
||||
<Option @click.native="$moveFileOrFolder(item)" :title="$t('context_menu.move')" icon="move-item" />
|
||||
@@ -43,21 +32,12 @@
|
||||
</MobileContextMenu>
|
||||
|
||||
<MobileCreateMenu>
|
||||
<OptionGroup :title="$t('Upload')">
|
||||
<OptionGroup :title="$t('Frequently Used')">
|
||||
<OptionUpload
|
||||
:title="$t('actions.upload')"
|
||||
type="file"
|
||||
:is-hover-disabled="true"
|
||||
/>
|
||||
<OptionUpload :title="$t('actions.upload_folder')" type="folder" />
|
||||
</OptionGroup>
|
||||
<OptionGroup :title="$t('Create')">
|
||||
<Option
|
||||
@click.stop.native="$createTeamFolder"
|
||||
:title="$t('Create Team Folder')"
|
||||
icon="users"
|
||||
:is-hover-disabled="true"
|
||||
/>
|
||||
<Option
|
||||
@click.stop.native="$createFolderByPopup"
|
||||
:title="$t('actions.create_folder')"
|
||||
@@ -65,6 +45,20 @@
|
||||
:is-hover-disabled="true"
|
||||
/>
|
||||
</OptionGroup>
|
||||
<OptionGroup :title="$t('Others')">
|
||||
<Option
|
||||
@click.stop.native="$createTeamFolder"
|
||||
:title="$t('Create Team Folder')"
|
||||
icon="users"
|
||||
:is-hover-disabled="true"
|
||||
/>
|
||||
<Option
|
||||
@click.native="$createFileRequest"
|
||||
:title="$t('Create File Request')"
|
||||
icon="upload-cloud"
|
||||
:is-hover-disabled="true"
|
||||
/>
|
||||
</OptionGroup>
|
||||
</MobileCreateMenu>
|
||||
|
||||
<MobileMultiSelectToolbar>
|
||||
|
||||
@@ -63,17 +63,6 @@
|
||||
</ContextMenu>
|
||||
|
||||
<MobileContextMenu>
|
||||
<OptionGroup v-if="isFolder">
|
||||
<Option
|
||||
@click.native="$toggleFavourites(item)"
|
||||
:title="
|
||||
isInFavourites
|
||||
? $t('context_menu.remove_from_favourites')
|
||||
: $t('context_menu.add_to_favourites')
|
||||
"
|
||||
icon="favourites"
|
||||
/>
|
||||
</OptionGroup>
|
||||
<OptionGroup>
|
||||
<Option @click.native="$renameFileOrFolder(item)" :title="$t('context_menu.rename')" icon="rename" />
|
||||
<Option @click.native="$deleteFileOrFolder(item)" :title="$t('context_menu.delete')" icon="trash" />
|
||||
|
||||
@@ -12,11 +12,8 @@
|
||||
</MobileContextMenu>
|
||||
|
||||
<MobileCreateMenu>
|
||||
<OptionGroup :title="$t('Upload')">
|
||||
<OptionGroup :title="$t('Frequently Used')">
|
||||
<OptionUpload :title="$t('actions.upload')" type="file" :is-hover-disabled="true" />
|
||||
<OptionUpload :title="$t('actions.upload_folder')" type="folder" :is-hover-disabled="true" />
|
||||
</OptionGroup>
|
||||
<OptionGroup :title="$t('Create')">
|
||||
<Option
|
||||
@click.stop.native="createFolder"
|
||||
:title="$t('actions.create_folder')"
|
||||
|
||||
@@ -1,18 +1,6 @@
|
||||
<template>
|
||||
<div>
|
||||
<MobileContextMenu>
|
||||
<OptionGroup v-if="item && isFolder">
|
||||
<Option
|
||||
@click.native="$toggleFavourites(item)"
|
||||
:title="
|
||||
isInFavourites
|
||||
? $t('context_menu.remove_from_favourites')
|
||||
: $t('context_menu.add_to_favourites')
|
||||
"
|
||||
icon="favourites"
|
||||
/>
|
||||
</OptionGroup>
|
||||
|
||||
<OptionGroup v-if="item">
|
||||
<Option @click.native="$renameFileOrFolder(item)" :title="$t('context_menu.rename')" icon="rename" />
|
||||
<Option @click.native="$moveFileOrFolder(item)" :title="$t('context_menu.move')" icon="move-item" />
|
||||
@@ -26,10 +14,16 @@
|
||||
/>
|
||||
<Option
|
||||
@click.native="$updateTeamFolder(item)"
|
||||
v-if="isFolder"
|
||||
v-if="isFolder && (isTeamFolderHomepage || currentTeamFolder.data.id === item.data.id)"
|
||||
:title="$t('Edit Team Members')"
|
||||
icon="users"
|
||||
/>
|
||||
<Option
|
||||
@click.native="$createFileRequest(item)"
|
||||
v-if="isFolder"
|
||||
:title="$t('File Request')"
|
||||
icon="upload-cloud"
|
||||
/>
|
||||
</OptionGroup>
|
||||
|
||||
<OptionGroup v-if="item">
|
||||
@@ -38,21 +32,21 @@
|
||||
</MobileContextMenu>
|
||||
|
||||
<MobileCreateMenu>
|
||||
<OptionGroup :title="$t('Upload')">
|
||||
<OptionUpload :title="$t('actions.upload')" type="file" :is-hover-disabled="true" />
|
||||
<OptionUpload :title="$t('actions.upload_folder')" type="folder" :is-hover-disabled="true" />
|
||||
</OptionGroup>
|
||||
<OptionGroup :title="$t('Create')">
|
||||
<Option
|
||||
@click.stop.native="$createTeamFolder"
|
||||
:title="$t('Create Team Folder')"
|
||||
icon="users"
|
||||
:is-hover-disabled="true"
|
||||
/>
|
||||
<OptionGroup :title="$t('Frequently Used')">
|
||||
<OptionUpload :title="$t('actions.upload')" type="file" :is-hover-disabled="true" :class="{'is-inactive': isTeamFolderHomepage}" />
|
||||
<Option
|
||||
@click.stop.native="$createFolderByPopup"
|
||||
:title="$t('actions.create_folder')"
|
||||
icon="folder-plus"
|
||||
:is-hover-disabled="true"
|
||||
:class="{'is-inactive': isTeamFolderHomepage}"
|
||||
/>
|
||||
</OptionGroup>
|
||||
<OptionGroup :title="$t('Others')">
|
||||
<Option
|
||||
@click.stop.native="$createTeamFolder"
|
||||
:title="$t('Create Team Folder')"
|
||||
icon="users"
|
||||
:is-hover-disabled="true"
|
||||
/>
|
||||
</OptionGroup>
|
||||
@@ -139,6 +133,12 @@
|
||||
:title="$t('Edit Team Members')"
|
||||
icon="users"
|
||||
/>
|
||||
<Option
|
||||
@click.native="$createFileRequest(item)"
|
||||
v-if="isFolder"
|
||||
:title="$t('File Request')"
|
||||
icon="upload-cloud"
|
||||
/>
|
||||
</OptionGroup>
|
||||
<OptionGroup>
|
||||
<Option @click.native="$openInDetailPanel(item)" :title="$t('context_menu.detail')" icon="detail" />
|
||||
|
||||
Reference in New Issue
Block a user