mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-12-09 21:56:32 +08:00
Change the draft version to be the next one after the latest published [SCI-8237]
This commit is contained in:
parent
0efeb1d4cb
commit
0b76acbede
3 changed files with 6 additions and 6 deletions
|
|
@ -5,7 +5,7 @@
|
|||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">
|
||||
{{ i18n.t('protocols.publish_modal.title', { nr: this.protocol.attributes.version })}}
|
||||
{{ i18n.t('protocols.publish_modal.title', { nr: protocol.attributes.version + 1 })}}
|
||||
</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
|
|
|
|||
|
|
@ -109,11 +109,11 @@
|
|||
return version;
|
||||
}
|
||||
|
||||
if (version > 1) {
|
||||
return this.i18n.t('protocols.header.draft_with_from_version', {nr: version});
|
||||
if (version === this.i18n.t('protocols.draft')) {
|
||||
return version;
|
||||
}
|
||||
|
||||
return this.i18n.t('protocols.draft')
|
||||
return this.i18n.t('protocols.header.draft_with_from_version', {nr: version});
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
|
|
|||
|
|
@ -19,9 +19,9 @@ class ProtocolSerializer < ActiveModel::Serializer
|
|||
def version
|
||||
return object.version_number unless object.in_repository_draft?
|
||||
|
||||
return object.previous_version.version_number + 1 if object.previous_version
|
||||
return object.previous_version.version_number if object.previous_version
|
||||
|
||||
1
|
||||
I18n.t('protocols.draft')
|
||||
end
|
||||
|
||||
def published
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue