From 07f03bdf3c2a6e57e80ee83cfaba45042abde994 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sedat=20=C3=96ZT=C3=9CRK?= <76204082+iamsedatozturk@users.noreply.github.com> Date: Tue, 18 Nov 2025 14:48:51 +0300 Subject: [PATCH] =?UTF-8?q?SubForms=20i=C3=A7inde=20=C4=B0li=C5=9Fkili=20s?= =?UTF-8?q?=C3=BCtunu=20tan=C4=B1mlamadan=20Insert?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ListForms/GridOptionsDto/SubFormDto.cs | 5 +- .../ListFormFieldsAppService.cs | 3 +- .../Seeds/LanguagesData.json | 6 + .../Seeds/ListFormSeeder_Accounting.cs | 96 +-- .../Seeds/ListFormSeeder_Administration.cs | 247 +++---- .../Seeds/ListFormSeeder_Coordinator.cs | 128 ++-- .../Seeds/ListFormSeeder_Crm.cs | 147 ++-- .../Seeds/ListFormSeeder_Hr.cs | 161 ++--- .../Seeds/ListFormSeeder_Saas.cs | 169 ++--- .../Seeds/ListFormSeeder_SupplyChain.cs | 661 +++++++++--------- .../Seeds/PermissionsData.json | 63 ++ .../Seeds/SeederUtils.cs | 194 +++-- .../Entities/Branch/Accounting/BankAccount.cs | 1 - .../Erp.Platform.Domain/Queries/SubForm.cs | 2 + ....cs => 20251117212636_Initial.Designer.cs} | 5 +- ...8_Initial.cs => 20251117212636_Initial.cs} | 1 - .../PlatformDbContextModelSnapshot.cs | 3 - ui/src/proxy/form/models.ts | 1 + .../admin/listForm/edit/FormTabSubForm.tsx | 8 +- .../JsonRowOpDialogSubForm.tsx | 151 ++-- 20 files changed, 1020 insertions(+), 1032 deletions(-) rename api/src/Erp.Platform.EntityFrameworkCore/Migrations/{20251116194718_Initial.Designer.cs => 20251117212636_Initial.Designer.cs} (99%) rename api/src/Erp.Platform.EntityFrameworkCore/Migrations/{20251116194718_Initial.cs => 20251117212636_Initial.cs} (99%) diff --git a/api/src/Erp.Platform.Application.Contracts/ListForms/GridOptionsDto/SubFormDto.cs b/api/src/Erp.Platform.Application.Contracts/ListForms/GridOptionsDto/SubFormDto.cs index f98ac9a9..af5891f6 100644 --- a/api/src/Erp.Platform.Application.Contracts/ListForms/GridOptionsDto/SubFormDto.cs +++ b/api/src/Erp.Platform.Application.Contracts/ListForms/GridOptionsDto/SubFormDto.cs @@ -1,4 +1,6 @@ -namespace Erp.Platform.ListForms; +using System.Data; + +namespace Erp.Platform.ListForms; public class SubFormDto { @@ -12,6 +14,7 @@ public class SubFormDto public class SubFormRelationDto { public string ParentFieldName { get; set; } + public DbType DbType { get; set; } public string ChildFieldName { get; set; } } diff --git a/api/src/Erp.Platform.Application/ListForms/Administration/ListFormFieldsAppService.cs b/api/src/Erp.Platform.Application/ListForms/Administration/ListFormFieldsAppService.cs index 4f3968f7..2d80c369 100644 --- a/api/src/Erp.Platform.Application/ListForms/Administration/ListFormFieldsAppService.cs +++ b/api/src/Erp.Platform.Application/ListForms/Administration/ListFormFieldsAppService.cs @@ -107,7 +107,8 @@ public class ListFormFieldsAppService : CrudAppService< R = listFormPermissions?.R, C = listFormPermissions?.C, U = listFormPermissions?.U, - E = true + E = true, + I = true }); } diff --git a/api/src/Erp.Platform.DbMigrator/Seeds/LanguagesData.json b/api/src/Erp.Platform.DbMigrator/Seeds/LanguagesData.json index 1d80d0ef..ddbc896b 100644 --- a/api/src/Erp.Platform.DbMigrator/Seeds/LanguagesData.json +++ b/api/src/Erp.Platform.DbMigrator/Seeds/LanguagesData.json @@ -4309,6 +4309,12 @@ "en": "Relation Fields", "tr": "İlişkili Sütunlar" }, + { + "resourceName": "Platform", + "key": "ListForms.ListFormEdit.SubFormsRelation.ParentFieldName", + "en": "Parent Field Name", + "tr": "Üst Kimlik İfadesi" + }, { "resourceName": "Platform", "key": "ListForms.ListFormEdit.SubFormsRelation.ChildFieldName", diff --git a/api/src/Erp.Platform.DbMigrator/Seeds/ListFormSeeder_Accounting.cs b/api/src/Erp.Platform.DbMigrator/Seeds/ListFormSeeder_Accounting.cs index 305efb74..2267eb9d 100644 --- a/api/src/Erp.Platform.DbMigrator/Seeds/ListFormSeeder_Accounting.cs +++ b/api/src/Erp.Platform.DbMigrator/Seeds/ListFormSeeder_Accounting.cs @@ -72,7 +72,7 @@ public class ListFormSeeder_Accounting : IDataSeedContributor, ITransientDepende SortMode = GridOptions.SortModeSingle, FilterRowJson = DefaultFilterRowJson, HeaderFilterJson = DefaultHeaderFilterJson, - SearchPanelJson= DefaultSearchPanelJson, + SearchPanelJson = DefaultSearchPanelJson, GroupPanelJson = DefaultGroupPanelJson, SelectionJson = DefaultSelectionSingleJson, ColumnOptionJson = DefaultColumnOptionJson, @@ -132,9 +132,7 @@ public class ListFormSeeder_Accounting : IDataSeedContributor, ITransientDepende PermissionJson = DefaultFieldPermissionJson(listForm.Name), PivotSettingsJson = DefaultPivotSettingsJson }, - // BranchId - new() - { + new() { ListFormCode = listForm.ListFormCode, CultureName = LanguageCodes.En, SourceDbType = DbType.Guid, @@ -342,30 +340,6 @@ public class ListFormSeeder_Accounting : IDataSeedContributor, ITransientDepende }, ], autoSave: true); #endregion - - // Sub Forms for Bank - await utils.CloneListFormWithFieldsAsync( - _listFormRepository, - _listFormFieldRepository, - listForm.ListFormCode, - JsonSerializer.Serialize(new List() { - new { - TabTitle = "Bank Accounts", - TabType = ListFormTabTypeEnum.List, - Code = ListFormCodes.Lists.BankAccount, - Relation = new List() { - new { - ParentFieldName = "Id", - ChildFieldName = "BankId" - }, - new { - ParentFieldName = "BranchId", - ChildFieldName = "BranchId" - }, - } - }, - }) - ); } #endregion @@ -376,7 +350,7 @@ public class ListFormSeeder_Accounting : IDataSeedContributor, ITransientDepende new ListForm() { ListFormType = ListFormTypeEnum.List, - IsSubForm = false, + IsSubForm = true, ShowNote = true, LayoutJson = DefaultLayoutJson, CultureName = LanguageCodes.En, @@ -385,7 +359,7 @@ public class ListFormSeeder_Accounting : IDataSeedContributor, ITransientDepende Title = AppCodes.Accounting.BankAccount, DataSourceCode = SeedConsts.DataSources.DefaultCode, IsTenant = true, - IsBranch = true, + IsBranch = false, IsOrganizationUnit = false, Description = AppCodes.Accounting.BankAccount, SelectCommandType = SelectCommandTypeEnum.Table, @@ -396,7 +370,7 @@ public class ListFormSeeder_Accounting : IDataSeedContributor, ITransientDepende SortMode = GridOptions.SortModeSingle, FilterRowJson = DefaultFilterRowJson, HeaderFilterJson = DefaultHeaderFilterJson, - SearchPanelJson= DefaultSearchPanelJson, + SearchPanelJson = DefaultSearchPanelJson, GroupPanelJson = DefaultGroupPanelJson, SelectionJson = DefaultSelectionSingleJson, ColumnOptionJson = DefaultColumnOptionJson, @@ -410,21 +384,20 @@ public class ListFormSeeder_Accounting : IDataSeedContributor, ITransientDepende new() { Order=1, ColCount=1, ColSpan=1, ItemType="group", Items = [ - new EditingFormItemDto { Order = 1, DataField = "BankId", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton }, - new EditingFormItemDto { Order = 2, DataField = "AccountNumber", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxTextBox }, - new EditingFormItemDto { Order = 3, DataField = "AccountOwner", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxTextBox }, - new EditingFormItemDto { Order = 4, DataField = "CurrencyId", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton }, - new EditingFormItemDto { Order = 5, DataField = "CanTransferMoney", ColSpan = 1, EditorType2=EditorTypes.dxCheckBox }, + new EditingFormItemDto { Order = 1, DataField = "AccountNumber", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 2, DataField = "AccountOwner", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 3, DataField = "CurrencyId", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton }, + new EditingFormItemDto { Order = 4, DataField = "CanTransferMoney", ColSpan = 1, EditorType2=EditorTypes.dxCheckBox }, ]} }), FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { new() { FieldName = "CanTransferMoney", FieldDbType = DbType.Boolean, Value = "false", CustomValueType = FieldCustomValueTypeEnum.Value } }), - } + }, autoSave: true ); #region Bank Account Fields - await _listFormFieldRepository.InsertManyAsync(new ListFormField[] { + await _listFormFieldRepository.InsertManyAsync([ new() { ListFormCode = listForm.ListFormCode, CultureName = LanguageCodes.En, @@ -441,29 +414,13 @@ public class ListFormSeeder_Accounting : IDataSeedContributor, ITransientDepende PermissionJson = DefaultFieldPermissionJson(listForm.Name), PivotSettingsJson = DefaultPivotSettingsJson }, - new() { - ListFormCode = listForm.ListFormCode, - CultureName = LanguageCodes.En, - SourceDbType = DbType.Guid, - FieldName = "BankId", - Width = 250, - ListOrderNo = 2, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = true, - LookupJson = LookupQueryValues.DefaultLookupQueryJson(nameof(TableNameEnum.Bank), "Id", "Name"), - ColumnCustomizationJson = DefaultColumnCustomizationJson, - PermissionJson = DefaultFieldPermissionJson(listForm.Name), - PivotSettingsJson = DefaultPivotSettingsJson - }, new() { ListFormCode = listForm.ListFormCode, CultureName = LanguageCodes.En, SourceDbType = DbType.String, FieldName = "AccountNumber", Width = 150, - ListOrderNo = 3, + ListOrderNo = 2, Visible = true, IsActive = true, IsDeleted = false, @@ -481,7 +438,7 @@ public class ListFormSeeder_Accounting : IDataSeedContributor, ITransientDepende SourceDbType = DbType.String, FieldName = "AccountOwner", Width = 250, - ListOrderNo = 4, + ListOrderNo = 3, Visible = true, IsActive = true, IsDeleted = false, @@ -498,7 +455,7 @@ public class ListFormSeeder_Accounting : IDataSeedContributor, ITransientDepende SourceDbType = DbType.Guid, FieldName = "CurrencyId", Width = 150, - ListOrderNo = 5, + ListOrderNo = 4, Visible = true, IsActive = true, IsDeleted = false, @@ -514,7 +471,7 @@ public class ListFormSeeder_Accounting : IDataSeedContributor, ITransientDepende SourceDbType = DbType.Boolean, FieldName = "CanTransferMoney", Width = 50, - ListOrderNo = 6, + ListOrderNo = 5, Visible = true, IsActive = true, IsDeleted = false, @@ -523,10 +480,31 @@ public class ListFormSeeder_Accounting : IDataSeedContributor, ITransientDepende PermissionJson = DefaultFieldPermissionJson(listForm.Name), PivotSettingsJson = DefaultPivotSettingsJson }, - }); + ], autoSave: true); #endregion } #endregion + + // Bank ve Bank Account arasında Sub Forms ilişkisinin kurulması + await utils.CloneListFormWithFieldsAsync( + _listFormRepository, + _listFormFieldRepository, + ListFormCodes.Lists.Bank, + JsonSerializer.Serialize(new List() { + new { + TabTitle = "Bank Accounts", + TabType = ListFormTabTypeEnum.List, + Code = ListFormCodes.Lists.BankAccount, + Relation = new List() { + new { + ParentFieldName = "Id", + DbType = DbType.Guid, + ChildFieldName = "BankId" + }, + } + }, + }) + ); } } diff --git a/api/src/Erp.Platform.DbMigrator/Seeds/ListFormSeeder_Administration.cs b/api/src/Erp.Platform.DbMigrator/Seeds/ListFormSeeder_Administration.cs index e9a13e53..0c540a41 100644 --- a/api/src/Erp.Platform.DbMigrator/Seeds/ListFormSeeder_Administration.cs +++ b/api/src/Erp.Platform.DbMigrator/Seeds/ListFormSeeder_Administration.cs @@ -74,7 +74,7 @@ public class ListFormSeeder_Administration : IDataSeedContributor, ITransientDep SortMode = GridOptions.SortModeSingle, FilterRowJson = DefaultFilterRowJson, HeaderFilterJson = DefaultHeaderFilterJson, - SearchPanelJson= DefaultSearchPanelJson, + SearchPanelJson = DefaultSearchPanelJson, GroupPanelJson = DefaultGroupPanelJson, SelectionJson = DefaultSelectionSingleJson, ColumnOptionJson = DefaultColumnOptionJson, @@ -190,7 +190,7 @@ public class ListFormSeeder_Administration : IDataSeedContributor, ITransientDep SortMode = GridOptions.SortModeSingle, FilterRowJson = DefaultFilterRowJson, HeaderFilterJson = DefaultHeaderFilterJson, - SearchPanelJson= DefaultSearchPanelJson, + SearchPanelJson = DefaultSearchPanelJson, GroupPanelJson = DefaultGroupPanelJson, ColumnOptionJson = DefaultColumnOptionJson, PermissionJson = DefaultPermissionJson(AbpIdentity.Permissions.Create, AbpIdentity.Permissions.Default, AbpIdentity.Permissions.Update, AbpIdentity.Permissions.Delete, AbpIdentity.Permissions.Export, AbpIdentity.Permissions.Import, AbpIdentity.Permissions.Note), @@ -410,7 +410,7 @@ public class ListFormSeeder_Administration : IDataSeedContributor, ITransientDep SortMode = GridOptions.SortModeSingle, FilterRowJson = DefaultFilterRowJson, HeaderFilterJson = DefaultHeaderFilterJson, - SearchPanelJson= DefaultSearchPanelJson, + SearchPanelJson = DefaultSearchPanelJson, GroupPanelJson = DefaultGroupPanelJson, SelectionJson = DefaultSelectionSingleJson, ColumnOptionJson = DefaultColumnOptionJson, @@ -616,7 +616,7 @@ public class ListFormSeeder_Administration : IDataSeedContributor, ITransientDep SortMode = GridOptions.SortModeSingle, FilterRowJson = DefaultFilterRowJson, HeaderFilterJson = DefaultHeaderFilterJson, - SearchPanelJson= DefaultSearchPanelJson, + SearchPanelJson = DefaultSearchPanelJson, GroupPanelJson = DefaultGroupPanelJson, SelectionJson = DefaultSelectionSingleJson, ColumnOptionJson = DefaultColumnOptionJson, @@ -748,7 +748,7 @@ public class ListFormSeeder_Administration : IDataSeedContributor, ITransientDep SortMode = GridOptions.SortModeSingle, FilterRowJson = DefaultFilterRowJson, HeaderFilterJson = DefaultHeaderFilterJson, - SearchPanelJson= DefaultSearchPanelJson, + SearchPanelJson = DefaultSearchPanelJson, GroupPanelJson = DefaultGroupPanelJson, SelectionJson = DefaultSelectionSingleJson, ColumnOptionJson = DefaultColumnOptionJson, @@ -954,7 +954,7 @@ public class ListFormSeeder_Administration : IDataSeedContributor, ITransientDep SortMode = GridOptions.SortModeSingle, FilterRowJson = DefaultFilterRowJson, HeaderFilterJson = DefaultHeaderFilterJson, - SearchPanelJson= DefaultSearchPanelJson, + SearchPanelJson = DefaultSearchPanelJson, GroupPanelJson = DefaultGroupPanelJson, SelectionJson = DefaultSelectionSingleJson, ColumnOptionJson = DefaultColumnOptionJson, @@ -1090,7 +1090,7 @@ public class ListFormSeeder_Administration : IDataSeedContributor, ITransientDep SortMode = GridOptions.SortModeSingle, FilterRowJson = DefaultFilterRowJson, HeaderFilterJson = DefaultHeaderFilterJson, - SearchPanelJson= DefaultSearchPanelJson, + SearchPanelJson = DefaultSearchPanelJson, GroupPanelJson = DefaultGroupPanelJson, SelectionJson = DefaultSelectionSingleJson, ColumnOptionJson = DefaultColumnOptionJson, @@ -1279,7 +1279,7 @@ public class ListFormSeeder_Administration : IDataSeedContributor, ITransientDep SortMode = GridOptions.SortModeSingle, FilterRowJson = DefaultFilterRowJson, HeaderFilterJson = DefaultHeaderFilterJson, - SearchPanelJson= DefaultSearchPanelJson, + SearchPanelJson = DefaultSearchPanelJson, GroupPanelJson = DefaultGroupPanelJson, SelectionJson = DefaultSelectionSingleJson, ColumnOptionJson = DefaultColumnOptionJson, @@ -1495,7 +1495,7 @@ public class ListFormSeeder_Administration : IDataSeedContributor, ITransientDep SortMode = GridOptions.SortModeSingle, FilterRowJson = DefaultFilterRowJson, HeaderFilterJson = DefaultHeaderFilterJson, - SearchPanelJson= DefaultSearchPanelJson, + SearchPanelJson = DefaultSearchPanelJson, GroupPanelJson = JsonSerializer.Serialize(new { Visible = false }), SelectionJson = DefaultSelectionSingleJson, ColumnOptionJson = DefaultColumnOptionJson, @@ -1612,7 +1612,7 @@ public class ListFormSeeder_Administration : IDataSeedContributor, ITransientDep SortMode = GridOptions.SortModeSingle, FilterRowJson = DefaultFilterRowJson, HeaderFilterJson = DefaultHeaderFilterJson, - SearchPanelJson= DefaultSearchPanelJson, + SearchPanelJson = DefaultSearchPanelJson, GroupPanelJson = JsonSerializer.Serialize(new { Visible = false }), SelectionJson = DefaultSelectionSingleJson, ColumnOptionJson = DefaultColumnOptionJson, @@ -1731,7 +1731,7 @@ public class ListFormSeeder_Administration : IDataSeedContributor, ITransientDep SortMode = GridOptions.SortModeSingle, FilterRowJson = DefaultFilterRowJson, HeaderFilterJson = DefaultHeaderFilterJson, - SearchPanelJson= DefaultSearchPanelJson, + SearchPanelJson = DefaultSearchPanelJson, GroupPanelJson = JsonSerializer.Serialize(new { Visible = false }), SelectionJson = DefaultSelectionSingleJson, ColumnOptionJson = DefaultColumnOptionJson, @@ -1905,7 +1905,7 @@ public class ListFormSeeder_Administration : IDataSeedContributor, ITransientDep SortMode = GridOptions.SortModeSingle, FilterRowJson = DefaultFilterRowJson, HeaderFilterJson = DefaultHeaderFilterJson, - SearchPanelJson= DefaultSearchPanelJson, + SearchPanelJson = DefaultSearchPanelJson, GroupPanelJson = JsonSerializer.Serialize(new { Visible = false }), SelectionJson = DefaultSelectionSingleJson, ColumnOptionJson = DefaultColumnOptionJson, @@ -2121,7 +2121,7 @@ public class ListFormSeeder_Administration : IDataSeedContributor, ITransientDep DefaultFilter = DefaultFilterJson, FilterRowJson = DefaultFilterRowJson, HeaderFilterJson = DefaultHeaderFilterJson, - SearchPanelJson= DefaultSearchPanelJson, + SearchPanelJson = DefaultSearchPanelJson, GroupPanelJson = JsonSerializer.Serialize(new { Visible = false }), SelectionJson = DefaultSelectionSingleJson, ColumnOptionJson = DefaultColumnOptionJson, @@ -2244,7 +2244,7 @@ public class ListFormSeeder_Administration : IDataSeedContributor, ITransientDep DefaultFilter = DefaultFilterJson, FilterRowJson = DefaultFilterRowJson, HeaderFilterJson = DefaultHeaderFilterJson, - SearchPanelJson= DefaultSearchPanelJson, + SearchPanelJson = DefaultSearchPanelJson, GroupPanelJson = JsonSerializer.Serialize(new { Visible = false }), SelectionJson = DefaultSelectionSingleJson, ColumnOptionJson = DefaultColumnOptionJson, @@ -2367,7 +2367,7 @@ public class ListFormSeeder_Administration : IDataSeedContributor, ITransientDep SortMode = GridOptions.SortModeSingle, FilterRowJson = DefaultFilterRowJson, HeaderFilterJson = DefaultHeaderFilterJson, - SearchPanelJson= DefaultSearchPanelJson, + SearchPanelJson = DefaultSearchPanelJson, GroupPanelJson = JsonSerializer.Serialize(new { Visible = false }), SelectionJson = DefaultSelectionSingleJson, ColumnOptionJson = DefaultColumnOptionJson, @@ -2806,7 +2806,7 @@ public class ListFormSeeder_Administration : IDataSeedContributor, ITransientDep SortMode = GridOptions.SortModeSingle, FilterRowJson = DefaultFilterRowJson, HeaderFilterJson = DefaultHeaderFilterJson, - SearchPanelJson= DefaultSearchPanelJson, + SearchPanelJson = DefaultSearchPanelJson, GroupPanelJson = DefaultGroupPanelJson, SelectionJson = DefaultSelectionSingleJson, ColumnOptionJson = DefaultColumnOptionJson, @@ -2990,7 +2990,7 @@ public class ListFormSeeder_Administration : IDataSeedContributor, ITransientDep SortMode = GridOptions.SortModeSingle, FilterRowJson = DefaultFilterRowJson, HeaderFilterJson = DefaultHeaderFilterJson, - SearchPanelJson= DefaultSearchPanelJson, + SearchPanelJson = DefaultSearchPanelJson, GroupPanelJson = DefaultGroupPanelJson, SelectionJson = DefaultSelectionSingleJson, ColumnOptionJson = DefaultColumnOptionJson, @@ -3313,7 +3313,7 @@ public class ListFormSeeder_Administration : IDataSeedContributor, ITransientDep SortMode = GridOptions.SortModeSingle, FilterRowJson = DefaultFilterRowJson, HeaderFilterJson = DefaultHeaderFilterJson, - SearchPanelJson= DefaultSearchPanelJson, + SearchPanelJson = DefaultSearchPanelJson, GroupPanelJson = JsonSerializer.Serialize(new { Visible = false }), SelectionJson = DefaultSelectionSingleJson, ColumnOptionJson = DefaultColumnOptionJson, @@ -3524,7 +3524,7 @@ public class ListFormSeeder_Administration : IDataSeedContributor, ITransientDep SortMode = GridOptions.SortModeSingle, FilterRowJson = DefaultFilterRowJson, HeaderFilterJson = DefaultHeaderFilterJson, - SearchPanelJson= DefaultSearchPanelJson, + SearchPanelJson = DefaultSearchPanelJson, GroupPanelJson = JsonSerializer.Serialize(new { Visible = false }), SelectionJson = DefaultSelectionSingleJson, ColumnOptionJson = DefaultColumnOptionJson, @@ -3735,7 +3735,7 @@ public class ListFormSeeder_Administration : IDataSeedContributor, ITransientDep SortMode = GridOptions.SortModeSingle, FilterRowJson = DefaultFilterRowJson, HeaderFilterJson = DefaultHeaderFilterJson, - SearchPanelJson= DefaultSearchPanelJson, + SearchPanelJson = DefaultSearchPanelJson, GroupPanelJson = DefaultGroupPanelJson, SelectionJson = DefaultSelectionSingleJson, ColumnOptionJson = DefaultColumnOptionJson, @@ -4067,7 +4067,7 @@ public class ListFormSeeder_Administration : IDataSeedContributor, ITransientDep SortMode = GridOptions.SortModeSingle, FilterRowJson = DefaultFilterRowJson, HeaderFilterJson = DefaultHeaderFilterJson, - SearchPanelJson= DefaultSearchPanelJson, + SearchPanelJson = DefaultSearchPanelJson, GroupPanelJson = JsonSerializer.Serialize(new { Visible = false }), SelectionJson = DefaultSelectionSingleJson, ColumnOptionJson = DefaultColumnOptionJson, @@ -4131,37 +4131,6 @@ public class ListFormSeeder_Administration : IDataSeedContributor, ITransientDep } ], autoSave: true); #endregion - - // Sub Forms for SkillType - await utils.CloneListFormWithFieldsAsync( - _listFormRepository, - _listFormFieldRepository, - listForm.ListFormCode, - JsonSerializer.Serialize(new List() { - new { - TabTitle = "Skill Levels", - TabType = ListFormTabTypeEnum.List, - Code = ListFormCodes.Lists.SkillLevel, - Relation = new List() { - new { - ParentFieldName = "Id", - ChildFieldName = "SkillTypeId" - } - } - }, - new { - TabTitle = "Skills", - TabType = ListFormTabTypeEnum.List, - Code = ListFormCodes.Lists.Skill, - Relation = new List() { - new { - ParentFieldName = "Id", - ChildFieldName = "SkillTypeId" - } - } - } - }) - ); } #endregion @@ -4172,7 +4141,7 @@ public class ListFormSeeder_Administration : IDataSeedContributor, ITransientDep new ListForm() { ListFormType = ListFormTypeEnum.List, - IsSubForm = false, + IsSubForm = true, ShowNote = true, LayoutJson = DefaultLayoutJson, CultureName = LanguageCodes.En, @@ -4192,7 +4161,7 @@ public class ListFormSeeder_Administration : IDataSeedContributor, ITransientDep SortMode = GridOptions.SortModeSingle, FilterRowJson = DefaultFilterRowJson, HeaderFilterJson = DefaultHeaderFilterJson, - SearchPanelJson= DefaultSearchPanelJson, + SearchPanelJson = DefaultSearchPanelJson, GroupPanelJson = DefaultGroupPanelJson, SelectionJson = DefaultSelectionSingleJson, ColumnOptionJson = DefaultColumnOptionJson, @@ -4207,7 +4176,6 @@ public class ListFormSeeder_Administration : IDataSeedContributor, ITransientDep new EditingFormItemDto { Order = 1, DataField = "Name", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxTextBox }, new EditingFormItemDto { Order = 2, DataField = "Progress", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxSlider, EditorOptions=EditorOptionValues.SliderOptions }, new EditingFormItemDto { Order = 3, DataField = "IsDefault", ColSpan = 1, EditorType2=EditorTypes.dxCheckBox }, - new EditingFormItemDto { Order = 4, DataField = "SkillTypeId", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton }, ] } }), @@ -4215,11 +4183,11 @@ public class ListFormSeeder_Administration : IDataSeedContributor, ITransientDep FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { new() { FieldName = "IsDefault", FieldDbType = DbType.Boolean, Value = "true", CustomValueType = FieldCustomValueTypeEnum.Value } }), - } + }, autoSave: true ); #region Skill Level Fields - await _listFormFieldRepository.InsertManyAsync(new ListFormField[] { + await _listFormFieldRepository.InsertManyAsync([ new() { ListFormCode = listForm.ListFormCode, CultureName = LanguageCodes.En, @@ -4284,24 +4252,7 @@ public class ListFormSeeder_Administration : IDataSeedContributor, ITransientDep PermissionJson = DefaultFieldPermissionJson(listForm.Name), PivotSettingsJson = DefaultPivotSettingsJson }, - new() { - ListFormCode = listForm.ListFormCode, - CultureName = LanguageCodes.En, - SourceDbType = DbType.Guid, - FieldName = "SkillTypeId", - Width = 150, - ListOrderNo = 5, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = true, - LookupJson = LookupQueryValues.DefaultLookupQueryJson(nameof(TableNameEnum.SkillType), "Id", "Name"), - ValidationRuleJson = DefaultValidationRuleRequiredJson, - ColumnCustomizationJson = DefaultColumnCustomizationJson, - PermissionJson = DefaultFieldPermissionJson(listForm.Name), - PivotSettingsJson = DefaultPivotSettingsJson - }, - }); + ], autoSave: true); #endregion } #endregion @@ -4313,7 +4264,7 @@ public class ListFormSeeder_Administration : IDataSeedContributor, ITransientDep new ListForm() { ListFormType = ListFormTypeEnum.List, - IsSubForm = false, + IsSubForm = true, ShowNote = true, LayoutJson = DefaultLayoutJson, CultureName = LanguageCodes.En, @@ -4333,7 +4284,7 @@ public class ListFormSeeder_Administration : IDataSeedContributor, ITransientDep SortMode = GridOptions.SortModeSingle, FilterRowJson = DefaultFilterRowJson, HeaderFilterJson = DefaultHeaderFilterJson, - SearchPanelJson= DefaultSearchPanelJson, + SearchPanelJson = DefaultSearchPanelJson, GroupPanelJson = DefaultGroupPanelJson, SelectionJson = DefaultSelectionSingleJson, ColumnOptionJson = DefaultColumnOptionJson, @@ -4345,15 +4296,14 @@ public class ListFormSeeder_Administration : IDataSeedContributor, ITransientDep EditingFormJson = JsonSerializer.Serialize(new List() { new() { Order=1, ColCount=1, ColSpan=1, ItemType="group", Items=[ new EditingFormItemDto { Order = 1, DataField = "Name", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxTextBox }, - new EditingFormItemDto { Order = 2, DataField = "SkillTypeId", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton }, ]} }), InsertFieldsDefaultValueJson = DefaultInsertFieldsDefaultValueJson, - } + }, autoSave: true ); #region Skill Fields - await _listFormFieldRepository.InsertManyAsync(new ListFormField[] { + await _listFormFieldRepository.InsertManyAsync([ new() { ListFormCode = listForm.ListFormCode, CultureName = LanguageCodes.En, @@ -4388,33 +4338,50 @@ public class ListFormSeeder_Administration : IDataSeedContributor, ITransientDep PermissionJson = DefaultFieldPermissionJson(listForm.Name), PivotSettingsJson = DefaultPivotSettingsJson }, - new() { - ListFormCode = listForm.ListFormCode, - CultureName = LanguageCodes.En, - SourceDbType = DbType.Guid, - FieldName = "SkillTypeId", - Width = 150, - ListOrderNo = 3, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = true, - LookupJson = LookupQueryValues.DefaultLookupQueryJson(nameof(TableNameEnum.SkillType), "Id", "Name"), - ValidationRuleJson = DefaultValidationRuleRequiredJson, - ColumnCustomizationJson = DefaultColumnCustomizationJson, - PermissionJson = DefaultFieldPermissionJson(listForm.Name), - PivotSettingsJson = DefaultPivotSettingsJson - }, - }); + ], autoSave: true); #endregion } #endregion + // Skill Type ile Skill Level ve Skill Sub Forms ilişkisinin kurulması + await utils.CloneListFormWithFieldsAsync( + _listFormRepository, + _listFormFieldRepository, + ListFormCodes.Lists.SkillType, + JsonSerializer.Serialize(new List() { + new { + TabTitle = "Skill Levels", + TabType = ListFormTabTypeEnum.List, + Code = ListFormCodes.Lists.SkillLevel, + Relation = new List() { + new { + ParentFieldName = "Id", + DbType = DbType.Guid, + ChildFieldName = "SkillTypeId" + } + } + }, + new { + TabTitle = "Skills", + TabType = ListFormTabTypeEnum.List, + Code = ListFormCodes.Lists.Skill, + Relation = new List() { + new { + ParentFieldName = "Id", + DbType = DbType.Guid, + ChildFieldName = "SkillTypeId" + } + } + } + }) + ); + #region UomCategory if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.UomCategory)) { var listForm = await _listFormRepository.InsertAsync( - new ListForm { + new ListForm + { ListFormType = ListFormTypeEnum.List, IsSubForm = false, ShowNote = true, @@ -4436,7 +4403,7 @@ public class ListFormSeeder_Administration : IDataSeedContributor, ITransientDep SortMode = GridOptions.SortModeSingle, FilterRowJson = DefaultFilterRowJson, HeaderFilterJson = DefaultHeaderFilterJson, - SearchPanelJson= DefaultSearchPanelJson, + SearchPanelJson = DefaultSearchPanelJson, GroupPanelJson = JsonSerializer.Serialize(new { Visible = false }), SelectionJson = DefaultSelectionSingleJson, ColumnOptionJson = DefaultColumnOptionJson, @@ -4500,26 +4467,6 @@ public class ListFormSeeder_Administration : IDataSeedContributor, ITransientDep } ], autoSave: true); #endregion - - // Sub Forms for UomCategory - await utils.CloneListFormWithFieldsAsync( - _listFormRepository, - _listFormFieldRepository, - ListFormCodes.Lists.UomCategory, - JsonSerializer.Serialize(new List() { - new { - TabTitle = "Uoms", - TabType = ListFormTabTypeEnum.List, - Code = ListFormCodes.Lists.Uom, - Relation = new List() { - new { - ParentFieldName = "Id", - ChildFieldName = "UomCategoryId" - } - } - }, - }) - ); } #endregion @@ -4530,7 +4477,7 @@ public class ListFormSeeder_Administration : IDataSeedContributor, ITransientDep new ListForm() { ListFormType = ListFormTypeEnum.List, - IsSubForm = false, + IsSubForm = true, ShowNote = true, LayoutJson = DefaultLayoutJson, CultureName = LanguageCodes.En, @@ -4550,7 +4497,7 @@ public class ListFormSeeder_Administration : IDataSeedContributor, ITransientDep SortMode = GridOptions.SortModeSingle, FilterRowJson = DefaultFilterRowJson, HeaderFilterJson = DefaultHeaderFilterJson, - SearchPanelJson= DefaultSearchPanelJson, + SearchPanelJson = DefaultSearchPanelJson, GroupPanelJson = DefaultGroupPanelJson, SelectionJson = DefaultSelectionSingleJson, ColumnOptionJson = DefaultColumnOptionJson, @@ -4566,16 +4513,18 @@ public class ListFormSeeder_Administration : IDataSeedContributor, ITransientDep new EditingFormItemDto { Order = 2, DataField = "Type", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton }, new EditingFormItemDto { Order = 3, DataField = "Ratio", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxNumberBox }, new EditingFormItemDto { Order = 4, DataField = "Rounding", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxNumberBox }, - new EditingFormItemDto { Order = 5, DataField = "IsActive", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxCheckBox }, - new EditingFormItemDto { Order = 6, DataField = "UomCategoryId", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton }, + new EditingFormItemDto { Order = 5, DataField = "IsActive", ColSpan = 1, EditorType2=EditorTypes.dxCheckBox }, ]} }), InsertFieldsDefaultValueJson = DefaultInsertFieldsDefaultValueJson, - } + FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { + new() { FieldName = "IsActive", FieldDbType = DbType.Boolean, Value = "true", CustomValueType = FieldCustomValueTypeEnum.Value } + }), + }, autoSave: true ); #region Uom Fields - await _listFormFieldRepository.InsertManyAsync(new ListFormField[] { + await _listFormFieldRepository.InsertManyAsync([ new ListFormField { ListFormCode = listForm.ListFormCode, @@ -4681,25 +4630,45 @@ public class ListFormSeeder_Administration : IDataSeedContributor, ITransientDep { ListFormCode = listForm.ListFormCode, CultureName = LanguageCodes.En, - SourceDbType = DbType.Guid, - FieldName = "UomCategoryId", - Width = 150, + SourceDbType = DbType.Boolean, + FieldName = "IsActive", + Width = 100, ListOrderNo = 6, Visible = true, IsActive = true, IsDeleted = false, AllowSearch = true, - LookupJson = LookupQueryValues.DefaultLookupQueryJson(nameof(TableNameEnum.UomCategory), "Id", "Name"), ValidationRuleJson = DefaultValidationRuleRequiredJson, ColumnCustomizationJson = DefaultColumnCustomizationJson, PermissionJson = DefaultFieldPermissionJson(listForm.Name), PivotSettingsJson = DefaultPivotSettingsJson }, - }); + ], autoSave: true); #endregion } #endregion + // UomCategory ve Uom arasında Sub Forms ilişkisinin kurulması + await utils.CloneListFormWithFieldsAsync( + _listFormRepository, + _listFormFieldRepository, + ListFormCodes.Lists.UomCategory, + JsonSerializer.Serialize(new List() { + new { + TabTitle = "Uoms", + TabType = ListFormTabTypeEnum.List, + Code = ListFormCodes.Lists.Uom, + Relation = new List() { + new { + ParentFieldName = "Id", + DbType = DbType.Guid, + ChildFieldName = "UomCategoryId" + } + } + }, + }) + ); + #region Behavior if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.Behavior)) { @@ -4727,7 +4696,7 @@ public class ListFormSeeder_Administration : IDataSeedContributor, ITransientDep SortMode = GridOptions.SortModeSingle, FilterRowJson = DefaultFilterRowJson, HeaderFilterJson = DefaultHeaderFilterJson, - SearchPanelJson= DefaultSearchPanelJson, + SearchPanelJson = DefaultSearchPanelJson, GroupPanelJson = DefaultGroupPanelJson, SelectionJson = DefaultSelectionSingleJson, ColumnOptionJson = DefaultColumnOptionJson, @@ -4813,7 +4782,7 @@ public class ListFormSeeder_Administration : IDataSeedContributor, ITransientDep SortMode = GridOptions.SortModeSingle, FilterRowJson = DefaultFilterRowJson, HeaderFilterJson = DefaultHeaderFilterJson, - SearchPanelJson= DefaultSearchPanelJson, + SearchPanelJson = DefaultSearchPanelJson, GroupPanelJson = DefaultGroupPanelJson, SelectionJson = DefaultSelectionSingleJson, ColumnOptionJson = DefaultColumnOptionJson, @@ -4901,7 +4870,7 @@ public class ListFormSeeder_Administration : IDataSeedContributor, ITransientDep SortMode = GridOptions.SortModeSingle, FilterRowJson = DefaultFilterRowJson, HeaderFilterJson = DefaultHeaderFilterJson, - SearchPanelJson= DefaultSearchPanelJson, + SearchPanelJson = DefaultSearchPanelJson, GroupPanelJson = DefaultGroupPanelJson, SelectionJson = DefaultSelectionSingleJson, ColumnOptionJson = DefaultColumnOptionJson, @@ -4986,7 +4955,7 @@ public class ListFormSeeder_Administration : IDataSeedContributor, ITransientDep SortMode = GridOptions.SortModeSingle, FilterRowJson = DefaultFilterRowJson, HeaderFilterJson = DefaultHeaderFilterJson, - SearchPanelJson= DefaultSearchPanelJson, + SearchPanelJson = DefaultSearchPanelJson, GroupPanelJson = DefaultGroupPanelJson, SelectionJson = DefaultSelectionSingleJson, ColumnOptionJson = DefaultColumnOptionJson, @@ -5089,7 +5058,7 @@ public class ListFormSeeder_Administration : IDataSeedContributor, ITransientDep SortMode = GridOptions.SortModeSingle, FilterRowJson = DefaultFilterRowJson, HeaderFilterJson = DefaultHeaderFilterJson, - SearchPanelJson= DefaultSearchPanelJson, + SearchPanelJson = DefaultSearchPanelJson, GroupPanelJson = DefaultGroupPanelJson, SelectionJson = DefaultSelectionSingleJson, ColumnOptionJson = DefaultColumnOptionJson, @@ -5175,7 +5144,7 @@ public class ListFormSeeder_Administration : IDataSeedContributor, ITransientDep SortMode = GridOptions.SortModeSingle, FilterRowJson = DefaultFilterRowJson, HeaderFilterJson = DefaultHeaderFilterJson, - SearchPanelJson= DefaultSearchPanelJson, + SearchPanelJson = DefaultSearchPanelJson, GroupPanelJson = DefaultGroupPanelJson, SelectionJson = DefaultSelectionSingleJson, ColumnOptionJson = DefaultColumnOptionJson, @@ -5448,7 +5417,7 @@ public class ListFormSeeder_Administration : IDataSeedContributor, ITransientDep SortMode = GridOptions.SortModeSingle, FilterRowJson = DefaultFilterRowJson, HeaderFilterJson = DefaultHeaderFilterJson, - SearchPanelJson= DefaultSearchPanelJson, + SearchPanelJson = DefaultSearchPanelJson, GroupPanelJson = DefaultGroupPanelJson, SelectionJson = DefaultSelectionSingleJson, ColumnOptionJson = DefaultColumnOptionJson, @@ -5624,7 +5593,7 @@ public class ListFormSeeder_Administration : IDataSeedContributor, ITransientDep SortMode = GridOptions.SortModeSingle, FilterRowJson = DefaultFilterRowJson, HeaderFilterJson = DefaultHeaderFilterJson, - SearchPanelJson= DefaultSearchPanelJson, + SearchPanelJson = DefaultSearchPanelJson, GroupPanelJson = DefaultGroupPanelJson, SelectionJson = DefaultSelectionSingleJson, ColumnOptionJson = DefaultColumnOptionJson, diff --git a/api/src/Erp.Platform.DbMigrator/Seeds/ListFormSeeder_Coordinator.cs b/api/src/Erp.Platform.DbMigrator/Seeds/ListFormSeeder_Coordinator.cs index 0d9b159d..ecfa7ee1 100644 --- a/api/src/Erp.Platform.DbMigrator/Seeds/ListFormSeeder_Coordinator.cs +++ b/api/src/Erp.Platform.DbMigrator/Seeds/ListFormSeeder_Coordinator.cs @@ -72,7 +72,7 @@ public class ListFormSeeder_Coordinator : IDataSeedContributor, ITransientDepend SortMode = GridOptions.SortModeSingle, FilterRowJson = DefaultFilterRowJson, HeaderFilterJson = DefaultHeaderFilterJson, - SearchPanelJson= DefaultSearchPanelJson, + SearchPanelJson = DefaultSearchPanelJson, GroupPanelJson = DefaultGroupPanelJson, SelectionJson = DefaultSelectionSingleJson, ColumnOptionJson = DefaultColumnOptionJson, @@ -186,7 +186,7 @@ public class ListFormSeeder_Coordinator : IDataSeedContributor, ITransientDepend SortMode = GridOptions.SortModeSingle, FilterRowJson = DefaultFilterRowJson, HeaderFilterJson = DefaultHeaderFilterJson, - SearchPanelJson= DefaultSearchPanelJson, + SearchPanelJson = DefaultSearchPanelJson, GroupPanelJson = DefaultGroupPanelJson, SelectionJson = DefaultSelectionSingleJson, ColumnOptionJson = DefaultColumnOptionJson, @@ -580,7 +580,7 @@ public class ListFormSeeder_Coordinator : IDataSeedContributor, ITransientDepend SortMode = GridOptions.SortModeSingle, FilterRowJson = DefaultFilterRowJson, HeaderFilterJson = DefaultHeaderFilterJson, - SearchPanelJson= DefaultSearchPanelJson, + SearchPanelJson = DefaultSearchPanelJson, GroupPanelJson = DefaultGroupPanelJson, SelectionJson = DefaultSelectionSingleJson, ColumnOptionJson = DefaultColumnOptionJson, @@ -726,7 +726,7 @@ public class ListFormSeeder_Coordinator : IDataSeedContributor, ITransientDepend SortMode = GridOptions.SortModeSingle, FilterRowJson = DefaultFilterRowJson, HeaderFilterJson = DefaultHeaderFilterJson, - SearchPanelJson= DefaultSearchPanelJson, + SearchPanelJson = DefaultSearchPanelJson, GroupPanelJson = DefaultGroupPanelJson, SelectionJson = DefaultSelectionSingleJson, ColumnOptionJson = DefaultColumnOptionJson, @@ -899,7 +899,7 @@ public class ListFormSeeder_Coordinator : IDataSeedContributor, ITransientDepend SortMode = GridOptions.SortModeSingle, FilterRowJson = DefaultFilterRowJson, HeaderFilterJson = DefaultHeaderFilterJson, - SearchPanelJson= DefaultSearchPanelJson, + SearchPanelJson = DefaultSearchPanelJson, GroupPanelJson = DefaultGroupPanelJson, SelectionJson = DefaultSelectionSingleJson, ColumnOptionJson = DefaultColumnOptionJson, @@ -1107,7 +1107,7 @@ public class ListFormSeeder_Coordinator : IDataSeedContributor, ITransientDepend SortMode = GridOptions.SortModeSingle, FilterRowJson = DefaultFilterRowJson, HeaderFilterJson = DefaultHeaderFilterJson, - SearchPanelJson= DefaultSearchPanelJson, + SearchPanelJson = DefaultSearchPanelJson, GroupPanelJson = DefaultGroupPanelJson, SelectionJson = DefaultSelectionSingleJson, ColumnOptionJson = DefaultColumnOptionJson, @@ -1280,7 +1280,7 @@ public class ListFormSeeder_Coordinator : IDataSeedContributor, ITransientDepend SortMode = GridOptions.SortModeSingle, FilterRowJson = DefaultFilterRowJson, HeaderFilterJson = DefaultHeaderFilterJson, - SearchPanelJson= DefaultSearchPanelJson, + SearchPanelJson = DefaultSearchPanelJson, GroupPanelJson = DefaultGroupPanelJson, SelectionJson = DefaultSelectionSingleJson, ColumnOptionJson = DefaultColumnOptionJson, @@ -1552,7 +1552,7 @@ public class ListFormSeeder_Coordinator : IDataSeedContributor, ITransientDepend SortMode = GridOptions.SortModeSingle, FilterRowJson = DefaultFilterRowJson, HeaderFilterJson = DefaultHeaderFilterJson, - SearchPanelJson= DefaultSearchPanelJson, + SearchPanelJson = DefaultSearchPanelJson, GroupPanelJson = DefaultGroupPanelJson, SelectionJson = DefaultSelectionSingleJson, ColumnOptionJson = DefaultColumnOptionJson, @@ -1666,7 +1666,7 @@ public class ListFormSeeder_Coordinator : IDataSeedContributor, ITransientDepend SortMode = GridOptions.SortModeSingle, FilterRowJson = DefaultFilterRowJson, HeaderFilterJson = DefaultHeaderFilterJson, - SearchPanelJson= DefaultSearchPanelJson, + SearchPanelJson = DefaultSearchPanelJson, GroupPanelJson = DefaultGroupPanelJson, SelectionJson = DefaultSelectionSingleJson, ColumnOptionJson = DefaultColumnOptionJson, @@ -1905,7 +1905,7 @@ public class ListFormSeeder_Coordinator : IDataSeedContributor, ITransientDepend SortMode = GridOptions.SortModeSingle, FilterRowJson = DefaultFilterRowJson, HeaderFilterJson = DefaultHeaderFilterJson, - SearchPanelJson= DefaultSearchPanelJson, + SearchPanelJson = DefaultSearchPanelJson, GroupPanelJson = DefaultGroupPanelJson, SelectionJson = DefaultSelectionSingleJson, ColumnOptionJson = DefaultColumnOptionJson, @@ -1915,7 +1915,7 @@ public class ListFormSeeder_Coordinator : IDataSeedContributor, ITransientDepend PagerOptionJson = DefaultPagerOptionJson, EditingOptionJson = DefaultEditingOptionJson(AppCodes.Definitions.QuestionTag, 500, 250, true, true, true, true, false), EditingFormJson = JsonSerializer.Serialize(new List() { - new() { + new() { Order=1, ColCount=1, ColSpan=1, ItemType="group", Items= [ new EditingFormItemDto { Order = 1, DataField = "Name", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxTextBox }, @@ -1924,7 +1924,7 @@ public class ListFormSeeder_Coordinator : IDataSeedContributor, ITransientDepend ]} }), InsertFieldsDefaultValueJson = DefaultInsertFieldsDefaultValueJson, - } + }, autoSave: true ); #region QuestionTag Fields @@ -1993,7 +1993,7 @@ public class ListFormSeeder_Coordinator : IDataSeedContributor, ITransientDepend PermissionJson = DefaultFieldPermissionJson(listForm.Name), PivotSettingsJson = DefaultPivotSettingsJson } - ]); + ], autoSave: true); #endregion } #endregion @@ -2025,7 +2025,7 @@ public class ListFormSeeder_Coordinator : IDataSeedContributor, ITransientDepend SortMode = GridOptions.SortModeSingle, FilterRowJson = DefaultFilterRowJson, HeaderFilterJson = DefaultHeaderFilterJson, - SearchPanelJson= DefaultSearchPanelJson, + SearchPanelJson = DefaultSearchPanelJson, GroupPanelJson = DefaultGroupPanelJson, SelectionJson = DefaultSelectionSingleJson, ColumnOptionJson = DefaultColumnOptionJson, @@ -2035,7 +2035,7 @@ public class ListFormSeeder_Coordinator : IDataSeedContributor, ITransientDepend PagerOptionJson = DefaultPagerOptionJson, EditingOptionJson = DefaultEditingOptionJson(AppCodes.Definitions.QuestionPool, 500, 250, true, true, true, true, false), EditingFormJson = JsonSerializer.Serialize(new List() { - new() { + new() { Order=1, ColCount=1, ColSpan=1,ItemType="group", Items= [ new EditingFormItemDto { Order = 1, DataField = "Name", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxTextBox }, new EditingFormItemDto { Order = 2, DataField = "Description", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxTextBox }, @@ -2124,26 +2124,6 @@ public class ListFormSeeder_Coordinator : IDataSeedContributor, ITransientDepend } ], autoSave: true); #endregion - - // Sub Forms for Question Pool - await utils.CloneListFormWithFieldsAsync( - _listFormRepository, - _listFormFieldRepository, - listForm.ListFormCode, - JsonSerializer.Serialize(new List() { - new { - TabTitle = "Questions", - TabType = ListFormTabTypeEnum.List, - Code = ListFormCodes.Lists.Question, - Relation = new List() { - new { - ParentFieldName = "Id", - ChildFieldName = "QuestionPoolId" - } - } - } - }) - ); } #endregion @@ -2174,7 +2154,7 @@ public class ListFormSeeder_Coordinator : IDataSeedContributor, ITransientDepend SortMode = GridOptions.SortModeSingle, FilterRowJson = DefaultFilterRowJson, HeaderFilterJson = DefaultHeaderFilterJson, - SearchPanelJson= DefaultSearchPanelJson, + SearchPanelJson = DefaultSearchPanelJson, GroupPanelJson = DefaultGroupPanelJson, SelectionJson = DefaultSelectionSingleJson, ColumnOptionJson = DefaultColumnOptionJson, @@ -2197,13 +2177,13 @@ public class ListFormSeeder_Coordinator : IDataSeedContributor, ITransientDepend }), EditingFormJson = JsonSerializer.Serialize(new List() { new() { Order=1, ColCount=1, ColSpan=1, ItemType="group", Items= [ - new EditingFormItemDto { Order = 1, DataField = "QuestionPoolId", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton }, - new EditingFormItemDto { Order = 2, DataField = "QuestionType", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton }, - new EditingFormItemDto { Order = 3, DataField = "Points", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxNumberBox }, - new EditingFormItemDto { Order = 4, DataField = "Title", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxTextBox }, - new EditingFormItemDto { Order = 5, DataField = "Content", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxTextArea }, - new EditingFormItemDto { Order = 6, DataField = "Difficulty", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton }, - new EditingFormItemDto { Order = 7, DataField = "MediaType", ColSpan = 1, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton }, + new EditingFormItemDto { Order = 1, DataField = "QuestionType", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton }, + new EditingFormItemDto { Order = 2, DataField = "Points", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxNumberBox }, + new EditingFormItemDto { Order = 3, DataField = "Title", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 4, DataField = "Content", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxTextArea }, + new EditingFormItemDto { Order = 5, DataField = "MediaType", ColSpan = 1, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton }, + new EditingFormItemDto { Order = 6, DataField = "MediaUrl", ColSpan = 1, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 7, DataField = "Difficulty", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton }, new EditingFormItemDto { Order = 8, DataField = "MediaUrl", ColSpan = 1, EditorType2 = EditorTypes.dxTextBox }, new EditingFormItemDto { Order = 9, DataField = "CorrectAnswer", ColSpan = 1, EditorType2 = EditorTypes.dxTextBox, EditorOptions="{\"disabled\": true}" }, new EditingFormItemDto { Order = 10, DataField = "TimeLimit", ColSpan = 1, EditorType2 = EditorTypes.dxNumberBox }, @@ -2214,7 +2194,7 @@ public class ListFormSeeder_Coordinator : IDataSeedContributor, ITransientDepend new() { FieldName = "MediaType", FieldDbType = DbType.String, Value = "image", CustomValueType = FieldCustomValueTypeEnum.Value }, new() { FieldName = "Difficulty", FieldDbType = DbType.String, Value = "easy", CustomValueType = FieldCustomValueTypeEnum.Value } }) - } + }, autoSave: true ); #region Question Fields @@ -2235,30 +2215,13 @@ public class ListFormSeeder_Coordinator : IDataSeedContributor, ITransientDepend PermissionJson = DefaultFieldPermissionJson(listForm.Name), PivotSettingsJson = DefaultPivotSettingsJson }, - new() { - ListFormCode = listForm.ListFormCode, - CultureName = LanguageCodes.En, - SourceDbType = DbType.Guid, - FieldName = "QuestionPoolId", - Width = 100, - ListOrderNo = 2, - Visible = false, - IsActive = true, - IsDeleted = false, - SortIndex = 0, - ValidationRuleJson = DefaultValidationRuleRequiredJson, - LookupJson = LookupQueryValues.DefaultLookupQueryJson(nameof(TableNameEnum.QuestionPool), "Id", "Name"), - ColumnCustomizationJson = DefaultColumnCustomizationJson, - PermissionJson = DefaultFieldPermissionJson(listForm.Name), - PivotSettingsJson = DefaultPivotSettingsJson - }, new() { ListFormCode = listForm.ListFormCode, CultureName = LanguageCodes.En, SourceDbType = DbType.String, FieldName = "QuestionType", Width = 120, - ListOrderNo = 3, + ListOrderNo = 2, Visible = true, IsActive = true, IsDeleted = false, @@ -2292,7 +2255,7 @@ public class ListFormSeeder_Coordinator : IDataSeedContributor, ITransientDepend Format = "fixedPoint", Alignment = "right", Width = 60, - ListOrderNo = 4, + ListOrderNo = 3, Visible = true, IsActive = true, IsDeleted = false, @@ -2307,7 +2270,7 @@ public class ListFormSeeder_Coordinator : IDataSeedContributor, ITransientDepend SourceDbType = DbType.String, FieldName = "Title", Width = 150, - ListOrderNo = 5, + ListOrderNo = 4, Visible = true, IsActive = true, IsDeleted = false, @@ -2322,7 +2285,7 @@ public class ListFormSeeder_Coordinator : IDataSeedContributor, ITransientDepend SourceDbType = DbType.String, FieldName = "Content", Width = 350, - ListOrderNo = 6, + ListOrderNo = 5, Visible = true, IsActive = true, IsDeleted = false, @@ -2337,7 +2300,7 @@ public class ListFormSeeder_Coordinator : IDataSeedContributor, ITransientDepend SourceDbType = DbType.String, FieldName = "MediaType", Width = 100, - ListOrderNo = 7, + ListOrderNo = 6, Visible = true, IsActive = true, IsDeleted = false, @@ -2362,7 +2325,7 @@ public class ListFormSeeder_Coordinator : IDataSeedContributor, ITransientDepend SourceDbType = DbType.String, FieldName = "MediaUrl", Width = 170, - ListOrderNo = 8, + ListOrderNo = 7, Visible = true, IsActive = true, IsDeleted = false, @@ -2377,7 +2340,7 @@ public class ListFormSeeder_Coordinator : IDataSeedContributor, ITransientDepend SourceDbType = DbType.String, FieldName = "CorrectAnswer", Width = 150, - ListOrderNo = 9, + ListOrderNo = 8, Visible = true, IsActive = true, IsDeleted = false, @@ -2392,7 +2355,7 @@ public class ListFormSeeder_Coordinator : IDataSeedContributor, ITransientDepend SourceDbType = DbType.String, FieldName = "Difficulty", Width = 100, - ListOrderNo = 10, + ListOrderNo = 9, Visible = true, IsActive = true, IsDeleted = false, @@ -2418,7 +2381,7 @@ public class ListFormSeeder_Coordinator : IDataSeedContributor, ITransientDepend SourceDbType = DbType.Int32, FieldName = "TimeLimit", Width = 100, - ListOrderNo = 11, + ListOrderNo = 10, Visible = true, IsActive = true, IsDeleted = false, @@ -2433,7 +2396,7 @@ public class ListFormSeeder_Coordinator : IDataSeedContributor, ITransientDepend SourceDbType = DbType.String, FieldName = "Explanation", Width = 100, - ListOrderNo = 12, + ListOrderNo = 11, Visible = true, IsActive = true, IsDeleted = false, @@ -2442,9 +2405,30 @@ public class ListFormSeeder_Coordinator : IDataSeedContributor, ITransientDepend PermissionJson = DefaultFieldPermissionJson(listForm.Name), PivotSettingsJson = DefaultPivotSettingsJson }, - ]); + ], autoSave: true); #endregion } + + // QuestionPool ve Question arasında Sub Forms ilişkisinin kurulması + await utils.CloneListFormWithFieldsAsync( + _listFormRepository, + _listFormFieldRepository, + ListFormCodes.Lists.QuestionPool, + JsonSerializer.Serialize(new List() { + new { + TabTitle = "Questions", + TabType = ListFormTabTypeEnum.List, + Code = ListFormCodes.Lists.Question, + Relation = new List() { + new { + ParentFieldName = "Id", + DbType = DbType.Guid, + ChildFieldName = "QuestionPoolId" + } + } + } + }) + ); #endregion } } diff --git a/api/src/Erp.Platform.DbMigrator/Seeds/ListFormSeeder_Crm.cs b/api/src/Erp.Platform.DbMigrator/Seeds/ListFormSeeder_Crm.cs index 6f8d9f59..4a7e6a61 100644 --- a/api/src/Erp.Platform.DbMigrator/Seeds/ListFormSeeder_Crm.cs +++ b/api/src/Erp.Platform.DbMigrator/Seeds/ListFormSeeder_Crm.cs @@ -72,7 +72,7 @@ public class ListFormSeeder_Crm : IDataSeedContributor, ITransientDependency SortMode = GridOptions.SortModeSingle, FilterRowJson = DefaultFilterRowJson, HeaderFilterJson = DefaultHeaderFilterJson, - SearchPanelJson= DefaultSearchPanelJson, + SearchPanelJson = DefaultSearchPanelJson, GroupPanelJson = DefaultGroupPanelJson, SelectionJson = DefaultSelectionSingleJson, ColumnOptionJson = DefaultColumnOptionJson, @@ -193,7 +193,7 @@ public class ListFormSeeder_Crm : IDataSeedContributor, ITransientDependency SortMode = GridOptions.SortModeSingle, FilterRowJson = DefaultFilterRowJson, HeaderFilterJson = DefaultHeaderFilterJson, - SearchPanelJson= DefaultSearchPanelJson, + SearchPanelJson = DefaultSearchPanelJson, GroupPanelJson = DefaultGroupPanelJson, SelectionJson = DefaultSelectionSingleJson, ColumnOptionJson = DefaultColumnOptionJson, @@ -313,7 +313,7 @@ public class ListFormSeeder_Crm : IDataSeedContributor, ITransientDependency SortMode = GridOptions.SortModeSingle, FilterRowJson = DefaultFilterRowJson, HeaderFilterJson = DefaultHeaderFilterJson, - SearchPanelJson= DefaultSearchPanelJson, + SearchPanelJson = DefaultSearchPanelJson, GroupPanelJson = DefaultGroupPanelJson, SelectionJson = DefaultSelectionSingleJson, ColumnOptionJson = DefaultColumnOptionJson, @@ -936,48 +936,6 @@ public class ListFormSeeder_Crm : IDataSeedContributor, ITransientDependency PivotSettingsJson = DefaultPivotSettingsJson }, ], autoSave: true); - - // Sub Forms for Customer - await utils.CloneListFormWithFieldsAsync( - _listFormRepository, - _listFormFieldRepository, - listForm.ListFormCode, - JsonSerializer.Serialize(new List() { - new { - TabTitle = "Banks", - TabType = ListFormTabTypeEnum.List, - Code = ListFormCodes.Lists.PartnerBank, - Relation = new List() { - new { - ParentFieldName = "Id", - ChildFieldName = "PartnerId" - } - } - }, - new { - TabTitle = "Certificates", - TabType = ListFormTabTypeEnum.List, - Code = ListFormCodes.Lists.PartnerCertificate, - Relation = new List() { - new { - ParentFieldName = "Id", - ChildFieldName = "PartnerId" - } - } - }, - new { - TabTitle = "Contacts", - TabType = ListFormTabTypeEnum.List, - Code = ListFormCodes.Lists.PartnerContact, - Relation = new List() { - new { - ParentFieldName = "Id", - ChildFieldName = "PartnerId" - } - } - } - }) - ); } #endregion @@ -1008,7 +966,7 @@ public class ListFormSeeder_Crm : IDataSeedContributor, ITransientDependency SortMode = GridOptions.SortModeSingle, FilterRowJson = DefaultFilterRowJson, HeaderFilterJson = DefaultHeaderFilterJson, - SearchPanelJson= DefaultSearchPanelJson, + SearchPanelJson = DefaultSearchPanelJson, GroupPanelJson = DefaultGroupPanelJson, SelectionJson = DefaultSelectionSingleJson, ColumnOptionJson = DefaultColumnOptionJson, @@ -1177,7 +1135,7 @@ public class ListFormSeeder_Crm : IDataSeedContributor, ITransientDependency SortMode = GridOptions.SortModeSingle, FilterRowJson = DefaultFilterRowJson, HeaderFilterJson = DefaultHeaderFilterJson, - SearchPanelJson= DefaultSearchPanelJson, + SearchPanelJson = DefaultSearchPanelJson, GroupPanelJson = DefaultGroupPanelJson, SelectionJson = DefaultSelectionSingleJson, ColumnOptionJson = DefaultColumnOptionJson, @@ -1531,37 +1489,6 @@ public class ListFormSeeder_Crm : IDataSeedContributor, ITransientDependency }, ], autoSave: true); #endregion - - // Sub Forms for Opportunity - await utils.CloneListFormWithFieldsAsync( - _listFormRepository, - _listFormFieldRepository, - listForm.ListFormCode, - JsonSerializer.Serialize(new List() { - new { - TabTitle = "Activity", - TabType = ListFormTabTypeEnum.List, - Code = ListFormCodes.Lists.OpportunityActivity, - Relation = new List() { - new { - ParentFieldName = "Id", - ChildFieldName = "OpportunityId" - } - } - }, - new { - TabTitle = "Competitors", - TabType = ListFormTabTypeEnum.List, - Code = ListFormCodes.Lists.OpportunityCompetitor, - Relation = new List() { - new { - ParentFieldName = "Id", - ChildFieldName = "OpportunityId" - } - } - }, - }) - ); } #endregion @@ -1592,7 +1519,7 @@ public class ListFormSeeder_Crm : IDataSeedContributor, ITransientDependency SortMode = GridOptions.SortModeSingle, FilterRowJson = DefaultFilterRowJson, HeaderFilterJson = DefaultHeaderFilterJson, - SearchPanelJson= DefaultSearchPanelJson, + SearchPanelJson = DefaultSearchPanelJson, GroupPanelJson = DefaultGroupPanelJson, SelectionJson = DefaultSelectionSingleJson, ColumnOptionJson = DefaultColumnOptionJson, @@ -1618,16 +1545,15 @@ public class ListFormSeeder_Crm : IDataSeedContributor, ITransientDependency new EditingFormItemDto { Order = 10, DataField="FollowUpActivity", ColSpan = 1, EditorType2 = EditorTypes.dxTextArea }, new EditingFormItemDto { Order = 11, DataField="Outcome", ColSpan = 1, EditorType2 = EditorTypes.dxTextBox }, new EditingFormItemDto { Order = 12, DataField="NextSteps", ColSpan = 1, EditorType2 = EditorTypes.dxTextArea }, - new EditingFormItemDto { Order = 13, DataField="OpportunityId", ColSpan = 1, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton }, ]} }), FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { new() { FieldName = "ActivityDate", FieldDbType = DbType.DateTime, Value = "@DATE", CustomValueType = FieldCustomValueTypeEnum.CustomKey } }), - } + }, autoSave: true ); - #region Action Fields + #region Activity Fields await _listFormFieldRepository.InsertManyAsync([ new() { ListFormCode = listForm.ListFormCode, @@ -1845,23 +1771,7 @@ public class ListFormSeeder_Crm : IDataSeedContributor, ITransientDependency PermissionJson = DefaultFieldPermissionJson(listForm.Name), PivotSettingsJson = DefaultPivotSettingsJson }, - new() { - ListFormCode = listForm.ListFormCode, - CultureName = LanguageCodes.En, - SourceDbType = DbType.Guid, - FieldName = "OpportunityId", - Width = 200, - ListOrderNo = 14, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = true, - LookupJson = LookupQueryValues.DefaultLookupQueryJson(nameof(TableNameEnum.Opportunity), "Id", "Title"), - ColumnCustomizationJson = DefaultColumnCustomizationJson, - PermissionJson = DefaultFieldPermissionJson(listForm.Name), - PivotSettingsJson = DefaultPivotSettingsJson - }, - ]); + ], autoSave: true); #endregion } #endregion @@ -1893,7 +1803,7 @@ public class ListFormSeeder_Crm : IDataSeedContributor, ITransientDependency SortMode = GridOptions.SortModeSingle, FilterRowJson = DefaultFilterRowJson, HeaderFilterJson = DefaultHeaderFilterJson, - SearchPanelJson= DefaultSearchPanelJson, + SearchPanelJson = DefaultSearchPanelJson, GroupPanelJson = DefaultGroupPanelJson, SelectionJson = DefaultSelectionSingleJson, ColumnOptionJson = DefaultColumnOptionJson, @@ -1914,7 +1824,7 @@ public class ListFormSeeder_Crm : IDataSeedContributor, ITransientDependency new EditingFormItemDto { Order = 5, DataField="MarketShare", ColSpan = 1, EditorType2 = EditorTypes.dxNumberBox }, ]} }), - } + }, autoSave: true ); #region Competitor Fields @@ -2011,9 +1921,42 @@ public class ListFormSeeder_Crm : IDataSeedContributor, ITransientDependency PermissionJson = DefaultFieldPermissionJson(listForm.Name), PivotSettingsJson = DefaultPivotSettingsJson }, - ]); + ], autoSave: true); #endregion } #endregion + + // Opportunity ile Activity ve Competitor arasında Sub Forms ilişkisinin kurulması + await utils.CloneListFormWithFieldsAsync( + _listFormRepository, + _listFormFieldRepository, + ListFormCodes.Lists.Opportunity, + JsonSerializer.Serialize(new List() { + new { + TabTitle = "Activity", + TabType = ListFormTabTypeEnum.List, + Code = ListFormCodes.Lists.OpportunityActivity, + Relation = new List() { + new { + ParentFieldName = "Id", + DbType = DbType.Guid, + ChildFieldName = "OpportunityId" + } + } + }, + new { + TabTitle = "Competitors", + TabType = ListFormTabTypeEnum.List, + Code = ListFormCodes.Lists.OpportunityCompetitor, + Relation = new List() { + new { + ParentFieldName = "Id", + DbType = DbType.Guid, + ChildFieldName = "OpportunityId" + } + } + }, + }) + ); } } diff --git a/api/src/Erp.Platform.DbMigrator/Seeds/ListFormSeeder_Hr.cs b/api/src/Erp.Platform.DbMigrator/Seeds/ListFormSeeder_Hr.cs index da8c2614..eb4d4765 100644 --- a/api/src/Erp.Platform.DbMigrator/Seeds/ListFormSeeder_Hr.cs +++ b/api/src/Erp.Platform.DbMigrator/Seeds/ListFormSeeder_Hr.cs @@ -73,7 +73,7 @@ public class ListFormSeeder_Hr : IDataSeedContributor, ITransientDependency SortMode = GridOptions.SortModeSingle, FilterRowJson = DefaultFilterRowJson, HeaderFilterJson = DefaultHeaderFilterJson, - SearchPanelJson= DefaultSearchPanelJson, + SearchPanelJson = DefaultSearchPanelJson, GroupPanelJson = DefaultGroupPanelJson, SelectionJson = DefaultSelectionSingleJson, ColumnOptionJson = DefaultColumnOptionJson, @@ -171,7 +171,7 @@ public class ListFormSeeder_Hr : IDataSeedContributor, ITransientDependency SortMode = GridOptions.SortModeSingle, FilterRowJson = DefaultFilterRowJson, HeaderFilterJson = DefaultHeaderFilterJson, - SearchPanelJson= DefaultSearchPanelJson, + SearchPanelJson = DefaultSearchPanelJson, GroupPanelJson = DefaultGroupPanelJson, SelectionJson = DefaultSelectionSingleJson, ColumnOptionJson = DefaultColumnOptionJson, @@ -468,7 +468,7 @@ public class ListFormSeeder_Hr : IDataSeedContributor, ITransientDependency SortMode = GridOptions.SortModeSingle, FilterRowJson = DefaultFilterRowJson, HeaderFilterJson = DefaultHeaderFilterJson, - SearchPanelJson= DefaultSearchPanelJson, + SearchPanelJson = DefaultSearchPanelJson, GroupPanelJson = DefaultGroupPanelJson, SelectionJson = DefaultSelectionSingleJson, ColumnOptionJson = DefaultColumnOptionJson, @@ -686,7 +686,7 @@ public class ListFormSeeder_Hr : IDataSeedContributor, ITransientDependency SortMode = GridOptions.SortModeSingle, FilterRowJson = DefaultFilterRowJson, HeaderFilterJson = DefaultHeaderFilterJson, - SearchPanelJson= DefaultSearchPanelJson, + SearchPanelJson = DefaultSearchPanelJson, GroupPanelJson = DefaultGroupPanelJson, SelectionJson = DefaultSelectionSingleJson, ColumnOptionJson = DefaultColumnOptionJson, @@ -992,7 +992,7 @@ public class ListFormSeeder_Hr : IDataSeedContributor, ITransientDependency SortMode = GridOptions.SortModeSingle, FilterRowJson = DefaultFilterRowJson, HeaderFilterJson = DefaultHeaderFilterJson, - SearchPanelJson= DefaultSearchPanelJson, + SearchPanelJson = DefaultSearchPanelJson, GroupPanelJson = DefaultGroupPanelJson, SelectionJson = DefaultSelectionSingleJson, ColumnOptionJson = DefaultColumnOptionJson, @@ -1286,7 +1286,7 @@ public class ListFormSeeder_Hr : IDataSeedContributor, ITransientDependency SortMode = GridOptions.SortModeSingle, FilterRowJson = DefaultFilterRowJson, HeaderFilterJson = DefaultHeaderFilterJson, - SearchPanelJson= DefaultSearchPanelJson, + SearchPanelJson = DefaultSearchPanelJson, GroupPanelJson = DefaultGroupPanelJson, SelectionJson = DefaultSelectionSingleJson, ColumnOptionJson = DefaultColumnOptionJson, @@ -2003,7 +2003,7 @@ public class ListFormSeeder_Hr : IDataSeedContributor, ITransientDependency SortMode = GridOptions.SortModeSingle, FilterRowJson = DefaultFilterRowJson, HeaderFilterJson = DefaultHeaderFilterJson, - SearchPanelJson= DefaultSearchPanelJson, + SearchPanelJson = DefaultSearchPanelJson, GroupPanelJson = DefaultGroupPanelJson, SelectionJson = DefaultSelectionSingleJson, ColumnOptionJson = DefaultColumnOptionJson, @@ -2330,7 +2330,7 @@ public class ListFormSeeder_Hr : IDataSeedContributor, ITransientDependency SortMode = GridOptions.SortModeSingle, FilterRowJson = DefaultFilterRowJson, HeaderFilterJson = DefaultHeaderFilterJson, - SearchPanelJson= DefaultSearchPanelJson, + SearchPanelJson = DefaultSearchPanelJson, GroupPanelJson = DefaultGroupPanelJson, SelectionJson = DefaultSelectionSingleJson, ColumnOptionJson = DefaultColumnOptionJson, @@ -2655,7 +2655,7 @@ public class ListFormSeeder_Hr : IDataSeedContributor, ITransientDependency SortMode = GridOptions.SortModeSingle, FilterRowJson = DefaultFilterRowJson, HeaderFilterJson = DefaultHeaderFilterJson, - SearchPanelJson= DefaultSearchPanelJson, + SearchPanelJson = DefaultSearchPanelJson, GroupPanelJson = DefaultGroupPanelJson, SelectionJson = DefaultSelectionSingleJson, ColumnOptionJson = DefaultColumnOptionJson, @@ -2936,7 +2936,7 @@ public class ListFormSeeder_Hr : IDataSeedContributor, ITransientDependency SortMode = GridOptions.SortModeSingle, FilterRowJson = DefaultFilterRowJson, HeaderFilterJson = DefaultHeaderFilterJson, - SearchPanelJson= DefaultSearchPanelJson, + SearchPanelJson = DefaultSearchPanelJson, GroupPanelJson = DefaultGroupPanelJson, SelectionJson = DefaultSelectionSingleJson, ColumnOptionJson = DefaultColumnOptionJson, @@ -3298,7 +3298,7 @@ public class ListFormSeeder_Hr : IDataSeedContributor, ITransientDependency SortMode = GridOptions.SortModeSingle, FilterRowJson = DefaultFilterRowJson, HeaderFilterJson = DefaultHeaderFilterJson, - SearchPanelJson= DefaultSearchPanelJson, + SearchPanelJson = DefaultSearchPanelJson, GroupPanelJson = DefaultGroupPanelJson, SelectionJson = DefaultSelectionSingleJson, ColumnOptionJson = DefaultColumnOptionJson, @@ -3449,7 +3449,7 @@ public class ListFormSeeder_Hr : IDataSeedContributor, ITransientDependency SortMode = GridOptions.SortModeSingle, FilterRowJson = DefaultFilterRowJson, HeaderFilterJson = DefaultHeaderFilterJson, - SearchPanelJson= DefaultSearchPanelJson, + SearchPanelJson = DefaultSearchPanelJson, GroupPanelJson = DefaultGroupPanelJson, SelectionJson = DefaultSelectionSingleJson, ColumnOptionJson = DefaultColumnOptionJson, @@ -3682,7 +3682,7 @@ public class ListFormSeeder_Hr : IDataSeedContributor, ITransientDependency SortMode = GridOptions.SortModeSingle, FilterRowJson = DefaultFilterRowJson, HeaderFilterJson = DefaultHeaderFilterJson, - SearchPanelJson= DefaultSearchPanelJson, + SearchPanelJson = DefaultSearchPanelJson, GroupPanelJson = DefaultGroupPanelJson, SelectionJson = DefaultSelectionSingleJson, ColumnOptionJson = DefaultColumnOptionJson, @@ -4016,7 +4016,7 @@ public class ListFormSeeder_Hr : IDataSeedContributor, ITransientDependency SortMode = GridOptions.SortModeSingle, FilterRowJson = DefaultFilterRowJson, HeaderFilterJson = DefaultHeaderFilterJson, - SearchPanelJson= DefaultSearchPanelJson, + SearchPanelJson = DefaultSearchPanelJson, GroupPanelJson = DefaultGroupPanelJson, SelectionJson = DefaultSelectionSingleJson, ColumnOptionJson = DefaultColumnOptionJson, @@ -4163,37 +4163,6 @@ public class ListFormSeeder_Hr : IDataSeedContributor, ITransientDependency }, ], autoSave: true); #endregion - - // Sub Forms for Survey - await utils.CloneListFormWithFieldsAsync( - _listFormRepository, - _listFormFieldRepository, - listForm.ListFormCode, - JsonSerializer.Serialize(new List() { - new { - TabTitle = "Questions", - TabType = ListFormTabTypeEnum.List, - Code = ListFormCodes.Lists.SurveyQuestion, - Relation = new List() { - new { - ParentFieldName = "Id", - ChildFieldName = "SurveyId" - } - } - }, - new { - TabTitle = "Responses", - TabType = ListFormTabTypeEnum.List, - Code = ListFormCodes.Lists.SurveyResponse, - Relation = new List() { - new { - ParentFieldName = "Id", - ChildFieldName = "SurveyId" - } - } - } - }) - ); } #endregion @@ -4224,7 +4193,7 @@ public class ListFormSeeder_Hr : IDataSeedContributor, ITransientDependency SortMode = GridOptions.SortModeSingle, FilterRowJson = DefaultFilterRowJson, HeaderFilterJson = DefaultHeaderFilterJson, - SearchPanelJson= DefaultSearchPanelJson, + SearchPanelJson = DefaultSearchPanelJson, GroupPanelJson = DefaultGroupPanelJson, SelectionJson = DefaultSelectionSingleJson, ColumnOptionJson = DefaultColumnOptionJson, @@ -4238,7 +4207,7 @@ public class ListFormSeeder_Hr : IDataSeedContributor, ITransientDependency { new() { Order=1, ColCount=1, ColSpan=1, ItemType="group", Items =[ - new EditingFormItemDto { Order = 1, DataField = "SurveyId", ColSpan=1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton }, + new EditingFormItemDto { Order = 1, DataField = "Order", ColSpan=1, IsRequired = true, EditorType2 = EditorTypes.dxNumberBox }, new EditingFormItemDto { Order = 2, DataField = "QuestionText", ColSpan=1, IsRequired = true, EditorType2 = EditorTypes.dxTextBox }, new EditingFormItemDto { Order = 3, DataField = "Type", ColSpan=1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton }, new EditingFormItemDto { Order = 4, DataField = "IsRequired", ColSpan=1, IsRequired = true, EditorType2 = EditorTypes.dxCheckBox } @@ -4257,7 +4226,7 @@ public class ListFormSeeder_Hr : IDataSeedContributor, ITransientDependency Url="/admin/list/list-employees/@Id" }, }), - } + }, autoSave: true ); #region Survey Question Fields @@ -4278,30 +4247,13 @@ public class ListFormSeeder_Hr : IDataSeedContributor, ITransientDependency PermissionJson = DefaultFieldPermissionJson(listForm.Name), PivotSettingsJson = DefaultPivotSettingsJson }, - new() { - ListFormCode = listForm.ListFormCode, - CultureName = LanguageCodes.En, - SourceDbType = DbType.Guid, - FieldName = "SurveyId", - Width = 200, - ListOrderNo = 2, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = true, - LookupJson = LookupQueryValues.DefaultLookupQueryJson(nameof(TableNameEnum.Survey), "Id", "Title"), - ValidationRuleJson = DefaultValidationRuleRequiredJson, - ColumnCustomizationJson = DefaultColumnCustomizationJson, - PermissionJson = DefaultFieldPermissionJson(listForm.Name), - PivotSettingsJson = DefaultPivotSettingsJson - }, new() { ListFormCode = listForm.ListFormCode, CultureName = LanguageCodes.En, SourceDbType = DbType.Int32, FieldName = "Order", Width = 100, - ListOrderNo = 3, + ListOrderNo = 2, Visible = true, IsActive = true, IsDeleted = false, @@ -4317,7 +4269,7 @@ public class ListFormSeeder_Hr : IDataSeedContributor, ITransientDependency SourceDbType = DbType.String, FieldName = "QuestionText", Width = 300, - ListOrderNo = 4, + ListOrderNo = 3, Visible = true, IsActive = true, IsDeleted = false, @@ -4333,7 +4285,7 @@ public class ListFormSeeder_Hr : IDataSeedContributor, ITransientDependency SourceDbType = DbType.String, FieldName = "Type", Width = 100, - ListOrderNo = 5, + ListOrderNo = 4, Visible = true, IsActive = true, IsDeleted = false, @@ -4361,7 +4313,7 @@ public class ListFormSeeder_Hr : IDataSeedContributor, ITransientDependency SourceDbType = DbType.Boolean, FieldName = "IsRequired", Width = 100, - ListOrderNo = 6, + ListOrderNo = 5, Visible = true, IsActive = true, IsDeleted = false, @@ -4370,7 +4322,7 @@ public class ListFormSeeder_Hr : IDataSeedContributor, ITransientDependency PermissionJson = DefaultFieldPermissionJson(listForm.Name), PivotSettingsJson = DefaultPivotSettingsJson }, - ]); + ], autoSave: true); #endregion } #endregion @@ -4402,7 +4354,7 @@ public class ListFormSeeder_Hr : IDataSeedContributor, ITransientDependency SortMode = GridOptions.SortModeSingle, FilterRowJson = DefaultFilterRowJson, HeaderFilterJson = DefaultHeaderFilterJson, - SearchPanelJson= DefaultSearchPanelJson, + SearchPanelJson = DefaultSearchPanelJson, GroupPanelJson = DefaultGroupPanelJson, SelectionJson = DefaultSelectionSingleJson, ColumnOptionJson = DefaultColumnOptionJson, @@ -4416,10 +4368,9 @@ public class ListFormSeeder_Hr : IDataSeedContributor, ITransientDependency { new() { Order=1, ColCount=1, ColSpan=1, ItemType="group", Items =[ - new EditingFormItemDto { Order = 1, DataField = "SurveyId", ColSpan=1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton }, - new EditingFormItemDto { Order = 2, DataField = "EmployeeId", ColSpan=1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton }, - new EditingFormItemDto { Order = 3, DataField = "SubmissionTime", ColSpan=1, IsRequired = true, EditorType2 = EditorTypes.dxTextBox }, - new EditingFormItemDto { Order = 4, DataField = "CreationTime", ColSpan=1, IsRequired = true, EditorType2 = EditorTypes.dxDateBox } + new EditingFormItemDto { Order = 1, DataField = "EmployeeId", ColSpan=1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton }, + new EditingFormItemDto { Order = 2, DataField = "SubmissionTime", ColSpan=1, IsRequired = true, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 3, DataField = "CreationTime", ColSpan=1, IsRequired = true, EditorType2 = EditorTypes.dxDateBox } ]} }), CommandColumnJson = JsonSerializer.Serialize(new CommandColumnDto[] { @@ -4431,7 +4382,7 @@ public class ListFormSeeder_Hr : IDataSeedContributor, ITransientDependency Url="/admin/list/list-employees/@Id" }, }), - } + }, autoSave: true ); #region Survey Response Fields @@ -4452,30 +4403,13 @@ public class ListFormSeeder_Hr : IDataSeedContributor, ITransientDependency PermissionJson = DefaultFieldPermissionJson(listForm.Name), PivotSettingsJson = DefaultPivotSettingsJson }, - new() { - ListFormCode = listForm.ListFormCode, - CultureName = LanguageCodes.En, - SourceDbType = DbType.Guid, - FieldName = "SurveyId", - Width = 200, - ListOrderNo = 2, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = true, - LookupJson = LookupQueryValues.DefaultLookupQueryJson(nameof(TableNameEnum.Survey), "Id", "Title"), - ValidationRuleJson = DefaultValidationRuleRequiredJson, - ColumnCustomizationJson = DefaultColumnCustomizationJson, - PermissionJson = DefaultFieldPermissionJson(listForm.Name), - PivotSettingsJson = DefaultPivotSettingsJson - }, new() { ListFormCode = listForm.ListFormCode, CultureName = LanguageCodes.En, SourceDbType = DbType.Guid, FieldName = "EmployeeId", Width = 100, - ListOrderNo = 3, + ListOrderNo = 2, Visible = true, IsActive = true, IsDeleted = false, @@ -4492,7 +4426,7 @@ public class ListFormSeeder_Hr : IDataSeedContributor, ITransientDependency SourceDbType = DbType.DateTime, FieldName = "SubmissionTime", Width = 100, - ListOrderNo = 4, + ListOrderNo = 3, Visible = true, IsActive = true, IsDeleted = false, @@ -4508,7 +4442,7 @@ public class ListFormSeeder_Hr : IDataSeedContributor, ITransientDependency SourceDbType = DbType.DateTime, FieldName = "CreationTime", Width = 100, - ListOrderNo = 5, + ListOrderNo = 4, Visible = true, IsActive = true, IsDeleted = false, @@ -4517,9 +4451,42 @@ public class ListFormSeeder_Hr : IDataSeedContributor, ITransientDependency PermissionJson = DefaultFieldPermissionJson(listForm.Name), PivotSettingsJson = DefaultPivotSettingsJson }, - ]); + ], autoSave: true); #endregion } + + // Survey ile Survey Question ve Survey Response Sub Forms ilişkisinin kurulması + await utils.CloneListFormWithFieldsAsync( + _listFormRepository, + _listFormFieldRepository, + ListFormCodes.Lists.Survey, + JsonSerializer.Serialize(new List() { + new { + TabTitle = "Questions", + TabType = ListFormTabTypeEnum.List, + Code = ListFormCodes.Lists.SurveyQuestion, + Relation = new List() { + new { + ParentFieldName = "Id", + DbType = DbType.Guid, + ChildFieldName = "SurveyId" + } + } + }, + new { + TabTitle = "Responses", + TabType = ListFormTabTypeEnum.List, + Code = ListFormCodes.Lists.SurveyResponse, + Relation = new List() { + new { + ParentFieldName = "Id", + DbType = DbType.Guid, + ChildFieldName = "SurveyId" + } + } + } + }) + ); #endregion } } diff --git a/api/src/Erp.Platform.DbMigrator/Seeds/ListFormSeeder_Saas.cs b/api/src/Erp.Platform.DbMigrator/Seeds/ListFormSeeder_Saas.cs index 4c40e05f..6732567d 100644 --- a/api/src/Erp.Platform.DbMigrator/Seeds/ListFormSeeder_Saas.cs +++ b/api/src/Erp.Platform.DbMigrator/Seeds/ListFormSeeder_Saas.cs @@ -74,13 +74,13 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency SortMode = GridOptions.SortModeSingle, FilterRowJson = DefaultFilterRowJson, HeaderFilterJson = DefaultHeaderFilterJson, - SearchPanelJson= DefaultSearchPanelJson, + SearchPanelJson = DefaultSearchPanelJson, GroupPanelJson = DefaultGroupPanelJson, SelectionJson = DefaultSelectionSingleJson, ColumnOptionJson = DefaultColumnOptionJson, PermissionJson = DefaultPermissionJson(TenantManagementPermissions.Tenants.Create, TenantManagementPermissions.Tenants.Default, TenantManagementPermissions.Tenants.Update, TenantManagementPermissions.Tenants.Delete, TenantManagementPermissions.Tenants.Default + ".Export", TenantManagementPermissions.Tenants.Default + ".Import", TenantManagementPermissions.Tenants.Default + ".Note"), PagerOptionJson = DefaultPagerOptionJson, - EditingOptionJson = DefaultEditingOptionJson(TenantManagementPermissions.Tenants.Default, 800, 800, true, true, true, true, false), + EditingOptionJson = DefaultEditingOptionJson(TenantManagementPermissions.Tenants.Default, 800, 700, true, true, true, true, false), EditingFormJson = JsonSerializer.Serialize(new List() { new() { Order=1, ColCount=1, ColSpan=1, ItemType="group", Items = @@ -140,11 +140,11 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency new() { FieldName = "Country", FieldDbType = DbType.String, Value = "TR", CustomValueType = FieldCustomValueTypeEnum.Value } }) - }, autoSave: true); + }, autoSave: true + ); #region Tenants Fields - await _listFormFieldRepository.InsertManyAsync( - [ + await _listFormFieldRepository.InsertManyAsync([ new ListFormField { ListFormCode = listForm.ListFormCode, @@ -517,38 +517,18 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency }, ], autoSave: true); #endregion - - // Sub Forms for Tenant - await utils.CloneListFormWithFieldsAsync( - _listFormRepository, - _listFormFieldRepository, - listForm.ListFormCode, - JsonSerializer.Serialize(new List() { - new { - TabTitle = "Branches", - TabType = ListFormTabTypeEnum.List, - Code = ListFormCodes.Lists.Branch, - Relation = new List() { - new { - ParentFieldName = "Id", - ChildFieldName = "TenantId" - } - } - } } - ) - ); } #endregion - #region Branche + #region Branches if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.Branch)) { var listForm = await _listFormRepository.InsertAsync( new ListForm() { ListFormType = ListFormTypeEnum.List, - IsSubForm = false, + IsSubForm = true, ShowNote = true, LayoutJson = DefaultLayoutJson, CultureName = LanguageCodes.En, @@ -568,13 +548,13 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency SortMode = GridOptions.SortModeSingle, FilterRowJson = DefaultFilterRowJson, HeaderFilterJson = DefaultHeaderFilterJson, - SearchPanelJson= DefaultSearchPanelJson, + SearchPanelJson = DefaultSearchPanelJson, GroupPanelJson = DefaultGroupPanelJson, SelectionJson = DefaultSelectionSingleJson, ColumnOptionJson = DefaultColumnOptionJson, PermissionJson = DefaultPermissionJson(AppCodes.Branches), PagerOptionJson = DefaultPagerOptionJson, - EditingOptionJson = DefaultEditingOptionJson(AppCodes.Branches, 900, 800, true, true, true, true, false), + EditingOptionJson = DefaultEditingOptionJson(AppCodes.Branches, 800, 700, true, true, true, true, false), EditingFormJson = JsonSerializer.Serialize(new List() { new() { Order=1, ColCount=1, ColSpan=1, ItemType="group", Items = @@ -612,22 +592,21 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency new() { FieldName = "Country", FieldDbType = DbType.String, Value = "TR", CustomValueType = FieldCustomValueTypeEnum.Value } }), CommandColumnJson = JsonSerializer.Serialize(new CommandColumnDto[] { - new() { - Hint = "Seed", - Text = "Seed", - AuthName = AppCodes.Branches + ".Update", - DialogName = "BranchSeed", - DialogParameters = JsonSerializer.Serialize( - new { id = "@Id", name = "@Name"} - ) - }, - }), - } + new() { + Hint = "Seed", + Text = "Seed", + AuthName = AppCodes.Branches + ".Update", + DialogName = "BranchSeed", + DialogParameters = JsonSerializer.Serialize( + new { id = "@Id", name = "@Name"} + ) + }, + }), + }, autoSave: true ); #region Branches Fields - await _listFormFieldRepository.InsertManyAsync( - [ + await _listFormFieldRepository.InsertManyAsync([ new ListFormField { ListFormCode = listForm.ListFormCode, @@ -979,11 +958,32 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency PermissionJson = DefaultFieldPermissionJson(listForm.Name), PivotSettingsJson = DefaultPivotSettingsJson }, - ]); + ], autoSave: true); #endregion } #endregion + // Tenant ve Branches arasında Sub Forms ilişkisinin kurulması + await utils.CloneListFormWithFieldsAsync( + _listFormRepository, + _listFormFieldRepository, + ListFormCodes.Lists.Tenant, + JsonSerializer.Serialize(new List() { + new { + TabTitle = "Branches", + TabType = ListFormTabTypeEnum.List, + Code = ListFormCodes.Lists.Branch, + Relation = new List() { + new { + ParentFieldName = "Id", + DbType = DbType.Guid, + ChildFieldName = "TenantId" + } + } + }} + ) + ); + #region SettingDefinition if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.SettingDefinition)) { @@ -1011,7 +1011,7 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency SortMode = GridOptions.SortModeSingle, FilterRowJson = DefaultFilterRowJson, HeaderFilterJson = DefaultHeaderFilterJson, - SearchPanelJson= DefaultSearchPanelJson, + SearchPanelJson = DefaultSearchPanelJson, GroupPanelJson = DefaultGroupPanelJson, SelectionJson = DefaultSelectionSingleJson, ColumnOptionJson = DefaultColumnOptionJson, @@ -1381,7 +1381,7 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency SortMode = GridOptions.SortModeSingle, FilterRowJson = DefaultFilterRowJson, HeaderFilterJson = DefaultHeaderFilterJson, - SearchPanelJson= DefaultSearchPanelJson, + SearchPanelJson = DefaultSearchPanelJson, GroupPanelJson = DefaultGroupPanelJson, SelectionJson = DefaultSelectionSingleJson, ColumnOptionJson = DefaultColumnOptionJson, @@ -1533,7 +1533,7 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency SortMode = GridOptions.SortModeSingle, FilterRowJson = DefaultFilterRowJson, HeaderFilterJson = DefaultHeaderFilterJson, - SearchPanelJson= DefaultSearchPanelJson, + SearchPanelJson = DefaultSearchPanelJson, GroupPanelJson = DefaultGroupPanelJson, SelectionJson = DefaultSelectionSingleJson, ColumnOptionJson = DefaultColumnOptionJson, @@ -1564,8 +1564,8 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency Url=$"/admin/form/{utils.GetDefaultFormCodes(ListFormCodes.Lists.Language)}/@Id" }, }), - } - , autoSave: true); + }, autoSave: true + ); #region Language Fields await _listFormFieldRepository.InsertManyAsync([ @@ -1651,26 +1651,6 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency }, ], autoSave: true); #endregion - - // Sub Forms for Tenant - await utils.CloneListFormWithFieldsAsync( - _listFormRepository, - _listFormFieldRepository, - ListFormCodes.Lists.Language, - JsonSerializer.Serialize(new List() { - new { - TabTitle = "Language Texts", - TabType = ListFormTabTypeEnum.List, - Code = ListFormCodes.Lists.LanguageText, - Relation = new List() { - new { - ParentFieldName = "CultureName", - ChildFieldName = "CultureName" - } - } - } - }) - ); } #endregion @@ -1681,7 +1661,7 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency new ListForm() { ListFormType = ListFormTypeEnum.List, - IsSubForm = false, + IsSubForm = true, ShowNote = true, LayoutJson = DefaultLayoutJson, CultureName = LanguageCodes.En, @@ -1701,7 +1681,7 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency SortMode = GridOptions.SortModeSingle, FilterRowJson = DefaultFilterRowJson, HeaderFilterJson = DefaultHeaderFilterJson, - SearchPanelJson= DefaultSearchPanelJson, + SearchPanelJson = DefaultSearchPanelJson, GroupPanelJson = DefaultGroupPanelJson, SelectionJson = DefaultSelectionSingleJson, ColumnOptionJson = DefaultColumnOptionJson, @@ -1721,7 +1701,7 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency } }), InsertFieldsDefaultValueJson = DefaultInsertFieldsDefaultValueJson, - } + }, autoSave: true ); #region LanguageText Fields @@ -1828,12 +1808,33 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency PermissionJson = DefaultFieldPermissionJson(listForm.Name), PivotSettingsJson = DefaultPivotSettingsJson }, - ]); + ], autoSave: true); #endregion } #endregion + // Language ve LanguageText Sub Forms ilişkisinin kurulması + await utils.CloneListFormWithFieldsAsync( + _listFormRepository, + _listFormFieldRepository, + ListFormCodes.Lists.Language, + JsonSerializer.Serialize(new List() { + new { + TabTitle = "Language Texts", + TabType = ListFormTabTypeEnum.List, + Code = ListFormCodes.Lists.LanguageText, + Relation = new List() { + new { + ParentFieldName = "CultureName", + DbType = DbType.String, + ChildFieldName = "CultureName" + } + } + } + }) + ); + #region Route if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.Route)) { @@ -1861,7 +1862,7 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency SortMode = GridOptions.SortModeSingle, FilterRowJson = DefaultFilterRowJson, HeaderFilterJson = DefaultHeaderFilterJson, - SearchPanelJson= DefaultSearchPanelJson, + SearchPanelJson = DefaultSearchPanelJson, GroupPanelJson = JsonSerializer.Serialize(new { Visible = false }), SelectionJson = DefaultSelectionSingleJson, ColumnOptionJson = DefaultColumnOptionJson, @@ -2034,7 +2035,7 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency SortMode = GridOptions.SortModeSingle, FilterRowJson = DefaultFilterRowJson, HeaderFilterJson = DefaultHeaderFilterJson, - SearchPanelJson= DefaultSearchPanelJson, + SearchPanelJson = DefaultSearchPanelJson, GroupPanelJson = DefaultGroupPanelJson, SelectionJson = DefaultSelectionSingleJson, ColumnOptionJson = DefaultColumnOptionJson, @@ -2314,7 +2315,7 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency SortMode = GridOptions.SortModeSingle, FilterRowJson = DefaultFilterRowJson, HeaderFilterJson = DefaultHeaderFilterJson, - SearchPanelJson= DefaultSearchPanelJson, + SearchPanelJson = DefaultSearchPanelJson, GroupPanelJson = DefaultGroupPanelJson, SelectionJson = DefaultSelectionSingleJson, ColumnOptionJson = DefaultColumnOptionJson, @@ -2444,7 +2445,7 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency SortMode = GridOptions.SortModeMultiple, FilterRowJson = JsonSerializer.Serialize(new GridFilterRowDto { Visible = true, ApplyFilter = GridOptions.FilterRowApplyFilterAuto }), HeaderFilterJson = DefaultHeaderFilterJson, - SearchPanelJson= DefaultSearchPanelJson, + SearchPanelJson = DefaultSearchPanelJson, GroupPanelJson = DefaultGroupPanelJson, SelectionJson = DefaultSelectionMultipleJson, ColumnOptionJson = DefaultColumnOptionJson, @@ -2912,7 +2913,7 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency SortMode = GridOptions.SortModeSingle, FilterRowJson = DefaultFilterRowJson, HeaderFilterJson = DefaultHeaderFilterJson, - SearchPanelJson= DefaultSearchPanelJson, + SearchPanelJson = DefaultSearchPanelJson, GroupPanelJson = DefaultGroupPanelJson, SelectionJson = DefaultSelectionSingleJson, ColumnOptionJson = DefaultColumnOptionJson, @@ -3144,7 +3145,7 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency SortMode = GridOptions.SortModeSingle, FilterRowJson = DefaultFilterRowJson, HeaderFilterJson = DefaultHeaderFilterJson, - SearchPanelJson= DefaultSearchPanelJson, + SearchPanelJson = DefaultSearchPanelJson, GroupPanelJson = DefaultGroupPanelJson, SelectionJson = DefaultSelectionSingleJson, ColumnOptionJson = DefaultColumnOptionJson, @@ -3334,7 +3335,7 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency SortMode = GridOptions.SortModeSingle, FilterRowJson = DefaultFilterRowJson, HeaderFilterJson = DefaultHeaderFilterJson, - SearchPanelJson= DefaultSearchPanelJson, + SearchPanelJson = DefaultSearchPanelJson, GroupPanelJson = DefaultGroupPanelJson, SelectionJson = DefaultSelectionSingleJson, ColumnOptionJson = DefaultColumnOptionJson, @@ -3770,7 +3771,7 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency SortMode = GridOptions.SortModeSingle, FilterRowJson = DefaultFilterRowJson, HeaderFilterJson = DefaultHeaderFilterJson, - SearchPanelJson= DefaultSearchPanelJson, + SearchPanelJson = DefaultSearchPanelJson, GroupPanelJson = JsonSerializer.Serialize(new { Visible = false }), SelectionJson = DefaultSelectionSingleJson, ColumnOptionJson = DefaultColumnOptionJson, @@ -3924,7 +3925,7 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency SortMode = GridOptions.SortModeSingle, FilterRowJson = DefaultFilterRowJson, HeaderFilterJson = DefaultHeaderFilterJson, - SearchPanelJson= DefaultSearchPanelJson, + SearchPanelJson = DefaultSearchPanelJson, GroupPanelJson = JsonSerializer.Serialize(new { Visible = false }), SelectionJson = DefaultSelectionSingleJson, ColumnOptionJson = DefaultColumnOptionJson, @@ -4009,7 +4010,7 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency SortMode = GridOptions.SortModeSingle, FilterRowJson = DefaultFilterRowJson, HeaderFilterJson = DefaultHeaderFilterJson, - SearchPanelJson= DefaultSearchPanelJson, + SearchPanelJson = DefaultSearchPanelJson, GroupPanelJson = JsonSerializer.Serialize(new { Visible = false }), SelectionJson = DefaultSelectionSingleJson, ColumnOptionJson = DefaultColumnOptionJson, @@ -4208,7 +4209,7 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency SortMode = GridOptions.SortModeSingle, FilterRowJson = DefaultFilterRowJson, HeaderFilterJson = DefaultHeaderFilterJson, - SearchPanelJson= DefaultSearchPanelJson, + SearchPanelJson = DefaultSearchPanelJson, GroupPanelJson = JsonSerializer.Serialize(new { Visible = false }), SelectionJson = DefaultSelectionSingleJson, ColumnOptionJson = DefaultColumnOptionJson, @@ -4354,7 +4355,7 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency SortMode = GridOptions.SortModeSingle, FilterRowJson = DefaultFilterRowJson, HeaderFilterJson = DefaultHeaderFilterJson, - SearchPanelJson= DefaultSearchPanelJson, + SearchPanelJson = DefaultSearchPanelJson, GroupPanelJson = JsonSerializer.Serialize(new { Visible = false }), SelectionJson = DefaultSelectionSingleJson, ColumnOptionJson = DefaultColumnOptionJson, diff --git a/api/src/Erp.Platform.DbMigrator/Seeds/ListFormSeeder_SupplyChain.cs b/api/src/Erp.Platform.DbMigrator/Seeds/ListFormSeeder_SupplyChain.cs index e2f8987f..f317b1ca 100644 --- a/api/src/Erp.Platform.DbMigrator/Seeds/ListFormSeeder_SupplyChain.cs +++ b/api/src/Erp.Platform.DbMigrator/Seeds/ListFormSeeder_SupplyChain.cs @@ -1046,111 +1046,112 @@ public class ListFormSeeder_SupplyChain : IDataSeedContributor, ITransientDepend #region Supplier if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.Supply)) { - var listForm = await _listFormRepository.InsertAsync(new ListForm() - { - ListFormType = ListFormTypeEnum.List, - IsSubForm = false, - ShowNote = true, - LayoutJson = DefaultLayoutJson, - CultureName = LanguageCodes.En, - ListFormCode = ListFormCodes.Lists.Supply, - Name = AppCodes.SupplyChain.Supply, - Title = AppCodes.SupplyChain.Supply, - DataSourceCode = SeedConsts.DataSources.DefaultCode, - IsTenant = true, - IsBranch = false, - IsOrganizationUnit = false, - Description = AppCodes.SupplyChain.Supply, - SelectCommandType = SelectCommandTypeEnum.Table, - SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.Partner)), - KeyFieldName = "Id", - KeyFieldDbSourceType = DbType.Guid, - DefaultFilter = "\"IsDeleted\" = 'false' AND \"PartyType\" = 'Supplier'", - SortMode = GridOptions.SortModeSingle, - FilterRowJson = DefaultFilterRowJson, - HeaderFilterJson = DefaultHeaderFilterJson, - SearchPanelJson = DefaultSearchPanelJson, - GroupPanelJson = DefaultGroupPanelJson, - SelectionJson = DefaultSelectionSingleJson, - ColumnOptionJson = DefaultColumnOptionJson, - PermissionJson = DefaultPermissionJson(AppCodes.SupplyChain.Supply), - DeleteCommand = DefaultDeleteCommand(nameof(TableNameEnum.Partner)), - DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson, - PagerOptionJson = DefaultPagerOptionJson, - EditingOptionJson = DefaultEditingOptionJson(AppCodes.SupplyChain.Supply, 1000, 600, true, true, true, true, false), - EditingFormJson = JsonSerializer.Serialize(new List() + var listForm = await _listFormRepository.InsertAsync( + new ListForm() { - new() + ListFormType = ListFormTypeEnum.List, + IsSubForm = false, + ShowNote = true, + LayoutJson = DefaultLayoutJson, + CultureName = LanguageCodes.En, + ListFormCode = ListFormCodes.Lists.Supply, + Name = AppCodes.SupplyChain.Supply, + Title = AppCodes.SupplyChain.Supply, + DataSourceCode = SeedConsts.DataSources.DefaultCode, + IsTenant = true, + IsBranch = false, + IsOrganizationUnit = false, + Description = AppCodes.SupplyChain.Supply, + SelectCommandType = SelectCommandTypeEnum.Table, + SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.Partner)), + KeyFieldName = "Id", + KeyFieldDbSourceType = DbType.Guid, + DefaultFilter = "\"IsDeleted\" = 'false' AND \"PartyType\" = 'Supplier'", + SortMode = GridOptions.SortModeSingle, + FilterRowJson = DefaultFilterRowJson, + HeaderFilterJson = DefaultHeaderFilterJson, + SearchPanelJson = DefaultSearchPanelJson, + GroupPanelJson = DefaultGroupPanelJson, + SelectionJson = DefaultSelectionSingleJson, + ColumnOptionJson = DefaultColumnOptionJson, + PermissionJson = DefaultPermissionJson(AppCodes.SupplyChain.Supply), + DeleteCommand = DefaultDeleteCommand(nameof(TableNameEnum.Partner)), + DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson, + PagerOptionJson = DefaultPagerOptionJson, + EditingOptionJson = DefaultEditingOptionJson(AppCodes.SupplyChain.Supply, 1000, 600, true, true, true, true, false), + EditingFormJson = JsonSerializer.Serialize(new List() { - Order = 1, Caption = "General", ColCount = 3, ColSpan = 2, ItemType = "group", Items = - [ - new EditingFormItemDto { Order = 1, DataField = "Code", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxTextBox }, - new EditingFormItemDto { Order = 2, DataField = "Name", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxTextBox }, - new EditingFormItemDto { Order = 3, DataField = "PartyType", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions = EditorOptionValues.Disabled }, - new EditingFormItemDto { Order = 4, DataField = "SectorId", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton }, - new EditingFormItemDto { Order = 5, DataField = "TaxNumber", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxNumberBox }, - new EditingFormItemDto { Order = 6, DataField = "TaxOffice", ColSpan = 1, EditorType2 = EditorTypes.dxTextBox }, - new EditingFormItemDto { Order = 7, DataField = "CurrencyId", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton }, - new EditingFormItemDto { Order = 8, DataField = "PaymentTermId", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton }, - new EditingFormItemDto { Order = 9, DataField = "CreditLimit", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxNumberBox }, - ] - }, - new() + new() + { + Order = 1, Caption = "General", ColCount = 3, ColSpan = 2, ItemType = "group", Items = + [ + new EditingFormItemDto { Order = 1, DataField = "Code", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 2, DataField = "Name", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 3, DataField = "PartyType", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions = EditorOptionValues.Disabled }, + new EditingFormItemDto { Order = 4, DataField = "SectorId", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton }, + new EditingFormItemDto { Order = 5, DataField = "TaxNumber", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxNumberBox }, + new EditingFormItemDto { Order = 6, DataField = "TaxOffice", ColSpan = 1, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 7, DataField = "CurrencyId", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton }, + new EditingFormItemDto { Order = 8, DataField = "PaymentTermId", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton }, + new EditingFormItemDto { Order = 9, DataField = "CreditLimit", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxNumberBox }, + ] + }, + new() + { + Order = 2, Caption = "Address", ColCount = 3, ColSpan = 2, ItemType = "group", Items = + [ + new EditingFormItemDto { Order = 10, DataField = "Country", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton }, + new EditingFormItemDto { Order = 11, DataField = "City", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton }, + new EditingFormItemDto { Order = 12, DataField = "District", ColSpan = 1, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton }, + new EditingFormItemDto { Order = 13, DataField = "Street", ColSpan = 1, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton }, + new EditingFormItemDto { Order = 14, DataField = "Address1", ColSpan = 1, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 15, DataField = "Address2", ColSpan = 1, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 16, DataField = "PostalCode", ColSpan = 1, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 17, DataField = "PhoneNumber", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxTextBox, EditorOptions = EditorOptionValues.PhoneEditorOptions }, + new EditingFormItemDto { Order = 18, DataField = "MobileNumber", ColSpan = 1, EditorType2 = EditorTypes.dxTextBox, EditorOptions = EditorOptionValues.PhoneEditorOptions }, + new EditingFormItemDto { Order = 19, DataField = "FaxNumber", ColSpan = 1, EditorType2 = EditorTypes.dxTextBox, EditorOptions = EditorOptionValues.PhoneEditorOptions }, + new EditingFormItemDto { Order = 20, DataField = "Email", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 21, DataField = "Website", ColSpan = 1, EditorType2 = EditorTypes.dxTextBox }, + ] + }, + new() + { + Order = 3, Caption="Supply Card", ColCount = 3, ColSpan = 2, ItemType = "group", Items = + [ + new EditingFormItemDto { Order = 22, DataField = "SupplierTypeId", ColSpan = 1, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton }, + new EditingFormItemDto { Order = 23, DataField = "SupplyCardTypeId", ColSpan = 1, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton }, + new EditingFormItemDto { Order = 24, DataField = "CardNumber", ColSpan = 1, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 25, DataField = "ValidFrom", ColSpan = 1, EditorType2 = EditorTypes.dxDateBox }, + new EditingFormItemDto { Order = 26, DataField = "ValidTo", ColSpan = 1, EditorType2 = EditorTypes.dxDateBox }, + new EditingFormItemDto { Order = 27, DataField = "CurrentBalance", ColSpan = 1, EditorType2 = EditorTypes.dxNumberBox }, + new EditingFormItemDto { Order = 28, DataField = "DiscountRate", ColSpan = 1, EditorType2 = EditorTypes.dxNumberBox }, + new EditingFormItemDto { Order = 29, DataField = "Status", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox }, + ] + } + }), + InsertFieldsDefaultValueJson = DefaultInsertFieldsDefaultValueJson, + FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { - Order = 2, Caption = "Address", ColCount = 3, ColSpan = 2, ItemType = "group", Items = - [ - new EditingFormItemDto { Order = 10, DataField = "Country", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton }, - new EditingFormItemDto { Order = 11, DataField = "City", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton }, - new EditingFormItemDto { Order = 12, DataField = "District", ColSpan = 1, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton }, - new EditingFormItemDto { Order = 13, DataField = "Street", ColSpan = 1, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton }, - new EditingFormItemDto { Order = 14, DataField = "Address1", ColSpan = 1, EditorType2 = EditorTypes.dxTextBox }, - new EditingFormItemDto { Order = 15, DataField = "Address2", ColSpan = 1, EditorType2 = EditorTypes.dxTextBox }, - new EditingFormItemDto { Order = 16, DataField = "PostalCode", ColSpan = 1, EditorType2 = EditorTypes.dxTextBox }, - new EditingFormItemDto { Order = 17, DataField = "PhoneNumber", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxTextBox, EditorOptions = EditorOptionValues.PhoneEditorOptions }, - new EditingFormItemDto { Order = 18, DataField = "MobileNumber", ColSpan = 1, EditorType2 = EditorTypes.dxTextBox, EditorOptions = EditorOptionValues.PhoneEditorOptions }, - new EditingFormItemDto { Order = 19, DataField = "FaxNumber", ColSpan = 1, EditorType2 = EditorTypes.dxTextBox, EditorOptions = EditorOptionValues.PhoneEditorOptions }, - new EditingFormItemDto { Order = 20, DataField = "Email", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxTextBox }, - new EditingFormItemDto { Order = 21, DataField = "Website", ColSpan = 1, EditorType2 = EditorTypes.dxTextBox }, - ] - }, - new() - { - Order = 3, Caption="Supply Card", ColCount = 3, ColSpan = 2, ItemType = "group", Items = - [ - new EditingFormItemDto { Order = 22, DataField = "SupplierTypeId", ColSpan = 1, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton }, - new EditingFormItemDto { Order = 23, DataField = "SupplyCardTypeId", ColSpan = 1, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton }, - new EditingFormItemDto { Order = 24, DataField = "CardNumber", ColSpan = 1, EditorType2 = EditorTypes.dxTextBox }, - new EditingFormItemDto { Order = 25, DataField = "ValidFrom", ColSpan = 1, EditorType2 = EditorTypes.dxDateBox }, - new EditingFormItemDto { Order = 26, DataField = "ValidTo", ColSpan = 1, EditorType2 = EditorTypes.dxDateBox }, - new EditingFormItemDto { Order = 27, DataField = "CurrentBalance", ColSpan = 1, EditorType2 = EditorTypes.dxNumberBox }, - new EditingFormItemDto { Order = 28, DataField = "DiscountRate", ColSpan = 1, EditorType2 = EditorTypes.dxNumberBox }, - new EditingFormItemDto { Order = 29, DataField = "Status", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox }, - ] - } - }), - InsertFieldsDefaultValueJson = DefaultInsertFieldsDefaultValueJson, - FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] - { - new() { FieldName = "PartyType", FieldDbType = DbType.String, Value = "Supplier", CustomValueType = FieldCustomValueTypeEnum.Value }, - new() { FieldName = "CreditLimit", FieldDbType = DbType.Decimal, Value = "0", CustomValueType = FieldCustomValueTypeEnum.Value }, - new() { FieldName = "CurrentBalance", FieldDbType = DbType.Decimal, Value = "0", CustomValueType = FieldCustomValueTypeEnum.Value }, - new() { FieldName = "DiscountRate", FieldDbType = DbType.Decimal, Value = "0", CustomValueType = FieldCustomValueTypeEnum.Value }, - new() { FieldName = "Status", FieldDbType = DbType.String, Value = "Aktif", CustomValueType = FieldCustomValueTypeEnum.Value }, - new() { FieldName = "Country", FieldDbType = DbType.String, Value = "TR", CustomValueType = FieldCustomValueTypeEnum.Value }, - }), - CommandColumnJson = JsonSerializer.Serialize(new CommandColumnDto[] { - new() { - Hint = "Manage", - Text ="Manage", - UrlTarget="_blank", - AuthName = AppCodes.SupplyChain.Supply, - Url=$"/admin/form/{utils.GetDefaultFormCodes(ListFormCodes.Lists.Supply)}/@Id" - }, - }), - }, autoSave: true); + new() { FieldName = "PartyType", FieldDbType = DbType.String, Value = "Supplier", CustomValueType = FieldCustomValueTypeEnum.Value }, + new() { FieldName = "CreditLimit", FieldDbType = DbType.Decimal, Value = "0", CustomValueType = FieldCustomValueTypeEnum.Value }, + new() { FieldName = "CurrentBalance", FieldDbType = DbType.Decimal, Value = "0", CustomValueType = FieldCustomValueTypeEnum.Value }, + new() { FieldName = "DiscountRate", FieldDbType = DbType.Decimal, Value = "0", CustomValueType = FieldCustomValueTypeEnum.Value }, + new() { FieldName = "Status", FieldDbType = DbType.String, Value = "Aktif", CustomValueType = FieldCustomValueTypeEnum.Value }, + new() { FieldName = "Country", FieldDbType = DbType.String, Value = "TR", CustomValueType = FieldCustomValueTypeEnum.Value }, + }), + CommandColumnJson = JsonSerializer.Serialize(new CommandColumnDto[] { + new() { + Hint = "Manage", + Text ="Manage", + UrlTarget="_blank", + AuthName = AppCodes.SupplyChain.Supply, + Url=$"/admin/form/{utils.GetDefaultFormCodes(ListFormCodes.Lists.Supply)}/@Id" + }, + }), + }, autoSave: true + ); - await _listFormFieldRepository.InsertManyAsync( - [ + await _listFormFieldRepository.InsertManyAsync([ new() { ListFormCode = listForm.ListFormCode, @@ -1689,48 +1690,6 @@ public class ListFormSeeder_SupplyChain : IDataSeedContributor, ITransientDepend PivotSettingsJson = DefaultPivotSettingsJson }, ], autoSave: true); - - // Sub Forms for Supply - await utils.CloneListFormWithFieldsAsync( - _listFormRepository, - _listFormFieldRepository, - listForm.ListFormCode, - JsonSerializer.Serialize(new List() { - new { - TabTitle = "Banks", - TabType = ListFormTabTypeEnum.List, - Code = ListFormCodes.Lists.PartnerBank, - Relation = new List() { - new { - ParentFieldName = "Id", - ChildFieldName = "PartnerId" - } - } - }, - new { - TabTitle = "Certificates", - TabType = ListFormTabTypeEnum.List, - Code = ListFormCodes.Lists.PartnerCertificate, - Relation = new List() { - new { - ParentFieldName = "Id", - ChildFieldName = "PartnerId" - } - } - }, - new { - TabTitle = "Contacts", - TabType = ListFormTabTypeEnum.List, - Code = ListFormCodes.Lists.PartnerContact, - Relation = new List() { - new { - ParentFieldName = "Id", - ChildFieldName = "PartnerId" - } - } - } - }) - ); } #endregion @@ -1788,7 +1747,6 @@ public class ListFormSeeder_SupplyChain : IDataSeedContributor, ITransientDepend new EditingFormItemDto { Order = 11, DataField="DailyTransferLimit", ColSpan = 1, EditorType2 = EditorTypes.dxNumberBox }, new EditingFormItemDto { Order = 12, DataField="IsDefault", ColSpan = 1, EditorType2 = EditorTypes.dxCheckBox }, new EditingFormItemDto { Order = 13, DataField="IsActive", ColSpan = 1, EditorType2 = EditorTypes.dxCheckBox }, - new EditingFormItemDto { Order = 14, DataField="PartnerId", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox }, ]} }), FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { @@ -1798,7 +1756,7 @@ public class ListFormSeeder_SupplyChain : IDataSeedContributor, ITransientDepend new() { FieldName = "IsDefault", FieldDbType = DbType.Boolean, Value = "false", CustomValueType = FieldCustomValueTypeEnum.Value }, new() { FieldName = "IsActive", FieldDbType = DbType.Boolean, Value = "true", CustomValueType = FieldCustomValueTypeEnum.Value } }), - } + }, autoSave: true ); #region Partner Bank Fields @@ -2038,23 +1996,7 @@ public class ListFormSeeder_SupplyChain : IDataSeedContributor, ITransientDepend PermissionJson = DefaultFieldPermissionJson(listForm.Name), PivotSettingsJson = DefaultPivotSettingsJson }, - new() { - ListFormCode = listForm.ListFormCode, - CultureName = LanguageCodes.En, - SourceDbType = DbType.Guid, - FieldName = "PartnerId", - Width = 100, - ListOrderNo = 15, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = true, - LookupJson = LookupQueryValues.DefaultLookupQueryJson(nameof(TableNameEnum.Partner), "Id", "Name"), - ColumnCustomizationJson = DefaultColumnCustomizationJson, - PermissionJson = DefaultFieldPermissionJson(listForm.Name), - PivotSettingsJson = DefaultPivotSettingsJson - }, - ]); + ], autoSave: true); #endregion } #endregion @@ -2104,10 +2046,9 @@ public class ListFormSeeder_SupplyChain : IDataSeedContributor, ITransientDepend new EditingFormItemDto { Order = 2, DataField="Issuer", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxTextBox }, new EditingFormItemDto { Order = 3, DataField="IssueDate", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxDateBox }, new EditingFormItemDto { Order = 4, DataField="ExpiryDate", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxDateBox }, - new EditingFormItemDto { Order = 5, DataField="PartnerId", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox }, ]} }), - } + }, autoSave: true ); #region Supplier Certificate Fields @@ -2192,23 +2133,7 @@ public class ListFormSeeder_SupplyChain : IDataSeedContributor, ITransientDepend PermissionJson = DefaultFieldPermissionJson(AppCodes.SupplyChain.PartnerCertificate), PivotSettingsJson = DefaultPivotSettingsJson }, - new() { - ListFormCode = listForm.ListFormCode, - CultureName = LanguageCodes.En, - SourceDbType = DbType.Guid, - FieldName = "PartnerId", - Width = 100, - ListOrderNo = 6, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = true, - LookupJson = LookupQueryValues.DefaultLookupQueryJson(nameof(TableNameEnum.Partner), "Id", "Name"), - ColumnCustomizationJson = DefaultColumnCustomizationJson, - PermissionJson = DefaultFieldPermissionJson(listForm.Name), - PivotSettingsJson = DefaultPivotSettingsJson - }, - ]); + ], autoSave: true); #endregion } #endregion @@ -2262,14 +2187,13 @@ public class ListFormSeeder_SupplyChain : IDataSeedContributor, ITransientDepend new EditingFormItemDto { Order = 6, DataField="MobileNumber", ColSpan = 1, EditorType2 = EditorTypes.dxTextBox, EditorOptions = EditorOptionValues.PhoneEditorOptions }, new EditingFormItemDto { Order = 7, DataField="IsPrimary", ColSpan = 1, EditorType2 = EditorTypes.dxCheckBox }, new EditingFormItemDto { Order = 8, DataField="IsActive", ColSpan = 1, EditorType2 = EditorTypes.dxCheckBox }, - new EditingFormItemDto { Order = 9, DataField="PartnerId", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox }, ]} }), FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { new() { FieldName = "IsPrimary", FieldDbType = DbType.Boolean, Value = "false", CustomValueType = FieldCustomValueTypeEnum.Value }, new() { FieldName = "IsActive", FieldDbType = DbType.Boolean, Value = "true", CustomValueType = FieldCustomValueTypeEnum.Value } }), - } + }, autoSave: true ); #region Supplier Contact Fields @@ -2416,27 +2340,101 @@ public class ListFormSeeder_SupplyChain : IDataSeedContributor, ITransientDepend PermissionJson = DefaultFieldPermissionJson(listForm.Name), PivotSettingsJson = DefaultPivotSettingsJson }, - new() { - ListFormCode = listForm.ListFormCode, - CultureName = LanguageCodes.En, - SourceDbType = DbType.Guid, - FieldName = "PartnerId", - Width = 100, - ListOrderNo = 8, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = true, - LookupJson = LookupQueryValues.DefaultLookupQueryJson(nameof(TableNameEnum.Partner), "Id", "Name"), - ColumnCustomizationJson = DefaultColumnCustomizationJson, - PermissionJson = DefaultFieldPermissionJson(listForm.Name), - PivotSettingsJson = DefaultPivotSettingsJson - }, - ]); + ], autoSave: true); #endregion } #endregion + // Supply ile Bank, Certificate ve Contact Sub Forms ilişkisinin kurulması + await utils.CloneListFormWithFieldsAsync( + _listFormRepository, + _listFormFieldRepository, + ListFormCodes.Lists.Supply, + JsonSerializer.Serialize(new List() { + new { + TabTitle = "Banks", + TabType = ListFormTabTypeEnum.List, + Code = ListFormCodes.Lists.PartnerBank, + Relation = new List() { + new { + ParentFieldName = "Id", + DbType = DbType.Guid, + ChildFieldName = "PartnerId" + } + } + }, + new { + TabTitle = "Certificates", + TabType = ListFormTabTypeEnum.List, + Code = ListFormCodes.Lists.PartnerCertificate, + Relation = new List() { + new { + ParentFieldName = "Id", + DbType = DbType.Guid, + ChildFieldName = "PartnerId" + } + } + }, + new { + TabTitle = "Contacts", + TabType = ListFormTabTypeEnum.List, + Code = ListFormCodes.Lists.PartnerContact, + Relation = new List() { + new { + ParentFieldName = "Id", + DbType = DbType.Guid, + ChildFieldName = "PartnerId" + } + } + } + }) + ); + + // Customer ile Bank, Certificate ve Contact Sub Forms ilişkisinin kurulması + await utils.CloneListFormWithFieldsAsync( + _listFormRepository, + _listFormFieldRepository, + ListFormCodes.Lists.Customer, + JsonSerializer.Serialize(new List() { + new { + TabTitle = "Banks", + TabType = ListFormTabTypeEnum.List, + Code = ListFormCodes.Lists.PartnerBank, + Relation = new List() { + new { + ParentFieldName = "Id", + DbType = DbType.Guid, + ChildFieldName = "PartnerId" + } + } + }, + new { + TabTitle = "Certificates", + TabType = ListFormTabTypeEnum.List, + Code = ListFormCodes.Lists.PartnerCertificate, + Relation = new List() { + new { + ParentFieldName = "Id", + DbType = DbType.Guid, + ChildFieldName = "PartnerId" + } + } + }, + new { + TabTitle = "Contacts", + TabType = ListFormTabTypeEnum.List, + Code = ListFormCodes.Lists.PartnerContact, + Relation = new List() { + new { + ParentFieldName = "Id", + DbType = DbType.Guid, + ChildFieldName = "PartnerId" + } + } + } + }) + ); + #region Approval if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.Approval)) { @@ -2602,27 +2600,6 @@ public class ListFormSeeder_SupplyChain : IDataSeedContributor, ITransientDepend ], autoSave: true); #endregion } - - // Sub Forms for Approval Workflow - await utils.CloneListFormWithFieldsAsync( - _listFormRepository, - _listFormFieldRepository, - ListFormCodes.Lists.Approval, - JsonSerializer.Serialize(new List() { - new { - TabTitle = "Steps", - TabType = ListFormTabTypeEnum.List, - Code = ListFormCodes.Lists.ApprovalStep, - Relation = new List() { - new { - ParentFieldName = "Id", - ChildFieldName = "ApprovalId" - } - } - } - }) - ); - #endregion #region Approval Step @@ -2632,7 +2609,7 @@ public class ListFormSeeder_SupplyChain : IDataSeedContributor, ITransientDepend new ListForm() { ListFormType = ListFormTypeEnum.List, - IsSubForm = false, + IsSubForm = true, ShowNote = true, LayoutJson = DefaultLayoutJson, CultureName = LanguageCodes.En, @@ -2670,7 +2647,6 @@ public class ListFormSeeder_SupplyChain : IDataSeedContributor, ITransientDepend new EditingFormItemDto { Order = 3, DataField = "TimeoutDays", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxNumberBox }, new EditingFormItemDto { Order = 4, DataField = "IsRequired", ColSpan = 1, EditorType2 = EditorTypes.dxCheckBox }, new EditingFormItemDto { Order = 5, DataField = "IsParallel", ColSpan = 1, EditorType2 = EditorTypes.dxCheckBox }, - new EditingFormItemDto { Order = 6, DataField = "ApprovalId", ColSpan = 1, EditorType2 = EditorTypes.dxSelectBox }, ]} }), FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { @@ -2678,10 +2654,10 @@ public class ListFormSeeder_SupplyChain : IDataSeedContributor, ITransientDepend new() { FieldName = "IsRequired", FieldDbType = DbType.Boolean, Value = "true", CustomValueType = FieldCustomValueTypeEnum.Value }, new() { FieldName = "IsParallel", FieldDbType = DbType.Boolean, Value = "false", CustomValueType = FieldCustomValueTypeEnum.Value } }), - } + }, autoSave: true ); - #region Approval Workflow Step Fields + #region Approval Step Fields await _listFormFieldRepository.InsertManyAsync([ new() { ListFormCode = listForm.ListFormCode, @@ -2778,27 +2754,32 @@ public class ListFormSeeder_SupplyChain : IDataSeedContributor, ITransientDepend PermissionJson = DefaultFieldPermissionJson(listForm.Name), PivotSettingsJson = DefaultPivotSettingsJson }, - new() { - ListFormCode = listForm.ListFormCode, - CultureName = LanguageCodes.En, - SourceDbType = DbType.Guid, - FieldName = "ApprovalId", - Width = 100, - ListOrderNo = 8, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = true, - LookupJson = LookupQueryValues.DefaultLookupQueryJson(nameof(TableNameEnum.Approval), "Id", "Name"), - ColumnCustomizationJson = DefaultColumnCustomizationJson, - PermissionJson = DefaultFieldPermissionJson(listForm.Name), - PivotSettingsJson = DefaultPivotSettingsJson - } - ]); + ], autoSave: true); #endregion } #endregion + // Approval ve Approval Step arasında Sub Forms ilişkisinin kurulması + await utils.CloneListFormWithFieldsAsync( + _listFormRepository, + _listFormFieldRepository, + ListFormCodes.Lists.Approval, + JsonSerializer.Serialize(new List() { + new { + TabTitle = "Steps", + TabType = ListFormTabTypeEnum.List, + Code = ListFormCodes.Lists.ApprovalStep, + Relation = new List() { + new { + ParentFieldName = "Id", + DbType = DbType.Guid, + ChildFieldName = "ApprovalId" + } + } + } + }) + ); + #region Request Type if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.RequestType)) { @@ -2925,74 +2906,76 @@ public class ListFormSeeder_SupplyChain : IDataSeedContributor, ITransientDepend #region Purchase Request if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.Request)) { - var listForm = await _listFormRepository.InsertAsync(new ListForm() - { - ListFormType = ListFormTypeEnum.List, - IsSubForm = false, - ShowNote = true, - LayoutJson = DefaultLayoutJson, - CultureName = LanguageCodes.En, - ListFormCode = ListFormCodes.Lists.Request, - Name = AppCodes.SupplyChain.Request, - Title = AppCodes.SupplyChain.Request, - DataSourceCode = SeedConsts.DataSources.DefaultCode, - IsTenant = true, - IsBranch = false, - IsOrganizationUnit = false, - Description = AppCodes.SupplyChain.Request, - SelectCommandType = SelectCommandTypeEnum.Table, - SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.Request)), - KeyFieldName = "Id", - KeyFieldDbSourceType = DbType.Guid, - DefaultFilter = DefaultFilterJson, - SortMode = GridOptions.SortModeSingle, - FilterRowJson = DefaultFilterRowJson, - HeaderFilterJson = DefaultHeaderFilterJson, - SearchPanelJson = DefaultSearchPanelJson, - GroupPanelJson = DefaultGroupPanelJson, - SelectionJson = DefaultSelectionSingleJson, - ColumnOptionJson = DefaultColumnOptionJson, - PermissionJson = DefaultPermissionJson(AppCodes.SupplyChain.Request), - DeleteCommand = DefaultDeleteCommand(nameof(TableNameEnum.Request)), - DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson, - PagerOptionJson = DefaultPagerOptionJson, - EditingOptionJson = DefaultEditingOptionJson(AppCodes.SupplyChain.Request, 800, 300, true, true, true, true, false), - EditingFormJson = JsonSerializer.Serialize(new List() + var listForm = await _listFormRepository.InsertAsync( + new ListForm() { - new() + ListFormType = ListFormTypeEnum.List, + IsSubForm = false, + ShowNote = true, + LayoutJson = DefaultLayoutJson, + CultureName = LanguageCodes.En, + ListFormCode = ListFormCodes.Lists.Request, + Name = AppCodes.SupplyChain.Request, + Title = AppCodes.SupplyChain.Request, + DataSourceCode = SeedConsts.DataSources.DefaultCode, + IsTenant = true, + IsBranch = false, + IsOrganizationUnit = false, + Description = AppCodes.SupplyChain.Request, + SelectCommandType = SelectCommandTypeEnum.Table, + SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.Request)), + KeyFieldName = "Id", + KeyFieldDbSourceType = DbType.Guid, + DefaultFilter = DefaultFilterJson, + SortMode = GridOptions.SortModeSingle, + FilterRowJson = DefaultFilterRowJson, + HeaderFilterJson = DefaultHeaderFilterJson, + SearchPanelJson = DefaultSearchPanelJson, + GroupPanelJson = DefaultGroupPanelJson, + SelectionJson = DefaultSelectionSingleJson, + ColumnOptionJson = DefaultColumnOptionJson, + PermissionJson = DefaultPermissionJson(AppCodes.SupplyChain.Request), + DeleteCommand = DefaultDeleteCommand(nameof(TableNameEnum.Request)), + DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson, + PagerOptionJson = DefaultPagerOptionJson, + EditingOptionJson = DefaultEditingOptionJson(AppCodes.SupplyChain.Request, 800, 300, true, true, true, true, false), + EditingFormJson = JsonSerializer.Serialize(new List() { - Order = 1, ColCount = 2, ColSpan = 2, ItemType = "group", Items = - [ - new EditingFormItemDto { Order = 1, DataField = "RequestNumber", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxTextBox, EditorOptions = EditorOptionValues.Disabled }, - new EditingFormItemDto { Order = 2, DataField = "RequestTypeId", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox }, - new EditingFormItemDto { Order = 3, DataField = "DepartmentId", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox }, - new EditingFormItemDto { Order = 4, DataField = "EmployeeId", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox }, - new EditingFormItemDto { Order = 5, DataField = "RequestDate", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxDateBox }, - new EditingFormItemDto { Order = 6, DataField = "RequiredDate", ColSpan = 1, EditorType2 = EditorTypes.dxDateBox }, - new EditingFormItemDto { Order = 7, DataField = "Priority", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox }, - new EditingFormItemDto { Order = 8, DataField = "Status", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox }, - new EditingFormItemDto { Order = 9, DataField = "Description", ColSpan = 2, EditorType2 = EditorTypes.dxTextArea }, - ] - } - }), - InsertFieldsDefaultValueJson = DefaultInsertFieldsDefaultValueJson, - FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] - { - new() { FieldName = "RequestNumber", FieldDbType = DbType.String, Value = "@AUTONUMBER", CustomValueType = FieldCustomValueTypeEnum.CustomKey }, - new() { FieldName = "RequestDate", FieldDbType = DbType.Date, Value = "@DATE", CustomValueType = FieldCustomValueTypeEnum.CustomKey }, - new() { FieldName = "Priority", FieldDbType = DbType.String, Value = "Low", CustomValueType = FieldCustomValueTypeEnum.Value }, - new() { FieldName = "Status", FieldDbType = DbType.String, Value = "Draft", CustomValueType = FieldCustomValueTypeEnum.Value }, - }), - CommandColumnJson = JsonSerializer.Serialize(new CommandColumnDto[] { - new() { - Hint = "Manage", - Text ="Manage", - UrlTarget="_blank", - AuthName = AppCodes.SupplyChain.Request, - Url=$"/admin/form/{utils.GetDefaultFormCodes(ListFormCodes.Lists.Request)}/@Id" - }, - }), - }, autoSave: true); + new() + { + Order = 1, ColCount = 2, ColSpan = 2, ItemType = "group", Items = + [ + new EditingFormItemDto { Order = 1, DataField = "RequestNumber", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxTextBox, EditorOptions = EditorOptionValues.Disabled }, + new EditingFormItemDto { Order = 2, DataField = "RequestTypeId", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox }, + new EditingFormItemDto { Order = 3, DataField = "DepartmentId", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox }, + new EditingFormItemDto { Order = 4, DataField = "EmployeeId", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox }, + new EditingFormItemDto { Order = 5, DataField = "RequestDate", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxDateBox }, + new EditingFormItemDto { Order = 6, DataField = "RequiredDate", ColSpan = 1, EditorType2 = EditorTypes.dxDateBox }, + new EditingFormItemDto { Order = 7, DataField = "Priority", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox }, + new EditingFormItemDto { Order = 8, DataField = "Status", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox }, + new EditingFormItemDto { Order = 9, DataField = "Description", ColSpan = 2, EditorType2 = EditorTypes.dxTextArea }, + ] + } + }), + InsertFieldsDefaultValueJson = DefaultInsertFieldsDefaultValueJson, + FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] + { + new() { FieldName = "RequestNumber", FieldDbType = DbType.String, Value = "@AUTONUMBER", CustomValueType = FieldCustomValueTypeEnum.CustomKey }, + new() { FieldName = "RequestDate", FieldDbType = DbType.Date, Value = "@DATE", CustomValueType = FieldCustomValueTypeEnum.CustomKey }, + new() { FieldName = "Priority", FieldDbType = DbType.String, Value = "Low", CustomValueType = FieldCustomValueTypeEnum.Value }, + new() { FieldName = "Status", FieldDbType = DbType.String, Value = "Draft", CustomValueType = FieldCustomValueTypeEnum.Value }, + }), + CommandColumnJson = JsonSerializer.Serialize(new CommandColumnDto[] { + new() { + Hint = "Manage", + Text ="Manage", + UrlTarget="_blank", + AuthName = AppCodes.SupplyChain.Request, + Url=$"/admin/form/{utils.GetDefaultFormCodes(ListFormCodes.Lists.Request)}/@Id" + }, + }), + }, autoSave: true + ); await _listFormFieldRepository.InsertManyAsync([ new() { @@ -3183,26 +3166,6 @@ public class ListFormSeeder_SupplyChain : IDataSeedContributor, ITransientDepend PivotSettingsJson = DefaultPivotSettingsJson } ], autoSave: true); - - // Sub Forms for Supply - await utils.CloneListFormWithFieldsAsync( - _listFormRepository, - _listFormFieldRepository, - listForm.ListFormCode, - JsonSerializer.Serialize(new List() { - new { - TabTitle = "Malzemeler", - TabType = ListFormTabTypeEnum.List, - Code = ListFormCodes.Lists.RequestItem, - Relation = new List() { - new { - ParentFieldName = "Id", - ChildFieldName = "RequestId" - } - } - } - }) - ); } #endregion @@ -3254,7 +3217,6 @@ public class ListFormSeeder_SupplyChain : IDataSeedContributor, ITransientDepend new EditingFormItemDto { Order = 5, DataField="Specification", ColSpan = 1, EditorType2 = EditorTypes.dxTextBox }, new EditingFormItemDto { Order = 6, DataField="Justification", ColSpan = 1, EditorType2 = EditorTypes.dxTextBox }, new EditingFormItemDto { Order = 7, DataField="IsUrgent", ColSpan = 1, EditorType2 = EditorTypes.dxCheckBox }, - new EditingFormItemDto { Order = 8, DataField="RequestId", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox }, ]} }), FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { @@ -3262,7 +3224,7 @@ public class ListFormSeeder_SupplyChain : IDataSeedContributor, ITransientDepend new() { FieldName = "EstimatedPrice", FieldDbType = DbType.Decimal, Value = "0", CustomValueType = FieldCustomValueTypeEnum.Value }, new() { FieldName = "IsUrgent", FieldDbType = DbType.Boolean, Value = "false", CustomValueType = FieldCustomValueTypeEnum.Value } }), - } + }, autoSave: true ); #region Purchase Request Item Fields @@ -3397,25 +3359,30 @@ public class ListFormSeeder_SupplyChain : IDataSeedContributor, ITransientDepend PermissionJson = DefaultFieldPermissionJson(listForm.Name), PivotSettingsJson = DefaultPivotSettingsJson }, - new() { - ListFormCode = listForm.ListFormCode, - CultureName = LanguageCodes.En, - SourceDbType = DbType.Guid, - FieldName = "RequestId", - Width = 130, - ListOrderNo = 8, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = true, - LookupJson = LookupQueryValues.DefaultLookupQueryJson(nameof(TableNameEnum.Request), "Id", "RequestNumber"), - ColumnCustomizationJson = DefaultColumnCustomizationJson, - PermissionJson = DefaultFieldPermissionJson(listForm.Name), - PivotSettingsJson = DefaultPivotSettingsJson - }, - ]); + ], autoSave: true); #endregion } #endregion + + // Purchase Request ve Purchase Request Item arasında SubForm ilişki kurulması + await utils.CloneListFormWithFieldsAsync( + _listFormRepository, + _listFormFieldRepository, + ListFormCodes.Lists.Request, + JsonSerializer.Serialize(new List() { + new { + TabTitle = "Malzemeler", + TabType = ListFormTabTypeEnum.List, + Code = ListFormCodes.Lists.RequestItem, + Relation = new List() { + new { + ParentFieldName = "Id", + DbType = DbType.Guid, + ChildFieldName = "RequestId" + } + } + } + }) + ); } } diff --git a/api/src/Erp.Platform.DbMigrator/Seeds/PermissionsData.json b/api/src/Erp.Platform.DbMigrator/Seeds/PermissionsData.json index f7e83720..8e629555 100644 --- a/api/src/Erp.Platform.DbMigrator/Seeds/PermissionsData.json +++ b/api/src/Erp.Platform.DbMigrator/Seeds/PermissionsData.json @@ -11292,6 +11292,69 @@ "MultiTenancySide": 3, "MenuGroup": "Erp" }, + { + "GroupName": "App.Accounting", + "Name": "App.Accounting.BankAccount", + "ParentName": null, + "DisplayName": "App.Accounting.BankAccount", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.Accounting", + "Name": "App.Accounting.BankAccount.Create", + "ParentName": "App.Accounting.BankAccount", + "DisplayName": "Create", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.Accounting", + "Name": "App.Accounting.BankAccount.Update", + "ParentName": "App.Accounting.BankAccount", + "DisplayName": "Update", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.Accounting", + "Name": "App.Accounting.BankAccount.Delete", + "ParentName": "App.Accounting.BankAccount", + "DisplayName": "Delete", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.Accounting", + "Name": "App.Accounting.BankAccount.Export", + "ParentName": "App.Accounting.BankAccount", + "DisplayName": "Export", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.Accounting", + "Name": "App.Accounting.BankAccount.Import", + "ParentName": "App.Accounting.BankAccount", + "DisplayName": "Import", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.Accounting", + "Name": "App.Accounting.BankAccount.Note", + "ParentName": "App.Accounting.BankAccount", + "DisplayName": "Note", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, { "GroupName": "App.Accounting", "Name": "App.Accounting.CheckNote", diff --git a/api/src/Erp.Platform.DbMigrator/Seeds/SeederUtils.cs b/api/src/Erp.Platform.DbMigrator/Seeds/SeederUtils.cs index 6941a5fe..83631416 100644 --- a/api/src/Erp.Platform.DbMigrator/Seeds/SeederUtils.cs +++ b/api/src/Erp.Platform.DbMigrator/Seeds/SeederUtils.cs @@ -1,7 +1,12 @@ using System; using System.Collections.Generic; +using System.Data; +using System.Linq; +using System.Text.Json; using System.Threading.Tasks; using Erp.Platform.Entities; +using Erp.Platform.ListForms; +using Microsoft.EntityFrameworkCore; using Volo.Abp.Domain.Repositories; namespace Erp.Platform.Data.Seeds; @@ -12,78 +17,77 @@ public class SeederUtils : IDisposable IRepository listFormRepository, IRepository listFormFieldRepository, string listFormCode, - string subFormsJson = "") + string subFormsJson) { // load source form - var sourceForm = await listFormRepository.FirstOrDefaultAsync(f => f.ListFormCode == listFormCode); - if (sourceForm == null) + var listForm = await listFormRepository.FirstOrDefaultAsync(f => f.ListFormCode == listFormCode); + if (listForm == null) { return null; } - string targetListFormCode = GetDefaultFormCodes(listFormCode); + string formCode = GetDefaultFormCodes(listFormCode); - var targetForm = await listFormRepository.FirstOrDefaultAsync(f => f.ListFormCode == targetListFormCode); - if (targetForm != null) + var targetForm = await listFormRepository.FirstOrDefaultAsync(f => f.ListFormCode == formCode); + if (targetForm == null) { - return null; + // create a shallow copy of the source form and set the target code + var insertForm = new ListForm + { + ListFormCode = formCode, + SubFormsJson = subFormsJson, //Özelleştirilmiş SubFormsJson + + ListFormType = listForm.ListFormType, + IsSubForm = listForm.IsSubForm, + ShowNote = listForm.ShowNote, + LayoutJson = listForm.LayoutJson, + CultureName = listForm.CultureName, + Name = listForm.Name, + Title = listForm.Title, + DataSourceCode = listForm.DataSourceCode, + IsTenant = listForm.IsTenant, + IsBranch = listForm.IsBranch, + IsOrganizationUnit = listForm.IsOrganizationUnit, + Description = listForm.Description, + SelectCommandType = listForm.SelectCommandType, + SelectCommand = listForm.SelectCommand, + KeyFieldName = listForm.KeyFieldName, + KeyFieldDbSourceType = listForm.KeyFieldDbSourceType, + DefaultFilter = listForm.DefaultFilter, + SortMode = listForm.SortMode, + PermissionJson = listForm.PermissionJson, + DeleteCommand = listForm.DeleteCommand, + DeleteFieldsDefaultValueJson = listForm.DeleteFieldsDefaultValueJson, + EditingOptionJson = listForm.EditingOptionJson, + EditingFormJson = listForm.EditingFormJson, + InsertFieldsDefaultValueJson = listForm.InsertFieldsDefaultValueJson, + FormFieldsDefaultValueJson = listForm.FormFieldsDefaultValueJson, + CommandColumnJson = listForm.CommandColumnJson, + InsertServiceAddress = listForm.InsertServiceAddress, + UpdateServiceAddress = listForm.UpdateServiceAddress, + FilterRowJson = listForm.FilterRowJson, + HeaderFilterJson = listForm.HeaderFilterJson, + SearchPanelJson = listForm.SearchPanelJson, + GroupPanelJson = listForm.GroupPanelJson, + SelectionJson = listForm.SelectionJson, + ColumnOptionJson = listForm.ColumnOptionJson, + PagerOptionJson = listForm.PagerOptionJson, + }; + + // insert cloned form + targetForm = await listFormRepository.InsertAsync(insertForm, autoSave: true); } - // create a shallow copy of the source form and set the target code - var clonedForm = new ListForm - { - ListFormType = sourceForm.ListFormType, - IsSubForm = sourceForm.IsSubForm, - ShowNote = sourceForm.ShowNote, - LayoutJson = sourceForm.LayoutJson, - SubFormsJson = subFormsJson ?? sourceForm.SubFormsJson, - CultureName = sourceForm.CultureName, - ListFormCode = targetListFormCode, - Name = sourceForm.Name, - Title = sourceForm.Title, - DataSourceCode = sourceForm.DataSourceCode, - IsTenant = sourceForm.IsTenant, - IsBranch = sourceForm.IsBranch, - IsOrganizationUnit = sourceForm.IsOrganizationUnit, - Description = sourceForm.Description, - SelectCommandType = sourceForm.SelectCommandType, - SelectCommand = sourceForm.SelectCommand, - KeyFieldName = sourceForm.KeyFieldName, - KeyFieldDbSourceType = sourceForm.KeyFieldDbSourceType, - DefaultFilter = sourceForm.DefaultFilter, - SortMode = sourceForm.SortMode, - PermissionJson = sourceForm.PermissionJson, - DeleteCommand = sourceForm.DeleteCommand, - DeleteFieldsDefaultValueJson = sourceForm.DeleteFieldsDefaultValueJson, - EditingOptionJson = sourceForm.EditingOptionJson, - EditingFormJson = sourceForm.EditingFormJson, - InsertFieldsDefaultValueJson = sourceForm.InsertFieldsDefaultValueJson, - FormFieldsDefaultValueJson = sourceForm.FormFieldsDefaultValueJson, - CommandColumnJson = sourceForm.CommandColumnJson, - InsertServiceAddress = sourceForm.InsertServiceAddress, - UpdateServiceAddress = sourceForm.UpdateServiceAddress, - FilterRowJson = sourceForm.FilterRowJson, - HeaderFilterJson = sourceForm.HeaderFilterJson, - SearchPanelJson = sourceForm.SearchPanelJson, - GroupPanelJson = sourceForm.GroupPanelJson, - SelectionJson = sourceForm.SelectionJson, - ColumnOptionJson = sourceForm.ColumnOptionJson, - PagerOptionJson = sourceForm.PagerOptionJson, - }; - - // insert cloned form - var insertedForm = await listFormRepository.InsertAsync(clonedForm); - // copy fields - var fields = await listFormFieldRepository.GetListAsync(f => f.ListFormCode == listFormCode); - if (fields != null && fields.Count > 0) + var targetFormFields = await listFormFieldRepository.GetListAsync(f => f.ListFormCode == listFormCode); + if (targetFormFields != null && targetFormFields.Count > 0) { var clonedFields = new List(); - foreach (var f in fields) + foreach (var f in targetFormFields) { var newField = new ListFormField { - ListFormCode = targetListFormCode, + ListFormCode = formCode, CultureName = f.CultureName, SourceDbType = f.SourceDbType, FieldName = f.FieldName, @@ -105,10 +109,84 @@ public class SeederUtils : IDisposable clonedFields.Add(newField); } - await listFormFieldRepository.InsertManyAsync(clonedFields); + await listFormFieldRepository.InsertManyAsync(clonedFields, autoSave: true); } - return insertedForm; + //Subform içerisindeki ParentFieldName ve ChildFieldName alanlarına göre eksik olan fieldları ekle + var subForms = JsonSerializer.Deserialize>(subFormsJson); + if (subForms != null) + { + foreach (var subForm in subForms) + { + foreach (var sf in subForm.Relation) + { + var parentFieldName = sf.ParentFieldName; + var dbType = sf.DbType; + + await InsertListFormFieldAsync( + listFormRepository, + listFormFieldRepository, + listFormCode, + parentFieldName, + dbType + ); + + var childListFormCode = subForm.Code; + var childFieldName = sf.ChildFieldName; + + await InsertListFormFieldAsync( + listFormRepository, + listFormFieldRepository, + childListFormCode, + childFieldName, + dbType + ); + } + } + } + + return targetForm; + } + + private async Task InsertListFormFieldAsync( + IRepository listFormRepository, + IRepository listFormFieldRepository, + string listFormCode, + string fieldName, + DbType dbType + ) + { + var form = await listFormRepository.FirstOrDefaultAsync(f => f.ListFormCode == listFormCode); + var fieldQuery = await listFormFieldRepository.GetQueryableAsync(); + + var formField = await fieldQuery.FirstOrDefaultAsync(f => f.ListFormCode == listFormCode && f.FieldName == fieldName); + if (formField == null) + { + var listOrderNo = await fieldQuery.Where(f => f.ListFormCode == listFormCode).MaxAsync(a => a.ListOrderNo) ?? 0; + var field = new ListFormField + { + CultureName = PlatformConsts.DefaultLanguage, + ListFormCode = listFormCode, + SourceDbType = dbType, + FieldName = fieldName, + ListOrderNo = listOrderNo + 1, + Visible = false, + IsActive = true, + IsDeleted = false, + SortIndex = 0, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = form.Name + ".Create", + R = form.Name, + U = form.Name + ".Update", + E = true, + I = false, + Deny = false + }), + }; + + await listFormFieldRepository.InsertAsync(field, autoSave: true); + } } public string GetDefaultFormCodes(string listCode) diff --git a/api/src/Erp.Platform.Domain/Entities/Branch/Accounting/BankAccount.cs b/api/src/Erp.Platform.Domain/Entities/Branch/Accounting/BankAccount.cs index c7a9f203..dde4c2c6 100644 --- a/api/src/Erp.Platform.Domain/Entities/Branch/Accounting/BankAccount.cs +++ b/api/src/Erp.Platform.Domain/Entities/Branch/Accounting/BankAccount.cs @@ -7,7 +7,6 @@ namespace Erp.Platform.Entities; public class BankAccount : FullAuditedEntity, IMultiTenant { public Guid? TenantId { get; set; } - public Guid? BranchId { get; set; } public string AccountNumber { get; set; } public Guid BankId { get; set; } diff --git a/api/src/Erp.Platform.Domain/Queries/SubForm.cs b/api/src/Erp.Platform.Domain/Queries/SubForm.cs index 43014762..a7120bf1 100644 --- a/api/src/Erp.Platform.Domain/Queries/SubForm.cs +++ b/api/src/Erp.Platform.Domain/Queries/SubForm.cs @@ -1,4 +1,5 @@ using System.Collections.Generic; +using System.Data; using Volo.Abp.Domain.Values; namespace Erp.Platform.Queries; @@ -24,6 +25,7 @@ public class SubForm : ValueObject public class SubFormRelation { public string ParentFieldName { get; set; } + public DbType DbType { get; set; } public string ChildFieldName { get; set; } } diff --git a/api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251116194718_Initial.Designer.cs b/api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251117212636_Initial.Designer.cs similarity index 99% rename from api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251116194718_Initial.Designer.cs rename to api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251117212636_Initial.Designer.cs index 2053a291..4c4491a3 100644 --- a/api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251116194718_Initial.Designer.cs +++ b/api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251117212636_Initial.Designer.cs @@ -13,7 +13,7 @@ using Volo.Abp.EntityFrameworkCore; namespace Erp.Platform.Migrations { [DbContext(typeof(PlatformDbContext))] - [Migration("20251116194718_Initial")] + [Migration("20251117212636_Initial")] partial class Initial { /// @@ -1230,9 +1230,6 @@ namespace Erp.Platform.Migrations b.Property("BankId") .HasColumnType("uniqueidentifier"); - b.Property("BranchId") - .HasColumnType("uniqueidentifier"); - b.Property("CanTransferMoney") .HasColumnType("bit"); diff --git a/api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251116194718_Initial.cs b/api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251117212636_Initial.cs similarity index 99% rename from api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251116194718_Initial.cs rename to api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251117212636_Initial.cs index f9176ee4..6c5f81a8 100644 --- a/api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251116194718_Initial.cs +++ b/api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251117212636_Initial.cs @@ -2674,7 +2674,6 @@ namespace Erp.Platform.Migrations { Id = table.Column(type: "uniqueidentifier", nullable: false), TenantId = table.Column(type: "uniqueidentifier", nullable: true), - BranchId = table.Column(type: "uniqueidentifier", nullable: true), AccountNumber = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), BankId = table.Column(type: "uniqueidentifier", nullable: false), AccountOwner = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: false), diff --git a/api/src/Erp.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs b/api/src/Erp.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs index e0d8ccf1..a040d627 100644 --- a/api/src/Erp.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs +++ b/api/src/Erp.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs @@ -1227,9 +1227,6 @@ namespace Erp.Platform.Migrations b.Property("BankId") .HasColumnType("uniqueidentifier"); - b.Property("BranchId") - .HasColumnType("uniqueidentifier"); - b.Property("CanTransferMoney") .HasColumnType("bit"); diff --git a/ui/src/proxy/form/models.ts b/ui/src/proxy/form/models.ts index d4c72549..6d9bcc29 100644 --- a/ui/src/proxy/form/models.ts +++ b/ui/src/proxy/form/models.ts @@ -699,6 +699,7 @@ export interface SubFormDto { export interface SubFormRelationDto { parentFieldName: string + dbType : DbTypeEnum childFieldName: string } diff --git a/ui/src/views/admin/listForm/edit/FormTabSubForm.tsx b/ui/src/views/admin/listForm/edit/FormTabSubForm.tsx index 448747b0..2edd39d6 100644 --- a/ui/src/views/admin/listForm/edit/FormTabSubForm.tsx +++ b/ui/src/views/admin/listForm/edit/FormTabSubForm.tsx @@ -12,6 +12,7 @@ import { useState } from 'react' import { FaEdit, FaFileMedical, FaTrash } from 'react-icons/fa' import JsonRowOpDialogSubForm from './json-row-operations/JsonRowOpDialogSubForm' import { JsonRowDialogData } from './json-row-operations/types' +import { dbSourceTypeOptions } from './options' function FormTabSubForm() { const [isJsonRowOpDialogOpen, setIsJsonRowOpDialogOpen] = useState(false) @@ -111,7 +112,12 @@ function FormTabSubForm() {
    {row.relation?.map((i) => (
  • - {i.parentFieldName + ' : ' + i.childFieldName} + {i.parentFieldName + + ' : ' + + i.childFieldName + + ' (' + + dbSourceTypeOptions.find((option) => option.value === i.dbType)?.label + + ')'}
  • ))}
