diff --git a/app/javascript/application.js b/app/javascript/application.js index 75178c96..458a7a4e 100644 --- a/app/javascript/application.js +++ b/app/javascript/application.js @@ -164,6 +164,7 @@ safeRegisterElement('template-builder', class extends HTMLElement { this.app = createApp(TemplateBuilder, { template, customFields: reactive(JSON.parse(this.dataset.customFields || '[]')), + dateFormats: JSON.parse(this.dataset.dateFormats || '[]'), dynamicDocuments: reactive(JSON.parse(this.dataset.dynamicDocuments || '[]')), backgroundColor: '#faf7f5', locale: this.dataset.locale, diff --git a/app/javascript/submission_form/form.vue b/app/javascript/submission_form/form.vue index 20a08583..e61feae5 100644 --- a/app/javascript/submission_form/form.vue +++ b/app/javascript/submission_form/form.vue @@ -1575,6 +1575,7 @@ export default { } }, goToStep (stepIndex, scrollToArea = false, clickUpload = false) { + this.isInvite = false this.currentStep = stepIndex this.showFillAllRequiredFields = false @@ -1599,6 +1600,10 @@ export default { }) }, saveStep (formData) { + if (!formData && !this.$refs.form) { + return + } + const currentFieldUuids = this.currentStepFields.map((f) => f.uuid) const currentFieldType = this.currentField.type diff --git a/app/javascript/template_builder/area.vue b/app/javascript/template_builder/area.vue index e15bf2f8..88253fa2 100644 --- a/app/javascript/template_builder/area.vue +++ b/app/javascript/template_builder/area.vue @@ -319,7 +319,7 @@ export default { default: false } }, - emits: ['start-resize', 'stop-resize', 'start-drag', 'stop-drag', 'remove', 'scroll-to', 'add-custom-field', 'click-title'], + emits: ['start-resize', 'stop-resize', 'start-drag', 'stop-drag', 'remove', 'scroll-to', 'add-custom-field', 'click-title', 'multi-select'], data () { return { isContenteditable: false, @@ -798,6 +798,8 @@ export default { this.selectedAreasRef.value.splice(this.selectedAreasRef.value.indexOf(this.area), 1) } + this.$emit('multi-select', e) + return } diff --git a/app/javascript/template_builder/page.vue b/app/javascript/template_builder/page.vue index 163a386f..1248cfe7 100644 --- a/app/javascript/template_builder/page.vue +++ b/app/javascript/template_builder/page.vue @@ -57,6 +57,7 @@ @scroll-to="$emit('scroll-to', $event)" @add-custom-field="$emit('add-custom-field', $event)" @contextmenu="openAreaContextMenu($event, item.area, item.field)" + @multi-select="openMultiSelectContextMenu" @click-title="closeContextMenu" /> = 2) { + this.openSelectionContextMenu(event) + + return + } + event.preventDefault() event.stopPropagation() @@ -443,6 +450,13 @@ export default { areas: this.selectedAreasRef.value } }, + openMultiSelectContextMenu (event) { + if (this.selectedAreasRef.value.length >= 2) { + this.openSelectionContextMenu(event) + } else { + this.closeContextMenu() + } + }, handleSelectionCopy () { this.$emit('copy-selected-areas') diff --git a/app/javascript/template_builder/selection_context_menu.vue b/app/javascript/template_builder/selection_context_menu.vue index 4649e011..fb275271 100644 --- a/app/javascript/template_builder/selection_context_menu.vue +++ b/app/javascript/template_builder/selection_context_menu.vue @@ -9,6 +9,62 @@ @mousedown.stop @pointerdown.stop > + + +
+ + +
{{ t('height') }} -
- -
- <%= button_to '', destroy_user_session_path, method: :delete, data: { turbo: false }, form: { id: 'destroy_user_session_form' }, form_class: 'hidden' %> + <%= button_to '', destroy_user_session_path, method: :delete, form: { id: 'destroy_user_session_form', data: { turbo: false } }, form_class: 'hidden' %> diff --git a/app/views/shared/_settings_nav.html.erb b/app/views/shared/_settings_nav.html.erb index f5fdce90..217854da 100644 --- a/app/views/shared/_settings_nav.html.erb +++ b/app/views/shared/_settings_nav.html.erb @@ -132,7 +132,7 @@ <%= capture do %>
- <%= svg_icon('brand_openai', class: 'w-8 h-8') %> + <%= svg_icon('message', class: 'w-8 h-8') %>
<% end %> diff --git a/app/views/submissions/_send_email_base.html.erb b/app/views/submissions/_send_email_base.html.erb index 36650851..9830344d 100644 --- a/app/views/submissions/_send_email_base.html.erb +++ b/app/views/submissions/_send_email_base.html.erb @@ -47,7 +47,7 @@ <% is_edit_viewer = local_assigns[:submitter] && local_assigns[:viewer_submitter_uuids].include?(local_assigns[:submitter].uuid) %>