diff --git a/api/src/Kurs.Platform.Application.Contracts/ListForms/Chart/ChartExportDto.cs b/api/src/Kurs.Platform.Application.Contracts/ListForms/Chart/ChartExportDto.cs index 5b1ad71d..b72644f7 100644 --- a/api/src/Kurs.Platform.Application.Contracts/ListForms/Chart/ChartExportDto.cs +++ b/api/src/Kurs.Platform.Application.Contracts/ListForms/Chart/ChartExportDto.cs @@ -15,6 +15,9 @@ public class ChartExportDto /// UI bileşeninde istemci tarafında dışa aktarmayı etkinleştirir. /// public bool Enabled { get; set; } + /// UI bileşeninde istemci tarafında dışa aktarmayı etkinleştirir. + /// + public bool AllowExportSelectedData { get; set; } ///// Dışa aktarma formatı belirtir. ///// Desteklenen formatlar: 'GIF' | 'JPEG' | 'PDF' | 'PNG' | 'SVG' ///// diff --git a/api/src/Kurs.Platform.Application.Contracts/ListForms/GridOptionsDto/TreeOptionDto.cs b/api/src/Kurs.Platform.Application.Contracts/ListForms/GridOptionsDto/TreeOptionDto.cs index 45b14b7a..490315b7 100644 --- a/api/src/Kurs.Platform.Application.Contracts/ListForms/GridOptionsDto/TreeOptionDto.cs +++ b/api/src/Kurs.Platform.Application.Contracts/ListForms/GridOptionsDto/TreeOptionDto.cs @@ -5,6 +5,10 @@ namespace Kurs.Platform.ListForms; /// public class TreeOptionDto { + /// + /// Parent kaydı belirten field adı (örn: "Id") + /// + public string KeyExpr { get; set; } /// /// Parent kaydı belirten field adı (örn: "parentId") /// diff --git a/api/src/Kurs.Platform.DbMigrator/Seeds/LanguagesData.json b/api/src/Kurs.Platform.DbMigrator/Seeds/LanguagesData.json index ef1db177..edc4f2e8 100644 --- a/api/src/Kurs.Platform.DbMigrator/Seeds/LanguagesData.json +++ b/api/src/Kurs.Platform.DbMigrator/Seeds/LanguagesData.json @@ -5179,6 +5179,12 @@ "en": "Visible", "tr": "Görünür" }, + { + "resourceName": "Platform", + "key": "ListForms.ListFormEdit.TreeKeyFieldName", + "en": "Key Field Name", + "tr": "Anahtar Alanı" + }, { "resourceName": "Platform", "key": "ListForms.ListFormEdit.ParentIdExpr", diff --git a/api/src/Kurs.Platform.DbMigrator/Seeds/ListFormSeeder_Saas.cs b/api/src/Kurs.Platform.DbMigrator/Seeds/ListFormSeeder_Saas.cs index bb56e9b8..5dc1da99 100644 --- a/api/src/Kurs.Platform.DbMigrator/Seeds/ListFormSeeder_Saas.cs +++ b/api/src/Kurs.Platform.DbMigrator/Seeds/ListFormSeeder_Saas.cs @@ -2613,7 +2613,7 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency DeleteCommand = DefaultDeleteCommand(nameof(TableNameEnum.Menu)), DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson, PagerOptionJson = DefaultPagerOptionJson, - TreeOptionJson = DefaultTreeOptionJson("ParentCode", true), + TreeOptionJson = DefaultTreeOptionJson("Code", "ParentCode", true), EditingOptionJson = DefaultEditingOptionJson(AppCodes.Menus.Menu, 600, 600, true, true, true, true, false), EditingFormJson = JsonSerializer.Serialize(new List() { new() { Order=1, ColCount=1, ColSpan=1, ItemType="group", Items= diff --git a/api/src/Kurs.Platform.DbMigrator/Seeds/SeederDefaults.cs b/api/src/Kurs.Platform.DbMigrator/Seeds/SeederDefaults.cs index d560d10b..e0df34f7 100644 --- a/api/src/Kurs.Platform.DbMigrator/Seeds/SeederDefaults.cs +++ b/api/src/Kurs.Platform.DbMigrator/Seeds/SeederDefaults.cs @@ -77,8 +77,9 @@ public static class SeederDefaults Mode = GridOptions.SelectionModeMultiple, SelectAllMode = GridOptions.SelectionAllModeAllPages }); - public static string DefaultTreeOptionJson(string ParentIdExpr, bool AutoExpandAll = true) => JsonSerializer.Serialize(new TreeOptionDto + public static string DefaultTreeOptionJson(string KeyExpr, string ParentIdExpr, bool AutoExpandAll = true) => JsonSerializer.Serialize(new TreeOptionDto { + KeyExpr = KeyExpr, ParentIdExpr = ParentIdExpr, RootValue = null, AutoExpandAll = AutoExpandAll diff --git a/ui/src/proxy/admin/charts/models.ts b/ui/src/proxy/admin/charts/models.ts index 0cc16aef..4b37a982 100644 --- a/ui/src/proxy/admin/charts/models.ts +++ b/ui/src/proxy/admin/charts/models.ts @@ -179,70 +179,10 @@ export interface ChartDragBoxStyle { opacity: number } -// export interface ChartDto extends AuditedEntityDto { -// listFormCode?: string -// userId?: string -// roleId?: string -// cultureName?: string -// commonJson?: string -// commonDto: ChartCommonDto -// adaptiveLayoutJson?: string -// adaptivelayoutDto: ChartAdaptivelayoutDto -// animationJson?: string -// animationDto: ChartAnimationDto -// annotationsJson?: string -// annotationsDto: ChartAnnotationDto[] -// argumentAxisJson?: string -// argumentAxisDto: ChartArgumentAxisDto -// commonAnnotationsSettingsJson?: string -// commonAnnotationSettingsDto: ChartCommonAnnotationDto -// commonAxisSettingsJson?: string -// commonAxisSettingsDto: ChartCommonAxisDto -// commonPaneSettingsJson?: string -// commonPaneSettingsDto: ChartCommonPaneDto -// commonSeriesSettingsJson?: string -// commonSeriesSettingsDto: ChartCommonSeriesSettingsDto -// crosshairJson?: string -// crosshairDto: ChartCrosshairDto -// exportJson?: string -// exportDto: ChartExportDto -// legendJson?: string -// legendDto: ChartLegendDto -// marginJson?: string -// marginDto: ChartMarginDto -// panesJson?: string -// panesDto: ChartPanesDto[] -// scrollBarJson?: string -// scrollBarDto: ChartScrollBarDto -// seriesJson?: string -// seriesDto: ChartSeriesDto[] -// sizeJson?: string -// sizeDto: ChartSizeDto -// titleJson?: string -// titleDto: ChartTitleDto -// tooltipJson?: string -// tooltipDto: ChartTooltipDto -// valueAxisJson?: string -// valueAxisDto: ChartValueAxisDto[] -// zoomAndPanJson?: string -// zoomAndPanDto: ChartZoomAndPanDto -// permissionJson?: string -// permissionDto: PermissionCrudDto -// isTenant: boolean -// isBranch: boolean -// isOrganizationUnit: boolean -// } - -// export interface ChartEditDto extends ChartDto { -// editType: string -// dataSourceJson?: string -// dataSourceDto: ChartDataSourceDto -// dataSourceCode?: string -// } - export interface ChartExportDto { backgroundColor?: string enabled: boolean + allowExportSelectedData: boolean margin: number printingEnabled: boolean } diff --git a/ui/src/proxy/admin/list-form/options.ts b/ui/src/proxy/admin/list-form/options.ts index f35b8b72..f03a3035 100644 --- a/ui/src/proxy/admin/list-form/options.ts +++ b/ui/src/proxy/admin/list-form/options.ts @@ -119,4 +119,52 @@ export const tabVisibilityConfig: Record = { 'widget', 'subForms', ], - } \ No newline at end of file + } + + export const themeOptions = [ + { value: 'generic.dark', label: 'Generic Dark' }, + { value: 'generic.light', label: 'Generic Carmine' }, + { value: 'generic.contrast', label: 'Generic Contrast' }, + { value: 'generic.carmine', label: 'Generic Darkmoon' }, + { value: 'generic.darkmoon', label: 'Generic Darkviolet' }, + { value: 'generic.darkviolet', label: 'Generic Greenmist' }, + { value: 'generic.greenmist', label: 'Generic Light' }, + { value: 'generic.softblue', label: 'Generic Soft Blue' }, + { value: 'material.blue.light', label: 'Material Blue Light' }, + { value: 'material.lime.light', label: 'Material Lime Light' }, + { value: 'material.orange.light', label: 'Material Orange Light' }, + { value: 'material.purple.light', label: 'Material Purple Light' }, + { value: 'material.teal.light', label: 'Material Teal Light' }, +] + +export const tooltipFormatListOptions = [ + { value: null, label: 'None' }, + { value: 'billions', label: 'Billions' }, + { value: 'currency', label: 'Currency' }, + { value: 'day', label: 'Day' }, + { value: 'dayOfWeek', label: 'Day of Week' }, + { value: 'decimal', label: 'Decimal' }, + { value: 'exponential', label: 'Exponential' }, + { value: 'fixedPoint', label: 'Fixed Point' }, + { value: 'hour', label: 'Hour' }, + { value: 'largeNumber', label: 'Large Number' }, + { value: 'longDate', label: 'Long Date' }, + { value: 'longDateLongTime', label: 'Long Date Long Time' }, + { value: 'longTime', label: 'Long Time' }, + { value: 'millions', label: 'Millions' }, + { value: 'millisecond', label: 'Millisecond' }, + { value: 'minute', label: 'Minute' }, + { value: 'month', label: 'Month' }, + { value: 'monthAndDay', label: 'Month And Day' }, + { value: 'monthAndYear', label: 'Month And Year' }, + { value: 'percent', label: 'Percent' }, + { value: 'quarter', label: 'Quarter' }, + { value: 'quarterAndYear', label: 'Quarter And Year' }, + { value: 'second', label: 'Second' }, + { value: 'shortDate', label: 'Short Date' }, + { value: 'shortDateShortTime', label: 'Short Date Short Time' }, + { value: 'shortTime', label: 'ShortTime' }, + { value: 'thousands', label: 'Thousands' }, + { value: 'trillions', label: 'Trillions' }, + { value: 'year', label: 'Year' }, +] diff --git a/ui/src/proxy/form/models.ts b/ui/src/proxy/form/models.ts index f5a6a6c5..2b840a04 100644 --- a/ui/src/proxy/form/models.ts +++ b/ui/src/proxy/form/models.ts @@ -378,6 +378,7 @@ export interface GridPivotOptionDto { } export interface TreeOptionDto { + keyExpr?: string parentIdExpr?: string hasItemsExpr?: string rootValue?: any diff --git a/ui/src/shared/options.ts b/ui/src/shared/options.ts deleted file mode 100644 index 4db2eacb..00000000 --- a/ui/src/shared/options.ts +++ /dev/null @@ -1,47 +0,0 @@ -export const themeOptions = [ - { value: 'generic.dark', label: 'Generic Dark' }, - { value: 'generic.light', label: 'Generic Carmine' }, - { value: 'generic.contrast', label: 'Generic Contrast' }, - { value: 'generic.carmine', label: 'Generic Darkmoon' }, - { value: 'generic.darkmoon', label: 'Generic Darkviolet' }, - { value: 'generic.darkviolet', label: 'Generic Greenmist' }, - { value: 'generic.greenmist', label: 'Generic Light' }, - { value: 'generic.softblue', label: 'Generic Soft Blue' }, - { value: 'material.blue.light', label: 'Material Blue Light' }, - { value: 'material.lime.light', label: 'Material Lime Light' }, - { value: 'material.orange.light', label: 'Material Orange Light' }, - { value: 'material.purple.light', label: 'Material Purple Light' }, - { value: 'material.teal.light', label: 'Material Teal Light' }, -] - -export const tooltipFormatListOptions = [ - { value: null, label: 'None' }, - { value: 'billions', label: 'Billions' }, - { value: 'currency', label: 'Currency' }, - { value: 'day', label: 'Day' }, - { value: 'dayOfWeek', label: 'Day of Week' }, - { value: 'decimal', label: 'Decimal' }, - { value: 'exponential', label: 'Exponential' }, - { value: 'fixedPoint', label: 'Fixed Point' }, - { value: 'hour', label: 'Hour' }, - { value: 'largeNumber', label: 'Large Number' }, - { value: 'longDate', label: 'Long Date' }, - { value: 'longDateLongTime', label: 'Long Date Long Time' }, - { value: 'longTime', label: 'Long Time' }, - { value: 'millions', label: 'Millions' }, - { value: 'millisecond', label: 'Millisecond' }, - { value: 'minute', label: 'Minute' }, - { value: 'month', label: 'Month' }, - { value: 'monthAndDay', label: 'Month And Day' }, - { value: 'monthAndYear', label: 'Month And Year' }, - { value: 'percent', label: 'Percent' }, - { value: 'quarter', label: 'Quarter' }, - { value: 'quarterAndYear', label: 'Quarter And Year' }, - { value: 'second', label: 'Second' }, - { value: 'shortDate', label: 'Short Date' }, - { value: 'shortDateShortTime', label: 'Short Date Short Time' }, - { value: 'shortTime', label: 'ShortTime' }, - { value: 'thousands', label: 'Thousands' }, - { value: 'trillions', label: 'Trillions' }, - { value: 'year', label: 'Year' }, -] diff --git a/ui/src/shared/useListFormCustomDataSource.ts b/ui/src/shared/useListFormCustomDataSource.ts index d16e6511..2d2a2859 100644 --- a/ui/src/shared/useListFormCustomDataSource.ts +++ b/ui/src/shared/useListFormCustomDataSource.ts @@ -3,11 +3,12 @@ import PivotGrid from 'devextreme-react/pivot-grid' import CustomStore from 'devextreme/data/custom_store' import { MutableRefObject, useCallback } from 'react' import { getLoadOptions, getServiceAddress, setGridPanelColor } from '../views/list/Utils' -import { GridOptionsDto } from '../proxy/form/models' +import { GridOptionsDto, LayoutDto } from '../proxy/form/models' import { GridColumnData } from '../views/list/GridColumnData' import { dynamicFetch } from '../services/form.service' import { MULTIVALUE_DELIMITER } from '../constants/app.constant' import { TreeList } from 'devextreme-react' +import { layoutTypes, ListViewLayoutType } from '@/views/admin/listForm/edit/types' const filteredGridPanelColor = 'rgba(10, 200, 10, 0.5)' // kullanici tanimli filtre ile filtrelenmis gridin paneline ait renk @@ -25,17 +26,20 @@ const useListFormCustomDataSource = ({ listFormCode: string, searchParams?: URLSearchParams, cols?: GridColumnData[], - chart?: boolean, + layout?: ListViewLayoutType | string, ) => { const store: any = new CustomStore({ - key: gridOptions.keyFieldName, + key: + layout === layoutTypes.tree + ? gridOptions.treeOptionDto?.keyExpr + : gridOptions.keyFieldName, useDefaultSearch: true, load: async (loadOptions) => { const parameters = getLoadOptions(loadOptions, { listFormCode, filter: '', createDeleteQuery: searchParams?.get('createDeleteQuery'), - chart, + chart: layout === layoutTypes.chart, }) // 1. Default filter'ı al const defaultFilter = searchParams?.get('filter') diff --git a/ui/src/views/admin/listForm/edit/ChartTabCommonSettings.tsx b/ui/src/views/admin/listForm/edit/ChartTabCommonSettings.tsx index c7d5a66a..517c5050 100644 --- a/ui/src/views/admin/listForm/edit/ChartTabCommonSettings.tsx +++ b/ui/src/views/admin/listForm/edit/ChartTabCommonSettings.tsx @@ -14,11 +14,10 @@ import TabNav from '@/components/ui/Tabs/TabNav' import { IdentityRoleDto } from '@/proxy/admin/models' import { SelectBoxOption } from '@/shared/types' import { Field, FieldProps, Form, Formik, FormikErrors, FormikTouched } from 'formik' -import { themeOptions, tooltipFormatListOptions } from '@/shared/options' import { FormEditProps } from '../../listForm/edit/FormEdit' import { useLocalization } from '@/utils/hooks/useLocalization' import { useStoreState } from '@/store/store' -import { ListFormEditTabs } from '@/proxy/admin/list-form/options' +import { ListFormEditTabs, themeOptions } from '@/proxy/admin/list-form/options' import { object } from 'yup' import { chartPaletteOptions, diff --git a/ui/src/views/admin/listForm/edit/ChartTabCrosshair.tsx b/ui/src/views/admin/listForm/edit/ChartTabCrosshair.tsx index 6aca0fd8..8b0c11dd 100644 --- a/ui/src/views/admin/listForm/edit/ChartTabCrosshair.tsx +++ b/ui/src/views/admin/listForm/edit/ChartTabCrosshair.tsx @@ -1,11 +1,10 @@ import { Button, Card, Checkbox, FormContainer, FormItem, Input, Select } from '@/components/ui' -import { tooltipFormatListOptions } from '@/shared/options' import { SelectBoxOption } from '@/shared/types' import { Field, FieldProps, Form, Formik } from 'formik' import { FormEditProps } from '../../listForm/edit/FormEdit' import { useLocalization } from '@/utils/hooks/useLocalization' import { useStoreState } from '@/store/store' -import { ListFormEditTabs } from '@/proxy/admin/list-form/options' +import { ListFormEditTabs, tooltipFormatListOptions } from '@/proxy/admin/list-form/options' import { object } from 'yup' import { chartSeriesDashStyleOptions } from './options' diff --git a/ui/src/views/admin/listForm/edit/ChartTabExport.tsx b/ui/src/views/admin/listForm/edit/ChartTabExport.tsx index c5a7c4d2..14ccd9b5 100644 --- a/ui/src/views/admin/listForm/edit/ChartTabExport.tsx +++ b/ui/src/views/admin/listForm/edit/ChartTabExport.tsx @@ -27,25 +27,21 @@ function ChartTabExport(props: FormEditProps) { {({ touched, errors, resetForm, isSubmitting, values }) => (
- + - + + + + + @@ -53,11 +49,12 @@ function ChartTabExport(props: FormEditProps) { +