diff --git a/ui/src/views/admin/listForm/edit/json-row-operations/JsonRowOpDialogSubForm.tsx b/ui/src/views/admin/listForm/edit/json-row-operations/JsonRowOpDialogSubForm.tsx index bc1eadcd..2d503936 100644 --- a/ui/src/views/admin/listForm/edit/json-row-operations/JsonRowOpDialogSubForm.tsx +++ b/ui/src/views/admin/listForm/edit/json-row-operations/JsonRowOpDialogSubForm.tsx @@ -17,7 +17,7 @@ import { Field, FieldArray, FieldProps, Form, Formik } from 'formik' import { Dispatch, SetStateAction } from 'react' import { FaCalendarPlus, FaCalendarMinus } from 'react-icons/fa' import { boolean, object, string } from 'yup' -import { tabTypeOptions } from '../options' +import { dbSourceTypeOptions, tabTypeOptions } from '../options' import { JsonRowDialogData } from './types' import { deleteListFormJsonRow, @@ -69,7 +69,7 @@ function JsonRowOpDialogSubForm({ return ( (
-
- - - +
+
+ + + - - - {({ field, form }: FieldProps) => ( - option.value === values.tabType, + )} + onChange={(option) => form.setFieldValue(field.name, option?.value)} + /> + )} + + - - - + + + - - - + + + +
Parent Field Name
Child Field Name
+
Db Type
{values.relation && values.relation.length > 0 ? ( values.relation.map((item: SubFormRelationDto, index: any) => ( @@ -206,18 +206,45 @@ function JsonRowOpDialogSubForm({ autoComplete="off" name={`relation.${index}.parentFieldName`} component={Input} - placeholder="Parent Field Name" + placeholder={translate('::ListForms.ListFormEdit.SubFormsRelation.ParentFieldName')} />
+
+ +
+ + {({ field, form }: FieldProps) => ( +