mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-01-31 20:19:05 +08:00
Fix protocol status bar reloading after step elements modifications [SCI-6986]
This commit is contained in:
parent
b6b1fed7e2
commit
b582b138f5
5 changed files with 16 additions and 3 deletions
|
@ -80,7 +80,7 @@
|
|||
:attachment.sync="attachmentsOrdered[index]"
|
||||
:stepId="parseInt(step.id)"
|
||||
@attachment:viewMode="updateAttachmentViewMode"
|
||||
@attachment:delete="attachments.splice(index, 1)"
|
||||
@attachment:delete="deleteAttachment"
|
||||
/>
|
||||
</template>
|
||||
</div>
|
||||
|
@ -155,7 +155,11 @@
|
|||
return 'uploadingAttachment'
|
||||
}
|
||||
return `${attachment.attributes.view_mode}Attachment`
|
||||
}
|
||||
},
|
||||
deleteAttachment(index) {
|
||||
this.attachments.splice(index, 1)
|
||||
this.$emit('attachment:deleted')
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -101,6 +101,7 @@
|
|||
:inRepository="inRepository"
|
||||
@step:delete="updateStepsPosition"
|
||||
@step:update="updateStep"
|
||||
@stepUpdated="refreshProtocolStatus"
|
||||
:reorderStepUrl="steps.length > 1 ? urls.reorder_steps_url : null"
|
||||
/>
|
||||
</div>
|
||||
|
|
|
@ -64,6 +64,7 @@ export default {
|
|||
});
|
||||
filesUploadedCntr += 1;
|
||||
if (filesUploadedCntr === filesToUploadCntr) {
|
||||
this.$emit('stepUpdated');
|
||||
resolve('done');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -139,6 +139,7 @@
|
|||
<Attachments :step="step"
|
||||
:attachments="attachments"
|
||||
@attachments:openFileModal="showFileModal = true"
|
||||
@attachment:deleted="attachmentDeleted"
|
||||
@attachments:order="changeAttachmentsOrder"
|
||||
@attachments:viewMode="changeAttachmentsViewMode"
|
||||
@attachment:viewMode="updateAttachmentViewMode"/>
|
||||
|
@ -310,12 +311,14 @@
|
|||
return e;
|
||||
})
|
||||
this.reorderElements(unorderedElements)
|
||||
this.$emit('stepUpdated')
|
||||
},
|
||||
updateElement(element, skipRequest=false) {
|
||||
let index = this.elements.findIndex((e) => e.id === element.id);
|
||||
|
||||
if (skipRequest) {
|
||||
this.elements[index].attributes.orderable = element.attributes.orderable;
|
||||
this.$emit('stepUpdated');
|
||||
} else {
|
||||
$.ajax({
|
||||
url: element.attributes.orderable.urls.update_url,
|
||||
|
@ -323,6 +326,7 @@
|
|||
data: element.attributes.orderable,
|
||||
success: (result) => {
|
||||
this.elements[index].attributes.orderable = result.data.attributes;
|
||||
this.$emit('stepUpdated');
|
||||
}
|
||||
}).error(() => {
|
||||
HelperModule.flashAlertMsg(this.i18n.t('errors.general'), 'danger');
|
||||
|
@ -385,6 +389,9 @@
|
|||
$('.comments-sidebar .close-btn').click();
|
||||
this.showCommentsSidebar = true
|
||||
},
|
||||
attachmentDeleted() {
|
||||
this.$emit('stepUpdated');
|
||||
},
|
||||
closeCommentsSidebar() {
|
||||
this.showCommentsSidebar = false
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue