clear SharedWithMe.vue view

This commit is contained in:
Čarodej
2021-10-22 08:43:19 +02:00
parent 2aac3fc966
commit 3fee035e9e
11 changed files with 148 additions and 209 deletions

View File

@@ -37,7 +37,7 @@
"/chunks/dynamic-page.js": "/chunks/dynamic-page.js?id=793cd1705c00d2a5260f",
"/chunks/email-verified.js": "/chunks/email-verified.js?id=fcd5cda7addbe97141de",
"/chunks/environment-setup.js": "/chunks/environment-setup.js?id=84fcc1064e39ac137752",
"/chunks/files.js": "/chunks/files.js?id=abc8f11fd49f9baed8a3",
"/chunks/files.js": "/chunks/files.js?id=c62c104f6c021f393db6",
"/chunks/files~chunks/my-shared-items~chunks/platform~chunks/recent-uploads~chunks/shared-with-me~chun~fd99312c.js": "/chunks/files~chunks/my-shared-items~chunks/platform~chunks/recent-uploads~chunks/shared-with-me~chun~fd99312c.js?id=42944aee3313456a7e1c",
"/chunks/files~chunks/my-shared-items~chunks/platform~chunks/recent-uploads~chunks/shared~chunks/share~c7960950.js": "/chunks/files~chunks/my-shared-items~chunks/platform~chunks/recent-uploads~chunks/shared~chunks/share~c7960950.js?id=373ceb601d388f0872d3",
"/chunks/files~chunks/my-shared-items~chunks/recent-uploads~chunks/settings-subscription~chunks/shared~f3cd1a63.js": "/chunks/files~chunks/my-shared-items~chunks/recent-uploads~chunks/settings-subscription~chunks/shared~f3cd1a63.js?id=93200e8f38e44f4b59f0",
@@ -48,7 +48,7 @@
"/chunks/homepage.js": "/chunks/homepage.js?id=60205e6b1b7f0f0fed45",
"/chunks/installation-disclaimer.js": "/chunks/installation-disclaimer.js?id=47f4044131273770fe6f",
"/chunks/invoices.js": "/chunks/invoices.js?id=a1708b83d33bf559209d",
"/chunks/my-shared-items.js": "/chunks/my-shared-items.js?id=99507ef843c5f19de140",
"/chunks/my-shared-items.js": "/chunks/my-shared-items.js?id=18464a3b578061462182",
"/chunks/not-found.js": "/chunks/not-found.js?id=65f955eb0c5a18e5e8d5",
"/chunks/page-edit.js": "/chunks/page-edit.js?id=57b0a24fb21ce4c97633",
"/chunks/pages.js": "/chunks/pages.js?id=7cdb3e136f681945d110",
@@ -58,12 +58,12 @@
"/chunks/plan-settings.js": "/chunks/plan-settings.js?id=6497bc01ac41c0caf1c8",
"/chunks/plan-subscribers.js": "/chunks/plan-subscribers.js?id=2bdbb5f9141052aaaa3d",
"/chunks/plans.js": "/chunks/plans.js?id=a3a16f546521050656fb",
"/chunks/platform.js": "/chunks/platform.js?id=ecc47ed750bef78f68e8",
"/chunks/platform.js": "/chunks/platform.js?id=07fd139d62a2c60f9468",
"/chunks/platform~chunks/shared.js": "/chunks/platform~chunks/shared.js?id=e914b8a5e845646456c3",
"/chunks/profile.js": "/chunks/profile.js?id=91ea55260c78ea4e7abd",
"/chunks/profile~chunks/settings-password.js": "/chunks/profile~chunks/settings-password.js?id=7b80324eef831d31e3e8",
"/chunks/purchase-code.js": "/chunks/purchase-code.js?id=26a3951e09a8862d8dc2",
"/chunks/recent-uploads.js": "/chunks/recent-uploads.js?id=e865c452b597d57a1125",
"/chunks/recent-uploads.js": "/chunks/recent-uploads.js?id=cbe8ed8889b36b0413f5",
"/chunks/settings.js": "/chunks/settings.js?id=544b755a565148fbd962",
"/chunks/settings-create-payment-methods.js": "/chunks/settings-create-payment-methods.js?id=b70f28e4a9695f57316d",
"/chunks/settings-invoices.js": "/chunks/settings-invoices.js?id=ca2479a6e00351ea1569",
@@ -74,7 +74,7 @@
"/chunks/settings~chunks/settings-password.js": "/chunks/settings~chunks/settings-password.js?id=9ce23d68ab14cd3672cf",
"/chunks/setup-wizard.js": "/chunks/setup-wizard.js?id=651d5accf401908724c5",
"/chunks/shared.js": "/chunks/shared.js?id=30e37fcce9200fc20803",
"/chunks/shared-with-me.js": "/chunks/shared-with-me.js?id=8e2cbd8ee04cc259c3ef",
"/chunks/shared-with-me.js": "/chunks/shared-with-me.js?id=ebc069e66d3d8fed0565",
"/chunks/shared/authenticate.js": "/chunks/shared/authenticate.js?id=ac50ab7649bad5d43867",
"/chunks/shared/files.js": "/chunks/shared/files.js?id=f7d29daa21fc7df5fb8d",
"/chunks/shared/single-file.js": "/chunks/shared/single-file.js?id=8b19e65b3ef9aaef449e",
@@ -84,8 +84,8 @@
"/chunks/stripe-credentials.js": "/chunks/stripe-credentials.js?id=3697913d3cdc50504265",
"/chunks/subscription-plans.js": "/chunks/subscription-plans.js?id=a91ef265c3d79dfdbab3",
"/chunks/subscription-service.js": "/chunks/subscription-service.js?id=b5f6869f6337e903b613",
"/chunks/team-folders.js": "/chunks/team-folders.js?id=ec35a60f7bed3e8d39f4",
"/chunks/trash.js": "/chunks/trash.js?id=cfb30fa3a052e1d93065",
"/chunks/team-folders.js": "/chunks/team-folders.js?id=13d1394db5cb442afa86",
"/chunks/trash.js": "/chunks/trash.js?id=1134b440307fbc1c7a75",
"/chunks/upgrade-billing.js": "/chunks/upgrade-billing.js?id=4a136c5652851c3cd9f1",
"/chunks/upgrade-billing~chunks/upgrade-plan.js": "/chunks/upgrade-billing~chunks/upgrade-plan.js?id=1e0bf39b6af296ea0a69",
"/chunks/upgrade-plan.js": "/chunks/upgrade-plan.js?id=b3891081d4229ebe9939",
@@ -103,5 +103,27 @@
"/vendors~chunks/admin~chunks/files~chunks/my-shared-items~chunks/platform~chunks/recent-uploads~chunk~40ccbae3.js": "/vendors~chunks/admin~chunks/files~chunks/my-shared-items~chunks/platform~chunks/recent-uploads~chunk~40ccbae3.js?id=37ce1e1ab9968c100712",
"/vendors~chunks/admin~chunks/platform~chunks/settings~chunks/shared.js": "/vendors~chunks/admin~chunks/platform~chunks/settings~chunks/shared.js?id=90d4a5c68188a1bbce59",
"/chunks/platform~chunks/shared.e201462e3461644fdd7c.hot-update.js": "/chunks/platform~chunks/shared.e201462e3461644fdd7c.hot-update.js",
"/chunks/platform~chunks/shared.7197b42fd1286b07967d.hot-update.js": "/chunks/platform~chunks/shared.7197b42fd1286b07967d.hot-update.js"
"/chunks/platform~chunks/shared.7197b42fd1286b07967d.hot-update.js": "/chunks/platform~chunks/shared.7197b42fd1286b07967d.hot-update.js",
"/chunks/platform.cf0c6b310c82cc99dc3a.hot-update.js": "/chunks/platform.cf0c6b310c82cc99dc3a.hot-update.js",
"/chunks/platform.1141ffe8812323431c50.hot-update.js": "/chunks/platform.1141ffe8812323431c50.hot-update.js",
"/js/main.518c6b52544662ec3eba.hot-update.js": "/js/main.518c6b52544662ec3eba.hot-update.js",
"/js/main.8eef457571cc48beea73.hot-update.js": "/js/main.8eef457571cc48beea73.hot-update.js",
"/js/main.75f1f494fbb587279a93.hot-update.js": "/js/main.75f1f494fbb587279a93.hot-update.js",
"/js/main.b8dd5a70cdd0dc8e72ac.hot-update.js": "/js/main.b8dd5a70cdd0dc8e72ac.hot-update.js",
"/js/main.afe309280d499efa78fd.hot-update.js": "/js/main.afe309280d499efa78fd.hot-update.js",
"/js/main.2312bb6e17df313f9f7d.hot-update.js": "/js/main.2312bb6e17df313f9f7d.hot-update.js",
"/js/main.28d827fe9cefc8a5c87a.hot-update.js": "/js/main.28d827fe9cefc8a5c87a.hot-update.js",
"/chunks/shared-with-me.c25d5dddd74bd6c2af96.hot-update.js": "/chunks/shared-with-me.c25d5dddd74bd6c2af96.hot-update.js",
"/chunks/shared-with-me.0093520109d1c24f867b.hot-update.js": "/chunks/shared-with-me.0093520109d1c24f867b.hot-update.js",
"/chunks/shared-with-me.f4f332e49c30ce69222c.hot-update.js": "/chunks/shared-with-me.f4f332e49c30ce69222c.hot-update.js",
"/chunks/shared-with-me.2a42f7656cfe7ddf28d9.hot-update.js": "/chunks/shared-with-me.2a42f7656cfe7ddf28d9.hot-update.js",
"/chunks/shared-with-me.7cafdd5a2ed404620e6f.hot-update.js": "/chunks/shared-with-me.7cafdd5a2ed404620e6f.hot-update.js",
"/chunks/shared-with-me.c9137bf6cafbdd704660.hot-update.js": "/chunks/shared-with-me.c9137bf6cafbdd704660.hot-update.js",
"/chunks/shared-with-me.bd742259f23e9f586be9.hot-update.js": "/chunks/shared-with-me.bd742259f23e9f586be9.hot-update.js",
"/chunks/shared-with-me.2d8db7fe3060430c2ae2.hot-update.js": "/chunks/shared-with-me.2d8db7fe3060430c2ae2.hot-update.js",
"/chunks/files.d31306689802015a2238.hot-update.js": "/chunks/files.d31306689802015a2238.hot-update.js",
"/chunks/my-shared-items.d31306689802015a2238.hot-update.js": "/chunks/my-shared-items.d31306689802015a2238.hot-update.js",
"/chunks/recent-uploads.d31306689802015a2238.hot-update.js": "/chunks/recent-uploads.d31306689802015a2238.hot-update.js",
"/chunks/team-folders.d31306689802015a2238.hot-update.js": "/chunks/team-folders.d31306689802015a2238.hot-update.js",
"/chunks/trash.d31306689802015a2238.hot-update.js": "/chunks/trash.d31306689802015a2238.hot-update.js"
}

