Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[full-ci] Init trash overview #8515

Merged
merged 39 commits into from
Mar 7, 2023
Merged
Show file tree
Hide file tree
Changes from 29 commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
e9ab07b
Init trash overview
Mar 1, 2023
d07d18a
Enhancements
Mar 1, 2023
e1109d2
Enhancements
Mar 1, 2023
45dc6c5
Enhancements
Mar 1, 2023
4b41a8d
Enhancements
Mar 1, 2023
cdccc33
Update snapshots
Mar 1, 2023
9abe4a2
Purge navigate space items
Mar 1, 2023
a80d95b
Purge navigate space items
Mar 1, 2023
392a24c
Purge navigate space trash
Mar 1, 2023
26e1406
Lint
Mar 1, 2023
cdd64f4
Navigate to personal trash if no spaces are there
Mar 1, 2023
35c3958
Navigate to personal trash if no spaces are there
Mar 1, 2023
d66f1ea
Make oc10 compatible
Mar 1, 2023
8f5d8ce
Make oc10 compatible
Mar 1, 2023
06dc230
Fix e2e open trashbin
Mar 2, 2023
47d17cd
Fix e2e open trashbin
Mar 2, 2023
df483f2
Fix e2e open trashbin
Mar 2, 2023
03b9d1b
Fix e2e open trashbin
Mar 2, 2023
7d12e30
Add changelog item
Mar 2, 2023
fdbdb27
Fix typo
Mar 2, 2023
53a2c7c
Fix space in search result
Mar 2, 2023
39116b8
Fixx left padding of icon
Mar 2, 2023
f2980d0
Add unit tests
Mar 6, 2023
2e507f7
Add unit tests
Mar 6, 2023
bd3ed5a
Replace height with min-height
Mar 6, 2023
abec1c8
Lint
Mar 6, 2023
e7b9498
React on review
Mar 6, 2023
aa20dcd
React on review 2
Mar 6, 2023
ed23892
Fix orderBy func
Mar 6, 2023
83a631c
React on review 3
Mar 6, 2023
bb453de
Rewrite tests
Mar 6, 2023
35edc81
Fix projects§
Mar 7, 2023
20650fa
refactor: use types and type guards
kulmann Mar 7, 2023
935c3f1
Fix unit tests
Mar 7, 2023
42a3f86
Lint
Mar 7, 2023
cd4c219
Update snapshots
Mar 7, 2023
2d36ab6
tests: fix unit test about trash sorting
kulmann Mar 7, 2023
19e7c51
fix: space loading task in trash and spaces overviews
kulmann Mar 7, 2023
b78b69a
fix: revert the change that spaces are not reloaded in views
kulmann Mar 7, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions changelog/unreleased/enhancement-introduce-trashbin-overview
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Enhancement: Introduce trashbin overview

We've added a trashbin overview page, where the user can see their personal trashbins but also the trashbin of
the spaces they are a member of.

