mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-05 18:23:48 +00:00
- Prevent submit shared form
- Send shared link from FileInfoPanel.vue
This commit is contained in:
@@ -21,7 +21,6 @@ class ShareResource extends JsonResource
|
||||
'attributes' => [
|
||||
'permission' => $this->permission,
|
||||
'protected' => (int) $this->protected,
|
||||
'email_share'=> $request->has('emails') ? true : false,
|
||||
'item_id' => (int) $this->item_id,
|
||||
'expire_in' => (int) $this->expire_in,
|
||||
'token' => $this->token,
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
<div class="sharelink">
|
||||
<lock-icon v-if="isLocked" @click="shareItemOptions" class="lock-icon" size="17"></lock-icon>
|
||||
<unlock-icon v-if="! isLocked" @click="shareItemOptions" class="lock-icon" size="17"></unlock-icon>
|
||||
<CopyInput class="copy-sharelink" size="small" :value="fileInfoDetail[0].shared.link"/>
|
||||
<CopyInput class="copy-sharelink" size="small" :item="fileInfoDetail[0]"/>
|
||||
</div>
|
||||
</ListInfoItem>
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div class="inline-wrapper icon-append copy-input" :class="size" @click="copyUrl">
|
||||
<input ref="sel" :value="value" id="link-input" type="text" class="input-text" readonly>
|
||||
<input ref="sel" :value="item.shared.link" id="link-input" type="text" class="input-text" readonly>
|
||||
<div class="multi-icon">
|
||||
<div class="icon-item">
|
||||
<link-icon v-if="! isCopiedLink" size="14"></link-icon>
|
||||
@@ -19,7 +19,7 @@ import { events } from '@/bus'
|
||||
|
||||
export default {
|
||||
name: 'CopyInput',
|
||||
props: ['size', 'value'],
|
||||
props: ['size', 'item'],
|
||||
components: {
|
||||
CheckIcon,
|
||||
LinkIcon,
|
||||
@@ -32,7 +32,11 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
menuForEmail() {
|
||||
events.$emit('openSendToRecipientsMenu')
|
||||
events.$emit('popup:open', {
|
||||
name: 'share-edit',
|
||||
item: this.item,
|
||||
sentToEmail: true,
|
||||
})
|
||||
},
|
||||
copyUrl() {
|
||||
|
||||
|
||||
@@ -97,6 +97,7 @@ export default {
|
||||
}
|
||||
|
||||
.input-wrapper {
|
||||
margin-bottom: 0;
|
||||
background: white;
|
||||
max-width: 100%;
|
||||
display: flex;
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
<div v-if="isGeneratedShared" class="form-wrapper">
|
||||
<div class="input-wrapper">
|
||||
<label class="input-label">{{ this.shareViaEmail ? $t('shared_form.label_share_vie_email') : $t('shared_form.label_shared_url') }}:</label>
|
||||
<CopyInput size="small" :value="shareLink" />
|
||||
<CopyInput size="small" :item="pickedItem" />
|
||||
</div>
|
||||
</div>
|
||||
</PopupContent>
|
||||
@@ -210,10 +210,6 @@
|
||||
|
||||
// End loading
|
||||
this.isLoading = false
|
||||
|
||||
this.shareViaEmail = response.data.data.attributes.email_share
|
||||
|
||||
this.shareLink = response.data.data.attributes.link
|
||||
this.isGeneratedShared = true
|
||||
|
||||
this.$store.commit('UPDATE_SHARED_ITEM', response.data.data.attributes)
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
<div v-if="! sendToRecipientsMenu || (sendToRecipientsMenu && isEmailSended)" class="input-wrapper copy-input">
|
||||
<label class="input-label">{{ $t('shared_form.label_share_vie_email') }}:</label>
|
||||
<CopyInput size="small" :value="pickedItem.shared.link" />
|
||||
<CopyInput size="small" :item="pickedItem" />
|
||||
</div>
|
||||
|
||||
<ValidationObserver v-if="sendToRecipientsMenu && !isEmailSended" v-slot="{ invalid }" ref="shareEmail" tag="form" class="form-wrapper">
|
||||
@@ -315,10 +315,6 @@
|
||||
this.emails = emails
|
||||
})
|
||||
|
||||
events.$on('openSendToRecipientsMenu', () => {
|
||||
this.sendToRecipientsMenu = true
|
||||
})
|
||||
|
||||
// Show popup
|
||||
events.$on('popup:open', args => {
|
||||
|
||||
@@ -339,6 +335,9 @@
|
||||
if (args.item.shared.expire_in)
|
||||
this.isMoreOptions = true
|
||||
|
||||
if (args.sentToEmail)
|
||||
this.sendToRecipientsMenu = true
|
||||
|
||||
this.canChangePassword = args.item.shared.protected
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user