Merge pull request #8360 from andrej-scinote/aj_SCI_11470

Fix the disabling of the publish button [SCI-11470]
This commit is contained in:
andrej-scinote 2025-03-25 14:42:15 +01:00 committed by GitHub
commit a22bcdd5b7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -188,11 +188,14 @@ export default {
},
methods: {
isValidChanged() {
if (this.$refs.editField?.field) {
const index = this.fields.findIndex((f) => f.id === this.$refs.editField.field.id);
this.fields[index].isValid = this.$refs.editField.isValid;
this.$nextTick(() => {
if (this.$refs.editField?.field) {
const index = this.fields.findIndex((f) => f.id === this.$refs.editField.field.id);
this.fields[index].isValid = this.$refs.editField.isValid;
}
this.isValid = !this.fields.some((field) => field.isValid === false);
}
});
},
syncSavedFields() {
this.savedFields = this.fields.map((f) => ({ ...f }));
@ -206,6 +209,8 @@ export default {
[this.activeField] = this.fields;
}
this.syncSavedFields();
this.isValidChanged();
if (this.form.attributes.published_on || !this.form.attributes.urls.create_field) {
this.preview = true;
}