View File

@@ -1,16 +1,16 @@
<template>
<transition appear name="fade">
<li class="toastr-item" :class="item.type" v-show="isActive">
<div class="toastr-content-wrapper">
<span class="toastr-icon">
<check-icon v-if="item.type == 'success'" size="22"></check-icon>
<x-icon v-if="item.type == 'danger'" size="22"></x-icon>
<li v-show="isActive" class="toaster-item" :class="item.type">
<div class="toaster-content-wrapper">
<span class="toaster-icon">
<check-icon v-if="item.type === 'success'" size="22" />
<x-icon v-if="item.type === 'danger'" size="22" />
</span>
<div class="toastr-content">
<p class="toastr-description">{{ item.message }}</p>
<div class="toaster-content">
<p class="toaster-description">{{ item.message }}</p>
</div>
</div>
<div class="progressbar">
<div :class="{'success': item.type === 'success', 'danger': item.type === 'danger'}" class="progressbar">
<span></span>
</div>
</li>
@@ -22,10 +22,12 @@
export default {
components: {
CheckIcon,
XIcon,
CheckIcon
},
props: ['item'],
props: [
'item'
],
data() {
return {
isActive: 0
@@ -34,7 +36,7 @@
created() {
this.isActive = 1
setTimeout(() => (this.isActive = 0), 5000)
setTimeout(() => (this.isActive = 0), 55000)
}
}
</script>
@@ -54,7 +56,7 @@
@include transform(translateX(100%));
}
.toastr-content-wrapper {
.toaster-content-wrapper {
display: flex;
align-items: center;
padding: 15px;
@@ -72,9 +74,16 @@
width: 0;
height: 3px;
display: block;
background: $theme;
animation: progressbar 5s linear;
}
&.success span {
background: $theme;
}
&.danger span {
background: $danger;
}
}
@keyframes progressbar {
@@ -86,7 +95,7 @@
}
}
.toastr-item {
.toaster-item {
max-width: 320px;
margin-bottom: 20px;
position: relative;
@@ -94,12 +103,12 @@
display: block;
border-radius: 8px;
.toastr-description {
.toaster-description {
@include font-size(15);
font-weight: bold;
}
.toastr-icon {
.toaster-icon {
height: 42px;
width: 42px;
display: inline-flex;
@@ -113,11 +122,11 @@
&.success {
background: $theme_light;
polyline {
line {
stroke: $theme;
}
.toastr-description {
.toaster-description {
color: $theme;
}
}
@@ -125,11 +134,11 @@
&.danger {
background: rgba($danger, 0.1);
polyline {
line {
stroke: $danger;
}
.toastr-description {
.toaster-description {
color: $danger;
}
}
@@ -137,7 +146,7 @@
@media only screen and (max-width: 690px) {
.toastr-item {
.toaster-item {
margin-bottom: 0;
margin-top: 20px;
max-width: 100%;
@@ -151,7 +160,7 @@
}
.dark-mode {
.toastr-item {
.toaster-item {
&.success, &.danger {
background: $dark_mode_foreground;

View File

@@ -1,5 +1,5 @@
<template>
<div id="toastr-wrapper">
<div id="toaster-wrapper">
<ToasterItem :item="item" v-for="(item, i) in notifications" :key="i"/>
</div>
</template>
@@ -27,22 +27,22 @@
@import '/resources/sass/vuefilemanager/_variables';
@import '/resources/sass/vuefilemanager/_mixins';
.toastr-list {
.toaster-list {
transition: all 5s ease;
display: inline-block;
}
.toastr-list-enter,
.toastr-list-leave-to {
.toaster-list-enter,
.toaster-list-leave-to {
opacity: 0;
transform: translateY(-100%);
}
.toastr-list-leave-active {
.toaster-list-leave-active {
position: absolute;
}
#toastr-wrapper {
#toaster-wrapper {
position: absolute;
right: 30px;
bottom: 30px;
@@ -51,7 +51,7 @@
@media only screen and (max-width: 690px) {
#toastr-wrapper {
#toaster-wrapper {
right: 15px;
left: 15px;
bottom: 15px;

View File

@@ -4,13 +4,13 @@
<!--Title-->
<PopupHeader :title="$t('Edit Team Folder')" icon="user-plus" />
<!--Content-->
<!--Content-->
<PopupContent>
<!--Item Thumbnail-->
<ThumbnailItem class="item-thumbnail" :item="item" info="metadata" />
<!--Form to set team folder-->
<!--Form to set team folder-->
<ValidationObserver @submit.prevent="updateTeamFolder" ref="teamFolderForm" v-slot="{ invalid }" tag="form" class="form-wrapper">
<!--Add Member-->
@@ -32,21 +32,21 @@
</PopupContent>
<!--Actions-->
<!--Actions-->
<PopupActions>
<ButtonBase
class="popup-button"
@click.native="$closePopup()"
button-style="secondary"
>{{ $t('popup_move_item.cancel') }}
class="popup-button"
@click.native="$closePopup()"
button-style="secondary"
>{{ $t('popup_move_item.cancel') }}
</ButtonBase>
<ButtonBase
class="popup-button"
@click.native="updateTeamFolder"
:button-style="isDisabledSubmit ? 'secondary' : 'theme'"
:loading="isLoading"
:disabled="isLoading || isDisabledSubmit"
>{{ $t('Update Team Folder') }}
class="popup-button"
@click.native="updateTeamFolder"
:button-style="isDisabledSubmit ? 'secondary' : 'theme'"
:loading="isLoading"
:disabled="isLoading || isDisabledSubmit"
>{{ $t('Update Team Folder') }}
</ButtonBase>
</PopupActions>
</PopupWrapper>
@@ -54,50 +54,50 @@
<script>
import {ValidationProvider, ValidationObserver} from 'vee-validate/dist/vee-validate.full'
import PopupWrapper from '/resources/js/components/Others/Popup/PopupWrapper'
import PopupActions from '/resources/js/components/Others/Popup/PopupActions'
import PopupContent from '/resources/js/components/Others/Popup/PopupContent'
import PopupHeader from '/resources/js/components/Others/Popup/PopupHeader'
import ThumbnailItem from '/resources/js/components/Others/ThumbnailItem'
import ButtonBase from '/resources/js/components/FilesView/ButtonBase'
import PopupWrapper from '/resources/js/components/Others/Popup/PopupWrapper'
import PopupActions from '/resources/js/components/Others/Popup/PopupActions'
import PopupContent from '/resources/js/components/Others/Popup/PopupContent'
import PopupHeader from '/resources/js/components/Others/Popup/PopupHeader'
import ThumbnailItem from '/resources/js/components/Others/ThumbnailItem'
import ButtonBase from '/resources/js/components/FilesView/ButtonBase'
import TeamList from "./Components/TeamList";
import {required} from 'vee-validate/dist/rules'
import {required} from 'vee-validate/dist/rules'
import InfoBox from "../Others/Forms/InfoBox";
import {events} from '/resources/js/bus'
import {events} from '/resources/js/bus'
import axios from "axios";
export default {
name: 'UpdateTeamFolderPopup',
components: {
ValidationProvider,
ValidationObserver,
export default {
name: 'UpdateTeamFolderPopup',
components: {
ValidationProvider,
ValidationObserver,
TeamList,
ThumbnailItem,
PopupWrapper,
PopupActions,
PopupContent,
PopupHeader,
ButtonBase,
required,
ThumbnailItem,
PopupWrapper,
PopupActions,
PopupContent,
PopupHeader,
ButtonBase,
required,
InfoBox,
},
computed: {
},
computed: {
isDisabledSubmit() {
return Object.values(this.members).length === 0 && Object.values(this.invitations).length === 0
}
},
data() {
return {
invitations: [],
members: [],
item: undefined,
name: undefined,
},
data() {
return {
invitations: [],
members: [],
item: undefined,
name: undefined,
email: undefined,
isLoading: false,
}
},
methods: {
async updateTeamFolder() {
}
},
methods: {
async updateTeamFolder() {
const isValid = await this.$refs.teamFolderForm.validate()
if (!isValid) return
@@ -117,7 +117,12 @@
message: this.$t('Your team folder was updated'),
})
})
.catch(() => this.$isSomethingWrong())
.catch(() => {
events.$emit('toaster', {
type: 'danger',
message: this.$t('popup_error.title'),
})
})
.finally(() => {
this.isLoading = false
this.name = undefined
@@ -126,11 +131,11 @@
this.$closePopup()
})
},
},
addMember() {
let email = this.email.match(/^[^\s@]+@[^\s@]+\.[^\s@]+$/)[0]
let email = this.email.match(/^[^\s@]+@[^\s@]+\.[^\s@]+$/)[0]
if (! email) {
if (!email) {
this.$refs.teamFolderForm.setErrors({
'Email': this.$t("You have to type valid email")
});
@@ -138,7 +143,7 @@
this.$refs.teamFolderForm.reset()
this.invitations.push({
this.invitations.push({
type: 'invitation',
email: this.email,
permission: 'can-edit',
@@ -146,10 +151,10 @@
this.email = undefined
}
},
mounted() {
events.$on('popup:open', args => {
if (args.name !== 'update-team-folder') return
},
mounted() {
events.$on('popup:open', args => {
if (args.name !== 'update-team-folder') return
this.item = args.item
@@ -178,7 +183,7 @@
this.$nextTick(() => {
this.$refs.email.focus()
})
})
})
events.$on('popup:close', () => {
setTimeout(() => {
@@ -189,15 +194,15 @@
this.members = []
}, 150)
})
}
}
}
}
</script>
<style scoped lang="scss">
@import "resources/sass/vuefilemanager/_inapp-forms.scss";
@import '/resources/sass/vuefilemanager/_forms';
@import '/resources/sass/vuefilemanager/_forms';
.item-thumbnail {
margin-bottom: 20px;
}
.item-thumbnail {
margin-bottom: 20px;
}
</style>

View File

@@ -85,7 +85,7 @@
{{ $t('actions.search') }}
</MobileActionButton>
<MobileActionButton @click.native="$showLocations" icon="filter">
{{ filterLocationTitle }}
{{ $getCurrentLocationName() }}
</MobileActionButton>
<MobileActionButton @click.native="$createItems" v-if="$checkPermission(['master', 'editor'])" icon="cloud-plus">
{{ $t('mobile.create') }}
@@ -170,15 +170,6 @@
favourites() {
return this.user.data.relationships.favourites.data
},
filterLocationTitle() {
return {
'RecentUploads': this.$t('Recent'),
'MySharedItems': this.$t('Shared'),
'Trash': this.$t('Trash'),
'Public': this.$t('Files'),
'Files': this.$t('Files'),
}[this.$route.name]
}
},
data() {
return {

View File

@@ -54,7 +54,7 @@
{{ $t('actions.search')}}
</MobileActionButton>
<MobileActionButton @click.native="$showLocations" icon="filter">
{{ filterLocationTitle }}
{{ $getCurrentLocationName() }}
</MobileActionButton>
<MobileActionButton @click.native="$enableMultiSelectMode" icon="check-square">
{{ $t('context_menu.select') }}
@@ -119,15 +119,6 @@
favourites() {
return this.user.data.relationships.favourites.data.attributes.folders
},
filterLocationTitle() {
return {
'RecentUploads': this.$t('Recent'),
'MySharedItems': this.$t('Shared'),
'Trash': this.$t('Trash'),
'Public': this.$t('Files'),
'Files': this.$t('Files'),
}[this.$route.name]
},
},
data() {
return {

View File

@@ -45,7 +45,7 @@
{{ $t('actions.search')}}
</MobileActionButton>
<MobileActionButton @click.native="$showLocations" icon="filter">
{{ filterLocationTitle }}
{{ $getCurrentLocationName() }}
</MobileActionButton>
<MobileActionButtonUpload>
{{ $t('context_menu.upload') }}
@@ -111,15 +111,6 @@
'clipboard',
'user',
]),
filterLocationTitle() {
return {
'RecentUploads': this.$t('Recent'),
'MySharedItems': this.$t('Shared'),
'Trash': this.$t('Trash'),
'Public': this.$t('Files'),
'Files': this.$t('Files'),
}[this.$route.name]
},
},
data() {
return {

View File

@@ -1,20 +1,11 @@
<template>
<div>
<MobileContextMenu>
<OptionGroup v-if="item && isFolder">
<Option @click.native="addToFavourites" :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" />
<Option @click.native="$deleteFileOrFolder(item)" :title="$t('context_menu.delete')" icon="trash" />
</OptionGroup>
<OptionGroup v-if="item">
<Option @click.native="$shareFileOrFolder(item)" :title="item.data.relationships.shared ? $t('context_menu.share_edit') : $t('context_menu.share')" icon="share" />
<Option @click.native="$updateTeamFolder(item)" v-if="isFolder" :title="$t('Convert as Team Folder')" icon="users" />
</OptionGroup>
<OptionGroup v-if="item">
<Option @click.native="$downloadSelection(item)" :title="$t('context_menu.download')" icon="download" />
</OptionGroup>
@@ -25,7 +16,6 @@
<OptionUpload :title="$t('actions.upload')" is-hover-disabled="true" />
</OptionGroup>
<OptionGroup>
<Option @click.stop.native="$createTeamFolder" :title="$t('Create Team Folder')" icon="users" is-hover-disabled="true" />
<Option @click.stop.native="createFolder" :title="$t('actions.create_folder')" icon="folder-plus" is-hover-disabled="true" />
</OptionGroup>
</MobileCreateMenu>
@@ -42,24 +32,14 @@
<OptionUpload :title="$t('actions.upload')" />
<Option @click.stop.native="$createFolder" :title="$t('actions.create_folder')" icon="folder-plus" />
</OptionGroup>
<OptionGroup v-if="isTeamFolderHomepage">
<Option @click.native="$createTeamFolder" :title="$t('Create Team Folder')" icon="users" />
</OptionGroup>
</template>
<template v-slot:single-select v-if="item">
<OptionGroup v-if="isFolder">
<Option @click.native="addToFavourites" :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="$moveFileOrFolder(item)" :title="$t('context_menu.move')" icon="move-item" />
<Option @click.native="$deleteFileOrFolder(item)" :title="$t('context_menu.delete')" icon="trash" />
</OptionGroup>
<OptionGroup>
<Option @click.native="$shareFileOrFolder(item)" :title="item.data.relationships.shared ? $t('context_menu.share_edit') : $t('context_menu.share')" icon="share" />
<Option @click.native="$updateTeamFolder(item)" v-if="isFolder" :title="$t('Edit Team Members')" icon="users" />
</OptionGroup>
<OptionGroup>
<Option @click.native="$openInDetailPanel(item)" :title="$t('context_menu.detail')" icon="detail" />
<Option @click.native="$downloadSelection(item)" :title="$t('context_menu.download')" icon="download" />
@@ -67,9 +47,6 @@
</template>
<template v-slot:multiple-select v-if="item">
<OptionGroup v-if="!hasFile">
<Option @click.native="addToFavourites" :title="isInFavourites ? $t('context_menu.remove_from_favourites') : $t('context_menu.add_to_favourites')" icon="favourites" />
</OptionGroup>
<OptionGroup>
<Option @click.native="$moveFileOrFolder(item)" :title="$t('context_menu.move')" icon="move-item" />
<Option @click.native="$deleteFileOrFolder(item)" :title="$t('context_menu.delete')" icon="trash" />
@@ -86,9 +63,9 @@
{{ $t('actions.search') }}
</MobileActionButton>
<MobileActionButton @click.native="$showLocations" icon="filter">
{{ filterLocationTitle }}
{{ $getCurrentLocationName() }}
</MobileActionButton>
<MobileActionButton @click.native="$createItems" v-if="$checkPermission(['master', 'editor'])" icon="cloud-plus">
<MobileActionButton @click.native="$createItems" icon="cloud-plus">
{{ $t('mobile.create') }}
</MobileActionButton>
<MobileActionButton @click.native="$enableMultiSelectMode" icon="check-square">
@@ -108,9 +85,6 @@
<p class="description">
{{ $t('All items that are shared with you will be visible here.') }}
</p>
<ButtonBase @click.native="$createTeamFolder" button-style="theme" class="m-center">
{{ $t('Create your Team Folder') }}
</ButtonBase>
</template>
<template v-if="! isTeamFolderHomepage">
@@ -178,24 +152,9 @@
isFolder() {
return this.item && this.item.data.type === 'folder'
},
isInFavourites() {
return this.favourites.find((el) => el.id === this.item.id)
},
hasFile() {
return this.clipboard.find(item => item.type !== 'folder')
},
favourites() {
return this.user.data.relationships.favourites.data
},
filterLocationTitle() {
return {
'RecentUploads': this.$t('Recent'),
'MySharedItems': this.$t('Shared'),
'Trash': this.$t('Trash'),
'Public': this.$t('Files'),
'Files': this.$t('Files'),
}[this.$route.name]
}
},
data() {
return {
@@ -203,22 +162,6 @@
}
},
methods: {
addToFavourites() {
// Check if folder is in favourites and then add/remove from favourites
if (this.favourites && !this.favourites.find(el => el.id === this.item.data.id)) {
// Add to favourite folder that is not selected
if (!this.clipboard.includes(this.item)) {
this.$store.dispatch('addToFavourites', this.item)
}
// Add to favourites all selected folders
if (this.clipboard.includes(this.item)) {
this.$store.dispatch('addToFavourites', null)
}
} else {
this.$store.dispatch('removeFromFavourites', this.item)
}
},
createFolder() {
events.$emit('popup:open', {name: 'create-folder'})
},

View File

@@ -86,7 +86,7 @@
{{ $t('actions.search') }}
</MobileActionButton>
<MobileActionButton @click.native="$showLocations" icon="filter">
{{ filterLocationTitle }}
{{ $getCurrentLocationName() }}
</MobileActionButton>
<MobileActionButton @click.native="$createItems" v-if="$checkPermission(['master', 'editor'])" icon="cloud-plus">
{{ $t('mobile.create') }}
@@ -187,15 +187,6 @@
favourites() {
return this.user.data.relationships.favourites.data
},
filterLocationTitle() {
return {
'RecentUploads': this.$t('Recent'),
'MySharedItems': this.$t('Shared'),
'Trash': this.$t('Trash'),
'Public': this.$t('Files'),
'Files': this.$t('Files'),
}[this.$route.name]
}
},
data() {
return {

View File

@@ -48,7 +48,7 @@
{{ $t('actions.search')}}
</MobileActionButton>
<MobileActionButton @click.native="$showLocations" icon="filter">
{{ filterLocationTitle }}
{{ $getCurrentLocationName() }}
</MobileActionButton>
<MobileActionButton @click.native="$emptyTrash" icon="trash">
{{ $t('context_menu.empty_trash') }}
@@ -103,15 +103,6 @@
...mapGetters([
'clipboard',
]),
filterLocationTitle() {
return {
'RecentUploads': this.$t('Recent'),
'MySharedItems': this.$t('Shared'),
'Trash': this.$t('Trash'),
'Public': this.$t('Files'),
'Files': this.$t('Files'),
}[this.$route.name]
},
},
data() {
return {

View File

@@ -28,9 +28,14 @@ class ShareController extends Controller
CreateShareRequest $request,
SendViaEmailAction $sendLinkToEmailAction,
): ShareResource {
$type = $request->input('type') === 'folder' ? 'folder' : 'file';
$item = get_item($request->input('id'), $type);
$this->authorize('owner', $item);
$shared = Share::create([
'password' => $request->has('password') ? bcrypt($request->input('password')) : null,
'type' => $request->input('type') === 'folder' ? 'folder' : 'file',
'type' => $type,
'is_protected' => $request->input('isPassword'),
'permission' => $request->input('permission') ?? null,
'expire_in' => $request->input('expiration') ?? null,