Skip to content

Commit

Permalink
Merge pull request #6612 from owncloud/status-indicators-followup
Browse files Browse the repository at this point in the history
[full-ci] StatusIndicators in ResourceTable Followup
  • Loading branch information
kulmann authored Mar 28, 2022
2 parents d6dd73e + ae2eb0c commit ef7a66d
Show file tree
Hide file tree
Showing 26 changed files with 203 additions and 153 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ and adjusted the design in ODS.
https://github.com/owncloud/web/issues/5976
https://github.com/owncloud/web/pull/6552
https://github.com/owncloud/owncloud-design-system/pull/2014
https://github.com/owncloud/web/pull/6583
https://github.com/owncloud/web/pull/6583
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Enhancement: Remove public links from SharedWithOthers page

We've removed links from the shared-with-others page as those belong in the `Shared via link` page (and already exist there).

https://github.com/owncloud/web/issues/5976
https://github.com/owncloud/web/pull/6612
58 changes: 0 additions & 58 deletions packages/web-app-files/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -144,61 +144,3 @@ main {
grid-area: upload;
}
</style>
<style lang="scss">
// Hide files table columns
.files-table {
.oc-table-header-cell-mdate,
.oc-table-data-cell-mdate,
.oc-table-header-cell-sdate,
.oc-table-data-cell-sdate,
.oc-table-header-cell-ddate,
.oc-table-data-cell-ddate,
.oc-table-header-cell-size,
.oc-table-data-cell-size,
.oc-table-header-cell-sharedWith,
.oc-table-data-cell-sharedWith,
.oc-table-header-cell-owner,
.oc-table-data-cell-owner,
.oc-table-header-cell-status,
.oc-table-data-cell-status {
display: none;
@media only screen and (min-width: 640px) {
display: table-cell;
}
}
.oc-table-header-cell-owner,
.oc-table-data-cell-owner {
display: none;
@media only screen and (min-width: 960px) {
display: table-cell;
}
}
&-squashed {
.oc-table-header-cell-mdate,
.oc-table-data-cell-mdate,
.oc-table-header-cell-sdate,
.oc-table-data-cell-sdate,
.oc-table-header-cell-ddate,
.oc-table-data-cell-ddate,
.oc-table-header-cell-size,
.oc-table-data-cell-size,
.oc-table-header-cell-sharedWith,
.oc-table-data-cell-sharedWith,
.oc-table-header-cell-owner,
.oc-table-data-cell-owner,
.oc-table-header-cell-status,
.oc-table-data-cell-status {
display: none;
@media only screen and (min-width: 1600px) {
display: table-cell;
}
}
}
}
</style>
6 changes: 3 additions & 3 deletions packages/web-app-files/src/components/AppBar/AppBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ export default {
return []
}
const personalRouteName = this.hasSpaces
const personalRouteTitle = this.hasSpaces
? this.$gettext('Personal')
: this.$gettext('All files')
Expand All @@ -200,7 +200,7 @@ export default {
to: '/files/trash'
},
{
text: personalRouteName,
text: personalRouteTitle,
onClick: () => bus.publish('app.files.list.load')
}
]
Expand Down Expand Up @@ -243,7 +243,7 @@ export default {
if (acc.length) {
if (this.isPersonalLocation) {
acc[0].text = personalRouteName
acc[0].text = personalRouteTitle
acc[0].to = acc[0].to + '/'
} else if (this.isSpacesProjectLocation || this.isSpacesProjectsLocation) {
acc[0] = {
Expand Down
118 changes: 100 additions & 18 deletions packages/web-app-files/src/components/FilesList/ResourceTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,16 @@
<slot name="status" :resource="item" />
</template>
<template #sharedWith="{ item }">
<oc-avatars
class="resource-table-people"
:items="item.sharedWith"
:stacked="true"
:max-displayed="3"
:is-tooltip-displayed="true"
:accessible-description="getSharedWithAvatarDescription(item)"
/>
<oc-button appearance="raw" variation="inverse" @click="openSharingSidebar(item)">
<oc-avatars
class="resource-table-people"
:items="item.sharedWith"
:stacked="true"
:max-displayed="3"
:is-tooltip-displayed="true"
:accessible-description="getSharedWithAvatarDescription(item)"
/>
</oc-button>
</template>
<template #size="{ item }">
<oc-resource-size :size="item.size || Number.NaN" />
Expand All @@ -91,7 +93,7 @@
v-text="formatDateRelative(item.mdate)"
/>
</template>
<template #shareTypes="{ item }">
<template #indicators="{ item }">
<oc-status-indicators
v-if="item.indicators.length"
:resource="item"
Expand All @@ -113,12 +115,14 @@
/>
</template>
<template #owner="{ item }">
<oc-avatars
class="resource-table-people"
:items="item.owner"
:is-tooltip-displayed="true"
:accessible-description="getOwnerAvatarDescription(item)"
/>
<oc-button appearance="raw" variation="inverse" @click="openSharingSidebar(item)">
<oc-avatars
class="resource-table-people"
:items="item.owner"
:is-tooltip-displayed="true"
:accessible-description="getOwnerAvatarDescription(item)"
/>
</oc-button>
</template>
<template #actions="{ item }">
<div class="resource-table-actions">
Expand Down Expand Up @@ -161,7 +165,7 @@
<script lang="ts">
import { DateTime } from 'luxon'
import maxSize from 'popper-max-size-modifier'
import { mapGetters } from 'vuex'
import { mapGetters, mapActions } from 'vuex'
import { EVENT_TROW_MOUNTED, EVENT_FILE_DROPPED } from '../../constants'
import { SortDir } from '../../composables'
import * as path from 'path'
Expand All @@ -170,6 +174,7 @@ import { useCapabilitySpacesEnabled } from 'web-pkg/src/composables'
import Rename from '../../mixins/actions/rename'
import { defineComponent, PropType } from '@vue/composition-api'
import { Resource } from '../../helpers/resource'
import { ShareTypes } from '../../helpers/share'
export default defineComponent({
mixins: [Rename],
Expand Down Expand Up @@ -310,6 +315,15 @@ export default defineComponent({
required: false,
default: undefined
},
/**
* Define what fields should be displayed in the table
* If null, all fields are displayed
*/
fieldsDisplayed: {
type: Array,
required: false,
default: null
},
/**
* Show that the table is sorted ascendingly/descendingly (no actual sorting takes place)
*/
Expand Down Expand Up @@ -382,7 +396,7 @@ export default defineComponent({
wrap: 'truncate'
},
{
name: 'shareTypes',
name: 'indicators',
title: this.$gettext('Shares'),
type: 'slot',
alignH: 'right',
Expand Down Expand Up @@ -444,7 +458,11 @@ export default defineComponent({
this.formatDateRelative(item.ddate) + ' (' + this.formatDate(item.ddate) + ')'
}
]
.filter((field) => Object.prototype.hasOwnProperty.call(firstResource, field.name))
.filter((field) => {
const hasField = Object.prototype.hasOwnProperty.call(firstResource, field.name)
if (!this.fieldsDisplayed) return hasField
return hasField && this.fieldsDisplayed.includes(field.name)
})
.map((field) => {
const sortField = sortFields.find((f) => f.name === field.name)
if (sortField) {
Expand Down Expand Up @@ -498,13 +516,21 @@ export default defineComponent({
}
},
methods: {
...mapActions('Files/sidebar', ['openWithPanel']),
hasRenameAction(item) {
return this.$_rename_items.filter((menuItem) => menuItem.isEnabled({ resources: [item] }))
.length
},
openRenameDialog(item) {
this.$_rename_trigger({ resources: [item] })
},
openSharingSidebar(file) {
if (file.share?.shareType === ShareTypes.link.value) {
this.openWithPanel('links-item')
return
}
this.openWithPanel('sharing-item')
},
folderLink(file) {
return this.createFolderLink(file.path, file.storageId)
},
Expand Down Expand Up @@ -702,4 +728,60 @@ export default defineComponent({
justify-content: center;
}
}
// Hide files table columns
.files-table {
.oc-table-header-cell-mdate,
.oc-table-data-cell-mdate,
.oc-table-header-cell-sdate,
.oc-table-data-cell-sdate,
.oc-table-header-cell-ddate,
.oc-table-data-cell-ddate,
.oc-table-header-cell-size,
.oc-table-data-cell-size,
.oc-table-header-cell-sharedWith,
.oc-table-data-cell-sharedWith,
.oc-table-header-cell-owner,
.oc-table-data-cell-owner,
.oc-table-header-cell-status,
.oc-table-data-cell-status {
display: none;
@media only screen and (min-width: 640px) {
display: table-cell;
}
}
.oc-table-header-cell-owner,
.oc-table-data-cell-owner {
display: none;
@media only screen and (min-width: 960px) {
display: table-cell;
}
}
&-squashed {
.oc-table-header-cell-mdate,
.oc-table-data-cell-mdate,
.oc-table-header-cell-sdate,
.oc-table-data-cell-sdate,
.oc-table-header-cell-ddate,
.oc-table-data-cell-ddate,
.oc-table-header-cell-size,
.oc-table-data-cell-size,
.oc-table-header-cell-sharedWith,
.oc-table-data-cell-sharedWith,
.oc-table-header-cell-owner,
.oc-table-data-cell-owner,
.oc-table-header-cell-status,
.oc-table-data-cell-status {
display: none;
@media only screen and (min-width: 1600px) {
display: table-cell;
}
}
}
}
</style>
1 change: 1 addition & 0 deletions packages/web-app-files/src/components/TrashBin.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
v-model="selected"
class="files-table"
:class="{ 'files-table-squashed': !sidebarClosed }"
:fields-displayed="['name', 'ddate']"
:are-paths-displayed="true"
:are-thumbnails-displayed="false"
:resources="paginatedResources"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export class FolderLoaderFavorites implements FolderLoader {
clientService: { owncloudSdk: client }
} = context

// eslint-disable-next-line @typescript-eslint/no-unused-vars
return useTask(function* (signal1, signal2) {
store.commit('Files/CLEAR_CURRENT_FILES_LIST')

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export class FolderLoaderSharedViaLink implements FolderLoader {

const hasResharing = useCapabilityFilesSharingResharing(store)

// eslint-disable-next-line @typescript-eslint/no-unused-vars
return useTask(function* (signal1, signal2) {
store.commit('Files/CLEAR_CURRENT_FILES_LIST')

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export class FolderLoaderSharedWithMe implements FolderLoader {

const hasResharing = useCapabilityFilesSharingResharing(store)

// eslint-disable-next-line @typescript-eslint/no-unused-vars
return useTask(function* (signal1, signal2) {
store.commit('Files/CLEAR_CURRENT_FILES_LIST')

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import Router from 'vue-router'
import { useTask } from 'vue-concurrency'
import { isLocationSharesActive } from '../../router'
import { aggregateResourceShares } from '../../helpers/resources'
import { ShareTypes } from '../../helpers/share'
import { useCapabilityFilesSharingResharing } from 'web-pkg/src/composables'
import { unref } from '@vue/composition-api'

Expand All @@ -19,12 +20,18 @@ export class FolderLoaderSharedWithOthers implements FolderLoader {

const hasResharing = useCapabilityFilesSharingResharing(store)

// eslint-disable-next-line @typescript-eslint/no-unused-vars
return useTask(function* (signal1, signal2) {
store.commit('Files/CLEAR_CURRENT_FILES_LIST')

const shareTypes = ShareTypes.authenticated
.filter((type) => type.value !== ShareTypes.space.value)
.map((share) => share.value)
.join(',')

let resources = yield client.requests.ocs({
service: 'apps/files_sharing',
action: '/api/v1/shares?format=json&reshares=true&include_tags=false',
action: `/api/v1/shares?format=json&reshares=true&include_tags=false&share_types=${shareTypes}`,
method: 'GET'
})

Expand Down
Loading

0 comments on commit ef7a66d

Please sign in to comment.