From 4089ba01e0881c89a72332e13bc3a80b6bddec2a Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Mon, 29 Jun 2026 22:15:55 +0000
Subject: [PATCH] =DashboardManager overhaul. A bit easier to modify the output of pages. Still have to get the account pages to work as expected, as well as verify the integrations and others are working - but registrar/content pages work as expected. Also fixed up the table generation in CRUD.js and CRUDSkeleton.php

---
 assets/js/concise/FormController.js |   25 ++++++++++++++++---------
 1 files changed, 16 insertions(+), 9 deletions(-)

diff --git a/assets/js/concise/FormController.js b/assets/js/concise/FormController.js
index d5e5835..b92c486 100644
--- a/assets/js/concise/FormController.js
+++ b/assets/js/concise/FormController.js
@@ -482,14 +482,14 @@
 			} else {
 				this.notify('form-submit', {
 					config: form,
-					data: this.changes.get(form.id)?.changes??{},
+					data: this.changes.get(form.id)?.changes ?? {},
 				});
 			}
-			if (form.options.endpoint && !form.options.handled) {
-				console.log('Submitting form...');
-				await this.handleServerSave(form, this.collectFormData(form.form));
-			}
-
+		}
+		if (form.options.endpoint && !form.options.handled) {
+			e.preventDefault();
+			console.log('Submitting form...', this.changes.get(form.id)?.changes ?? {});
+			await this.handleServerSave(form, this.changes.get(form.id)?.changes ?? {});
 		}
 
 		if (form.options.showSummary) {
@@ -526,7 +526,6 @@
 		}
 
 		if (form.tabs) {
-			console.log('Updating step progress on change');
 			this.updateStepProgress(form);
 		}
 
@@ -668,7 +667,7 @@
 	async handleServerSave(form, changes) {
 		this.cancelServerSave(form.id);
 
-		if (window.jvbQueue) {
+		if (form.useQueue && window.jvbQueue) {
 			changes.user = window.auth.getUser();
 			window.jvbQueue.addToQueue({
 				endpoint: form.options.endpoint,
@@ -676,9 +675,10 @@
 				headers: form.options.headers??{},
 			});
 		} else {
-			await window.auth.fetch(jvbBase.api+form.options.endpoint, {
+			await window.auth.fetch(jvbSettings.api+form.options.endpoint, {
 				body: changes,
 				headers: form.options.headers??{},
+				method: 'POST',
 			});
 		}
 	}
@@ -694,6 +694,7 @@
 			autoUpload: false,
 			imageMeta: true,
 			delay: 1500,
+			useQueue: true,
 			endpoint: Object.hasOwn(form.dataset, 'save') ? form.dataset.save: '',
 			showStatus: true,
 			showSummary: false,
@@ -1610,6 +1611,12 @@
 
 		field.classList.remove('has-success');
 		field.classList.add('has-error');
+		field.scrollIntoView({
+			behavior: "smooth",
+			block: "center",
+			inline: "nearest"
+		});
+		field.querySelector(this.inputSelectors)?.focus();
 
 		if (item.ui.message) {
 			item.ui.message.hidden = false;

--
Gitblit v1.10.0