Fix task status update [SCI-11626]

This commit is contained in:
Andrej 2025-03-10 12:25:22 +01:00
parent 988fb12bd2
commit 2d878f52a4
4 changed files with 15 additions and 6 deletions

View file

@ -367,7 +367,7 @@ export default {
deleteSteps() {
$.post(this.urls.delete_steps_url, () => {
this.steps = [];
this.refreshProtocolDropdownOptions();
this.refreshProtocolStatus();
}).fail(() => {
HelperModule.flashAlertMsg(this.i18n.t('errors.general'), 'danger');
});

View file

@ -692,6 +692,7 @@
const index = this.attachments.findIndex(a => a.id === attachment.id);
if (index !== -1) {
this.attachments[index] = attachment;
this.$emit('stepUpdated');
}
},
closeCommentsSidebar() {
@ -725,6 +726,7 @@
return s;
})
this.elements.push(element);
this.$emit('stepUpdated');
},
moveElement(position, target_id) {
this.elements.splice(position, 1)

View file

@ -195,6 +195,9 @@ export default {
update() {
this.$emit('update', this.element, false);
},
updatedChecklistItem() {
this.$emit('update', this.element, true);
},
loadChecklistItems(insertAfter) {
$.get(this.element.attributes.orderable.urls.checklist_items_url, (result) => {
this.checklistItems = result.data;
@ -219,6 +222,7 @@ export default {
after_id: afterId
}).then((result) => {
this.loadChecklistItems(result.data.data[result.data.data.length - 1].id);
this.updatedChecklistItem();
}).catch(() => {
HelperModule.flashAlertMsg(this.i18n.t('errors.general'), 'danger');
});
@ -232,6 +236,7 @@ export default {
data: item,
success: () => {
this.loadChecklistItems(insertAfter);
this.updatedChecklistItem();
},
error: (xhr) => this.setFlashErrors(xhr.responseJSON.errors)
});
@ -270,6 +275,7 @@ export default {
},
removeItem(position) {
this.checklistItems = this.checklistItems.filter((item) => item.attributes.position !== position);
this.updatedChecklistItem();
},
startReorder() {
this.reordering = true;
@ -299,6 +305,7 @@ export default {
after_id: afterId
}).then(() => {
this.loadChecklistItems();
this.updatedChecklistItem();
}).catch((e) => {
this.setFlashErrors(e.response.errors);
});

View file

@ -78,6 +78,7 @@ import moveElementModal from './modal/move.vue';
import InlineEdit from '../inline_edit.vue';
import Tinymce from '../tinymce.vue';
import MenuDropdown from '../menu_dropdown.vue';
import axios from '../../../packs/custom_axios';
export default {
name: 'TextContent',
@ -183,12 +184,11 @@ export default {
},
updateName(name) {
this.element.attributes.orderable.name = name;
$.ajax({
url: this.element.attributes.orderable.urls.update_url,
method: 'PUT',
data: { text_component: { name } }
axios.put(this.element.attributes.orderable.urls.update_url, {
text_component: { name }
}).then(() => {
this.$emit('update', this.element, true);
});
this.$emit('update', this.element, true);
},
updateText(data) {
this.element.attributes.orderable.text_view = data.attributes.text_view;