Merge pull request #6140 from lasniscinote/gl_SCI_9193

Fix save empty OVE [SCI-9193]
This commit is contained in:
Martin Artnik 2023-09-05 16:04:54 +02:00 committed by GitHub
commit f25e477e2a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 17 deletions

View file

@ -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,

View file

@ -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>

View file

@ -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()