Display user-status in sharing list

Signed-off-by: Georg Ehrke <developer@georgehrke.com>
This commit is contained in:
Georg Ehrke 2020-08-14 17:03:57 +02:00 committed by John Molakvoæ (skjnldsv)
parent 5b26487f14
commit 4485cb30a1
No known key found for this signature in database
GPG Key ID: 60C25B8C072916CF
5 changed files with 22 additions and 2 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -29,6 +29,10 @@
:url="share.shareWithAvatar" />
<div v-tooltip.auto="tooltip" class="sharing-entry__desc">
<h5>{{ title }}</h5>
<p v-if="hasStatus">
<span>{{ share.status.icon || '' }}</span>
<span>{{ share.status.message || '' }}</span>
</p>
</div>
<Actions
menu-align="right"
@ -342,6 +346,17 @@ export default {
&& moment().add(1 + this.config.defaultInternalExpireDate, 'days')
},
/**
* @returns {bool}
*/
hasStatus() {
if (this.share.type !== this.SHARE_TYPES.SHARE_TYPE_USER) {
return false
}
return (typeof this.share.status === 'object' && !Array.isArray(this.share.status))
},
},
methods: {

View File

@ -528,4 +528,8 @@ export default class Share {
return this.#share.item_source
}
get status() {
return this.#share.status
}
}

View File

@ -286,6 +286,7 @@ export default {
this.linkShares = shares.filter(share => share.type === this.SHARE_TYPES.SHARE_TYPE_LINK || share.type === this.SHARE_TYPES.SHARE_TYPE_EMAIL)
this.shares = shares.filter(share => share.type !== this.SHARE_TYPES.SHARE_TYPE_LINK && share.type !== this.SHARE_TYPES.SHARE_TYPE_EMAIL)
console.debug('Processed', this.linkShares.length, 'link share(s)')
console.debug('Processed', this.shares.length, 'share(s)')
}