Merge remote-tracking branch 'origin/remote-upload-merge'

# Conflicts:
#	public/mix-manifest.json
This commit is contained in:
Čarodej
2022-04-22 16:37:07 +02:00
61 changed files with 966 additions and 306 deletions
@@ -10,7 +10,7 @@
<div class="flex items-center">
<div class="mr-3 ml-0 flex items-center lg:mx-3">
<span
class="inline-block max-w-[150px] xs:max-w-[230px] md:max-w-[290px] overflow-hidden text-ellipsis whitespace-nowrap text-sm font-bold"
class="inline-block max-w-[150px] xs:max-w-[220px] md:max-w-[240px] overflow-hidden text-ellipsis whitespace-nowrap text-sm font-bold"
>
{{ currentFile.data.attributes.name }}
</span>
@@ -12,17 +12,22 @@
:action="$t('create_something')"
/>
<PopoverItem name="desktop-create" side="left">
<OptionGroup :title="$t('upload')">
<OptionGroup :title="$t('frequently_used')">
<OptionUpload :title="$t('upload_files')" type="file" />
<OptionUpload :title="$t('upload_folder')" type="folder" />
</OptionGroup>
<OptionGroup :title="$t('create')">
<Option
@click.native="$createFolder"
:title="$t('create_folder')"
icon="folder-plus"
/>
</OptionGroup>
<OptionGroup :title="$t('others')">
<OptionUpload :title="$t('upload_folder')" type="folder" />
<Option
@click.stop.native="$openRemoteUploadPopup"
:title="$t('remote_upload')"
icon="remote-upload"
/>
</OptionGroup>
</PopoverItem>
</PopoverWrapper>
@@ -39,6 +39,11 @@
:title="$t('upload_folder')"
type="folder"
/>
<Option
@click.stop.native="$openRemoteUploadPopup"
:title="$t('remote_upload')"
icon="remote-upload"
/>
<Option
@click.stop.native="$createTeamFolder"
:class="{ 'is-inactive': canCreateTeamFolder }"
@@ -24,17 +24,22 @@
:action="$t('create_something')"
/>
<PopoverItem name="desktop-create" side="left">
<OptionGroup :title="$t('upload')">
<OptionGroup :title="$t('frequently_used')">
<OptionUpload :title="$t('upload_files')" type="file" />
<OptionUpload :title="$t('upload_folder')" type="folder" />
</OptionGroup>
<OptionGroup :title="$t('create')">
<Option
@click.native="$createFolder"
:title="$t('create_folder')"
icon="folder-plus"
/>
</OptionGroup>
<OptionGroup :title="$t('others')">
<OptionUpload :title="$t('upload_folder')" type="folder" />
<Option
@click.stop.native="$openRemoteUploadPopup"
:title="$t('remote_upload')"
icon="remote-upload"
/>
</OptionGroup>
</PopoverItem>
</PopoverWrapper>
@@ -3,7 +3,7 @@
<!--Menu icon-->
<div
v-if="!isVisibleNavigationBars"
@click="toggleNavigationBars"
@click.stop="toggleNavigationBars"
class="-mt-0.5 mr-2 hidden cursor-pointer p-2 lg:block"
>
<menu-icon size="17" />
@@ -119,6 +119,12 @@
class="vue-feather group-hover-text-theme"
:class="{ 'text-theme': isActive }"
/>
<link2-icon
v-if="icon === 'remote-upload'"
size="17"
class="vue-feather group-hover-text-theme"
:class="{ 'text-theme': isActive }"
/>
<users-icon
v-if="icon === 'users'"
size="17"
@@ -246,6 +252,7 @@
<script>
import AlphabetIcon from '../../Icons/AlphabetIcon'
import {
Link2Icon,
UserMinusIcon,
UserCheckIcon,
UserPlusIcon,
@@ -287,6 +294,7 @@ export default {
name: 'Option',
props: ['isHoverDisabled', 'isActive', 'title', 'arrow', 'icon'],
components: {
Link2Icon,
UserMinusIcon,
UserCheckIcon,
UserPlusIcon,
@@ -2,6 +2,7 @@
<div class="flex items-center justify-between px-6 pt-6 pb-6">
<div class="flex items-center">
<div class="mr-3">
<link2-icon v-if="icon === 'remote-upload'" size="18" class="vue-feather text-theme" />
<upload-cloud-icon v-if="icon === 'upload'" size="18" class="vue-feather text-theme" />
<corner-down-right-icon v-if="icon === 'move'" size="18" class="vue-feather text-theme" />
<share-icon v-if="icon === 'share'" size="18" class="vue-feather text-theme" />
@@ -25,6 +26,7 @@
<script>
import {
Link2Icon,
BellIcon,
UploadCloudIcon,
CreditCardIcon,
@@ -43,6 +45,7 @@ export default {
name: 'PopupHeader',
props: ['title', 'icon'],
components: {
Link2Icon,
BellIcon,
UploadCloudIcon,
CornerDownRightIcon,
@@ -0,0 +1,135 @@
<template>
<PopupWrapper name="remote-upload">
<PopupHeader :title="$t('upload_files_remotely')" icon="remote-upload" />
<PopupContent>
<ValidationObserver @submit.prevent ref="createForm" v-slot="{ invalid }" tag="form">
<ValidationProvider tag="div" mode="passive" name="Remote Links" rules="required" v-slot="{ errors }">
<AppInputText
:title="$t('remote_links')"
:description="$t('remote_links_help')"
:error="errors[0]"
:is-last="true"
>
<textarea
v-model="links"
class="focus-border-theme input-dark whitespace-nowrap"
rows="6"
:placeholder="$t('paste_remote_links_here')"
:class="{ '!border-rose-600': errors[0] }"
ref="textarea"
>
</textarea>
</AppInputText>
</ValidationProvider>
</ValidationObserver>
</PopupContent>
<PopupActions>
<ButtonBase class="w-full" @click.native="$closePopup()" button-style="secondary">
{{ $t('cancel') }}
</ButtonBase>
<ButtonBase class="w-full" @click.native="upload" button-style="theme" :loading="loading">
{{ $t('upload') }}
</ButtonBase>
</PopupActions>
</PopupWrapper>
</template>
<script>
import { ValidationProvider, ValidationObserver } from 'vee-validate/dist/vee-validate.full'
import PopupWrapper from '../Popups/Components/PopupWrapper'
import PopupContent from '../Popups/Components/PopupContent'
import PopupActions from '../Popups/Components/PopupActions'
import PopupHeader from '../Popups/Components/PopupHeader'
import AppInputText from '../Forms/Layouts/AppInputText'
import { required } from 'vee-validate/dist/rules'
import ButtonBase from '../UI/Buttons/ButtonBase'
import { events } from '../../bus'
export default {
name: 'RemoteUploadPopup',
components: {
ValidationProvider,
ValidationObserver,
required,
PopupWrapper,
PopupContent,
PopupHeader,
PopupActions,
AppInputText,
ButtonBase,
},
data() {
return {
links: undefined,
loading: false,
}
},
methods: {
async upload() {
// Validate fields
const isValid = await this.$refs.createForm.validate()
if (!isValid) return
this.loading = true
// Get route
let route = {
RequestUpload: `/api/upload-request/${this.$router.currentRoute.params.token}/upload/remote`,
Public: `/api/editor/upload/remote/${this.$router.currentRoute.params.token}`,
}[this.$router.currentRoute.name] || '/api/upload/remote'
let parentId = this.$store.getters.currentFolder
? this.$store.getters.currentFolder.data.id
: undefined
axios
.post(route, {
urls: this.links
.replace(/^(?=\n)$|^\s*|\s*$|\n\n+/gm, "")
.split(/\r?\n/),
parent_id: parentId,
})
.then(() => {
events.$emit('toaster', {
type: 'success',
message: this.$t('remote_download_processed'),
})
events.$emit('popup:close')
// Reload data
this.$getDataByLocation()
})
.catch((error) => {
if (error.response.status === 422) {
this.$refs.createForm.setErrors({
'Remote Links': error.response.data.message,
})
}
events.$emit('toaster', {
type: 'danger',
message: this.$t('popup_error.title'),
})
})
.finally(() => {
this.loading = false
})
},
},
mounted() {
events.$on('popup:open', (args) => {
if (args.name !== 'remote-upload') return
this.links = undefined
this.$nextTick(() => {
setTimeout(() => this.$refs.textarea.focus(), 100)
})
})
},
}
</script>
@@ -139,6 +139,11 @@
size="18"
class="vue-feather text-theme"
/>
<link2-icon
v-if="result.action.value === 'remote-upload'"
size="18"
class="vue-feather text-theme"
/>
<upload-cloud-icon
v-if="result.action.value === 'RecentUploads'"
size="18"
@@ -309,6 +314,7 @@ import KeyboardHints from './Components/KeyboardHints'
import axios from 'axios'
import { debounce } from 'lodash'
import {
Link2Icon,
FolderPlusIcon,
SmileIcon,
BoxIcon,
@@ -340,6 +346,7 @@ import { mapGetters } from 'vuex'
export default {
name: 'Spotlight',
components: {
Link2Icon,
FolderPlusIcon,
SmileIcon,
KeyboardHints,
@@ -598,6 +605,13 @@ export default {
value: 'create-file-request',
},
},
{
title: this.$t('remote_upload'),
action: {
type: 'function',
value: 'remote-upload',
},
},
]
let functionList = [
@@ -813,6 +827,10 @@ export default {
if (arg.action.value === 'create-file-request') {
this.$createFileRequest()
}
if (arg.action.value === 'remote-upload') {
this.$openRemoteUploadPopup()
}
}
this.exitSpotlight()
@@ -1,7 +1,7 @@
<template>
<div
v-if="toasters.length || notifications.length"
class="fixed bottom-4 right-4 left-4 z-50 sm:w-[360px] sm:left-auto lg:bottom-8 lg:right-8"
class="fixed bottom-4 right-4 left-4 z-[55] sm:w-[360px] sm:left-auto lg:bottom-8 lg:right-8"
>
<ToasterWrapper
v-for="notification in notifications"
+5 -1
View File
@@ -231,7 +231,7 @@ const FunctionHelpers = {
attempts = 0
// Set form data
formData.set('filename', item.file.name)
formData.set('name', item.file.name)
formData.set('file', chunk, source_name)
formData.set('path', item.path)
formData.set('parent_id', item.parent_id)
@@ -569,6 +569,10 @@ const FunctionHelpers = {
Vue.prototype.$changeSubscriptionOptions = function () {
events.$emit('popup:open', { name: 'change-plan-subscription' })
}
Vue.prototype.$openRemoteUploadPopup = function () {
events.$emit('popup:open', {name: 'remote-upload'})
}
},
}
+3
View File
@@ -8,6 +8,7 @@
<CreateUploadRequestPopup />
<CreateTeamFolderPopup />
<NotificationsPopup />
<RemoteUploadPopup />
<!--Mobile Navigation-->
<MobileNavigation />
@@ -86,6 +87,7 @@ import { mapGetters } from 'vuex'
import CreateUploadRequestPopup from "../components/UploadRequest/CreateUploadRequestPopup";
import CreateTeamFolderPopup from "../components/Teams/CreateTeamFolderPopup";
import NotificationsPopup from "../components/Notifications/NotificationsPopup";
import RemoteUploadPopup from "../components/RemoteUpload/RemoteUploadPopup";
export default {
name: 'Admin',
@@ -190,6 +192,7 @@ export default {
},
},
components: {
RemoteUploadPopup,
NotificationsPopup,
CreateTeamFolderPopup,
CreateUploadRequestPopup,
+5
View File
@@ -46,6 +46,11 @@
/>
</OptionGroup>
<OptionGroup :title="$t('others')">
<Option
@click.stop.native="$openRemoteUploadPopup"
:title="$t('remote_upload')"
icon="remote-upload"
/>
<Option
@click.stop.native="$createTeamFolder"
:title="$t('create_team_folder')"
+10 -4
View File
@@ -37,11 +37,8 @@
</MobileContextMenu>
<MobileCreateMenu>
<OptionGroup :title="$t('upload')">
<OptionGroup :title="$t('frequently_used')">
<OptionUpload :title="$t('upload_files')" type="file" :is-hover-disabled="true" />
<OptionUpload :title="$t('upload_folder')" type="folder" :is-hover-disabled="true" />
</OptionGroup>
<OptionGroup :title="$t('create')">
<Option
@click.stop.native="createFolder"
:title="$t('create_folder')"
@@ -49,6 +46,15 @@
:is-hover-disabled="true"
/>
</OptionGroup>
<OptionGroup :title="$t('others')">
<OptionUpload :title="$t('upload_folder')" type="folder" :is-hover-disabled="true" />
<Option
@click.stop.native="$openRemoteUploadPopup"
:title="$t('remote_upload')"
icon="remote-upload"
:is-hover-disabled="true"
/>
</OptionGroup>
</MobileCreateMenu>
<MobileMultiSelectToolbar>
@@ -21,6 +21,14 @@
:is-hover-disabled="true"
/>
</OptionGroup>
<OptionGroup :title="$t('others')">
<Option
@click.stop.native="$openRemoteUploadPopup"
:title="$t('remote_upload')"
icon="remote-upload"
:class="{'is-inactive': isTeamFolderHomepage}"
/>
</OptionGroup>
</MobileCreateMenu>
<MobileTeamContextMenu>
@@ -43,6 +43,12 @@
/>
</OptionGroup>
<OptionGroup :title="$t('others')">
<Option
@click.stop.native="$openRemoteUploadPopup"
:title="$t('remote_upload')"
icon="remote-upload"
:class="{'is-inactive': isTeamFolderHomepage}"
/>
<Option
@click.stop.native="$createTeamFolder"
:title="$t('create_team_folder')"
@@ -9,11 +9,8 @@
</MobileContextMenu>
<MobileCreateMenu>
<OptionGroup :title="$t('upload')">
<OptionGroup :title="$t('frequently_used')">
<OptionUpload :title="$t('upload_files')" type="file" :is-hover-disabled="true" />
<OptionUpload :title="$t('upload_folder')" type="folder" />
</OptionGroup>
<OptionGroup :title="$t('create')">
<Option
@click.stop.native="createFolder"
:title="$t('create_folder')"
@@ -21,6 +18,14 @@
:is-hover-disabled="true"
/>
</OptionGroup>
<OptionGroup :title="$t('others')">
<OptionUpload :title="$t('upload_folder')" type="folder" />
<Option
@click.stop.native="$openRemoteUploadPopup"
:title="$t('remote_upload')"
icon="remote-upload"
/>
</OptionGroup>
</MobileCreateMenu>
<MobileMultiSelectToolbar>
+3
View File
@@ -16,6 +16,7 @@
<CreateUploadRequestPopup />
<NotificationsPopup />
<RemoteUploadPopup />
<CreateFolderPopup />
<RenameItemPopup />
<MoveItemPopup />
@@ -79,10 +80,12 @@ import { events } from '../bus'
import { mapGetters } from 'vuex'
import CreateUploadRequestPopup from "../components/UploadRequest/CreateUploadRequestPopup";
import NotificationsPopup from "../components/Notifications/NotificationsPopup";
import RemoteUploadPopup from "../components/RemoteUpload/RemoteUploadPopup";
export default {
name: 'Platform',
components: {
RemoteUploadPopup,
NotificationsPopup,
CreateUploadRequestPopup,
CreateTeamFolderPopup,
+3
View File
@@ -8,6 +8,7 @@
<CreateUploadRequestPopup />
<CreateTeamFolderPopup />
<NotificationsPopup />
<RemoteUploadPopup />
<ConfirmPopup />
@@ -94,10 +95,12 @@ import CreateUploadRequestPopup from "../components/UploadRequest/CreateUploadRe
import CreateTeamFolderPopup from "../components/Teams/CreateTeamFolderPopup";
import ChangeSubscriptionPopup from "../components/Subscription/Popups/ChangeSubscriptionPopup";
import NotificationsPopup from "../components/Notifications/NotificationsPopup";
import RemoteUploadPopup from "../components/RemoteUpload/RemoteUploadPopup";
export default {
name: 'Settings',
components: {
RemoteUploadPopup,
NotificationsPopup,
ChangeSubscriptionPopup,
CreateTeamFolderPopup,
+3 -1
View File
@@ -7,6 +7,7 @@
<!--Popups-->
<ProcessingPopup />
<RemoteUploadPopup />
<CreateFolderPopup />
<RenameItemPopup />
<MoveItemPopup />
@@ -61,12 +62,13 @@ import DragUI from '../components/UI/Others/DragUI'
import Alert from '../components/Popups/Alert'
import { mapGetters } from 'vuex'
import { events } from '../bus'
import router from '../router'
import DesktopSharepageToolbar from '../components/Layout/Toolbars/DesktopSharepageToolbar'
import RemoteUploadPopup from "../components/RemoteUpload/RemoteUploadPopup";
export default {
name: 'Shared',
components: {
RemoteUploadPopup,
DesktopSharepageToolbar,
MobileToolbar,
InfoSidebar,
+3
View File
@@ -8,6 +8,7 @@
<!--Popups-->
<CreateFolderPopup />
<RemoteUploadPopup />
<RenameItemPopup />
<MoveItemPopup />
@@ -54,10 +55,12 @@ import Spotlight from '../components/Spotlight/Spotlight'
import DragUI from '../components/UI/Others/DragUI'
import { mapGetters } from 'vuex'
import { events } from '../bus'
import RemoteUploadPopup from "../components/RemoteUpload/RemoteUploadPopup";
export default {
name: 'UploadRequest',
components: {
RemoteUploadPopup,
DesktopUploadRequestToolbar,
MobileUploadRequestToolBar,
InfoSidebarUploadRequest,