mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-01-15 03:49:24 +08:00
Merge pull request #6140 from lasniscinote/gl_SCI_9193
Fix save empty OVE [SCI-9193]
This commit is contained in:
commit
f25e477e2a
3 changed files with 15 additions and 17 deletions
|
@ -55,6 +55,7 @@
|
|||
generatePng: true,
|
||||
readOnly: this.readOnly,
|
||||
showMenuBar: true,
|
||||
alwaysAllowSave: true,
|
||||
ToolBarProps: {
|
||||
toolList: [
|
||||
'saveTool',
|
||||
|
@ -108,12 +109,11 @@
|
|||
);
|
||||
},
|
||||
saveAndClose() {
|
||||
this.closeAfterSave = close;
|
||||
document.querySelector('[data-test=saveTool]').click();
|
||||
this.closeAfterSave = true;
|
||||
document.querySelector('[data-test=saveTool]').click()
|
||||
},
|
||||
saveFile(opts, sequenceDataToSave, editorState, onSuccessCallback) {
|
||||
if (this.readOnly) return;
|
||||
|
||||
blobToBase64(opts.pngFile).then((base64image) => {
|
||||
(this.fileUrl ? axios.patch : axios.post)(
|
||||
this.updateUrl,
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<template>
|
||||
<div class="step-attachments">
|
||||
<div class="step-attachments" v-if="attachments && attachments.length">
|
||||
<div class="attachments-actions">
|
||||
<div class="title">
|
||||
<h3>{{ i18n.t('protocols.steps.files', {count: attachments.length}) }}</h3>
|
||||
|
|
|
@ -140,8 +140,8 @@
|
|||
<div class="collapse in" :id="'stepBody' + step.id">
|
||||
<div class="step-elements">
|
||||
<div class="step-timestamp">{{ i18n.t('protocols.steps.timestamp', {date: step.attributes.created_at, user: step.attributes.created_by}) }}</div>
|
||||
<template v-for="(element, index) in orderedElements">
|
||||
<component
|
||||
v-for="(element, index) in orderedElements"
|
||||
:is="elements[index].attributes.orderable_type"
|
||||
:key="index"
|
||||
:element.sync="elements[index]"
|
||||
|
@ -154,17 +154,16 @@
|
|||
@reorder="openReorderModal"
|
||||
@component:insert="insertElement"
|
||||
/>
|
||||
</template>
|
||||
<Attachments v-if="attachments.length"
|
||||
:step="step"
|
||||
:attachments="attachments"
|
||||
:attachmentsReady="attachmentsReady"
|
||||
@attachments:openFileModal="showFileModal = true"
|
||||
@attachment:deleted="attachmentDeleted"
|
||||
@attachment:uploaded="loadAttachments"
|
||||
@attachments:order="changeAttachmentsOrder"
|
||||
@attachments:viewMode="changeAttachmentsViewMode"
|
||||
@attachment:viewMode="updateAttachmentViewMode"/>
|
||||
<Attachments
|
||||
:step="step"
|
||||
:attachments="attachments"
|
||||
:attachmentsReady="attachmentsReady"
|
||||
@attachments:openFileModal="showFileModal = true"
|
||||
@attachment:deleted="attachmentDeleted"
|
||||
@attachment:uploaded="loadAttachments"
|
||||
@attachments:order="changeAttachmentsOrder"
|
||||
@attachments:viewMode="changeAttachmentsViewMode"
|
||||
@attachment:viewMode="updateAttachmentViewMode"/>
|
||||
</div>
|
||||
</div>
|
||||
<deleteStepModal v-if="confirmingDelete" @confirm="deleteStep" @cancel="closeDeleteModal"/>
|
||||
|
@ -308,7 +307,6 @@
|
|||
|
||||
$.get(this.urls.attachments_url, (result) => {
|
||||
this.attachments = result.data
|
||||
|
||||
if (this.attachments.findIndex((e) => e.attributes.attached === false) >= 0) {
|
||||
setTimeout(() => {
|
||||
this.loadAttachments()
|
||||
|
|
Loading…
Reference in a new issue