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

[stable27] fix: Adapt to new NcEmptyContent usage #2987

Merged
merged 1 commit into from Jun 5, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
41 changes: 27 additions & 14 deletions src/view/Office.vue
Expand Up @@ -24,23 +24,26 @@
<transition name="fade" appear>
<div class="office-viewer">
<div v-if="showLoadingIndicator"
id="office-viewer__loading-overlay"
class="office-viewer__loading-overlay"
:class="{ debug: debug }">
<NcEmptyContent v-if="!error" icon="icon-loading">
{{ t('richdocuments', 'Loading {filename} …', { filename: basename }, 1, {escape: false}) }}
<template #desc>
<button @click="close">
<NcEmptyContent v-if="!error" :title="t('richdocuments', 'Loading {filename} …', { filename: basename }, 1, {escape: false})">
<template #icon>
<NcLoadingIcon />
</template>
<template #action>
<NcButton @click="close">
{{ t('richdocuments', 'Cancel') }}
</button>
</NcButton>
</template>
</NcEmptyContent>
<NcEmptyContent v-else icon="icon-error">
{{ t('richdocuments', 'Document loading failed') }}
<template #desc>
{{ errorMessage }}<br><br>
<button @click="close">
<NcEmptyContent v-else :title="t('richdocuments', 'Document loading failed')" :description="errorMessage">
<template #icon>
<AlertOctagonOutline />
</template>
<template #action>
<NcButton @click="close">
{{ t('richdocuments', 'Close') }}
</button>
</NcButton>
</template>
</NcEmptyContent>
</div>
Expand All @@ -65,13 +68,14 @@
:style="{visibility: showIframe ? 'visible' : 'hidden' }"
:src="src" />

<ZoteroHint v-if="showZotero" @submit="reload" />
<ZoteroHint :show.sync="showZotero" @submit="reload" />
</div>
</transition>
</template>

<script>
import { NcAvatar, NcActions, NcActionButton, NcEmptyContent } from '@nextcloud/vue'
import { NcAvatar, NcButton, NcActions, NcActionButton, NcEmptyContent, NcLoadingIcon } from '@nextcloud/vue'
import AlertOctagonOutline from 'vue-material-design-icons/AlertOctagonOutline.vue'
import { loadState } from '@nextcloud/initial-state'

import ZoteroHint from '../components/Modal/ZoteroHint.vue'
Expand All @@ -97,10 +101,13 @@ const LOADING_STATE = {
export default {
name: 'Office',
components: {
AlertOctagonOutline,
NcAvatar,
NcActions,
NcActionButton,
NcButton,
NcEmptyContent,
NcLoadingIcon,
ZoteroHint,
},
props: {
Expand Down Expand Up @@ -321,6 +328,7 @@ export default {
&__loading-overlay {
border-top: 3px solid var(--color-primary-element);
position: absolute;
display: flex;
height: 100%;
width: 100%;
z-index: 1;
Expand All @@ -334,6 +342,11 @@ export default {
::v-deep .empty-content p {
text-align: center;
}

.empty-content {
align-self: center;
flex-grow: 1;
}
}

&__header {
Expand Down