Browse Source

fix: made author-icon smaller and added try-catch

Signed-off-by: Eduardo Morales <emoral435@gmail.com>
tags/v29.0.0beta4
Eduardo Morales 3 months ago
parent
commit
4bfbcad4d6
1 changed files with 19 additions and 14 deletions
  1. 19
    14
      apps/files_versions/src/components/Version.vue

+ 19
- 14
apps/files_versions/src/components/Version.vue View File

--> -->
<template> <template>
<NcListItem class="version" <NcListItem class="version"
:name="versionLabel"
:force-display-actions="true" :force-display-actions="true"
:data-files-versions-version="version.fileVersion" :data-files-versions-version="version.fileVersion"
@click="click"> @click="click">
<template #name> <template #name>
<div class="version__info"> <div class="version__info">
<div v-if="versionLabel" class="version__info__label">{{ versionLabel }}</div> <div v-if="versionLabel" class="version__info__label">{{ versionLabel }}</div>
<div v-if="versionAuthor" class="version__info version__info__author">
<div>•</div>
<div>{{ versionAuthor }}</div>
<div v-if="versionAuthor" class="version__info">
<div v-if="versionLabel">•</div>
<NcAvatar class="avatar" <NcAvatar class="avatar"
:user="version.author" :user="version.author"
:size="24"
:size="16"
:disable-menu="true" :disable-menu="true"
:disable-tooltip="true" :disable-tooltip="true"
:show-user-status="false" /> :show-user-status="false" />
<div>{{ versionAuthor }}</div>
</div> </div>
</div> </div>
</template> </template>


<!-- Version file size as subline --> <!-- Version file size as subline -->
<template #subname> <template #subname>
<div class="version__info">
<div class="version__info version__info__subline">
<span :title="formattedDate">{{ version.mtime | humanDateFromNow }}</span> <span :title="formattedDate">{{ version.mtime | humanDateFromNow }}</span>
<!-- Separate dot to improve alignement --> <!-- Separate dot to improve alignement -->
<span class="version__info__size">•</span>
<span class="version__info__size">{{ version.size | humanReadableSize }}</span>
<span>•</span>
<span>{{ version.size | humanReadableSize }}</span>
</div> </div>
</template> </template>


async fetchDisplayName() { async fetchDisplayName() {
// check to make sure that we have a valid author - in case database did not migrate, null author, etc. // check to make sure that we have a valid author - in case database did not migrate, null author, etc.
if (this.version.author) { if (this.version.author) {
const { data } = await axios.get(generateOcsUrl(`/cloud/users/${this.version.author}`))
this.versionAuthor = data.ocs.data.displayname
try {
const { data } = await axios.get(generateOcsUrl(`/cloud/users/${this.version.author}`))
this.versionAuthor = data.ocs.data.displayname
} catch (e) {
// Promise got rejected - default to null author to not try to load author profile
this.versionAuthor = null
}
} }
}, },


flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
gap: 0.5rem; gap: 0.5rem;
color: var(--color-main-text);
font-weight: 500;


&__label { &__label {
font-weight: 700; font-weight: 700;
} }


&__size, &__author {
color: var(--color-text-lighter);
font-weight: 500;
}
&__subline {
color: var(--color-text-maxcontrast)
}
} }


&__image { &__image {

Loading…
Cancel
Save