view only party

This commit is contained in:
Pete Matsyburka
2026-07-04 15:47:40 +03:00
parent b6fb7c6977
commit e88874e757
42 changed files with 620 additions and 78 deletions
+7 -2
View File
@@ -147,7 +147,7 @@
@submit.prevent="submitStep"
/>
<button
v-if="!isFormVisible"
v-if="!isFormVisible && currentField"
id="expand_form_button"
class="btn btn-neutral flex text-white absolute bottom-0 w-full mb-3 expand-form-button text-base"
style="width: 96%; margin-left: 2%"
@@ -174,6 +174,7 @@
/>
</button>
<div
v-if="currentField"
v-show="isFormVisible"
id="form_container"
class="shadow-md bg-base-100 absolute bottom-0 w-full border-base-200 border p-4 rounded form-container overflow-hidden"
@@ -1172,7 +1173,11 @@ export default {
}
},
isAnonymousChecboxes () {
return this.currentField.type === 'checkbox' && this.currentStepFields.every((e) => !e.name && !e.required) && this.currentStepFields.length > 4
if (this.currentField) {
return this.currentField.type === 'checkbox' && this.currentStepFields.every((e) => !e.name && !e.required) && this.currentStepFields.length > 4
} else {
return false
}
},
isButtonDisabled () {
if (this.recalculateButtonDisabledKey) {
+13 -29
View File
@@ -3206,15 +3206,6 @@ export default {
e.preventDefault()
alert(this.t('please_draw_fields_to_prepare_the_document'))
} else {
const submitterWithoutFields =
this.template.submitters.find((submitter) => !this.template.fields.some((f) => f.submitter_uuid === submitter.uuid))
if (submitterWithoutFields) {
e.preventDefault()
alert(this.t('please_add_fields_for_the_submitter_name_or_remove_the_submitter_name_if_not_needed').replaceAll('{submitter_name}', submitterWithoutFields.name))
}
}
},
onSaveClick () {
@@ -3231,32 +3222,25 @@ export default {
if (!this.template.fields.length) {
alert(this.t('please_draw_fields_to_prepare_the_document'))
} else {
const submitterWithoutFields =
this.template.submitters.find((submitter) => !this.template.fields.some((f) => f.submitter_uuid === submitter.uuid))
this.isSaving = true
if (submitterWithoutFields) {
alert(this.t('please_add_fields_for_the_submitter_name_or_remove_the_submitter_name_if_not_needed').replaceAll('{submitter_name}', submitterWithoutFields.name))
} else {
this.isSaving = true
const dynamicDocumentRefs = this.documentRefs.filter((ref) => ref.isDynamic)
const dynamicDocumentRefs = this.documentRefs.filter((ref) => ref.isDynamic)
dynamicDocumentRefs.map((ref) => ref.update())
dynamicDocumentRefs.map((ref) => ref.update())
this.rebuildVariablesSchema({ disable: false })
this.rebuildVariablesSchema({ disable: false })
const dynamicDocumentSaves = dynamicDocumentRefs.map((ref) => ref.saveBody())
const dynamicDocumentSaves = dynamicDocumentRefs.map((ref) => ref.saveBody())
Promise.all([this.save({ force: true }), ...dynamicDocumentSaves]).then(() => {
if (this.withRevisions) {
this.captureRevision()
}
Promise.all([this.save({ force: true }), ...dynamicDocumentSaves]).then(() => {
if (this.withRevisions) {
this.captureRevision()
}
window.Turbo.visit(`/templates/${this.template.id}`)
}).finally(() => {
this.isSaving = false
})
}
window.Turbo.visit(`/templates/${this.template.id}`)
}).finally(() => {
this.isSaving = false
})
}
},
scrollToArea (area) {