From ea5dbe91f5abd0a7408b75cc111c3119fbb8eb53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sedat=20=C3=96zt=C3=BCrk?= Date: Tue, 23 Sep 2025 22:52:08 +0300 Subject: [PATCH] =?UTF-8?q?Grid,=20Card=20ve=20Pivot=20son=20g=C3=BCncelle?= =?UTF-8?q?me?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/src/components/ui/Button/Button.tsx | 2 +- ui/src/index.css | 4 ++ ui/src/utils/hooks/useCurrentMenuIcon.tsx | 6 ++- ui/src/views/form/FormButtons.tsx | 55 ++++++++++++----------- ui/src/views/form/FormDevExpress.tsx | 4 +- ui/src/views/form/FormView.tsx | 2 +- ui/src/views/form/SubForms.tsx | 3 +- ui/src/views/list/Card.tsx | 36 ++++++++------- ui/src/views/list/Grid.tsx | 22 +++++++-- ui/src/views/list/List.tsx | 6 ++- 10 files changed, 86 insertions(+), 54 deletions(-) diff --git a/ui/src/components/ui/Button/Button.tsx b/ui/src/components/ui/Button/Button.tsx index a93e2bad..12df9320 100644 --- a/ui/src/components/ui/Button/Button.tsx +++ b/ui/src/components/ui/Button/Button.tsx @@ -86,7 +86,7 @@ const Button = forwardRef((props, ref) => { `h-${CONTROL_SIZES.xs}`, icon && !children ? `w-${CONTROL_SIZES.xs} ${sizeIconClass} text-base` - : 'px-3 py-1 text-xs' + : 'px-2 py-1 text-xs' ) break default: diff --git a/ui/src/index.css b/ui/src/index.css index 10201f3b..bcaada89 100644 --- a/ui/src/index.css +++ b/ui/src/index.css @@ -1,5 +1,9 @@ @import './assets/styles/app.css'; +.dx-field-item { + padding-top: 5px !important; +} + .dx-toolbar .dx-toolbar-item.no-default { all: unset; /* tüm default style'ları sıfırla */ display: block; /* tekrar görünür yap */ diff --git a/ui/src/utils/hooks/useCurrentMenuIcon.tsx b/ui/src/utils/hooks/useCurrentMenuIcon.tsx index b7d191a3..45c7da7a 100644 --- a/ui/src/utils/hooks/useCurrentMenuIcon.tsx +++ b/ui/src/utils/hooks/useCurrentMenuIcon.tsx @@ -13,9 +13,11 @@ export function useCurrentMenuIcon(className = 'w-6 h-6'): JSX.Element { if (!menu.path) return false // normalize: /list/ -> /form/ - const formPath = menu.path.replace('/list/', '/form/') + const menuPath = menu.path.toLowerCase() + const listFormPath = menuPath.replace('/list/', '/form/') + const formPath = listFormPath.replace('/list-', '/form-') - return location.pathname.startsWith(menu.path) || location.pathname.startsWith(formPath) + return location.pathname.startsWith(menuPath) || location.pathname.startsWith(listFormPath) || location.pathname.startsWith(formPath) }) const IconComponent = currentMenu?.icon ? navigationIcon[currentMenu.icon] || FaUser : FaUser diff --git a/ui/src/views/form/FormButtons.tsx b/ui/src/views/form/FormButtons.tsx index 2da72871..1af6df1d 100644 --- a/ui/src/views/form/FormButtons.tsx +++ b/ui/src/views/form/FormButtons.tsx @@ -83,7 +83,8 @@ const FormButtons = (props: { if (props.onActionNew) { props.onActionNew() } else { - navigate(ROUTES_ENUM.protected.admin.formNew.replace(':formCode', listFormCode)) + navigate(-1) + //navigate(ROUTES_ENUM.protected.admin.formNew.replace(':formCode', listFormCode)) } toast.push( @@ -171,8 +172,10 @@ const FormButtons = (props: { {!isSubForm && ( )} {mode != 'new' && ( )} {mode != 'new' && ( + > )} {mode == 'view' && ( + > )} {(mode == 'edit' || (onActionView && mode == 'new')) && ( + > )} {(mode == 'edit' || mode == 'new') && ( + > )} {checkPermission(gridDto?.gridOptions.permissionDto.c) && !isSubForm && ( + > )} +
{ return ( ) : ( )} -
+
{subForms.map((subForm, i) => { diff --git a/ui/src/views/list/Card.tsx b/ui/src/views/list/Card.tsx index 9cc2420d..aeb2dabc 100644 --- a/ui/src/views/list/Card.tsx +++ b/ui/src/views/list/Card.tsx @@ -20,20 +20,7 @@ import { Container, Loading } from '@/components/shared' import WidgetGroup from '@/components/common/WidgetGroup' import { GridExtraFilterState } from './Utils' import { useStoreActions, useStoreState } from '@/store/store' - -interface CardProps { - listFormCode: string - searchParams?: URLSearchParams - isSubForm?: boolean - level?: number - refreshData?: () => Promise - gridDto?: GridDto -} - -type Option = { - value: number - label: string -} +import { FaTrashCan } from 'react-icons/fa6' const CardItem = ({ isSubForm, @@ -189,6 +176,20 @@ const CardItem = ({ ) } +interface CardProps { + listFormCode: string + searchParams?: URLSearchParams + isSubForm?: boolean + level?: number + refreshData?: () => Promise + gridDto?: GridDto +} + +type Option = { + value: number + label: string +} + const Card = (props: CardProps) => { const { listFormCode, searchParams, gridDto } = props const { createSelectDataSource } = useListFormCustomDataSource({}) @@ -287,6 +288,7 @@ const Card = (props: CardProps) => { const dataSource = createSelectDataSource(gridDto.gridOptions, listFormCode, urlSearchParams) setGridDataSource(dataSource) + //listFormStates const listFormStates = states.find((a) => a.listFormCode === listFormCode) if (listFormStates) { setLayoutCount(listFormStates.cardLayoutColumn || 4) @@ -340,7 +342,7 @@ const Card = (props: CardProps) => { if (data.length > 0) { window.scrollTo({ top: 0, behavior: 'smooth' }) - if (data.length < 3) { + if (data.length < 6) { setLayoutCount(data.length) } } @@ -379,9 +381,9 @@ const Card = (props: CardProps) => { onFilter(newValue) setPrevValue(newValue) }} - className="p-1 pl-6 pr-2 border border-1 outline-none text-xs text-gray-700 - dark:text-gray-200 placeholder-gray-400 rounded" + className="p-1 pl-6 pr-2 border border-1 outline-none text-xs text-gray-700 dark:text-gray-200 placeholder-gray-400 rounded" /> +