diff --git a/api/src/Kurs.Platform.Application.Contracts/ListForms/GridOptionsDto/GridOptionsDto.cs b/api/src/Kurs.Platform.Application.Contracts/ListForms/GridOptionsDto/GridOptionsDto.cs index 1e56f397..d9f36506 100644 --- a/api/src/Kurs.Platform.Application.Contracts/ListForms/GridOptionsDto/GridOptionsDto.cs +++ b/api/src/Kurs.Platform.Application.Contracts/ListForms/GridOptionsDto/GridOptionsDto.cs @@ -305,4 +305,18 @@ public class GridOptionsDto : AuditedEntityDto } set { ExtraFilterJson = JsonSerializer.Serialize(value); } } + + [JsonIgnore] + public string LayoutJson { get; set; } + public LayoutDto LayoutDto + { + get + { + if (!string.IsNullOrEmpty(LayoutJson)) + return JsonSerializer.Deserialize(LayoutJson); + + return new LayoutDto(); + } + set { LayoutJson = JsonSerializer.Serialize(value); } + } } diff --git a/api/src/Kurs.Platform.Application.Contracts/ListForms/GridOptionsDto/LayoutDto.cs b/api/src/Kurs.Platform.Application.Contracts/ListForms/GridOptionsDto/LayoutDto.cs new file mode 100644 index 00000000..9930bf3b --- /dev/null +++ b/api/src/Kurs.Platform.Application.Contracts/ListForms/GridOptionsDto/LayoutDto.cs @@ -0,0 +1,10 @@ +namespace Kurs.Platform.ListForms; + +public class LayoutDto +{ + public bool Grid { get; set; } = true; + public bool Card { get; set; } = true; + public bool Pivot { get; set; } = true; + public string DefaultLayout { get; set; } = "grid"; + public int CardLayoutColumn { get; set; } = 4; +} diff --git a/api/src/Kurs.Platform.Application/ListForms/Administration/ListFormsAppService.cs b/api/src/Kurs.Platform.Application/ListForms/Administration/ListFormsAppService.cs index 26f21f94..1af3b62e 100644 --- a/api/src/Kurs.Platform.Application/ListForms/Administration/ListFormsAppService.cs +++ b/api/src/Kurs.Platform.Application/ListForms/Administration/ListFormsAppService.cs @@ -65,6 +65,7 @@ public class ListFormsAppService : CrudAppService< item.Description = input.Description; item.IsSubForm = input.IsSubForm; item.ListFormType = input.ListFormType; + item.LayoutJson = JsonSerializer.Serialize(input.LayoutDto); } else if (input.EditType == ListFormEditTabs.Database.DataSourceForm) { diff --git a/api/src/Kurs.Platform.DbMigrator/Seeds/ListFormsSeeder.cs b/api/src/Kurs.Platform.DbMigrator/Seeds/ListFormsSeeder.cs index 3ab1e159..8139ee36 100644 --- a/api/src/Kurs.Platform.DbMigrator/Seeds/ListFormsSeeder.cs +++ b/api/src/Kurs.Platform.DbMigrator/Seeds/ListFormsSeeder.cs @@ -2581,7 +2581,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency Visible = true, IsActive = true, IsDeleted = false, - AllowSearch = true, + AllowSearch = false, LookupJson = JsonSerializer.Serialize(new LookupDto { DataSourceType = UiLookupDataSourceTypeEnum.Query, @@ -3821,7 +3821,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency Visible = true, IsActive = true, IsDeleted = false, - AllowSearch = true, + AllowSearch = false, ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] { new ValidationRuleDto() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required)} }), @@ -4097,7 +4097,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency Visible = true, IsActive = true, IsDeleted = false, - AllowSearch = true, + AllowSearch = false, LookupJson = JsonSerializer.Serialize(new LookupDto { DataSourceType = UiLookupDataSourceTypeEnum.Query, @@ -5505,7 +5505,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency Visible = true, IsActive = true, IsDeleted = false, - AllowSearch = true, + AllowSearch = false, LookupJson = JsonSerializer.Serialize(new LookupDto { DataSourceType = UiLookupDataSourceTypeEnum.Query, @@ -5543,7 +5543,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency Visible = true, IsActive = true, IsDeleted = false, - AllowSearch = true, + AllowSearch = false, LookupJson = JsonSerializer.Serialize(new LookupDto { DataSourceType = UiLookupDataSourceTypeEnum.Query, @@ -5611,7 +5611,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency Visible = true, IsActive = true, IsDeleted = false, - AllowSearch = true, + AllowSearch = false, LookupJson = JsonSerializer.Serialize(new LookupDto { DataSourceType = UiLookupDataSourceTypeEnum.Query, @@ -5649,7 +5649,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency Visible = true, IsActive = true, IsDeleted = false, - AllowSearch = true, + AllowSearch = false, LookupJson = JsonSerializer.Serialize(new LookupDto { DataSourceType = UiLookupDataSourceTypeEnum.Query, @@ -12790,7 +12790,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency Visible = true, IsActive = true, IsDeleted = false, - AllowSearch = true, + AllowSearch = false, ValidationRuleJson = JsonSerializer.Serialize(new[] { new ValidationRuleDto { Type = "required" } @@ -12849,7 +12849,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency Visible = true, IsActive = true, IsDeleted = false, - AllowSearch = true, + AllowSearch = false, ValidationRuleJson = JsonSerializer.Serialize(new[] { new ValidationRuleDto { Type = "required" } @@ -13124,7 +13124,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency Visible = true, IsActive = true, IsDeleted = false, - AllowSearch = true, + AllowSearch = false, ValidationRuleJson = JsonSerializer.Serialize(new[] { new ValidationRuleDto { Type = "required" } @@ -13183,7 +13183,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency Visible = true, IsActive = true, IsDeleted = false, - AllowSearch = true, + AllowSearch = false, ValidationRuleJson = JsonSerializer.Serialize(new[] { new ValidationRuleDto { Type = "required" } @@ -13899,7 +13899,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency Visible = true, IsActive = true, IsDeleted = false, - AllowSearch = true, + AllowSearch = false, ValidationRuleJson = JsonSerializer.Serialize(new[] { new ValidationRuleDto { Type = "required" } @@ -13932,7 +13932,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency Visible = true, IsActive = true, IsDeleted = false, - AllowSearch = true, + AllowSearch = false, PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto { C = AppCodes.Orders.Products + ".Create", @@ -15790,7 +15790,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency Visible = true, IsActive = true, IsDeleted = false, - AllowSearch = true, + AllowSearch = false, LookupJson = JsonSerializer.Serialize(new LookupDto { DataSourceType = UiLookupDataSourceTypeEnum.Query, DisplayExpr = "Name", @@ -15848,7 +15848,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency Visible = true, IsActive = true, IsDeleted = false, - AllowSearch = true, + AllowSearch = false, LookupJson = JsonSerializer.Serialize(new LookupDto { DataSourceType = UiLookupDataSourceTypeEnum.Query, DisplayExpr = "Name", @@ -16322,7 +16322,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency Visible = true, IsActive = true, IsDeleted = false, - AllowSearch = true, + AllowSearch = false, LookupJson = JsonSerializer.Serialize(new LookupDto { DataSourceType = UiLookupDataSourceTypeEnum.Query, DisplayExpr = "Name", diff --git a/api/src/Kurs.Platform.DbMigrator/Seeds/SeederData.json b/api/src/Kurs.Platform.DbMigrator/Seeds/SeederData.json index 26979817..d9274e77 100644 --- a/api/src/Kurs.Platform.DbMigrator/Seeds/SeederData.json +++ b/api/src/Kurs.Platform.DbMigrator/Seeds/SeederData.json @@ -12510,6 +12510,36 @@ "en": "Height", "tr": "Yükseklik" }, + { + "resourceName": "Platform", + "key": "ListForms.ListFormEdit.DetailsLayoutDto.GridLayout", + "en": "Grid Layout", + "tr": "Liste Düzeni" + }, + { + "resourceName": "Platform", + "key": "ListForms.ListFormEdit.DetailsLayoutDto.CardLayout", + "en": "Card Layout", + "tr": "Kart Düzeni" + }, + { + "resourceName": "Platform", + "key": "ListForms.ListFormEdit.DetailsLayoutDto.PivotLayout", + "en": "Pivot Layout", + "tr": "Pivot Düzeni" + }, + { + "resourceName": "Platform", + "key": "ListForms.ListFormEdit.DetailsLayoutDto.DefaultLayout", + "en": "Default Layout", + "tr": "Varsayılan Düzen" + }, + { + "resourceName": "Platform", + "key": "ListForms.ListFormEdit.DetailsLayoutDto.CardLayoutColumn", + "en": "Card Layout Column", + "tr": "Kart Düzeni Sütunu" + }, { "resourceName": "Platform", "key": "ListForms.ListFormEdit.DatabaseDataSource", diff --git a/api/src/Kurs.Platform.Domain/Entities/ListForm.cs b/api/src/Kurs.Platform.Domain/Entities/ListForm.cs index bbc2acdc..81016dfe 100644 --- a/api/src/Kurs.Platform.Domain/Entities/ListForm.cs +++ b/api/src/Kurs.Platform.Domain/Entities/ListForm.cs @@ -121,4 +121,7 @@ public class ListForm : FullAuditedEntity /// bu listform'un üstünde yer alan widgetların listesidir public string ExtraFilterJson { get; set; } + + /// bu listform'un üstünde yer alan widgetların listesidir + public string LayoutJson { get; set; } } diff --git a/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20250917121912_Initial.Designer.cs b/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20250922114945_Initial.Designer.cs similarity index 99% rename from api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20250917121912_Initial.Designer.cs rename to api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20250922114945_Initial.Designer.cs index 152656c2..a6ed97b4 100644 --- a/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20250917121912_Initial.Designer.cs +++ b/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20250922114945_Initial.Designer.cs @@ -13,7 +13,7 @@ using Volo.Abp.EntityFrameworkCore; namespace Kurs.Platform.Migrations { [DbContext(typeof(PlatformDbContext))] - [Migration("20250917121912_Initial")] + [Migration("20250922114945_Initial")] partial class Initial { /// @@ -2869,6 +2869,9 @@ namespace Kurs.Platform.Migrations .HasColumnType("uniqueidentifier") .HasColumnName("LastModifierId"); + b.Property("LayoutJson") + .HasColumnType("nvarchar(max)"); + b.Property("ListFormCode") .IsRequired() .HasColumnType("nvarchar(450)"); diff --git a/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20250917121912_Initial.cs b/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20250922114945_Initial.cs similarity index 99% rename from api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20250917121912_Initial.cs rename to api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20250922114945_Initial.cs index e31f0a05..8d6001bd 100644 --- a/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20250917121912_Initial.cs +++ b/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20250922114945_Initial.cs @@ -1241,6 +1241,7 @@ namespace Kurs.Platform.Migrations SubFormsJson = table.Column(type: "nvarchar(max)", nullable: true), WidgetsJson = table.Column(type: "nvarchar(max)", nullable: true), ExtraFilterJson = table.Column(type: "nvarchar(max)", nullable: true), + LayoutJson = table.Column(type: "nvarchar(max)", nullable: true), CreationTime = table.Column(type: "datetime2", nullable: false), CreatorId = table.Column(type: "uniqueidentifier", nullable: true), LastModificationTime = table.Column(type: "datetime2", nullable: true), diff --git a/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs b/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs index cba25593..691d55ea 100644 --- a/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs +++ b/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs @@ -2866,6 +2866,9 @@ namespace Kurs.Platform.Migrations .HasColumnType("uniqueidentifier") .HasColumnName("LastModifierId"); + b.Property("LayoutJson") + .HasColumnType("nvarchar(max)"); + b.Property("ListFormCode") .IsRequired() .HasColumnType("nvarchar(450)"); diff --git a/ui/src/proxy/form/models.ts b/ui/src/proxy/form/models.ts index d56afb23..04cd351d 100644 --- a/ui/src/proxy/form/models.ts +++ b/ui/src/proxy/form/models.ts @@ -19,6 +19,7 @@ import { import { FormItemComponent } from 'devextreme/ui/form' import { AuditedEntityDto } from '../abp' import { EditorType2, RowMode } from '../../views/form/types' +import { bool } from 'yup' //1 export interface SelectListItem { @@ -481,6 +482,7 @@ export interface GridOptionsDto extends AuditedEntityDto { subFormsDto: SubFormDto[] extraFilterJson?: string extraFilterDto: ExtraFilterDto[] + layoutDto: LayoutDto } export interface GridOptionsEditDto extends GridOptionsDto, Record { @@ -727,6 +729,14 @@ export interface WidgetEditDto { onClick: string } +export interface LayoutDto { + grid: boolean + card: boolean + pivot: boolean + defaultLayout: 'grid' | 'card' | 'pivot' + cardLayoutColumn: number +} + export interface ExtraFilterDto { fieldName: string caption: string diff --git a/ui/src/views/admin/chart/ChartEdit.tsx b/ui/src/views/admin/chart/ChartEdit.tsx index cc802cc3..28d25715 100644 --- a/ui/src/views/admin/chart/ChartEdit.tsx +++ b/ui/src/views/admin/chart/ChartEdit.tsx @@ -292,7 +292,7 @@ function ChartEdit() {

- 🔙 {chartCode} + 🔙 {chartCode}

{chartValues.isTenant && ( @@ -3450,7 +3450,7 @@ function ChartEdit() { id: chartValues.id, index: databaseOperationsModalData.index, fieldName: 'serie', - itemSerie: { ...values }, + itemSerie: { ...values } as ChartSeriesDto, }) toast.push( diff --git a/ui/src/views/admin/listForm/edit/FormTabDetails.tsx b/ui/src/views/admin/listForm/edit/FormTabDetails.tsx index 41bfcba9..ded92760 100644 --- a/ui/src/views/admin/listForm/edit/FormTabDetails.tsx +++ b/ui/src/views/admin/listForm/edit/FormTabDetails.tsx @@ -10,7 +10,7 @@ import { Field, FieldProps, Form, Formik } from 'formik' import { useEffect, useState } from 'react' import * as Yup from 'yup' import { FormEditProps } from './FormEdit' -import { listFormTypeOptions } from './options' +import { listFormDefaultLayoutOptions, listFormTypeOptions } from './options' const schema = Yup.object().shape({ cultureName: Yup.string().required('Culture Name Required'), @@ -18,6 +18,13 @@ const schema = Yup.object().shape({ name: Yup.string(), pageSize: Yup.number(), description: Yup.string(), + layoutDto: Yup.object().shape({ + grid: Yup.boolean(), + card: Yup.boolean(), + pivot: Yup.boolean(), + defaultLayout: Yup.string(), + cardLayoutColumn: Yup.number(), + }), }) function FormTabDetails(props: FormEditProps) { @@ -181,6 +188,92 @@ function FormTabDetails(props: FormEditProps) { component={Input} /> + + + + + + + + + + + + + + + + {({ field, form }: FieldProps) => ( + - - - - -
-
- -
- {gridDataSource && - data.map((row, idx) => { - const keyField = gridDto.gridOptions.keyFieldName - const rowId = row[keyField!] - - return ( - - ) - })} -
- - {gridDto.gridOptions.pagerOptionDto?.visible && totalCount > pageSize && ( -
-
- - Toplam {totalCount} kayıt - - setSearchText(e.target.value)} + onKeyDown={(e) => { + if (e.key === 'Enter') { + filtrele(e.currentTarget.value) + } + }} + onBlur={(e) => { + filtrele(e.currentTarget.value) + }} + 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" + /> + + + + + +
+
+ + {loading ? ( + + ) : data.length === 0 ? ( +
+ +

+ Uygun kayıt bulunamadı +

+

+ Farklı filtreler deneyin veya yeni bir kayıt ekleyin. +

+
+ ) : ( +
+ {gridDataSource && + data.map((row, idx) => { + const keyField = gridDto.gridOptions.keyFieldName + const rowId = row[keyField!] + + return ( + + ) + })} +
+ )} + + {gridDto.gridOptions.pagerOptionDto?.visible && totalCount > pageSize && ( +
+
+ + Toplam {totalCount} kayıt + +