diff --git a/app/src/components/globals/CardForm.vue b/app/src/components/globals/CardForm.vue
index 097d0d0f..fe994787 100644
--- a/app/src/components/globals/CardForm.vue
+++ b/app/src/components/globals/CardForm.vue
@@ -1,79 +1,161 @@
-
-
-
+
- {{ serverError }}
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
@@ -82,7 +164,7 @@ function onSubmit(e: Event) {
- {{ submitText ? submitText : $t('save') }}
+ {{ submitText ?? $t('save') }}
diff --git a/app/src/helpers/commons.ts b/app/src/helpers/commons.ts
index 53c50501..669e3c63 100644
--- a/app/src/helpers/commons.ts
+++ b/app/src/helpers/commons.ts
@@ -145,6 +145,13 @@ export function getFileContent(
})
}
+export function toEntries>(
+ obj: T,
+): { [K in keyof T]: [K, T[K]] }[keyof T][] {
+ return Object.entries(obj) as { [K in keyof T]: [K, T[K]] }[keyof T][]
+}
+}
+
export function omit(
obj: T,
keys: K,
diff --git a/app/src/types/form.ts b/app/src/types/form.ts
index bfe291e4..37c8802f 100644
--- a/app/src/types/form.ts
+++ b/app/src/types/form.ts
@@ -5,7 +5,7 @@ import type {
} from '@vuelidate/core'
import type { RouteLocationRaw } from 'vue-router'
-import type { ArrInnerType, Cols } from '@/types/commons'
+import type { ArrInnerType, Cols, Obj } from '@/types/commons'
type StateValidation = false | null
type StateVariant = 'success' | 'info' | 'warning' | 'danger'
@@ -264,3 +264,14 @@ export type FormFieldReadonlyProps<
> = Omit, 'hr' | 'visible' | 'readonly'> & {
modelValue?: MV
}
+
+export type FormFieldDict = {
+ [k in keyof T | string]: k extends keyof T
+ ?
+ | FormField
+ | FormFieldReadonly
+ :
+ | FormField
+ | FormFieldReadonly
+ | FormFieldDisplay
+}