- when member upload files or create folder in team folder, the true owner of the content is creator of team member. That means the upload bandwidth and storage go to creator responsibility

This commit is contained in:
Čarodej
2022-03-30 09:34:25 +02:00
parent 0fbb8fd8ee
commit 0ca67c2348
31 changed files with 256 additions and 396 deletions

View File

@@ -87,9 +87,9 @@
<!--Author-->
<ListInfoItem v-if="canShowAuthor" :title="$t('author')">
<div class="mt-1.5 flex items-center">
<MemberAvatar :size="32" :member="singleFile.data.relationships.owner" />
<MemberAvatar :size="32" :member="singleFile.data.relationships.creator" />
<span class="ml-3 block text-sm font-bold">
{{ singleFile.data.relationships.owner.data.attributes.name }}
{{ singleFile.data.relationships.creator.data.attributes.name }}
</span>
</div>
</ListInfoItem>
@@ -160,7 +160,7 @@ import { mapGetters } from 'vuex'
return (
this.$isThisRoute(this.$route, ['SharedWithMe', 'TeamFolders']) &&
this.clipboard[0].data.type !== 'folder' &&
this.user.data.id !== this.clipboard[0].data.relationships.owner.data.id
this.user.data.id !== this.clipboard[0].data.relationships.creator.data.id
)
},
},

View File

@@ -38,7 +38,7 @@
v-if="user && canShowAuthor"
:size="38"
:is-border="true"
:member="entry.data.relationships.owner"
:member="entry.data.relationships.creator"
class="absolute right-2 -bottom-5 z-10 z-10 scale-75 transform lg:-bottom-7 lg:scale-100"
/>
@@ -58,7 +58,7 @@
v-if="user && canShowAuthor"
:size="38"
:is-border="true"
:member="entry.data.relationships.owner"
:member="entry.data.relationships.creator"
class="absolute -right-3 -bottom-2.5 z-10 scale-75 transform lg:scale-100"
/>
@@ -200,9 +200,10 @@ export default {
},
canShowAuthor() {
return (
this.$isThisRoute(this.$route, ['SharedWithMe', 'TeamFolders']) &&
!this.isFolder &&
this.user.data.id !== this.entry.data.relationships.owner.data.id
this.$isThisRoute(this.$route, ['SharedWithMe', 'TeamFolders'])
&& !this.isFolder
&& this.entry.data.relationships.creator
&& this.user.data.id !== this.entry.data.relationships.creator.data.id
)
},
canShowLinkIcon() {

View File

@@ -18,7 +18,7 @@
v-if="user && canShowAuthor"
:size="28"
:is-border="true"
:member="entry.data.relationships.owner"
:member="entry.data.relationships.creator"
class="absolute right-1.5 -bottom-2 z-10"
/>
@@ -183,7 +183,7 @@ export default {
: this.entry.data.attributes.items
},
canShowAuthor() {
return !this.isFolder && this.user.data.id !== this.entry.data.relationships.owner.data.id
return !this.isFolder && this.entry.data.relationships.creator && this.user.data.id !== this.entry.data.relationships.creator.data.id
},
canDrag() {
return !this.isDeleted && this.$checkPermission(['master', 'editor'])

View File

@@ -7,7 +7,7 @@
v-if="user && canShowAuthor"
:size="28"
:is-border="true"
:member="item.data.relationships.owner"
:member="item.data.relationships.creator"
class="absolute right-1.5 -bottom-2 z-10"
/>
@@ -130,7 +130,7 @@ export default {
: this.item.data.attributes.items
},
canShowAuthor() {
return !this.isFolder && this.user.data.id !== this.item.data.relationships.owner.data.id
return !this.isFolder && this.user.data.id !== this.item.data.relationships.creator.data.id
},
canDrag() {
return !this.isDeleted && this.$checkPermission(['master', 'editor'])

View File

@@ -1,13 +1,13 @@
<template>
<div
:class="{
'pointer-events-none opacity-50': (disabledById && disabledById.data.id === nodes.id) || !disableId || (isRootDepth && !nodes.folders.length),
'pointer-events-none opacity-50': (disabledById && disabledById.data.id === nodes.id) || !disableId || (isRootDepth && !nodes.folders.length && nodes.location !== 'files'),
'mb-2.5': isRootDepth,
}"
>
<div
:style="indent"
class="relative relative flex cursor-pointer select-none items-center whitespace-nowrap lg:py-2 py-3.5 px-1.5 transition-all duration-150"
class="relative relative flex cursor-pointer select-none items-center whitespace-nowrap px-1.5 transition-all duration-150"
>
<!--Arrow icon-->
<span @click.stop="showTree" class="-m-2 p-2">
@@ -51,7 +51,7 @@
<!--Item label-->
<b
@click="getFolder"
class="ml-3 inline-block overflow-x-hidden text-ellipsis whitespace-nowrap text-xs font-bold transition-all duration-150"
class="lg:py-2 py-3.5 ml-3 inline-block overflow-x-hidden text-ellipsis whitespace-nowrap text-xs font-bold transition-all duration-150"
:class="{'text-theme': isSelectedItem }"
>
{{ nodes.name }}

View File

@@ -788,37 +788,36 @@ export default {
},
})
} else if (file.data.attributes.isTeamFolder) {
if (file.data.relationships.owner.data.id === this.user.data.id) {
this.$router.push({
name: 'TeamFolders',
params: { id: file.data.id },
})
} else {
this.$router.push({
name: 'SharedWithMe',
params: { id: file.data.id },
})
}
let route = file.data.relationships.user.data.id === this.user.data.id
? 'TeamFolders'
: 'SharedWithMe'
this.$router.push({
name: route,
params: { id: file.data.id },
})
} else {
this.$router.push({
name: 'Files',
params: { id: file.data.id },
})
}
} else {
// Show file
if (['video', 'audio', 'image'].includes(file.data.type) || file.data.attributes.mimetype === 'pdf') {
this.$store.commit('ADD_TO_FAST_PREVIEW', file)
events.$emit('file-preview:show')
} else {
this.$downloadFile(
file.data.attributes.file_url,
file.data.attributes.name + '.' + file.data.attributes.mimetype
)
}
}
if (file.data.type !== 'folder') {
// Show file
if (['video', 'audio', 'image'].includes(file.data.type) || file.data.attributes.mimetype === 'pdf') {
this.$store.commit('ADD_TO_FAST_PREVIEW', file)
events.$emit('file-preview:show')
} else {
this.$downloadFile(
file.data.attributes.file_url,
file.data.attributes.name + '.' + file.data.attributes.mimetype
)
}
}
this.exitSpotlight()
},
findResult: debounce(function (value) {

View File

@@ -268,7 +268,8 @@ export default {
this.$updateText(
'/user/settings',
'last_name',
this.user.data.relationships.settings.data.attributes.last_name
this.user.data.relationships.settings.data.attributes.last_name,
true
)
},
},