Fix form moving between steps [SCI-11461]

This commit is contained in:
Andrej 2025-01-16 09:20:25 +01:00
parent e4ea3b61e1
commit 7c9b482f58
3 changed files with 9 additions and 5 deletions

View file

@ -11,6 +11,7 @@
:placeholder="fieldDisabled ? '' : i18n.t('forms.fields.from')"
:class="{'error': !validValue}"
/>
-
<DateTimePicker
@change="updateToDate"
:defaultValue="toValue"

View file

@ -86,7 +86,8 @@ export default {
form: this.element.attributes.orderable.form,
formResponse: this.element.attributes.orderable,
formFieldValues: this.element.attributes.orderable.form_field_values,
deleteUrl: this.element.attributes.orderable.urls.delete_url
deleteUrl: this.element.attributes.orderable.urls.delete_url,
moveUrl: this.element.attributes.orderable.urls.move_url
};
},
mounted() {
@ -159,6 +160,7 @@ export default {
const { attributes } = response.data.data;
this.formResponse = attributes.orderable;
this.deleteUrl = attributes.orderable.urls.delete_url;
this.moveUrl = attributes.orderable.urls.move_url;
});
},
resetForm() {
@ -166,6 +168,7 @@ export default {
const { attributes } = response.data.data;
this.formResponse = attributes.orderable;
this.deleteUrl = attributes.orderable.urls.delete_url;
this.moveUrl = attributes.orderable.urls.move_url;
});
}
}

View file

@ -13,11 +13,11 @@ export default {
closeMoveModal() {
this.movingElement = false;
},
moveElement(target_id) {
axios.post(this.element.attributes.orderable.urls.move_url, { target_id: target_id }).
then(() => {
moveElement(targetId) {
axios.post(this.moveUrl || this.element.attributes.orderable.urls.move_url, { target_id: targetId })
.then(() => {
this.movingElement = false;
this.$emit('moved', this.element.attributes.position, target_id);
this.$emit('moved', this.element.attributes.position, targetId);
});
}
}