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