Skip to content

Commit 64838eb

Browse files
committed
pkp/pkp-lib#7505 Fix UI in error cases
1 parent 238a217 commit 64838eb

File tree

1 file changed

+48
-50
lines changed

1 file changed

+48
-50
lines changed

src/pages/workflow/PublicationSectionJats.vue

Lines changed: 48 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -2,58 +2,56 @@
22
<div class="jatsPanel">
33
<slot>
44
<div v-if="hasLoadedContent" class="filePanel__ready">
5-
<div v-if="this.workingJatsProps['loadingContentError']">
6-
{{ this.workingJatsProps['loadingContentError'] }}
7-
</div>
8-
<div v-else>
9-
<div class="filePanel__header">
10-
<pkp-header>
11-
<h2>{{ title }}</h2>
12-
<template #actions>
13-
<div v-if="isDefaultContent">
14-
<pkp-button
15-
v-if="
16-
publication.status !== getConstant('STATUS_PUBLISHED') &&
17-
canEditPublication
18-
"
19-
ref="uploadXMLButton" @click="openFileBrowser"
20-
>
21-
{{ t('common.upload') }}
22-
</pkp-button>
23-
</div>
24-
<div v-else>
25-
<pkp-button
26-
v-if="
27-
publication.status !== getConstant('STATUS_PUBLISHED') &&
28-
canEditPublication
29-
"
30-
:disabled="isLoading"
31-
:isWarnable="true"
32-
@click="openDeleteModal"
33-
>
34-
{{ t('common.delete') }}
35-
</pkp-button>
36-
</div>
37-
<pkp-button ref="downloadJatsXMLButton" @click="downloadJatsXML">
38-
{{ t('common.download') }}
5+
<div class="filePanel__header">
6+
<pkp-header>
7+
<h2>{{ title }}</h2>
8+
<template #actions>
9+
<div v-if="isDefaultContent">
10+
<pkp-button
11+
v-if="
12+
publication.status !== getConstant('STATUS_PUBLISHED') &&
13+
canEditPublication
14+
"
15+
ref="uploadXMLButton" @click="openFileBrowser"
16+
>
17+
{{ t('common.upload') }}
3918
</pkp-button>
40-
</template>
41-
</pkp-header>
42-
</div>
43-
<div class="filePanel__items">
44-
<div class="filePanel__fileContent">
45-
<pre v-highlightjs="workingJatsContent"><code class="xml"></code></pre>
46-
</div>
47-
<div>
48-
<div v-if="isDefaultContent" class="filePanel__hasData">
49-
<div class="filePanel__defaultContentFooter">
50-
<span>{{ t('publication.jats.autoCreatedMessage') }}</span>
51-
</div>
5219
</div>
5320
<div v-else>
54-
<div class="filePanel__fileContentFooter">
55-
<span>{{ t('publication.jats.lastModified', {modificationDate: this.workingJatsProps.updatedAt, username: this.workingJatsProps.uploaderUserName}) }}</span>
56-
</div>
21+
<pkp-button
22+
v-if="
23+
publication.status !== getConstant('STATUS_PUBLISHED') &&
24+
canEditPublication
25+
"
26+
:disabled="isLoading"
27+
:isWarnable="true"
28+
@click="openDeleteModal"
29+
>
30+
{{ t('common.delete') }}
31+
</pkp-button>
32+
</div>
33+
<pkp-button v-if="this.workingJatsProps['loadingContentError'] == null" ref="downloadJatsXMLButton" @click="downloadJatsXML">
34+
{{ t('common.download') }}
35+
</pkp-button>
36+
</template>
37+
</pkp-header>
38+
</div>
39+
<div class="filePanel__items">
40+
<div class="filePanel__fileContent">
41+
<div v-if="this.workingJatsProps['loadingContentError']">
42+
{{ this.workingJatsProps['loadingContentError'] }}
43+
</div>
44+
<pre v-else v-highlightjs="workingJatsContent"><code class="xml"></code></pre>
45+
</div>
46+
<div v-if="this.workingJatsProps['loadingContentError'] == null">
47+
<div v-if="isDefaultContent" class="filePanel__hasData">
48+
<div class="filePanel__defaultContentFooter">
49+
<span>{{ t('publication.jats.autoCreatedMessage') }}</span>
50+
</div>
51+
</div>
52+
<div v-else>
53+
<div class="filePanel__fileContentFooter">
54+
<span>{{ t('publication.jats.lastModified', {modificationDate: this.workingJatsProps.updatedAt, username: this.workingJatsProps.uploaderUserName}) }}</span>
5755
</div>
5856
</div>
5957
</div>
@@ -297,7 +295,7 @@ export default {
297295
}
298296
299297
if (newValue != null && newValue[0] != null) {
300-
if (newValue[0].hasOwnProperty('jatsContent')) {
298+
if (newValue[0].hasOwnProperty('isDefaultContent')) {
301299
this.workingJatsProps = newValue[0];
302300
this.hasLoadedContent = true;
303301
}

0 commit comments

Comments
 (0)