mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-05-16 10:15:02 +00:00
- ability leave team folder
- refactoring
This commit is contained in:
@@ -61,10 +61,15 @@
|
||||
<TeamMembersButton @click.stop.native="showTeamFolderMenu" class="team-preview" />
|
||||
<PopoverItem name="team-folder" side="left">
|
||||
<TeamFolderPreview />
|
||||
|
||||
<OptionGroup v-if="$isThisRoute($route, ['TeamFolders'])">
|
||||
<Option @click.native="$updateTeamFolder(teamFolder)" :title="$t('Edit Members')" icon="rename" />
|
||||
<Option @click.native="$dissolveTeamFolder(teamFolder)" :title="$t('Dissolve Team')" icon="trash" />
|
||||
</OptionGroup>
|
||||
|
||||
<OptionGroup v-if="$isThisRoute($route, ['SharedWithMe'])">
|
||||
<Option @click.native="$detachMeFromTeamFolder(teamFolder)" :title="$t('Leave the Team Folder')" icon="user-minus" />
|
||||
</OptionGroup>
|
||||
</PopoverItem>
|
||||
</PopoverWrapper>
|
||||
|
||||
|
||||
@@ -16,12 +16,6 @@
|
||||
:style="{fill: color}"
|
||||
style="width: 53px; height: 52px"
|
||||
/>
|
||||
<!-- <FontAwesomeIcon
|
||||
v-if="!emoji"
|
||||
:class="[{'is-deleted':isDeleted},{'is-team':item.data.attributes.isTeamFolder},{'default-color': ! color && ! isDeleted}, 'folder-icon' ]"
|
||||
:style="{fill: color}"
|
||||
icon="folder"
|
||||
/>-->
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
<users-icon v-if="icon === 'users'" size="17" class="group-hover-text-theme" :class="{'text-theme': isActive}"/>
|
||||
<user-icon v-if="icon === 'user'" size="17" class="group-hover-text-theme" :class="{'text-theme': isActive}"/>
|
||||
<user-plus-icon v-if="icon === 'user-plus'" size="17" class="group-hover-text-theme" :class="{'text-theme': isActive}"/>
|
||||
<user-minus-icon v-if="icon === 'user-minus'" size="17" class="group-hover-text-theme" :class="{'text-theme': isActive}"/>
|
||||
<user-check-icon v-if="icon === 'user-check'" size="17" class="group-hover-text-theme" :class="{'text-theme': isActive}"/>
|
||||
<settings-icon v-if="icon === 'settings'" size="17" class="group-hover-text-theme" :class="{'text-theme': isActive}"/>
|
||||
<power-icon v-if="icon === 'power'" size="17" class="group-hover-text-theme" :class="{'text-theme': isActive}"/>
|
||||
@@ -50,6 +51,7 @@
|
||||
<script>
|
||||
import AlphabetIcon from '/resources/js/components/FilesView/Icons/AlphabetIcon'
|
||||
import {
|
||||
UserMinusIcon,
|
||||
UserCheckIcon,
|
||||
UserPlusIcon,
|
||||
ArrowUpIcon,
|
||||
@@ -96,6 +98,7 @@ import {
|
||||
'icon'
|
||||
],
|
||||
components: {
|
||||
UserMinusIcon,
|
||||
UserCheckIcon,
|
||||
UserPlusIcon,
|
||||
ArrowUpIcon,
|
||||
|
||||
@@ -122,7 +122,7 @@
|
||||
&.success {
|
||||
background: $theme_light;
|
||||
|
||||
line {
|
||||
line, polyline {
|
||||
stroke: $theme;
|
||||
}
|
||||
|
||||
@@ -134,7 +134,7 @@
|
||||
&.danger {
|
||||
background: rgba($danger, 0.1);
|
||||
|
||||
line {
|
||||
line, polyline {
|
||||
stroke: $danger;
|
||||
}
|
||||
|
||||
|
||||
@@ -121,7 +121,7 @@
|
||||
|
||||
let route = this.name
|
||||
? `/api/teams/folders`
|
||||
: `/api/teams/convert/${this.item.data.id}`
|
||||
: `/api/teams/folders/${this.item.data.id}/convert`
|
||||
|
||||
let payload = this.name
|
||||
? {
|
||||
|
||||
Vendored
+11
@@ -45,6 +45,17 @@ const itemHelpers = {
|
||||
})
|
||||
},
|
||||
|
||||
Vue.prototype.$detachMeFromTeamFolder = function (folder) {
|
||||
events.$emit('confirm:open', {
|
||||
title: this.$t('Are you sure you want to leave this team?'),
|
||||
message: this.$t('You will not have access to the files in this team folder.'),
|
||||
action: {
|
||||
id: folder.data.id,
|
||||
operation: 'leave-team-folder',
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
Vue.prototype.$createTeamFolder = function () {
|
||||
events.$emit('popup:open', {name: 'create-team-folder'})
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -92,7 +92,7 @@ const actions = {
|
||||
getTeamFolderTree: ({commit, getters}) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
axios
|
||||
.get(`/api/teams/tree/${getters.currentTeamFolder.data.id}${getters.sorting.URI}`)
|
||||
.get(`/api/teams/folders/${getters.currentTeamFolder.data.id}/tree${getters.sorting.URI}`)
|
||||
.then(response => {
|
||||
resolve(response)
|
||||
|
||||
|
||||
@@ -301,7 +301,7 @@
|
||||
this.$store.commit('SET_AUTHORIZED', true)
|
||||
|
||||
// Go to files page
|
||||
this.$router.push({name: 'Files'})
|
||||
this.proceedToAccount()
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
@@ -336,7 +336,7 @@
|
||||
this.$store.commit('SET_AUTHORIZED', true)
|
||||
|
||||
// Go to files page
|
||||
this.$router.push({name: 'Files'})
|
||||
this.proceedToAccount()
|
||||
})
|
||||
.catch(error => {
|
||||
|
||||
@@ -368,6 +368,13 @@
|
||||
}
|
||||
|
||||
},
|
||||
proceedToAccount() {
|
||||
if (this.$route.query.redirect) {
|
||||
this.$router.push(this.$route.query.redirect)
|
||||
} else {
|
||||
this.$router.push({name: 'Files'})
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.$scrollTop()
|
||||
@@ -377,6 +384,10 @@
|
||||
this.loginEmail = 'howdy@hi5ve.digital'
|
||||
this.loginPassword = 'vuefilemanager'
|
||||
//}
|
||||
|
||||
console.log(
|
||||
|
||||
);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -191,6 +191,22 @@
|
||||
events.$on('context-menu:show', (event, item) => this.item = item)
|
||||
events.$on('mobile-context-menu:show', item => this.item = item)
|
||||
events.$on('context-menu:current-folder', folder => this.item = folder)
|
||||
|
||||
events.$on('action:confirmed', data => {
|
||||
|
||||
// Leave team folder after popup confirmation
|
||||
if (data.operation === 'leave-team-folder')
|
||||
axios.delete(`/api/teams/folders/${data.id}/leave`)
|
||||
.then(() => {
|
||||
this.$router.push({name: 'SharedWithMe'})
|
||||
|
||||
events.$emit('toaster', {
|
||||
type: 'success',
|
||||
message: this.$t('You have successfully left the team folder'),
|
||||
})
|
||||
})
|
||||
.catch(() => this.$isSomethingWrong())
|
||||
})
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user