From 01ad6ffa60f6d0a5ad101c80da1f866497877db4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sedat=20=C3=96zt=C3=BCrk?= Date: Sun, 8 Feb 2026 09:52:48 +0300 Subject: [PATCH] FormTabEdit --- .../Seeds/LanguagesData.json | 6 + .../views/admin/listForm/edit/FormTabEdit.tsx | 665 +++++++++--------- ui/src/views/list/useListFormColumns.ts | 28 +- ui/src/views/list/useToolbar.tsx | 28 +- 4 files changed, 376 insertions(+), 351 deletions(-) diff --git a/api/src/Erp.Platform.DbMigrator/Seeds/LanguagesData.json b/api/src/Erp.Platform.DbMigrator/Seeds/LanguagesData.json index 0108783e..4590e79d 100644 --- a/api/src/Erp.Platform.DbMigrator/Seeds/LanguagesData.json +++ b/api/src/Erp.Platform.DbMigrator/Seeds/LanguagesData.json @@ -3198,6 +3198,12 @@ "en": "Save Grid State", "tr": "Tablo Yapısını Kaydet" }, + { + "resourceName": "Platform", + "key": "ListForms.ListForm.GridStateSaved", + "en": "Grid State Saved", + "tr": "Tablo Yapısı Kaydedildi" + }, { "resourceName": "Platform", "key": "ListForms.ListForm.ResetGridState", diff --git a/ui/src/views/admin/listForm/edit/FormTabEdit.tsx b/ui/src/views/admin/listForm/edit/FormTabEdit.tsx index 66e9f097..78715fea 100644 --- a/ui/src/views/admin/listForm/edit/FormTabEdit.tsx +++ b/ui/src/views/admin/listForm/edit/FormTabEdit.tsx @@ -41,362 +41,381 @@ function FormTabEdit(props: FormEditProps & { listFormCode: string }) { {({ touched, errors, values, isSubmitting }) => (
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - {({ field, form }: FieldProps) => ( - option.value === values.editingOptionDto.refreshMode, - )} - onChange={(option) => form.setFieldValue(field.name, option?.value)} - /> - )} - - - - - {({ field, form }: FieldProps) => ( - option.value === values.editingOptionDto.startEditAction, - )} - onChange={(option) => form.setFieldValue(field.name, option?.value)} - /> - )} - - - - - - {values.editingOptionDto.mode === 'popup' && ( - <> +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + name="editingOptionDto.mode" + placeholder={translate('::SidePanel.Mode')} + > + {({ field, form }: FieldProps) => ( + option.value === values.editingOptionDto.refreshMode, + )} + onChange={(option) => form.setFieldValue(field.name, option?.value)} + /> + )} + + {({ field, form }: FieldProps) => ( + option.value === values.editingOptionDto.startEditAction, + )} + onChange={(option) => form.setFieldValue(field.name, option?.value)} + /> + )} + + + + - - - - - - - - - - - )} - - + + {values.editingOptionDto.mode === 'popup' && ( + <> + + + + + + + + + + + + + + + + + + + + + + )} - component={Checkbox} - /> - + +
diff --git a/ui/src/views/list/useListFormColumns.ts b/ui/src/views/list/useListFormColumns.ts index d69aeef1..4fa05863 100644 --- a/ui/src/views/list/useListFormColumns.ts +++ b/ui/src/views/list/useListFormColumns.ts @@ -338,6 +338,20 @@ const useListFormColumns = ({ const buttons: any[] = [] + if (hasUpdate) { + buttons.push({ + name: 'edit', + text: translate('::App.Platform.Edit'), + }) + } + + if (hasDelete) { + buttons.push({ + name: 'delete', + text: translate('::App.Platform.Delete'), + }) + } + if (hasDetail) { const item = { name: 'detail', @@ -360,20 +374,6 @@ const useListFormColumns = ({ buttons.push(item) } - if (hasUpdate) { - buttons.push({ - name: 'edit', - text: translate('::App.Platform.Edit'), - }) - } - - if (hasDelete) { - buttons.push({ - name: 'delete', - text: translate('::App.Platform.Delete'), - }) - } - gridDto.gridOptions.commandColumnDto.forEach((action) => { if (action.buttonPosition !== UiCommandButtonPositionTypeEnum.CommandColumn) return if (!checkPermission(action.authName)) return diff --git a/ui/src/views/list/useToolbar.tsx b/ui/src/views/list/useToolbar.tsx index 4c6b3ac6..62eb0d50 100644 --- a/ui/src/views/list/useToolbar.tsx +++ b/ui/src/views/list/useToolbar.tsx @@ -71,6 +71,20 @@ const useToolbar = ({ }) } + // Add InsertNewRecord button + if (grdOpt.editingOptionDto?.allowAdding && checkPermission(grdOpt.permissionDto?.c)) { + items.push({ + locateInMenu: 'auto', + showText: 'always', + name: 'addRowButton', + location: 'after', + options: { + text: translate('::ListForms.ListForm.AddNewRecord'), + hint: translate('::ListForms.ListForm.AddNewRecord'), + }, + }) + } + items.push({ widget: 'dxButton', name: 'refreshButton', @@ -120,20 +134,6 @@ const useToolbar = ({ }) } - // Add InsertNewRecord button - if (grdOpt.editingOptionDto?.allowAdding && checkPermission(grdOpt.permissionDto?.c)) { - items.push({ - locateInMenu: 'auto', - showText: 'always', - name: 'addRowButton', - location: 'after', - options: { - text: translate('::ListForms.ListForm.AddNewRecord'), - hint: translate('::ListForms.ListForm.AddNewRecord'), - }, - }) - } - // Add group panel if (grdOpt.groupPanelDto?.visible) { items.push({