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] Web-648: Details sidebar for multiple selection #5630

Merged
merged 61 commits into from
Aug 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
e419320
Add details sidebar for multiple selection
lookacat Aug 6, 2021
316ccaa
Merge branch 'master' into WEB-648-details-for-multiple-selection
lookacat Aug 6, 2021
d938d95
fixed merge issues
lookacat Aug 6, 2021
c4bfb74
fixed highlightedFile issue for now, udpated package version to RC
lookacat Aug 9, 2021
488072b
hide size if no size is to display
lookacat Aug 9, 2021
6b64efc
fixed linting
lookacat Aug 9, 2021
9de2462
addressed merge request issues
lookacat Aug 9, 2021
b1a545a
fixed linting
lookacat Aug 9, 2021
35d6ff6
removed old test
lookacat Aug 9, 2021
a824f19
make sidebar closable
lookacat Aug 9, 2021
ba3c3d4
fixed showSidebar
lookacat Aug 9, 2021
810628d
removed file-info for multiple select
lookacat Aug 10, 2021
f32627c
fixed visibility observer, moved sidebar toggle logic to parent compo…
lookacat Aug 10, 2021
28a2cb6
update yarn.lock
lookacat Aug 11, 2021
fcce1e2
Fix sidebar in trashbin for multi selection
kulmann Aug 11, 2021
96a03f1
Modify selection model on quick action click
kulmann Aug 11, 2021
3cf03bb
Remove setHighlightedFile from the store
kulmann Aug 11, 2021
64ffabf
Bump ODS to v9.0.1
kulmann Aug 11, 2021
42869bd
Make linter happy
kulmann Aug 11, 2021
f020783
Fix opening sidebar in tests after click behaviour changed
kulmann Aug 12, 2021
307393b
Fix tests creating new files or folders by clearing selection first
kulmann Aug 12, 2021
39ef79d
Make linter happy
kulmann Aug 12, 2021
dc784dd
Fix helper call to clearing file selection
kulmann Aug 12, 2021
6a4f0a9
fixed share indicators
lookacat Aug 12, 2021
d339085
fixed cancel button when testing move files
lookacat Aug 12, 2021
74a2168
fixed linting
lookacat Aug 12, 2021
9f60fdc
Add details sidebar for multiple selection
lookacat Aug 6, 2021
cfb12e3
fixed merge issues
lookacat Aug 6, 2021
8a44731
fixed highlightedFile issue for now, udpated package version to RC
lookacat Aug 9, 2021
e20328d
hide size if no size is to display
lookacat Aug 9, 2021
f9bc7e5
fixed linting
lookacat Aug 9, 2021
70bf3aa
addressed merge request issues
lookacat Aug 9, 2021
d93577d
fixed linting
lookacat Aug 9, 2021
8969d3d
removed old test
lookacat Aug 9, 2021
6ac4fdb
make sidebar closable
lookacat Aug 9, 2021
d0cafed
fixed showSidebar
lookacat Aug 9, 2021
1eeccb6
removed file-info for multiple select
lookacat Aug 10, 2021
ca1d29e
fixed visibility observer, moved sidebar toggle logic to parent compo…
lookacat Aug 10, 2021
9963357
update yarn.lock
lookacat Aug 11, 2021
bfce828
Fix sidebar in trashbin for multi selection
kulmann Aug 11, 2021
6e9f422
Modify selection model on quick action click
kulmann Aug 11, 2021
6b15281
Remove setHighlightedFile from the store
kulmann Aug 11, 2021
43f848e
Bump ODS to v9.0.1
kulmann Aug 11, 2021
c5e8f5c
Make linter happy
kulmann Aug 11, 2021
31bd716
Fix opening sidebar in tests after click behaviour changed
kulmann Aug 12, 2021
656f70a
Fix tests creating new files or folders by clearing selection first
kulmann Aug 12, 2021
d394fb6
Make linter happy
kulmann Aug 12, 2021
fc08738
Fix helper call to clearing file selection
kulmann Aug 12, 2021
2677cc2
fixed share indicators
lookacat Aug 12, 2021
005733b
fixed cancel button when testing move files
lookacat Aug 12, 2021
b8dc5b5
fixed linting
lookacat Aug 12, 2021
1a3014c
fix some async/await in tests
kulmann Aug 12, 2021
767ef78
Set shorter timeout in tests
kulmann Aug 12, 2021
d64cfb6
Revert async/await when closing sidebar
kulmann Aug 12, 2021
db6b40e
Merge branch 'WEB-648-details-for-multiple-selection' of https://gith…
lookacat Aug 12, 2021
2ececa0
Add one broken sharing test to expected failures
kulmann Aug 12, 2021
03fa469
Fix waiting in modals (tests)
kulmann Aug 12, 2021
251f6e5
Don't open sidebar on selection
kulmann Aug 12, 2021
6151377
Merge branch 'WEB-648-details-for-multiple-selection' of https://gith…
lookacat Aug 12, 2021
51113e7
fixed initial sidebar open
lookacat Aug 12, 2021
40b5ed8
Remove test from expected failures
kulmann Aug 12, 2021
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Enhancement: Add multiple selection Sidebar

We've changed the sidebar so if a user selects multiple files or folders
he sees a detailed view of his selection in the sidebar.

https://github.com/owncloud/web/issues/5164
https://github.com/owncloud/web/pull/5630
40 changes: 22 additions & 18 deletions packages/web-app-files/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,18 @@
ref="filesListWrapper"
tabindex="-1"
class="files-list-wrapper uk-width-expand"
:class="{ 'uk-visible@m': _sidebarOpen }"
@dragover="$_ocApp_dragOver"
>
<app-bar id="files-app-bar" />
<progress-bar v-show="$_uploadProgressVisible" id="files-upload-progress" class="oc-p-s" />
<router-view id="files-view" />
</div>
<side-bar
v-if="_sidebarOpen"
lookacat marked this conversation as resolved.
Show resolved Hide resolved
v-if="showSidebar"
id="files-sidebar"
ref="filesSidebar"
tabindex="-1"
class="uk-width-1-1 uk-width-1-2@m uk-width-1-3@xl"
@reset="$_destroySideBar_hideDetails"
@beforeDestroy="focusSideBar"
@mounted="focusSideBar"
@fileChanged="focusSideBar"
Expand All @@ -27,19 +25,19 @@
<script>
import Mixins from './mixins'
import MixinRoutes from './mixins/routes'
import MixinDestroySideBar from './mixins/sidebar/destroySideBar'
import { mapActions, mapGetters, mapMutations } from 'vuex'
import AppBar from './components/AppBar/AppBar.vue'
import ProgressBar from './components/Upload/ProgressBar.vue'
import SideBar from './components/SideBar/SideBar.vue'
import { bus } from 'web-pkg/src/instance'

