mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-12-12 07:06:16 +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">
|
<div class="modal-header">
|
||||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||||
<h4 class="modal-title">
|
<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>
|
</h4>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
|
|
|
||||||
|
|
@ -109,11 +109,11 @@
|
||||||
return version;
|
return version;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (version > 1) {
|
if (version === this.i18n.t('protocols.draft')) {
|
||||||
return this.i18n.t('protocols.header.draft_with_from_version', {nr: version});
|
return version;
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.i18n.t('protocols.draft')
|
return this.i18n.t('protocols.header.draft_with_from_version', {nr: version});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
|
||||||
|
|
@ -19,9 +19,9 @@ class ProtocolSerializer < ActiveModel::Serializer
|
||||||
def version
|
def version
|
||||||
return object.version_number unless object.in_repository_draft?
|
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
|
end
|
||||||
|
|
||||||
def published
|
def published
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue