mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-18 16:22:14 +00:00
- added file request into the spotlight
- after enter stop editing item name
This commit is contained in:
@@ -74,17 +74,18 @@
|
||||
<!--Item Info-->
|
||||
<div class="text-center">
|
||||
<!--Item Title-->
|
||||
<b
|
||||
class="inline-block w-full overflow-hidden text-ellipsis whitespace-nowrap text-sm leading-3 tracking-tight md:px-6"
|
||||
<span
|
||||
class="inline-block w-full overflow-hidden text-ellipsis whitespace-nowrap text-sm font-bold leading-3 tracking-tight md:px-6"
|
||||
:class="{ 'hover:underline': canEditName }"
|
||||
ref="name"
|
||||
@input="renameItem"
|
||||
@keydown.delete.stop
|
||||
@click.stop
|
||||
@keydown.enter="$refs.name.blur()"
|
||||
:contenteditable="canEditName"
|
||||
>
|
||||
{{ itemName }}
|
||||
</b>
|
||||
</span>
|
||||
|
||||
<!--Item sub line-->
|
||||
<div class="flex items-center justify-center">
|
||||
|
||||
@@ -52,18 +52,19 @@
|
||||
<!--Item Info-->
|
||||
<div class="pl-2">
|
||||
<!--Item Title-->
|
||||
<b
|
||||
class="mb-0.5 block overflow-hidden text-ellipsis whitespace-nowrap text-sm"
|
||||
<span
|
||||
class="mb-0.5 block overflow-hidden text-ellipsis whitespace-nowrap text-sm font-bold"
|
||||
:class="{ 'hover:underline': canEditName }"
|
||||
style="max-width: 240px"
|
||||
ref="name"
|
||||
@input="renameItem"
|
||||
@keydown.delete.stop
|
||||
@click.stop
|
||||
@keydown.enter="$refs.name.blur()"
|
||||
:contenteditable="canEditName"
|
||||
>
|
||||
{{ itemName }}
|
||||
</b>
|
||||
</span>
|
||||
|
||||
<!--Item sub line-->
|
||||
<div class="flex items-center">
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
<template>
|
||||
<PopupWrapper name="create-upload-request">
|
||||
<PopupWrapper name="create-file-request">
|
||||
<!--Title-->
|
||||
<PopupHeader :title="$t('Create Upload Request')" icon="upload" />
|
||||
<PopupHeader :title="$t('Create File Request')" icon="upload" />
|
||||
|
||||
<!--Content-->
|
||||
<PopupContent>
|
||||
<!--Item Thumbnail-->
|
||||
<ThumbnailItem class="mb-5" :item="pickedItem" />
|
||||
<ThumbnailItem v-if="pickedItem" class="mb-5" :item="pickedItem" />
|
||||
|
||||
<!--Form to set upload request-->
|
||||
<ValidationObserver
|
||||
@@ -32,7 +32,7 @@
|
||||
rules="required"
|
||||
v-slot="{ errors }"
|
||||
>
|
||||
<AppInputText :error="errors[0]">
|
||||
<AppInputText :error="errors[0]" class="-mt-2">
|
||||
<input
|
||||
v-model="form.email"
|
||||
:class="{ 'border-red': errors[0] }"
|
||||
@@ -46,7 +46,7 @@
|
||||
|
||||
<!--Set note-->
|
||||
<ValidationProvider tag="div" mode="passive" name="Note" v-slot="{ errors }">
|
||||
<AppInputText :title="$t('Message (optional)')" :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]" :is-last="true">
|
||||
<textarea
|
||||
v-model="form.notes"
|
||||
rows="2"
|
||||
@@ -86,9 +86,9 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { ValidationProvider, ValidationObserver } from 'vee-validate/dist/vee-validate.full'
|
||||
import {ValidationProvider, ValidationObserver} from 'vee-validate/dist/vee-validate.full'
|
||||
import AppInputSwitch from '../Admin/AppInputSwitch'
|
||||
import { required } from 'vee-validate/dist/rules'
|
||||
import {required} from 'vee-validate/dist/rules'
|
||||
import ButtonBase from '../FilesView/ButtonBase'
|
||||
import AppInputText from '../Admin/AppInputText'
|
||||
import PopupWrapper from './Popup/PopupWrapper'
|
||||
@@ -98,7 +98,7 @@ import PopupHeader from './Popup/PopupHeader'
|
||||
import SwitchInput from './Forms/SwitchInput'
|
||||
import ThumbnailItem from './ThumbnailItem'
|
||||
import CopyInput from './Forms/CopyInput'
|
||||
import { events } from '../../bus'
|
||||
import {events} from '../../bus'
|
||||
import axios from 'axios'
|
||||
|
||||
export default {
|
||||
@@ -127,7 +127,7 @@ export default {
|
||||
},
|
||||
generatedUploadRequest: undefined,
|
||||
shareViaEmail: false,
|
||||
pickedItem: false,
|
||||
pickedItem: undefined,
|
||||
isLoading: false,
|
||||
}
|
||||
},
|
||||
@@ -159,9 +159,27 @@ export default {
|
||||
},
|
||||
created() {
|
||||
events.$on('popup:open', (args) => {
|
||||
if (args.name === 'create-upload-request') this.pickedItem = args.item
|
||||
if (args.name === 'create-file-request') this.pickedItem = args.item
|
||||
this.form.folder_id = args.item.data.id
|
||||
})
|
||||
|
||||
// Close popup
|
||||
events.$on('popup:close', () => {
|
||||
|
||||
// Restore data
|
||||
setTimeout(() => {
|
||||
this.generatedUploadRequest = undefined
|
||||
this.pickedItem = undefined
|
||||
|
||||
this.shareViaEmail = false
|
||||
|
||||
this.form = {
|
||||
email: undefined,
|
||||
notes: undefined,
|
||||
folder_id: undefined,
|
||||
}
|
||||
}, 150)
|
||||
})
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -94,25 +94,17 @@ export default {
|
||||
return
|
||||
|
||||
// Move item
|
||||
if (!this.isSelectedItem) {
|
||||
this.$store.dispatch('moveItem', {
|
||||
to_item: this.selectedFolder,
|
||||
isSelectedItem: null,
|
||||
noSelectedItem: this.isSelectedItem ? this.pickedItem : null,
|
||||
})
|
||||
}
|
||||
|
||||
if (this.isSelectedItem) {
|
||||
this.$store.dispatch('moveItem', {
|
||||
to_item: this.selectedFolder,
|
||||
isSelectedItem: this.pickedItem,
|
||||
})
|
||||
}
|
||||
|
||||
// Close popup
|
||||
events.$emit('popup:close')
|
||||
|
||||
// If is mobile, close the selecting mod after done the move action
|
||||
if (this.$isMobile()) this.$store.commit('DISABLE_MULTISELECT_MODE')
|
||||
if (this.$isMobile())
|
||||
this.$store.commit('DISABLE_MULTISELECT_MODE')
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
|
||||
@@ -213,6 +213,11 @@
|
||||
size="18"
|
||||
class="vue-feather text-theme"
|
||||
/>
|
||||
<upload-cloud-icon
|
||||
v-if="result.action.value === 'create-file-request'"
|
||||
size="18"
|
||||
class="vue-feather text-theme"
|
||||
/>
|
||||
|
||||
<b class="ml-3.5 text-sm font-bold">
|
||||
{{ result.title }}
|
||||
@@ -534,6 +539,13 @@ export default {
|
||||
value: 'create-team-folder',
|
||||
},
|
||||
},
|
||||
{
|
||||
title: this.$t('Create File Request'),
|
||||
action: {
|
||||
type: 'function',
|
||||
value: 'create-file-request',
|
||||
},
|
||||
},
|
||||
]
|
||||
|
||||
let functionList = [
|
||||
@@ -745,6 +757,10 @@ export default {
|
||||
if (arg.action.value === 'create-team-folder') {
|
||||
this.$createTeamFolder()
|
||||
}
|
||||
|
||||
if (arg.action.value === 'create-file-request') {
|
||||
this.$createFileRequest()
|
||||
}
|
||||
}
|
||||
|
||||
this.exitSpotlight()
|
||||
|
||||
4
resources/js/helpers/itemHelpers.js
vendored
4
resources/js/helpers/itemHelpers.js
vendored
@@ -113,9 +113,9 @@ const itemHelpers = {
|
||||
})
|
||||
}
|
||||
|
||||
Vue.prototype.$createUploadRequest = function (entry) {
|
||||
Vue.prototype.$createFileRequest = function (entry = undefined) {
|
||||
events.$emit('popup:open', {
|
||||
name: 'create-upload-request',
|
||||
name: 'create-file-request',
|
||||
item: entry,
|
||||
})
|
||||
}
|
||||
|
||||
@@ -136,9 +136,9 @@
|
||||
icon="user-plus"
|
||||
/>
|
||||
<Option
|
||||
@click.native="$createUploadRequest(item)"
|
||||
@click.native="$createFileRequest(item)"
|
||||
v-if="isFolder"
|
||||
:title="$t('Create Upload Request')"
|
||||
:title="$t('File Request')"
|
||||
icon="upload-cloud"
|
||||
/>
|
||||
</OptionGroup>
|
||||
|
||||
@@ -89,7 +89,7 @@
|
||||
:size="26"
|
||||
/>
|
||||
<b class="text-theme ml-2 text-sm">
|
||||
{{ $t('Tell Jane you are done!') }}
|
||||
{{ $t('Tell {name} you are done!', {name: userName}) }}
|
||||
</b>
|
||||
</button>
|
||||
|
||||
@@ -137,10 +137,16 @@
|
||||
<h1 class="title">
|
||||
{{ emptyPageTitle }}
|
||||
</h1>
|
||||
|
||||
<p class="description max-w-[420px] mx-auto">
|
||||
{{ emptyPageDescription }}
|
||||
</p>
|
||||
|
||||
<InfoBox class="max-w-[420px] mx-auto">
|
||||
<b>{{ $t('{name} leave you a message', {name: userName}) }}: </b>
|
||||
<p>{{ uploadRequest.data.attributes.notes }}</p>
|
||||
</InfoBox>
|
||||
|
||||
<ButtonUpload v-if="uploadRequest.data.attributes.status === 'active'" button-style="theme">
|
||||
{{ $t('empty_page.call_to_action') }}
|
||||
</ButtonUpload>
|
||||
@@ -169,10 +175,12 @@ import OptionGroup from '../../components/FilesView/OptionGroup'
|
||||
import Option from '../../components/FilesView/Option'
|
||||
import {events} from '../../bus'
|
||||
import {mapGetters} from 'vuex'
|
||||
import InfoBox from "../../components/Others/Forms/InfoBox";
|
||||
|
||||
export default {
|
||||
name: 'Files',
|
||||
components: {
|
||||
InfoBox,
|
||||
MobileMultiSelectToolbar,
|
||||
MobileActionButton,
|
||||
FileActionsMobile,
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
v-if="invitation"
|
||||
:title="$t('Invitation To Join Team Folder')"
|
||||
:description="
|
||||
$t('Jane invite you to join with his team into shared team folder', {
|
||||
$t('{name} invite you to join with his team into shared team folder', {
|
||||
name: invitation.data.relationships.inviter.data.attributes.name,
|
||||
})
|
||||
"
|
||||
|
||||
@@ -19,7 +19,7 @@ class MoveItemInUploadRequestController extends Controller
|
||||
return response('Access Denied', 403);
|
||||
}
|
||||
|
||||
$item->update(['parent_id' => $request->input('to_id')]);
|
||||
$item->update(['parent_id' => $request->input('to_id') ?? $uploadRequest->id]);
|
||||
}
|
||||
|
||||
return response('Done.', 204);
|
||||
|
||||
@@ -40,12 +40,19 @@ class UploadRequestNotification extends Notification implements ShouldQueue
|
||||
*/
|
||||
public function toMail($notifiable)
|
||||
{
|
||||
// Format optional message
|
||||
// TODO: add to language strings
|
||||
$message = $this->uploadRequest->notes
|
||||
? "PS: {$this->uploadRequest->user->settings->first_name} left you a message: {$this->uploadRequest->notes}"
|
||||
: null;
|
||||
|
||||
// TODO: add to language strings
|
||||
return (new MailMessage)
|
||||
->subject("{$this->uploadRequest->user->settings->first_name} Request You for File Upload")
|
||||
->greeting('Hello')
|
||||
->line("We are emailing you because {$this->uploadRequest->user->settings->first_name} needs files from you. Please click on the link below and upload your files for {$this->uploadRequest->user->settings->first_name}.")
|
||||
->action('Upload Files', url("/request/{$this->uploadRequest->id}/upload"))
|
||||
->line("We are emailing you because {$this->uploadRequest->user->settings->first_name} requested files from you. Please click on the link below and upload your files for {$this->uploadRequest->user->settings->first_name}.")
|
||||
->line($message)
|
||||
->action('Upload your Files', url("/request/{$this->uploadRequest->id}/upload"))
|
||||
->line('Thank you for using our application!');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user