export default {
components: {
AppBar,
ProgressBar,
SideBar
},
mixins: [Mixins, MixinRoutes, MixinDestroySideBar],
mixins: [Mixins, MixinRoutes],
data() {
return {
createFolder: false,
Expand All @@ -48,36 +46,39 @@ export default {
upload: false,
fileName: '',
selected: [],
breadcrumbs: []
breadcrumbs: [],
sidebarClosed: true
}
},
computed: {
...mapGetters('Files', ['dropzone', 'highlightedFile', 'inProgress']),

_sidebarOpen() {
return this.highlightedFile !== null
},
...mapGetters('Files', ['dropzone', 'inProgress', 'selectedFiles']),

$_uploadProgressVisible() {
return this.inProgress.length > 0
},
showSidebar() {
return this.selectedFiles && this.selectedFiles.length > 0 && !this.sidebarClosed
}
},
watch: {
$route() {
this.$_destroySideBar_hideDetails()
this.resetFileSelection()
},
highlightedFile(file) {
if (file !== null) {
return
}
this.$_destroySideBar_hideDetails()
lookacat marked this conversation as resolved.
Show resolved Hide resolved
showSidebar(visible) {
if (visible) return
this.SET_APP_SIDEBAR_ACTIVE_PANEL(null)
}
},
created() {
this.$root.$on('upload-end', () => {
this.delayForScreenreader(() => this.$refs.filesListWrapper.focus())
})
bus.on('app.files.sidebar.close', () => {
this.sidebarClosed = true
})
bus.on('app.files.sidebar.show', () => {
this.sidebarClosed = false
})
},

beforeDestroy() {
Expand All @@ -87,7 +88,10 @@ export default {
methods: {
...mapActions('Files', ['dragOver', 'resetFileSelection']),
...mapActions(['showMessage']),
...mapMutations(['SET_SIDEBAR_FOOTER_CONTENT_COMPONENT']),
...mapMutations('Files', [
'SET_SIDEBAR_FOOTER_CONTENT_COMPONENT',
'SET_APP_SIDEBAR_ACTIVE_PANEL'
]),

trace() {
console.info('trace', arguments)
Expand Down
11 changes: 8 additions & 3 deletions packages/web-app-files/src/components/AppBar/AppBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,12 @@ export default {
},

methods: {
...mapActions('Files', ['updateFileProgress', 'removeFilesFromTrashbin', 'loadIndicators']),
...mapActions('Files', [
'updateFileProgress',
'removeFilesFromTrashbin',
'loadIndicators',
'setFileSelection'
]),
...mapActions(['openFile', 'showMessage', 'createModal', 'setModalInputErrorMessage']),
...mapMutations('Files', ['UPSERT_RESOURCE', 'SET_HIDDEN_FILES_VISIBILITY']),
...mapMutations(['SET_QUOTA']),
Expand Down Expand Up @@ -362,7 +367,7 @@ export default {
}

setTimeout(() => {
this.setHighlightedFile(resource)
this.setFileSelection([resource])
this.scrollToResource(resource)
})
} catch (error) {
Expand Down Expand Up @@ -451,7 +456,7 @@ export default {
}

setTimeout(() => {
this.setHighlightedFile(resource)
this.setFileSelection([resource])
this.scrollToResource(resource)
})
} catch (error) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ export default {
},

methods: {
...mapActions('Files', ['removeFilesFromTrashbin', 'resetFileSelection', 'setHighlightedFile']),
...mapActions('Files', ['removeFilesFromTrashbin', 'resetFileSelection']),
...mapActions(['showMessage']),
...mapMutations('Files', ['UPDATE_RESOURCE']),

Expand All @@ -206,7 +206,6 @@ export default {
})
}
this.resetFileSelection()
this.setHighlightedFile(null)
},

emptyTrashbin() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
>%{ amount } selected item
</translate>
<oc-button
id="files-clear-selection"
v-oc-tooltip="clearSelectionLabel"
:aria-label="clearSelectionLabel"
class="oc-ml oc-mr-xs"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
appearance="raw"
class="oc-mr-xs"
:class="`files-quick-action-${action.id}`"
@click.stop="action.handler({ item, client: $client, store: $store })"
@click="action.handler({ item, client: $client, store: $store })"
>
<oc-icon :name="action.icon" class="uk-flex" />
</oc-button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
:style="{
'background-image': $asyncComputed.preview.updating ? 'none' : `url(${preview})`
}"
class="details-preview uk-flex uk-flex-middle uk-flex-center oc-mb-m"
class="details-preview uk-flex uk-flex-middle uk-flex-center oc-mb"
data-testid="preview"
>
<oc-spinner v-if="$asyncComputed.preview.updating" />
Expand Down Expand Up @@ -34,7 +34,7 @@
</oc-button>
<p class="oc-my-rm oc-mx-s" v-text="detailSharingInformation" />
</div>
<table class="details-table" aria-label="detailsTableLabel">
<table class="details-table" :aria-label="detailsTableLabel">
<tr v-if="hasTimestamp" data-testid="timestamp">
<th scope="col" class="oc-pr-s" v-text="timestampTitle" />
<td>
Expand Down Expand Up @@ -233,7 +233,7 @@ export default {
}
},
methods: {
...mapActions('Files', ['setHighlightedFile', 'loadPreview', 'loadVersions']),
...mapActions('Files', ['loadPreview', 'loadVersions']),
...mapMutations('Files', ['SET_APP_SIDEBAR_ACTIVE_PANEL']),
expandPeoplesAccordion() {
this.SET_APP_SIDEBAR_ACTIVE_PANEL('sharing-item')
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
<template>
<div id="oc-file-details-multiple-sidebar">
<div class="files-preview oc-mb">
<div class="files-preview-body">
<oc-icon class="preview-icon" size="xxlarge" variation="passive" name="file_copy" />
<span class="preview-text" data-testid="selectedFilesText" v-text="selectedFilesString" />
</div>
</div>
<div>
<table class="details-table" :aria-label="detailsTableLabel">
<tr data-testid="filesCount">
<th scope="col" class="oc-pr-s" v-text="filesText" />
<td v-text="filesCount" />
</tr>
<tr data-testid="foldersCount">
<th scope="col" class="oc-pr-s" v-text="foldersText" />
<td v-text="foldersCount" />
</tr>
<tr v-if="showSize" data-testid="size">
<th scope="col" class="oc-pr-s" v-text="sizeText" />
<td v-text="sizeValue" />
</tr>
</table>
</div>
</div>
</template>
<script>
import Mixins from '../../../mixins'
import MixinResources from '../../../mixins/resources'
import MixinRoutes from '../../../mixins/routes'
import { mapGetters } from 'vuex'

export default {
mixins: [Mixins, MixinResources, MixinRoutes],
title: $gettext => {
return $gettext('Details')
},
computed: {
...mapGetters('Files', ['selectedFiles']),
selectedFilesCount() {
return this.selectedFiles.length
},
selectedFilesString() {
return this.$gettextInterpolate(
this.$ngettext(
'%{ itemCount } item selected',
'%{ itemCount } items selected',
this.selectedFilesCount
),
{
itemCount: this.selectedFilesCount
}
)
},
sizeValue() {
let size = 0
this.selectedFiles.forEach(i => (size += parseInt(i.size)))
return this.getResourceSize(size)
},
showSize() {
return this.getResourceSize(this.selectedFiles[0].size) !== '?'
},
sizeText() {
return this.$gettext('Size')
},
filesCount() {
return this.selectedFiles.filter(i => i.type === 'file').length
},
filesText() {
return this.$gettext('Files')
},
foldersCount() {
return this.selectedFiles.filter(i => i.type === 'folder').length
},
foldersText() {
return this.$gettext('Folders')
},
detailsTableLabel() {
return this.$gettext('Overview of the information about the selected files')
}
}
}
</script>
<style lang="scss" scoped>
.files-preview {
position: relative;
background-color: var(--oc-color-background-muted);
border: 10px solid var(--oc-color-background-muted);
height: 230px;
text-align: center;
color: var(--oc-color-swatch-passive-muted);

&-body {
margin: 0;
position: absolute;
top: 50%;
left: 50%;
-ms-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);

.preview-icon {
display: inline-block;
}
.preview-text {
display: block;
}
}
}
.details-table {
text-align: left;

tr {
height: 1.5rem;
}

th {
font-weight: 600;
}
}
</style>
Loading