Skip to content

Commit

Permalink
pkp/pkp-lib#7505 Fix UI in error cases
Browse files Browse the repository at this point in the history
  • Loading branch information
defstat committed Dec 18, 2023
1 parent 863245f commit 989dbe3
Showing 1 changed file with 48 additions and 50 deletions.
98 changes: 48 additions & 50 deletions src/pages/workflow/PublicationSectionJats.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,58 +2,56 @@
<div class="jatsPanel">
<slot>
<div v-if="hasLoadedContent" class="filePanel__ready">
<div v-if="this.workingJatsProps['loadingContentError']">
{{ this.workingJatsProps['loadingContentError'] }}
</div>
<div v-else>
<div class="filePanel__header">
<pkp-header>
<h2>{{ title }}</h2>
<template #actions>
<div v-if="isDefaultContent">
<pkp-button
v-if="
publication.status !== getConstant('STATUS_PUBLISHED') &&
canEditPublication
"
ref="uploadXMLButton" @click="openFileBrowser"
>
{{ t('common.upload') }}
</pkp-button>
</div>
<div v-else>
<pkp-button
v-if="
publication.status !== getConstant('STATUS_PUBLISHED') &&
canEditPublication
"
:disabled="isLoading"
:isWarnable="true"
@click="openDeleteModal"
>
{{ t('common.delete') }}
</pkp-button>
</div>
<pkp-button ref="downloadJatsXMLButton" @click="downloadJatsXML">
{{ t('common.download') }}
<div class="filePanel__header">
<pkp-header>
<h2>{{ title }}</h2>
<template #actions>
<div v-if="isDefaultContent">
<pkp-button
v-if="
publication.status !== getConstant('STATUS_PUBLISHED') &&
canEditPublication
"
ref="uploadXMLButton" @click="openFileBrowser"
>
{{ t('common.upload') }}
</pkp-button>
</template>
</pkp-header>
</div>
<div class="filePanel__items">
<div class="filePanel__fileContent">
<pre v-highlightjs="workingJatsContent"><code class="xml"></code></pre>
</div>
<div>
<div v-if="isDefaultContent" class="filePanel__hasData">
<div class="filePanel__defaultContentFooter">
<span>{{ t('publication.jats.autoCreatedMessage') }}</span>
</div>
</div>
<div v-else>
<div class="filePanel__fileContentFooter">
<span>{{ t('publication.jats.lastModified', {modificationDate: this.workingJatsProps.updatedAt, username: this.workingJatsProps.uploaderUserName}) }}</span>
</div>
<pkp-button
v-if="
publication.status !== getConstant('STATUS_PUBLISHED') &&
canEditPublication
"
:disabled="isLoading"
:isWarnable="true"
@click="openDeleteModal"
>
{{ t('common.delete') }}
</pkp-button>
</div>
<pkp-button v-if="this.workingJatsProps['loadingContentError'] == null" ref="downloadJatsXMLButton" @click="downloadJatsXML">
{{ t('common.download') }}
</pkp-button>
</template>
</pkp-header>
</div>
<div class="filePanel__items">
<div class="filePanel__fileContent">
<div v-if="this.workingJatsProps['loadingContentError']">
{{ this.workingJatsProps['loadingContentError'] }}
</div>
<pre v-else v-highlightjs="workingJatsContent"><code class="xml"></code></pre>
</div>
<div v-if="this.workingJatsProps['loadingContentError'] == null">
<div v-if="isDefaultContent" class="filePanel__hasData">
<div class="filePanel__defaultContentFooter">
<span>{{ t('publication.jats.autoCreatedMessage') }}</span>
</div>
</div>
<div v-else>
<div class="filePanel__fileContentFooter">
<span>{{ t('publication.jats.lastModified', {modificationDate: this.workingJatsProps.updatedAt, username: this.workingJatsProps.uploaderUserName}) }}</span>
</div>
</div>
</div>
Expand Down Expand Up @@ -297,7 +295,7 @@ export default {
}
if (newValue != null && newValue[0] != null) {
if (newValue[0].hasOwnProperty('jatsContent')) {
if (newValue[0].hasOwnProperty('isDefaultContent')) {
this.workingJatsProps = newValue[0];
this.hasLoadedContent = true;
}
Expand Down

0 comments on commit 989dbe3

Please sign in to comment.