https://github.com/owncloud/web/pull/8515
https://github.com/owncloud/web/issues/8517
6 changes: 5 additions & 1 deletion packages/web-app-files/src/components/AppBar/AppBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<div class="files-topbar oc-py-s">
<h1 class="oc-invisible-sr" v-text="pageTitle" />
<div
class="oc-flex"
class="oc-flex files-app-bar-controls"
:class="{
'oc-flex-between': breadcrumbs.length || hasSharesNavigation,
'oc-flex-right': !breadcrumbs.length && !hasSharesNavigation
Expand Down Expand Up @@ -211,6 +211,10 @@ export default defineComponent({
padding: 0 var(--oc-space-medium);
top: 0;

.files-app-bar-controls {
min-height: 52px;
}

.files-app-bar-actions {
align-items: center;
display: flex;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import ShowDetails from '../../mixins/actions/showDetails'
import ShowShares from '../../mixins/actions/showShares'
import SetSpaceImage from '../../mixins/spaces/actions/setImage'
import SetSpaceReadme from 'web-pkg/src/mixins/spaces/setReadme'
import SpaceNavigate from 'web-pkg/src/mixins/spaces/navigate'
import { PropType } from 'vue'
import { Resource } from 'web-client'
import { SpaceResource } from 'web-client/src/helpers'
Expand All @@ -31,8 +30,7 @@ export default {
ShowDetails,
ShowShares,
SetSpaceImage,
SetSpaceReadme,
SpaceNavigate
SetSpaceReadme
],

props: {
Expand Down Expand Up @@ -141,8 +139,7 @@ export default {
...this.$_acceptShare_items,
...this.$_declineShare_items,
...this.$_setSpaceImage_items,
...this.$_setSpaceReadme_items,
...this.$_navigate_space_items
...this.$_setSpaceReadme_items
].filter((item) => item.isEnabled(this.filterParams))
},

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
import ActionMenuItem from 'web-pkg/src/components/ContextActions/ActionMenuItem.vue'
import Rename from 'web-pkg/src/mixins/spaces/rename'
import Delete from 'web-pkg/src/mixins/spaces/delete'
import DeletedFiles from 'web-pkg/src/mixins/spaces/deletedFiles'
import Disable from 'web-pkg/src/mixins/spaces/disable'
import Restore from 'web-pkg/src/mixins/spaces/restore'
import EditDescription from 'web-pkg/src/mixins/spaces/editDescription'
Expand All @@ -57,7 +56,6 @@ export default defineComponent({
mixins: [
Rename,
Delete,
DeletedFiles,
EditDescription,
EditReadmeContent,
Disable,
Expand Down Expand Up @@ -85,7 +83,6 @@ export default defineComponent({
...this.$_uploadImage_items,
...this.$_editReadmeContent_items,
...this.$_editQuota_items,
...this.$_deletedFiles_items,
...this.$_restore_items,
...this.$_delete_items,
...this.$_disable_items
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ import Restore from 'web-pkg/src/mixins/spaces/restore'
import ShowDetails from '../../mixins/actions/showDetails'
import EditDescription from 'web-pkg/src/mixins/spaces/editDescription'
import EditQuota from 'web-pkg/src/mixins/spaces/editQuota'
import DeletedFiles from 'web-pkg/src/mixins/spaces/deletedFiles'
import Disable from 'web-pkg/src/mixins/spaces/disable'
import ShowMembers from 'web-pkg/src/mixins/spaces/showMembers'
import UploadImage from '../../mixins/spaces/actions/uploadImage'
Expand All @@ -55,7 +54,6 @@ export default defineComponent({
Delete,
EditDescription,
EditQuota,
DeletedFiles,
Disable,
ShowDetails,
ShowMembers,
Expand Down Expand Up @@ -110,12 +108,6 @@ export default defineComponent({
items: this.menuItemsSecondaryActions
})
}
if (this.menuItemsTrashBin.length) {
sections.push({
name: 'trashBin',
items: this.menuItemsTrashBin
})
}
if (this.menuItemsSidebar.length) {
sections.push({
name: 'sidebar',
Expand Down Expand Up @@ -156,10 +148,6 @@ export default defineComponent({

return [...fileHandlers].filter((item) => item.isEnabled(this.filterParams))
},
menuItemsTrashBin() {
const fileHandlers = [...this.$_deletedFiles_items]
return [...fileHandlers].filter((item) => item.isEnabled(this.filterParams))
},
menuItemsSidebar() {
const fileHandlers = [...this.$_showDetails_items]
return [...fileHandlers].filter((item) => item.isEnabled(this.filterParams))
Expand Down
7 changes: 6 additions & 1 deletion packages/web-app-files/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import SharedWithOthers from './views/shares/SharedWithOthers.vue'
import SharedViaLink from './views/shares/SharedViaLink.vue'
import SpaceDriveResolver from './views/spaces/DriveResolver.vue'
import SpaceProjects from './views/spaces/Projects.vue'
import TrashOverview from './views/trash/Overview.vue'
import translations from '../l10n/translations.json'
import quickActions from './quickActions'
import store from './store'
Expand Down Expand Up @@ -78,8 +79,9 @@ const navItems = [
name: $gettext('Deleted files'),
icon: 'delete-bin-5',
route: {
path: `/${appInfo.id}/trash`
path: `/${appInfo.id}/trash/overview`
},
activeFor: [{ path: `/${appInfo.id}/trash` }],
enabled(capabilities) {
return capabilities.dav && capabilities.dav.trashbin === '1.0'
}
Expand All @@ -102,6 +104,9 @@ export default {
Spaces: {
DriveResolver: SpaceDriveResolver,
Projects: SpaceProjects
},
Trash: {
Overview: TrashOverview
}
}),
navItems,
Expand Down
3 changes: 3 additions & 0 deletions packages/web-app-files/src/router/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,7 @@ export interface RouteComponents {
DriveResolver: Component
Projects: Component
}
Trash: {
Overview: Component
}
}
20 changes: 17 additions & 3 deletions packages/web-app-files/src/router/trash.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,35 @@
import { RouteComponents } from './router'
import { RouteLocationNamedRaw, RouteRecordRaw } from 'vue-router'
import { createLocation, isLocationActiveDirector } from './utils'
import { $gettext, createLocation, isLocationActiveDirector } from './utils'

type trashTypes = 'files-trash-generic'
type trashTypes = 'files-trash-generic' | 'files-trash-overview'

export const createLocationTrash = (name: trashTypes, location = {}): RouteLocationNamedRaw =>
createLocation(name, location)

export const locationTrashGeneric = createLocationTrash('files-trash-generic')

export const isLocationTrashActive = isLocationActiveDirector<trashTypes>(locationTrashGeneric)
export const locationTrashOverview = createLocationTrash('files-trash-overview')

export const isLocationTrashActive = isLocationActiveDirector<trashTypes>(
locationTrashGeneric,
locationTrashOverview
)

export const buildRoutes = (components: RouteComponents): RouteRecordRaw[] => [
{
path: '/trash',
component: components.App,
children: [
{
path: 'overview',
name: locationTrashOverview.name,
component: components.Trash.Overview,
meta: {
authContext: 'user',
title: $gettext('Trash overview')
}
},
{
name: locationTrashGeneric.name,
path: ':driveAliasAndItem(.*)?',
Expand Down
5 changes: 1 addition & 4 deletions packages/web-app-files/src/views/spaces/GenericTrash.vue
Original file line number Diff line number Diff line change
Expand Up @@ -167,19 +167,16 @@ export default defineComponent({
},

breadcrumbs() {
let allowContextActions = true
let currentNodeName = this.space?.name
if (this.space.driveType === 'personal') {
currentNodeName = this.hasShareJail ? this.$gettext('Personal') : this.$gettext('All files')
allowContextActions = false
}
return [
{
text: this.$gettext('Deleted files'),
to: createLocationTrash('files-trash-generic') // FIXME: UX of clicking `Deleted files` and being redirected to personal trash is wrong.
to: createLocationTrash('files-trash-overview') // FIXME: UX of clicking `Deleted files` and being redirected to personal trash is wrong.
AlexAndBear marked this conversation as resolved.
Show resolved Hide resolved
},
{
allowContextActions,
text: currentNodeName,
onClick: () => eventBus.publish('app.files.list.load')
}
Expand Down
10 changes: 2 additions & 8 deletions packages/web-app-files/src/views/spaces/Projects.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<create-space v-if="hasCreatePermission" />
</template>
</app-bar>
<app-loading-spinner v-if="areResourcesLoading" />
<app-loading-spinner v-if="loadResourcesTask.isRunning" />
<template v-else>
<no-content-message
v-if="!spaces.length"
Expand Down Expand Up @@ -136,10 +136,6 @@ export default defineComponent({
store.commit('Files/LOAD_FILES', { currentFolder: null, files: unref(spaces) })
})

const areResourcesLoading = computed(() => {
return loadResourcesTask.isRunning || !loadResourcesTask.last
})

const hasCreatePermission = computed(() => can('create-all', 'Space'))
const viewModes = computed(() => [ViewModeConstants.tilesView])

Expand All @@ -149,8 +145,7 @@ export default defineComponent({
spaces,
graphClient,
loadResourcesTask,
areResourcesLoading,
accessToken,
accessToken,
AlexAndBear marked this conversation as resolved.
Show resolved Hide resolved
selectedResourcesIds,
handleSort,
sortBy,
Expand Down Expand Up @@ -227,7 +222,6 @@ export default defineComponent({
}
},
async created() {
await this.loadResourcesTask.perform()
AlexAndBear marked this conversation as resolved.
Show resolved Hide resolved
this.scrollToResourceFromRoute(this.spaces)
},
methods: {
Expand Down
Loading