From a3a9254665f5a7462514f4e45e924c89d8b09a3a Mon Sep 17 00:00:00 2001 From: Julien Nahum Date: Thu, 14 Dec 2023 16:53:05 +0100 Subject: [PATCH] WIP --- ...Input.vue => RichTextAreaInput.client.vue} | 0 client/components/forms/useFormInput.js | 2 +- client/components/global/Modal.vue | 7 +- .../forms/components/FormFieldsEditor.vue | 2 +- .../pages/auth/components/LoginForm.vue | 13 +- .../pages/auth/components/RegisterForm.vue | 2 +- client/components/pages/welcome/AiFeature.vue | 2 +- client/composables/lib/vForm/Errors.js | 75 ++++++++ client/composables/lib/vForm/Form.js | 175 ++++++++++++++++++ client/composables/useForm.js | 5 + client/composables/useOpnFetch.js | 5 + client/middleware/admin.js | 8 + client/middleware/auth.js | 11 ++ client/middleware/check-auth.global.js | 5 + client/opnform.config.js | 4 +- client/package-lock.json | 22 +-- client/package.json | 3 +- client/pages/ai-form-builder.vue | 6 +- client/pages/home.vue | 13 +- client/pages/index.vue | 2 +- client/plugins/fetch.js | 45 +++++ client/stores/auth.js | 76 +++++--- client/stores/forms.js | 30 +-- client/stores/workspaces.js | 54 +++--- 24 files changed, 445 insertions(+), 122 deletions(-) rename client/components/forms/{RichTextAreaInput.vue => RichTextAreaInput.client.vue} (100%) create mode 100644 client/composables/lib/vForm/Errors.js create mode 100644 client/composables/lib/vForm/Form.js create mode 100644 client/composables/useForm.js create mode 100644 client/composables/useOpnFetch.js create mode 100644 client/middleware/admin.js create mode 100644 client/middleware/auth.js create mode 100644 client/middleware/check-auth.global.js create mode 100644 client/plugins/fetch.js diff --git a/client/components/forms/RichTextAreaInput.vue b/client/components/forms/RichTextAreaInput.client.vue similarity index 100% rename from client/components/forms/RichTextAreaInput.vue rename to client/components/forms/RichTextAreaInput.client.vue diff --git a/client/components/forms/useFormInput.js b/client/components/forms/useFormInput.js index a478919..6c72199 100644 --- a/client/components/forms/useFormInput.js +++ b/client/components/forms/useFormInput.js @@ -33,7 +33,7 @@ export function useFormInput (props, context, formPrefixKey = null) { }) const hasError = computed(() => { - return hasValidation && props.form?.errors?.has(name) + return hasValidation && props.form?.errors?.has(props.name) }) const compVal = computed({ diff --git a/client/components/global/Modal.vue b/client/components/global/Modal.vue index 33f71b9..887e077 100644 --- a/client/components/global/Modal.vue +++ b/client/components/global/Modal.vue @@ -1,5 +1,5 @@