From e291c7abec375a56710029e51e25d6fc35213450 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Wed, 29 Oct 2025 12:26:56 +0100 Subject: [PATCH] Refactor `ThirdPartyEdit.vue` to improve validation handling and streamline input components. - Replaced individual validation logic with `useViolationList` composable for centralization and consistency. - Enhanced input components with floating labels, validation error feedback, and improved class binding for better UX. - Updated API to include `WriteThirdPartyViolationMap` interface for structured validation error mapping. - Refactored imports and adjusted spacing for better readability and adherence to coding standards. --- .../Resources/public/vuejs/_api/OnTheFly.ts | 16 + .../_components/OnTheFly/ThirdPartyEdit.vue | 357 +++++++++++------- 2 files changed, 242 insertions(+), 131 deletions(-) diff --git a/src/Bundle/ChillThirdPartyBundle/Resources/public/vuejs/_api/OnTheFly.ts b/src/Bundle/ChillThirdPartyBundle/Resources/public/vuejs/_api/OnTheFly.ts index d4f0f4e09..a44608ef7 100644 --- a/src/Bundle/ChillThirdPartyBundle/Resources/public/vuejs/_api/OnTheFly.ts +++ b/src/Bundle/ChillThirdPartyBundle/Resources/public/vuejs/_api/OnTheFly.ts @@ -14,6 +14,22 @@ export const getThirdparty = async (id: number) : Promise => { }); }; +export interface WriteThirdPartyViolationMap +extends Record> { + email: { + "{{ value }}": string; + }, + name: { + "{{ value }}": string; + }, + telephone: { + "{{ value }}": string; + } + telephone2: { + "{{ value }}": string; + } +} + /* * POST a new thirdparty */ diff --git a/src/Bundle/ChillThirdPartyBundle/Resources/public/vuejs/_components/OnTheFly/ThirdPartyEdit.vue b/src/Bundle/ChillThirdPartyBundle/Resources/public/vuejs/_components/OnTheFly/ThirdPartyEdit.vue index 89c98ce85..dde173b84 100644 --- a/src/Bundle/ChillThirdPartyBundle/Resources/public/vuejs/_components/OnTheFly/ThirdPartyEdit.vue +++ b/src/Bundle/ChillThirdPartyBundle/Resources/public/vuejs/_components/OnTheFly/ThirdPartyEdit.vue @@ -2,7 +2,7 @@
- + {{ trans(THIRDPARTY_MESSAGES_CHILD_OF) }} {{ parent.text }}
@@ -56,104 +56,146 @@
-
- +
+
+
+
+ + +
+
+
-
- +
+
+
+ + +
+
-
- - -
-
-
    -
  • - {{ qi }} -
  • -
+
+
+
+ + +
+
+
+
    +
  • + {{ qi }} +
  • +
+
-
- - -
-
-
    -
  • - {{ qi }} -
  • -
+
+
+
+ + +
+
+
+ {{ err }} +
+
+
    +
  • + {{ qi }} +
  • +
+
-
- - -
-
-
    -
  • - {{ query }} -
  • -
+
+
+
+ + +
+
+ +
+ {{ err }} +
+ +
+
    +
  • + {{ query }} +
  • +
+
@@ -167,49 +209,86 @@ /> -
- - +
+
+ + + +
+ + +
+
+
+ {{ err }} +
-
- - +
+
+ + + +
+ + +
+
+
+ {{ err }} +
-
- - +
+
+ +
+ + +
+
+
+ {{ err }} +