- mark folder as team folder after folder was created

- show members in spotlight search
This commit is contained in:
Čarodej
2021-11-04 09:14:12 +01:00
parent 5a9f2985c9
commit aec5b98313
15 changed files with 121 additions and 40 deletions

View File

@@ -24,7 +24,7 @@
v-if="user && canShowAuthor"
:size="38"
:is-border="true"
:member="entry.data.relationships.user"
:member="entry.data.relationships.owner"
class="absolute lg:-bottom-7 right-2 -bottom-5 z-10 transform lg:scale-100 scale-75 z-10"
/>
@@ -39,7 +39,7 @@
v-if="user && canShowAuthor"
:size="38"
:is-border="true"
:member="entry.data.relationships.user"
:member="entry.data.relationships.owner"
class="absolute -right-3 -bottom-2.5 transform lg:scale-100 scale-75 z-10"
/>
@@ -160,7 +160,7 @@
canShowAuthor() {
return this.$isThisRoute(this.$route, ['SharedWithMe', 'TeamFolders'])
&& !this.isFolder
&& this.user.data.id !== this.entry.data.relationships.user.data.id
&& this.user.data.id !== this.entry.data.relationships.owner.data.id
},
canDrag() {
return !this.isDeleted && this.$checkPermission(['master', 'editor'])

View File

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

View File

@@ -77,6 +77,7 @@ import ItemList from "../FilesView/ItemList"
import {events} from '/resources/js/bus'
import {debounce} from 'lodash';
import axios from "axios";
import {mapGetters} from "vuex";
export default {
name: 'Spotlight',
@@ -87,6 +88,9 @@ export default {
XIcon,
},
computed: {
...mapGetters([
'user'
]),
metaKeyIcon() {
return this.$isApple() ? '⌘' : 'alt'
},
@@ -135,7 +139,17 @@ export default {
// Show folder
if (file.data.type === 'folder') {
this.$router.push({name: 'Files', params: {id: file.data.id}})
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}})
}
} else {
this.$router.push({name: 'Files', params: {id: file.data.id}})
}
} else {
// Show file

View File

@@ -201,6 +201,7 @@
},
},
created() {
this.$store.commit('SET_CURRENT_TEAM_FOLDER', undefined)
this.$store.dispatch('getSharedWithMeFolder', this.$route.params.id)
events.$on('context-menu:show', (event, item) => this.item = item)