-
Notifications
You must be signed in to change notification settings - Fork 156
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6609 from owncloud/space-trashbin-enhancements
Trash bin enhancements
- Loading branch information
Showing
19 changed files
with
476 additions
and
318 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
Enhancement: Trash bin breadcrumbs | ||
|
||
We've improved the trash bin in general: | ||
* Add a breadcrumb for personal trash bin | ||
* Improve the breadcrumb for spaces trash bin, also add 'Navigate to space' action to context menu | ||
* Fix wrong page title in spaces trash bin | ||
|
||
https://github.com/owncloud/web/pull/6609 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
packages/web-app-files/src/mixins/spaces/actions/navigate.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { createLocationSpaces, isLocationTrashActive } from '../../../router' | ||
|
||
export default { | ||
computed: { | ||
$_navigate_space_items() { | ||
return [ | ||
{ | ||
name: 'navigate', | ||
icon: 'layout-grid', | ||
label: () => { | ||
return this.$gettext('Navigate to space') | ||
}, | ||
handler: this.$_navigate_space_trigger, | ||
isEnabled: ({ resources }) => { | ||
if (resources.length) { | ||
return false | ||
} | ||
return isLocationTrashActive(this.$router, 'files-trash-spaces-project') | ||
}, | ||
componentType: 'oc-button', | ||
class: 'oc-files-actions-navigate-trigger' | ||
} | ||
] | ||
} | ||
}, | ||
methods: { | ||
$_navigate_space_trigger() { | ||
this.$router.push( | ||
createLocationSpaces('files-spaces-project', { | ||
params: { | ||
storageId: this.$router.currentRoute.params.storageId | ||
} | ||
}) | ||
) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
<template><Trashbin /></template> | ||
<template><trash-bin /></template> | ||
|
||
<script> | ||
import Trashbin from '../components/Trashbin.vue' | ||
import TrashBin from '../components/TrashBin.vue' | ||
export default { | ||
components: { Trashbin } | ||
components: { TrashBin } | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,44 @@ | ||
<template><Trashbin :no-content-message="$gettext('Space has no deleted files')" /></template> | ||
<template><trash-bin :no-content-message="$gettext('Space has no deleted files')" /></template> | ||
|
||
<script> | ||
import Trashbin from '../../components/Trashbin.vue' | ||
import TrashBin from '../../components/TrashBin.vue' | ||
import { useStore } from 'web-pkg/src/composables' | ||
import { ref } from '@vue/composition-api' | ||
import { clientService } from 'web-pkg/src/services' | ||
import { useTask } from 'vue-concurrency' | ||
import { buildSpace } from '../../helpers/resources' | ||
import { mapGetters } from 'vuex' | ||
export default { | ||
components: { Trashbin } | ||
components: { TrashBin }, | ||
setup() { | ||
const store = useStore() | ||
const space = ref({}) | ||
const graphClient = clientService.graphAuthenticated( | ||
store.getters.configuration.server, | ||
store.getters.getToken | ||
) | ||
const loadResourcesTask = useTask(function* (signal, ref) { | ||
const response = yield graphClient.drives.getDrive(ref.$router.currentRoute.params.storageId) | ||
const loadedSpace = response.data || {} | ||
space.value = buildSpace(loadedSpace) | ||
}) | ||
return { | ||
space, | ||
loadResourcesTask | ||
} | ||
}, | ||
computed: { | ||
...mapGetters(['configuration']) | ||
}, | ||
async mounted() { | ||
await this.loadResourcesTask.perform(this) | ||
document.title = `${this.$router.currentRoute.meta.title} - ${this.space.name} - ${this.configuration.currentTheme.general.name}` | ||
} | ||
} | ||
</script> |
Oops, something went wrong.