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

Adjust recycle scroller item size #3100

Merged
merged 4 commits into from
Mar 2, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
14 changes: 7 additions & 7 deletions apps/files/src/components/Collaborators/SharedFilesList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
</sortable-column-header>
</div>
<div><!-- indicators column --></div>
<div key="shared-with-header-cell" v-if="!$_isSharedWithMe" class="uk-text-nowrap uk-text-meta uk-width-medium" translate-context="Collaborators table column" v-text="$gettext('Collaborators')" />
<div key="shared-with-header-cell" v-else class="uk-text-nowrap uk-text-meta uk-width-small" translate-context="Owner table column" v-text="$gettext('Owner')" />
<div key="shared-with-header-cell" v-if="!$_isSharedWithMe" class="uk-visible@s uk-text-nowrap uk-text-meta uk-width-medium" translate-context="Collaborators table column" v-text="$gettext('Collaborators')" />
<div key="shared-with-header-cell" v-else class="uk-visible@s uk-text-nowrap uk-text-meta uk-width-small" translate-context="Owner table column" v-text="$gettext('Owner')" />
<div
v-if="$route.name === 'files-shared-with-me'"
shrink
Expand All @@ -19,7 +19,7 @@
>
Status
</div>
<div class="uk-text-nowrap uk-text-meta uk-width-small">
<div class="uk-visible@s uk-text-nowrap uk-text-meta uk-width-small">
<sortable-column-header @click="toggleSort('shareTimeMoment')" :aria-label="$gettext('Sort files by share time')" :is-active="fileSortField == 'shareTimeMoment'" :is-desc="fileSortDirectionDesc">
<translate translate-context="Share time column in files table">Share time</translate>
</sortable-column-header>
Expand All @@ -38,7 +38,7 @@
/>
</div>
<div><!-- indicators column --></div>
<div key="shared-with-cell" v-if="!$_isSharedWithMe" class="uk-text-meta uk-text-nowrap uk-text-truncate uk-width-medium uk-flex file-row-collaborators">
<div key="shared-with-cell" v-if="!$_isSharedWithMe" class="uk-visible@s uk-text-meta uk-text-nowrap uk-text-truncate uk-width-medium uk-flex file-row-collaborators">
<span v-for="share in item.shares" :key="share.id" class="uk-margin-small-right uk-flex uk-flex-middle">
<avatar-image :key="'avatar-' + share.id" v-if="share.shareType === shareTypes.user && share.collaborator" class="uk-margin-xsmall-right" :width="24" :userid="share.collaborator.name" :userName="share.collaborator.displayName" />
<oc-icon
Expand All @@ -54,16 +54,16 @@
<translate :key="'collaborator-name-public-' + share.id" v-if="share.shareType === shareTypes.link" class="file-row-collaborator-name" translate-context="Short public link indicator">Public</translate>
</span>
</div>
<div v-else key="shared-from-cell" class="uk-text-meta uk-text-nowrap uk-text-truncate uk-width-small uk-flex uk-flex-middle file-row-collaborators">
<div v-else key="shared-from-cell" class="uk-visible@s uk-text-meta uk-text-nowrap uk-text-truncate uk-width-small uk-flex uk-flex-middle file-row-collaborators">
<avatar-image class="uk-margin-xsmall-right" :width="24" :userid="item.shareOwner.username" :userName="item.shareOwner.displayName" />
<span class="file-row-owner-name" v-text="item.shareOwner.displayName"/>
</div>
<div v-if="$route.name === 'files-shared-with-me'" class="uk-text-nowrap uk-width-small" :key="item.id + item.status">
<div v-if="$_isSharedWithMe" class="uk-text-nowrap uk-width-small" :key="item.id + item.status">
<a v-if="item.status === 1 || item.status === 2" class="file-row-share-status-action uk-text-meta" @click="pendingShareAction(item, 'POST')" v-translate>Accept</a>
<a v-if="item.status === 1" class="file-row-share-status-action uk-text-meta uk-margin-left" @click="pendingShareAction(item, 'DELETE')" v-translate>Decline</a>
<span class="uk-text-small uk-margin-left file-row-share-status-text" v-text="shareStatus(item.status)" />
</div>
<div class="uk-text-meta uk-text-nowrap uk-width-small" v-text="formDateFromNow(item.shareTime)" />
<div class="uk-visible@s uk-text-meta uk-text-nowrap uk-width-small" v-text="formDateFromNow(item.shareTime)" />
</template>
<template #noContentMessage>
<no-content-message icon="share">
Expand Down
2 changes: 1 addition & 1 deletion apps/files/src/components/FileList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<RecycleScroller
class="uk-height-1-1"
:items="fileData"
:item-size="70"
:item-size="55"
v-slot="{ item, index, active }"
v-if="fileData.length"
:key="fileData.length"
Expand Down
12 changes: 12 additions & 0 deletions changelog/unreleased/3100
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Bugfix: Fixed layout of file lists

A recent library update in ODS for the recycle scroller seem to have
changed the logic or calculation of the height.

This fix accomodates for that change and restores the row height to a
correct value.

The shared file lists are now more responsive, the collaborators/owner
and share time columns are now hidden on small screens.

https://github.com/owncloud/phoenix/pull/3100
2 changes: 2 additions & 0 deletions tests/acceptance/pageObjects/FilesPageElement/filesList.js
Original file line number Diff line number Diff line change
Expand Up @@ -594,6 +594,7 @@ module.exports = {
itemName = this.replaceChar(itemName, '"', '\\"')
}

await this.waitForElementVisible('@virtualScrollWrapper')
await this.api.executeAsync(
function (
{
Expand Down Expand Up @@ -651,6 +652,7 @@ module.exports = {
* Scroll the files list to the beginning
*/
filesListScrollToTop: async function () {
await this.waitForElementVisible('@virtualScrollWrapper')
await this.api.executeAsync(function (scrollerContainerSelector, done) {
const filesListScroll = document.querySelector(scrollerContainerSelector)
if (filesListScroll.scrollTop > 0) {
Expand Down
1 change: 1 addition & 0 deletions webpack.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ module.exports = merge(common, {
path.resolve(__dirname, '.*'),
path.resolve(__dirname, 'tests'),
path.resolve(__dirname, 'build'),
path.resolve(__dirname, 'changelog'),
path.resolve(__dirname, 'dist'),
path.resolve(__dirname, 'node_modules'),
path.resolve(__dirname, 'apps') + '/*/node_modules'
Expand Down