Skip to content

Commit

Permalink
Fix empty indicators column when not available, add click for OcAvatars
Browse files Browse the repository at this point in the history
  • Loading branch information
lookacat committed Mar 17, 2022
1 parent 1ff7d51 commit 8af8971
Showing 1 changed file with 31 additions and 17 deletions.
48 changes: 31 additions & 17 deletions packages/web-app-files/src/components/FilesList/ResourceTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,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" @click="openSharingSidebar">
<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 @@ -80,7 +82,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 @@ -102,12 +104,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" @click="openSharingSidebar">
<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 @@ -150,7 +154,7 @@
<script>
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 Down Expand Up @@ -359,7 +363,7 @@ export default {
wrap: 'truncate'
},
{
name: 'shareTypes',
name: 'indicators',
title: this.$gettext('Shares'),
type: 'slot',
alignH: 'right',
Expand Down Expand Up @@ -422,6 +426,12 @@ export default {
}
]
.filter((field) => Object.prototype.hasOwnProperty.call(firstResource, field.name))
.filter((field) => {
if(field.name !== 'indicators') {
return true
}
return firstResource.indicators.length > 0
})
.map((field) => {
const sortField = sortFields.find((f) => f.name === field.name)
if (sortField) {
Expand Down Expand Up @@ -472,6 +482,10 @@ export default {
}
},
methods: {
...mapActions('Files/sidebar', ['openWithPanel']),
openSharingSidebar() {
this.openWithPanel('sharing-item')
},
folderLink(file) {
return this.createFolderLink(file.path, file.storageId)
},
Expand Down

0 comments on commit 8af8971

Please sign in to comment.