Skip to content
Snippets Groups Projects
Verified Commit 6318bf84 authored by Martin Weise's avatar Martin Weise
Browse files
parent 6e06a9aa
No related branches found
No related tags found
2 merge requests!422Fixed a library issue where the value could not be empty,!421Fixed a library issue where the value could not be empty
...@@ -55,7 +55,10 @@ export default { ...@@ -55,7 +55,10 @@ export default {
return this.$t(`pages.database.status.${this.mode}`) return this.$t(`pages.database.status.${this.mode}`)
}, },
hasIdentifier () { hasIdentifier () {
return this.resource.identifiers?.length > 0 if (this.resource.identifiers?.length === 0) {
return false
}
return this.resource.identifiers.filter(i => i.status === 'published').length > 0
}, },
color () { color () {
if (this.hasIdentifier) { if (this.hasIdentifier) {
......
...@@ -15,27 +15,21 @@ ...@@ -15,27 +15,21 @@
:identifier="identifier" /> :identifier="identifier" />
</v-list-item-subtitle> </v-list-item-subtitle>
<template v-slot:append> <template v-slot:append>
<v-list-item-action>
<v-tooltip <v-tooltip
v-if="identifier.status === 'published'" :text="identifier.status === 'published' ? $t('pages.identifier.pid.title') : $t('pages.identifier.draft.title')"
:text="$t('pages.identifier.pid.title')"
left> left>
<template <template
v-slot:activator="{ props }"> v-slot:activator="{ props }">
<span class="mr-2">{{ formatTimestampUTCLabel(identifier.created) }}</span>
<v-icon <v-icon
color="primary" :color="identifier.status === 'published' ? 'primary' : null"
v-bind="props">mdi-identifier</v-icon> v-bind="props">
</template> {{ identifier.status === 'published' ? 'mdi-identifier' : 'mdi-pencil-outline' }}
</v-tooltip> </v-icon>
<v-tooltip
v-else
:text="$t('pages.identifier.draft.title')"
left>
<template
v-slot:activator="{ props }">
<v-icon
v-bind="props">mdi-pencil-outline</v-icon>
</template> </template>
</v-tooltip> </v-tooltip>
</v-list-item-action>
</template> </template>
</v-list-item> </v-list-item>
</div> </div>
...@@ -102,6 +96,7 @@ export default { ...@@ -102,6 +96,7 @@ export default {
this.init() this.init()
}, },
methods: { methods: {
formatTimestampUTCLabel,
href (identifier) { href (identifier) {
if (!identifier) { if (!identifier) {
return null return null
...@@ -128,7 +123,7 @@ export default { ...@@ -128,7 +123,7 @@ export default {
return identifierService.identifierPreferEnglishTitle(identifier) return identifierService.identifierPreferEnglishTitle(identifier)
}, },
isActive (identifier) { isActive (identifier) {
if (!identifier) { if (!identifier || !this.identifier) {
return false return false
} }
return this.identifier.id === identifier.id return this.identifier.id === identifier.id
...@@ -140,7 +135,7 @@ export default { ...@@ -140,7 +135,7 @@ export default {
return identifier.status === 'published' ? 'primary' : null return identifier.status === 'published' ? 'primary' : null
}, },
init () { init () {
if (!this.identifiers) { if (!this.identifiers || !this.identifier) {
return null return null
} }
this.idx = this.identifiers.map(i => i.id).indexOf(this.identifier.id) this.idx = this.identifiers.map(i => i.id).indexOf(this.identifier.id)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment