From d44555ad6ad836f0b2e0897531e59679f851c5bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sedat=20=C3=96zt=C3=BCrk?= Date: Sat, 2 May 2026 21:43:32 +0300 Subject: [PATCH] =?UTF-8?q?Listform=20Wizard=20Manager=20g=C3=BCncellemele?= =?UTF-8?q?ri?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Dtos/LanguageDto.cs | 2 +- .../Dtos/LanguageKeyDto.cs | 2 +- .../Dtos/LanguageTextDto.cs | 2 +- .../LanguagesApplicationAutoMapperProfile.cs | 1 - .../Entities/Language.cs | 4 +- .../Entities/LanguageKey.cs | 4 +- .../Entities/LanguageText.cs | 4 +- .../Seeds/LanguagesData.json | 4 +- .../Seeds/ListFormSeeder_DefaultJsons.cs | 1 - .../Seeds/ListFormSeeder_Saas.cs | 12 -- .../Seeds/MenuDataSeeder.cs | 6 +- .../Seeds/PermissionDataSeeder.cs | 4 +- .../WizardData/202605022050_Departments.json | 134 +++++++++++++++ .../Seeds/WizardDataSeeder.cs | 83 +++++++--- .../Entities/Tenant/Administration/Menu.cs | 4 +- .../Tenant/Administration/MenuGroup.cs | 4 +- ....cs => 20260502173210_Initial.Designer.cs} | 152 +----------------- ...2_Initial.cs => 20260502173210_Initial.cs} | 45 +----- .../PlatformDbContextModelSnapshot.cs | 150 ----------------- .../listForm/wizard/WizardFileManager.tsx | 37 ++++- 20 files changed, 247 insertions(+), 408 deletions(-) create mode 100644 api/src/Sozsoft.Platform.DbMigrator/Seeds/WizardData/202605022050_Departments.json rename api/src/Sozsoft.Platform.EntityFrameworkCore/Migrations/{20260501150322_Initial.Designer.cs => 20260502173210_Initial.Designer.cs} (97%) rename api/src/Sozsoft.Platform.EntityFrameworkCore/Migrations/{20260501150322_Initial.cs => 20260502173210_Initial.cs} (98%) diff --git a/api/modules/Sozsoft.Languages/Sozsoft.Languages.Application.Contracts/Dtos/LanguageDto.cs b/api/modules/Sozsoft.Languages/Sozsoft.Languages.Application.Contracts/Dtos/LanguageDto.cs index b498d1c..bda064e 100644 --- a/api/modules/Sozsoft.Languages/Sozsoft.Languages.Application.Contracts/Dtos/LanguageDto.cs +++ b/api/modules/Sozsoft.Languages/Sozsoft.Languages.Application.Contracts/Dtos/LanguageDto.cs @@ -4,7 +4,7 @@ using Volo.Abp.Application.Dtos; namespace Sozsoft.Languages; -public class LanguageDto : FullAuditedEntityDto +public class LanguageDto : EntityDto { [Required] public string CultureName { get; set; } diff --git a/api/modules/Sozsoft.Languages/Sozsoft.Languages.Application.Contracts/Dtos/LanguageKeyDto.cs b/api/modules/Sozsoft.Languages/Sozsoft.Languages.Application.Contracts/Dtos/LanguageKeyDto.cs index 8544b50..90511af 100644 --- a/api/modules/Sozsoft.Languages/Sozsoft.Languages.Application.Contracts/Dtos/LanguageKeyDto.cs +++ b/api/modules/Sozsoft.Languages/Sozsoft.Languages.Application.Contracts/Dtos/LanguageKeyDto.cs @@ -4,7 +4,7 @@ using Volo.Abp.Application.Dtos; namespace Sozsoft.Languages; -public class LanguageKeyDto : FullAuditedEntityDto +public class LanguageKeyDto : EntityDto { [Required] public string Key { get; set; } diff --git a/api/modules/Sozsoft.Languages/Sozsoft.Languages.Application.Contracts/Dtos/LanguageTextDto.cs b/api/modules/Sozsoft.Languages/Sozsoft.Languages.Application.Contracts/Dtos/LanguageTextDto.cs index 9bdf5c6..cad7bf5 100644 --- a/api/modules/Sozsoft.Languages/Sozsoft.Languages.Application.Contracts/Dtos/LanguageTextDto.cs +++ b/api/modules/Sozsoft.Languages/Sozsoft.Languages.Application.Contracts/Dtos/LanguageTextDto.cs @@ -3,7 +3,7 @@ using Volo.Abp.Application.Dtos; namespace Sozsoft.Languages; -public class LanguageTextDto : FullAuditedEntityDto +public class LanguageTextDto : EntityDto { public string CultureName { get; set; } public string ResourceName { get; set; } diff --git a/api/modules/Sozsoft.Languages/Sozsoft.Languages.Application/LanguagesApplicationAutoMapperProfile.cs b/api/modules/Sozsoft.Languages/Sozsoft.Languages.Application/LanguagesApplicationAutoMapperProfile.cs index 2800dca..a90b794 100644 --- a/api/modules/Sozsoft.Languages/Sozsoft.Languages.Application/LanguagesApplicationAutoMapperProfile.cs +++ b/api/modules/Sozsoft.Languages/Sozsoft.Languages.Application/LanguagesApplicationAutoMapperProfile.cs @@ -17,7 +17,6 @@ public class LanguagesApplicationAutoMapperProfile : Profile CreateMap() .IgnoreAllPropertiesWithAnInaccessibleSetter() - .IgnoreFullAuditedObjectProperties() .ForMember(dest => dest.LanguageKey, opt => opt.Ignore()); CreateMap() diff --git a/api/modules/Sozsoft.Languages/Sozsoft.Languages.Domain/Entities/Language.cs b/api/modules/Sozsoft.Languages/Sozsoft.Languages.Domain/Entities/Language.cs index 8039d59..0dd7c90 100644 --- a/api/modules/Sozsoft.Languages/Sozsoft.Languages.Domain/Entities/Language.cs +++ b/api/modules/Sozsoft.Languages/Sozsoft.Languages.Domain/Entities/Language.cs @@ -1,9 +1,9 @@ using System; -using Volo.Abp.Domain.Entities.Auditing; +using Volo.Abp.Domain.Entities; namespace Sozsoft.Languages.Entities; -public class Language : FullAuditedEntity +public class Language : Entity { public string CultureName { get; set; } public string UiCultureName { get; set; } diff --git a/api/modules/Sozsoft.Languages/Sozsoft.Languages.Domain/Entities/LanguageKey.cs b/api/modules/Sozsoft.Languages/Sozsoft.Languages.Domain/Entities/LanguageKey.cs index 5255b43..c69ba23 100644 --- a/api/modules/Sozsoft.Languages/Sozsoft.Languages.Domain/Entities/LanguageKey.cs +++ b/api/modules/Sozsoft.Languages/Sozsoft.Languages.Domain/Entities/LanguageKey.cs @@ -1,10 +1,10 @@ using System; using System.Collections.Generic; -using Volo.Abp.Domain.Entities.Auditing; +using Volo.Abp.Domain.Entities; namespace Sozsoft.Languages.Entities; -public class LanguageKey : FullAuditedEntity +public class LanguageKey : Entity { public string Key { get; set; } public string ResourceName { get; set; } diff --git a/api/modules/Sozsoft.Languages/Sozsoft.Languages.Domain/Entities/LanguageText.cs b/api/modules/Sozsoft.Languages/Sozsoft.Languages.Domain/Entities/LanguageText.cs index f2441a8..2a99b39 100644 --- a/api/modules/Sozsoft.Languages/Sozsoft.Languages.Domain/Entities/LanguageText.cs +++ b/api/modules/Sozsoft.Languages/Sozsoft.Languages.Domain/Entities/LanguageText.cs @@ -1,9 +1,9 @@ using System; -using Volo.Abp.Domain.Entities.Auditing; +using Volo.Abp.Domain.Entities; namespace Sozsoft.Languages.Entities; -public class LanguageText : FullAuditedEntity +public class LanguageText : Entity { public string CultureName { get; set; } public string? Key { get; set; } diff --git a/api/src/Sozsoft.Platform.DbMigrator/Seeds/LanguagesData.json b/api/src/Sozsoft.Platform.DbMigrator/Seeds/LanguagesData.json index fdf63df..dc5d6a5 100644 --- a/api/src/Sozsoft.Platform.DbMigrator/Seeds/LanguagesData.json +++ b/api/src/Sozsoft.Platform.DbMigrator/Seeds/LanguagesData.json @@ -16001,8 +16001,8 @@ { "resourceName": "Platform", "key": "App.Listforms.WizardManager", - "en": "Listform Wizard Manager", - "tr": "Listform Sihirbazı Yöneticisi" + "en": "Wizard Manager", + "tr": "Sihirbazı Yöneticisi" }, { "resourceName": "Platform", diff --git a/api/src/Sozsoft.Platform.DbMigrator/Seeds/ListFormSeeder_DefaultJsons.cs b/api/src/Sozsoft.Platform.DbMigrator/Seeds/ListFormSeeder_DefaultJsons.cs index 8aea812..701f0a2 100644 --- a/api/src/Sozsoft.Platform.DbMigrator/Seeds/ListFormSeeder_DefaultJsons.cs +++ b/api/src/Sozsoft.Platform.DbMigrator/Seeds/ListFormSeeder_DefaultJsons.cs @@ -19,7 +19,6 @@ public static class ListFormSeeder_DefaultJsons { new() { FieldName = "CreationTime", FieldDbType = DbType.DateTime, Value = "@NOW", CustomValueType = FieldCustomValueTypeEnum.CustomKey }, new() { FieldName = "CreatorId", FieldDbType = DbType.Guid, Value = "@USERID", CustomValueType = FieldCustomValueTypeEnum.CustomKey }, - new() { FieldName = "IsDeleted", FieldDbType = DbType.Boolean, Value = "false", CustomValueType = FieldCustomValueTypeEnum.Value }, new() { FieldName = "Id", FieldDbType = dbType, Value = newId, CustomValueType = FieldCustomValueTypeEnum.CustomKey } }); diff --git a/api/src/Sozsoft.Platform.DbMigrator/Seeds/ListFormSeeder_Saas.cs b/api/src/Sozsoft.Platform.DbMigrator/Seeds/ListFormSeeder_Saas.cs index de8773f..b05c649 100644 --- a/api/src/Sozsoft.Platform.DbMigrator/Seeds/ListFormSeeder_Saas.cs +++ b/api/src/Sozsoft.Platform.DbMigrator/Seeds/ListFormSeeder_Saas.cs @@ -3255,7 +3255,6 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.Language)), KeyFieldName = "Id", KeyFieldDbSourceType = DbType.Guid, - DefaultFilter = DefaultFilterJson, SortMode = GridOptions.SortModeSingle, FilterRowJson = DefaultFilterRowJson, HeaderFilterJson = DefaultHeaderFilterJson, @@ -3264,8 +3263,6 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency SelectionJson = DefaultSelectionSingleJson, ColumnOptionJson = DefaultColumnOptionJson(), PermissionJson = DefaultPermissionJson(listFormName), - DeleteCommand = DefaultDeleteCommand(nameof(TableNameEnum.Language)), - DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson(), PagerOptionJson = DefaultPagerOptionJson, InsertFieldsDefaultValueJson = DefaultInsertFieldsDefaultValueJson(), EditingOptionJson = DefaultEditingOptionJson(listFormName, 600, 300, true, true, true, true, false, true), @@ -3416,7 +3413,6 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.LanguageText)), KeyFieldName = "Id", KeyFieldDbSourceType = DbType.Guid, - DefaultFilter = DefaultFilterJson, SortMode = GridOptions.SortModeSingle, FilterRowJson = DefaultFilterRowJson, HeaderFilterJson = DefaultHeaderFilterJson, @@ -3425,8 +3421,6 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency SelectionJson = DefaultSelectionSingleJson, ColumnOptionJson = DefaultColumnOptionJson(), PermissionJson = DefaultPermissionJson(listFormName), - DeleteCommand = DefaultDeleteCommand(nameof(TableNameEnum.LanguageText)), - DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson(), PagerOptionJson = DefaultPagerOptionJson, EditingOptionJson = DefaultEditingOptionJson(listFormName, 600, 400, true, true, true, true, false), EditingFormJson = JsonSerializer.Serialize(new List() { @@ -5084,7 +5078,6 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency KeyFieldName = "Id", KeyFieldDbSourceType = DbType.String, SortMode = GridOptions.SortModeSingle, - DefaultFilter = DefaultFilterJson, FilterRowJson = DefaultFilterRowJson, HeaderFilterJson = DefaultHeaderFilterJson, SearchPanelJson = DefaultSearchPanelJson, @@ -5102,8 +5095,6 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency ] } }), - DeleteCommand = DefaultDeleteCommand(nameof(TableNameEnum.MenuGroup)), - DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson(), InsertFieldsDefaultValueJson = DefaultInsertFieldsDefaultValueJson(DbType.String, "Name"), }); @@ -5175,7 +5166,6 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.Menu)), KeyFieldName = "Code", KeyFieldDbSourceType = DbType.String, - DefaultFilter = DefaultFilterJson, SortMode = GridOptions.SortModeSingle, FilterRowJson = DefaultFilterRowJson, HeaderFilterJson = DefaultHeaderFilterJson, @@ -5184,8 +5174,6 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency SelectionJson = DefaultSelectionSingleJson, ColumnOptionJson = DefaultColumnOptionJson(), PermissionJson = DefaultPermissionJson(listFormName), - DeleteCommand = DefaultDeleteCommand(nameof(TableNameEnum.Menu)), - DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson(), PagerOptionJson = DefaultPagerOptionJson, TreeOptionJson = DefaultTreeOptionJson("Code", "ParentCode", true), EditingOptionJson = DefaultEditingOptionJson(listFormName, 800, 550, true, true, true, true, false), diff --git a/api/src/Sozsoft.Platform.DbMigrator/Seeds/MenuDataSeeder.cs b/api/src/Sozsoft.Platform.DbMigrator/Seeds/MenuDataSeeder.cs index bc1c0e2..4531a82 100644 --- a/api/src/Sozsoft.Platform.DbMigrator/Seeds/MenuDataSeeder.cs +++ b/api/src/Sozsoft.Platform.DbMigrator/Seeds/MenuDataSeeder.cs @@ -82,7 +82,7 @@ public class MenuDataSeeder : IDataSeedContributor, ITransientDependency item.ComponentPath, item.RouteType, item.Authority ?? [] - )); + ), autoSave: true); } } @@ -95,7 +95,7 @@ public class MenuDataSeeder : IDataSeedContributor, ITransientDependency await _menuGroupRepository.InsertAsync(new MenuGroup(item.Name) { Name = item.Name - }); + }, autoSave: true); } } @@ -116,7 +116,7 @@ public class MenuDataSeeder : IDataSeedContributor, ITransientDependency RequiredPermissionName = item.RequiredPermissionName, IsDisabled = item.IsDisabled, ShortName = item.ShortName - }); + }, autoSave: true); } } } diff --git a/api/src/Sozsoft.Platform.DbMigrator/Seeds/PermissionDataSeeder.cs b/api/src/Sozsoft.Platform.DbMigrator/Seeds/PermissionDataSeeder.cs index d380908..45cbc4e 100644 --- a/api/src/Sozsoft.Platform.DbMigrator/Seeds/PermissionDataSeeder.cs +++ b/api/src/Sozsoft.Platform.DbMigrator/Seeds/PermissionDataSeeder.cs @@ -50,7 +50,7 @@ public class PermissionDataSeeder : IDataSeedContributor, ITransientDependency { Name = item.Name, DisplayName = item.DisplayName - }); + }, autoSave: true); } } @@ -72,7 +72,7 @@ public class PermissionDataSeeder : IDataSeedContributor, ITransientDependency perm.SetMenuGroup(item.MenuGroup); - await _permissionRepository.InsertAsync(perm); + await _permissionRepository.InsertAsync(perm, autoSave: true); } } } diff --git a/api/src/Sozsoft.Platform.DbMigrator/Seeds/WizardData/202605022050_Departments.json b/api/src/Sozsoft.Platform.DbMigrator/Seeds/WizardData/202605022050_Departments.json new file mode 100644 index 0000000..38c111c --- /dev/null +++ b/api/src/Sozsoft.Platform.DbMigrator/Seeds/WizardData/202605022050_Departments.json @@ -0,0 +1,134 @@ +{ + "Wizard": { + "WizardName": "Departments", + "ListFormCode": "App.Wizard.Departments", + "MenuCode": "App.Wizard.Departments", + "IsTenant": true, + "IsBranch": false, + "IsOrganizationUnit": false, + "AllowAdding": true, + "AllowUpdating": true, + "AllowDeleting": true, + "AllowDetail": false, + "ConfirmDelete": true, + "DefaultLayout": "grid", + "Grid": true, + "Pivot": true, + "Tree": true, + "Chart": true, + "Gantt": true, + "Scheduler": true, + "LanguageTextMenuEn": "Departments", + "LanguageTextMenuTr": "Departments", + "LanguageTextTitleEn": "Departments", + "LanguageTextTitleTr": "Departments", + "LanguageTextDescEn": "Departments", + "LanguageTextDescTr": "Departments", + "LanguageTextMenuParentEn": "", + "LanguageTextMenuParentTr": "", + "PermissionGroupName": "App.Administration", + "MenuParentCode": "App.Administration.Definitions", + "MenuIcon": "FcDepartment", + "DataSourceCode": "Default", + "DataSourceConnectionString": "", + "SelectCommandType": 1, + "SelectCommand": "Adm_T_Department", + "KeyFieldName": "Id", + "KeyFieldDbSourceType": 9, + "Groups": [ + { + "Caption": "", + "ColCount": 1, + "Items": [ + { + "DataField": "Id", + "CaptionName": "App.Listform.ListformField.Id", + "EditorType": "dxTextBox", + "EditorOptions": "", + "EditorScript": "", + "ColSpan": 1, + "IsRequired": true, + "DbSourceType": 9, + "TurkishCaption": "Id", + "EnglishCaption": "Id", + "LookupDataSourceType": 1, + "ValueExpr": "Key", + "DisplayExpr": "Name", + "LookupQuery": "" + }, + { + "DataField": "BranchId", + "CaptionName": "App.Listform.ListformField.BranchId", + "EditorType": "dxSelectBox", + "EditorOptions": "", + "EditorScript": "", + "ColSpan": 1, + "IsRequired": false, + "DbSourceType": 9, + "TurkishCaption": "Branch Id", + "EnglishCaption": "Branch Id", + "LookupDataSourceType": 2, + "ValueExpr": "Key", + "DisplayExpr": "Name", + "LookupQuery": "SELECT \u0022Id\u0022 AS \u0022Key\u0022, \u0022Name\u0022 AS \u0022Name\u0022 FROM \u0022Sas_T_Branch\u0022 ORDER BY \u0022Name\u0022;" + }, + { + "DataField": "Name", + "CaptionName": "App.Listform.ListformField.Name", + "EditorType": "dxTextBox", + "EditorOptions": "", + "EditorScript": "", + "ColSpan": 1, + "IsRequired": true, + "DbSourceType": 16, + "TurkishCaption": "Name", + "EnglishCaption": "Name", + "LookupDataSourceType": 1, + "ValueExpr": "Key", + "DisplayExpr": "Name", + "LookupQuery": "" + }, + { + "DataField": "ParentId", + "CaptionName": "App.Listform.ListformField.ParentId", + "EditorType": "dxSelectBox", + "EditorOptions": "", + "EditorScript": "", + "ColSpan": 1, + "IsRequired": false, + "DbSourceType": 9, + "TurkishCaption": "Parent Id", + "EnglishCaption": "Parent Id", + "LookupDataSourceType": 2, + "ValueExpr": "Key", + "DisplayExpr": "Name", + "LookupQuery": "SELECT \u0022Id\u0022 AS \u0022Key\u0022, \u0022Name\u0022 AS \u0022Name\u0022 FROM \u0022Adm_T_Department\u0022 ORDER BY \u0022Name\u0022;" + } + ] + } + ] + }, + "IsDeletedField": true, + "IsCreatedField": true, + "InsertedRecords": { + "LanguageKeys": [ + "App.Wizard.Departments", + "App.Wizard.Departments.Title", + "App.Wizard.Departments.Desc" + ], + "PermissionGroupNames": [], + "PermissionNames": [ + "App.Wizard.Departments", + "App.Wizard.Departments.Create", + "App.Wizard.Departments.Update", + "App.Wizard.Departments.Delete", + "App.Wizard.Departments.Export", + "App.Wizard.Departments.Import", + "App.Wizard.Departments.Note" + ], + "MenuCodes": [ + "App.Wizard.Departments" + ], + "DataSourceCodes": [] + } +} \ No newline at end of file diff --git a/api/src/Sozsoft.Platform.DbMigrator/Seeds/WizardDataSeeder.cs b/api/src/Sozsoft.Platform.DbMigrator/Seeds/WizardDataSeeder.cs index 2458ea2..7a17f51 100644 --- a/api/src/Sozsoft.Platform.DbMigrator/Seeds/WizardDataSeeder.cs +++ b/api/src/Sozsoft.Platform.DbMigrator/Seeds/WizardDataSeeder.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; using System.Data; using System.IO; using System.Linq; @@ -80,6 +81,8 @@ public class WizardDataSeeder : IDataSeedContributor, ITransientDependency return; } + _logger.LogInformation("WizardDataSeeder başladı. {Count} dosya işlenecek.", jsonFiles.Length); + var options = new JsonSerializerOptions { PropertyNameCaseInsensitive = true }; foreach (var filePath in jsonFiles) @@ -91,27 +94,29 @@ public class WizardDataSeeder : IDataSeedContributor, ITransientDependency if (seedFile?.Wizard == null) { - _logger.LogWarning($"Geçersiz dosya atlandı: {filePath}"); + _logger.LogWarning("Geçersiz dosya atlandı: {FilePath}", filePath); continue; } var wizardName = seedFile.Wizard.WizardName?.Trim(); if (string.IsNullOrWhiteSpace(wizardName)) { - _logger.LogWarning($"WizardName boş olduğu için atlandı: {filePath}"); + _logger.LogWarning("WizardName boş olduğu için atlandı: {FilePath}", filePath); continue; } + var fileName = Path.GetFileName(filePath); + // Zaten seeded mi kontrol et (ListForm var mı?) if (await _repoListForm.AnyAsync(a => a.ListFormCode == seedFile.Wizard.ListFormCode)) { - _logger.LogInformation($"'{wizardName}' zaten mevcut, atlandı."); + _logger.LogInformation("[{File}] '{WizardName}' zaten mevcut, atlandı.", fileName, wizardName); continue; } - _logger.LogInformation($"'{wizardName}' uygulanıyor..."); + _logger.LogInformation("[{File}] '{WizardName}' uygulanıyor...", fileName, wizardName); await ApplyWizardSeedAsync(seedFile); - _logger.LogInformation($"'{wizardName}' başarıyla uygulandı."); + _logger.LogInformation("[{File}] '{WizardName}' başarıyla uygulandı.", fileName, wizardName); } catch (Exception ex) { @@ -146,41 +151,48 @@ public class WizardDataSeeder : IDataSeedContributor, ITransientDependency await CreateLangKeyAsync(groupName, groupName, groupName); } - // Permissions + // Permissions - tek seferde mevcut permission'ları çek, sonra her birini kontrol et var permQueryable = await _repoPerm.GetQueryableAsync(); var existingPerms = permQueryable.Where(a => a.GroupName == groupName).ToList(); - var permRead = existingPerms.FirstOrDefault(a => a.Name == code) ?? - await _repoPerm.InsertAsync(new PermissionDefinitionRecord( + var permRead = existingPerms.FirstOrDefault(a => a.Name == code); + if (permRead == null) + permRead = await _repoPerm.InsertAsync(new PermissionDefinitionRecord( Guid.NewGuid(), groupName, code, null, nameLangKey, true, MultiTenancySides.Both), autoSave: true); - var permCreate = existingPerms.FirstOrDefault(a => a.Name == WizardConsts.PermCreate(wizardName)) ?? - await _repoPerm.InsertAsync(new PermissionDefinitionRecord( + var permCreate = existingPerms.FirstOrDefault(a => a.Name == WizardConsts.PermCreate(wizardName)); + if (permCreate == null) + permCreate = await _repoPerm.InsertAsync(new PermissionDefinitionRecord( Guid.NewGuid(), groupName, WizardConsts.PermCreate(wizardName), permRead.Name, WizardConsts.LangKeyCreate, true, MultiTenancySides.Both), autoSave: true); - var permUpdate = existingPerms.FirstOrDefault(a => a.Name == WizardConsts.PermUpdate(wizardName)) ?? - await _repoPerm.InsertAsync(new PermissionDefinitionRecord( + var permUpdate = existingPerms.FirstOrDefault(a => a.Name == WizardConsts.PermUpdate(wizardName)); + if (permUpdate == null) + permUpdate = await _repoPerm.InsertAsync(new PermissionDefinitionRecord( Guid.NewGuid(), groupName, WizardConsts.PermUpdate(wizardName), permRead.Name, WizardConsts.LangKeyUpdate, true, MultiTenancySides.Both), autoSave: true); - var permDelete = existingPerms.FirstOrDefault(a => a.Name == WizardConsts.PermDelete(wizardName)) ?? - await _repoPerm.InsertAsync(new PermissionDefinitionRecord( + var permDelete = existingPerms.FirstOrDefault(a => a.Name == WizardConsts.PermDelete(wizardName)); + if (permDelete == null) + permDelete = await _repoPerm.InsertAsync(new PermissionDefinitionRecord( Guid.NewGuid(), groupName, WizardConsts.PermDelete(wizardName), permRead.Name, WizardConsts.LangKeyDelete, true, MultiTenancySides.Both), autoSave: true); - var permExport = existingPerms.FirstOrDefault(a => a.Name == WizardConsts.PermExport(wizardName)) ?? - await _repoPerm.InsertAsync(new PermissionDefinitionRecord( + var permExport = existingPerms.FirstOrDefault(a => a.Name == WizardConsts.PermExport(wizardName)); + if (permExport == null) + permExport = await _repoPerm.InsertAsync(new PermissionDefinitionRecord( Guid.NewGuid(), groupName, WizardConsts.PermExport(wizardName), permRead.Name, WizardConsts.LangKeyExport, true, MultiTenancySides.Both), autoSave: true); - var permImport = existingPerms.FirstOrDefault(a => a.Name == WizardConsts.PermImport(wizardName)) ?? - await _repoPerm.InsertAsync(new PermissionDefinitionRecord( + var permImport = existingPerms.FirstOrDefault(a => a.Name == WizardConsts.PermImport(wizardName)); + if (permImport == null) + permImport = await _repoPerm.InsertAsync(new PermissionDefinitionRecord( Guid.NewGuid(), groupName, WizardConsts.PermImport(wizardName), permRead.Name, WizardConsts.LangKeyImport, true, MultiTenancySides.Both), autoSave: true); - var permNote = existingPerms.FirstOrDefault(a => a.Name == WizardConsts.PermNote(wizardName)) ?? - await _repoPerm.InsertAsync(new PermissionDefinitionRecord( + var permNote = existingPerms.FirstOrDefault(a => a.Name == WizardConsts.PermNote(wizardName)); + if (permNote == null) + permNote = await _repoPerm.InsertAsync(new PermissionDefinitionRecord( Guid.NewGuid(), groupName, WizardConsts.PermNote(wizardName), permRead.Name, WizardConsts.LangKeyNote, true, MultiTenancySides.Both), autoSave: true); - // Permission Grants - Admin role için + // Permission Grants - Admin role için, sadece eksik olanları ekle var existingGrants = await _permissionGrantRepository.GetListAsync("R", PlatformConsts.AbpIdentity.User.AdminRoleName); - var existingGrantNames = existingGrants.Select(g => g.Name).ToHashSet(); + var existingGrantNames = new HashSet(existingGrants.Select(g => g.Name)); var grantsToInsert = new[] { @@ -197,20 +209,25 @@ public class WizardDataSeeder : IDataSeedContributor, ITransientDependency } // Menu Parent + var menuQueryable = await _repoMenu.GetQueryableAsync(); var menuParent = await _repoMenu.FirstOrDefaultAsync(a => a.Code == input.MenuParentCode); if (menuParent == null) { + var maxRootOrder = menuQueryable.Where(a => a.ParentCode == null || a.ParentCode == "").Select(a => (int?)a.Order).Max() ?? 0; await CreateLangKeyAsync(WizardConsts.WizardKeyParent(wizardName), input.LanguageTextMenuParentEn, input.LanguageTextMenuParentTr); menuParent = await _repoMenu.InsertAsync(new Menu { Code = input.MenuParentCode, DisplayName = WizardConsts.WizardKeyParent(wizardName), IsDisabled = false, + Order = maxRootOrder + 1, }, autoSave: true); } // Menu - if (!await _repoMenu.AnyAsync(a => a.Code == code)) + var maxChildOrder = menuQueryable.Where(a => a.ParentCode == menuParent.Code).Select(a => (int?)a.Order).Max() ?? 0; + var existingMenu = await _repoMenu.FirstOrDefaultAsync(a => a.Code == code); + if (existingMenu == null) { await _repoMenu.InsertAsync(new Menu { @@ -223,12 +240,14 @@ public class WizardDataSeeder : IDataSeedContributor, ITransientDependency ElementId = null, CssClass = null, Url = WizardConsts.MenuUrl(code), - RequiredPermissionName = permRead.Name + RequiredPermissionName = permRead.Name, + Order = maxChildOrder + 1, }, autoSave: true); } // DataSource - if (!await _repoDataSource.AnyAsync(a => a.Code == input.DataSourceCode)) + var existingDataSource = await _repoDataSource.FirstOrDefaultAsync(a => a.Code == input.DataSourceCode); + if (existingDataSource == null) { await _repoDataSource.InsertAsync(new DataSource { @@ -241,6 +260,7 @@ public class WizardDataSeeder : IDataSeedContributor, ITransientDependency }, autoSave: true); } + // EditingFormJson var editingFormDtos = input.Groups .Select((g, gi) => new EditingFormDto @@ -266,6 +286,19 @@ public class WizardDataSeeder : IDataSeedContributor, ITransientDependency }) .ToList(); + // ListForm - varsa sil, yeniden ekle + var existingListForm = await _repoListForm.FirstOrDefaultAsync(a => a.ListFormCode == input.ListFormCode); + if (existingListForm != null) + { + await _repoListForm.DeleteAsync(existingListForm, autoSave: true); + } + + var existingListFormFields = await _repoListFormField.GetListAsync(a => a.ListFormCode == input.ListFormCode); + if (existingListFormFields.Count > 0) + { + await _repoListFormField.DeleteManyAsync(existingListFormFields, autoSave: true); + } + // ListForm await _repoListForm.InsertAsync(new ListForm { diff --git a/api/src/Sozsoft.Platform.Domain/Entities/Tenant/Administration/Menu.cs b/api/src/Sozsoft.Platform.Domain/Entities/Tenant/Administration/Menu.cs index d30aef2..09983ee 100644 --- a/api/src/Sozsoft.Platform.Domain/Entities/Tenant/Administration/Menu.cs +++ b/api/src/Sozsoft.Platform.Domain/Entities/Tenant/Administration/Menu.cs @@ -1,9 +1,9 @@ using System; -using Volo.Abp.Domain.Entities.Auditing; +using Volo.Abp.Domain.Entities; namespace Sozsoft.Platform.Entities; -public class Menu : FullAuditedEntity +public class Menu : Entity { public string Code { get; set; } public string DisplayName { get; set; } diff --git a/api/src/Sozsoft.Platform.Domain/Entities/Tenant/Administration/MenuGroup.cs b/api/src/Sozsoft.Platform.Domain/Entities/Tenant/Administration/MenuGroup.cs index d0cdc5d..066adbc 100644 --- a/api/src/Sozsoft.Platform.Domain/Entities/Tenant/Administration/MenuGroup.cs +++ b/api/src/Sozsoft.Platform.Domain/Entities/Tenant/Administration/MenuGroup.cs @@ -1,8 +1,8 @@ -using Volo.Abp.Domain.Entities.Auditing; +using Volo.Abp.Domain.Entities; namespace Sozsoft.Platform.Entities; -public class MenuGroup : FullAuditedEntity +public class MenuGroup : Entity { public string Name { get; set; } diff --git a/api/src/Sozsoft.Platform.EntityFrameworkCore/Migrations/20260501150322_Initial.Designer.cs b/api/src/Sozsoft.Platform.EntityFrameworkCore/Migrations/20260502173210_Initial.Designer.cs similarity index 97% rename from api/src/Sozsoft.Platform.EntityFrameworkCore/Migrations/20260501150322_Initial.Designer.cs rename to api/src/Sozsoft.Platform.EntityFrameworkCore/Migrations/20260502173210_Initial.Designer.cs index 4245982..f309d73 100644 --- a/api/src/Sozsoft.Platform.EntityFrameworkCore/Migrations/20260501150322_Initial.Designer.cs +++ b/api/src/Sozsoft.Platform.EntityFrameworkCore/Migrations/20260502173210_Initial.Designer.cs @@ -13,7 +13,7 @@ using Volo.Abp.EntityFrameworkCore; namespace Sozsoft.Platform.Migrations { [DbContext(typeof(PlatformDbContext))] - [Migration("20260501150322_Initial")] + [Migration("20260502173210_Initial")] partial class Initial { /// @@ -33,49 +33,19 @@ namespace Sozsoft.Platform.Migrations .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); - b.Property("CreationTime") - .HasColumnType("datetime2") - .HasColumnName("CreationTime"); - - b.Property("CreatorId") - .HasColumnType("uniqueidentifier") - .HasColumnName("CreatorId"); - b.Property("CultureName") .IsRequired() .HasMaxLength(10) .HasColumnType("nvarchar(10)"); - b.Property("DeleterId") - .HasColumnType("uniqueidentifier") - .HasColumnName("DeleterId"); - - b.Property("DeletionTime") - .HasColumnType("datetime2") - .HasColumnName("DeletionTime"); - b.Property("DisplayName") .IsRequired() .HasMaxLength(64) .HasColumnType("nvarchar(64)"); - b.Property("IsDeleted") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false) - .HasColumnName("IsDeleted"); - b.Property("IsEnabled") .HasColumnType("bit"); - b.Property("LastModificationTime") - .HasColumnType("datetime2") - .HasColumnName("LastModificationTime"); - - b.Property("LastModifierId") - .HasColumnType("uniqueidentifier") - .HasColumnName("LastModifierId"); - b.Property("TwoLetterISOLanguageName") .IsRequired() .HasMaxLength(2) @@ -97,41 +67,11 @@ namespace Sozsoft.Platform.Migrations .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); - b.Property("CreationTime") - .HasColumnType("datetime2") - .HasColumnName("CreationTime"); - - b.Property("CreatorId") - .HasColumnType("uniqueidentifier") - .HasColumnName("CreatorId"); - - b.Property("DeleterId") - .HasColumnType("uniqueidentifier") - .HasColumnName("DeleterId"); - - b.Property("DeletionTime") - .HasColumnType("datetime2") - .HasColumnName("DeletionTime"); - - b.Property("IsDeleted") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false) - .HasColumnName("IsDeleted"); - b.Property("Key") .IsRequired() .HasMaxLength(128) .HasColumnType("nvarchar(128)"); - b.Property("LastModificationTime") - .HasColumnType("datetime2") - .HasColumnName("LastModificationTime"); - - b.Property("LastModifierId") - .HasColumnType("uniqueidentifier") - .HasColumnName("LastModifierId"); - b.Property("ResourceName") .IsRequired() .HasMaxLength(64) @@ -151,45 +91,15 @@ namespace Sozsoft.Platform.Migrations .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); - b.Property("CreationTime") - .HasColumnType("datetime2") - .HasColumnName("CreationTime"); - - b.Property("CreatorId") - .HasColumnType("uniqueidentifier") - .HasColumnName("CreatorId"); - b.Property("CultureName") .IsRequired() .HasMaxLength(10) .HasColumnType("nvarchar(10)"); - b.Property("DeleterId") - .HasColumnType("uniqueidentifier") - .HasColumnName("DeleterId"); - - b.Property("DeletionTime") - .HasColumnType("datetime2") - .HasColumnName("DeletionTime"); - - b.Property("IsDeleted") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false) - .HasColumnName("IsDeleted"); - b.Property("Key") .HasMaxLength(128) .HasColumnType("nvarchar(128)"); - b.Property("LastModificationTime") - .HasColumnType("datetime2") - .HasColumnName("LastModificationTime"); - - b.Property("LastModifierId") - .HasColumnType("uniqueidentifier") - .HasColumnName("LastModifierId"); - b.Property("ResourceName") .HasMaxLength(64) .HasColumnType("nvarchar(64)"); @@ -2814,14 +2724,6 @@ namespace Sozsoft.Platform.Migrations .HasMaxLength(128) .HasColumnType("nvarchar(128)"); - b.Property("CreationTime") - .HasColumnType("datetime2") - .HasColumnName("CreationTime"); - - b.Property("CreatorId") - .HasColumnType("uniqueidentifier") - .HasColumnName("CreatorId"); - b.Property("CssClass") .HasMaxLength(128) .HasColumnType("nvarchar(128)"); @@ -2830,14 +2732,6 @@ namespace Sozsoft.Platform.Migrations .HasMaxLength(64) .HasColumnType("nvarchar(64)"); - b.Property("DeleterId") - .HasColumnType("uniqueidentifier") - .HasColumnName("DeleterId"); - - b.Property("DeletionTime") - .HasColumnType("datetime2") - .HasColumnName("DeletionTime"); - b.Property("DisplayName") .IsRequired() .HasMaxLength(128) @@ -2851,23 +2745,9 @@ namespace Sozsoft.Platform.Migrations .HasMaxLength(64) .HasColumnType("nvarchar(64)"); - b.Property("IsDeleted") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false) - .HasColumnName("IsDeleted"); - b.Property("IsDisabled") .HasColumnType("bit"); - b.Property("LastModificationTime") - .HasColumnType("datetime2") - .HasColumnName("LastModificationTime"); - - b.Property("LastModifierId") - .HasColumnType("uniqueidentifier") - .HasColumnName("LastModifierId"); - b.Property("Order") .HasColumnType("int"); @@ -2908,36 +2788,6 @@ namespace Sozsoft.Platform.Migrations b.Property("Id") .HasColumnType("nvarchar(450)"); - b.Property("CreationTime") - .HasColumnType("datetime2") - .HasColumnName("CreationTime"); - - b.Property("CreatorId") - .HasColumnType("uniqueidentifier") - .HasColumnName("CreatorId"); - - b.Property("DeleterId") - .HasColumnType("uniqueidentifier") - .HasColumnName("DeleterId"); - - b.Property("DeletionTime") - .HasColumnType("datetime2") - .HasColumnName("DeletionTime"); - - b.Property("IsDeleted") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false) - .HasColumnName("IsDeleted"); - - b.Property("LastModificationTime") - .HasColumnType("datetime2") - .HasColumnName("LastModificationTime"); - - b.Property("LastModifierId") - .HasColumnType("uniqueidentifier") - .HasColumnName("LastModifierId"); - b.Property("Name") .IsRequired() .HasMaxLength(128) diff --git a/api/src/Sozsoft.Platform.EntityFrameworkCore/Migrations/20260501150322_Initial.cs b/api/src/Sozsoft.Platform.EntityFrameworkCore/Migrations/20260502173210_Initial.cs similarity index 98% rename from api/src/Sozsoft.Platform.EntityFrameworkCore/Migrations/20260501150322_Initial.cs rename to api/src/Sozsoft.Platform.EntityFrameworkCore/Migrations/20260502173210_Initial.cs index d7d2d3c..9761480 100644 --- a/api/src/Sozsoft.Platform.EntityFrameworkCore/Migrations/20260501150322_Initial.cs +++ b/api/src/Sozsoft.Platform.EntityFrameworkCore/Migrations/20260502173210_Initial.cs @@ -1036,14 +1036,7 @@ namespace Sozsoft.Platform.Migrations UiCultureName = table.Column(type: "nvarchar(10)", maxLength: 10, nullable: false), DisplayName = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), IsEnabled = table.Column(type: "bit", nullable: false), - TwoLetterISOLanguageName = table.Column(type: "nvarchar(2)", maxLength: 2, nullable: false), - CreationTime = table.Column(type: "datetime2", nullable: false), - CreatorId = table.Column(type: "uniqueidentifier", nullable: true), - LastModificationTime = table.Column(type: "datetime2", nullable: true), - LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), - IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), - DeleterId = table.Column(type: "uniqueidentifier", nullable: true), - DeletionTime = table.Column(type: "datetime2", nullable: true) + TwoLetterISOLanguageName = table.Column(type: "nvarchar(2)", maxLength: 2, nullable: false) }, constraints: table => { @@ -1057,14 +1050,7 @@ namespace Sozsoft.Platform.Migrations { Id = table.Column(type: "uniqueidentifier", nullable: false), Key = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), - ResourceName = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), - CreationTime = table.Column(type: "datetime2", nullable: false), - CreatorId = table.Column(type: "uniqueidentifier", nullable: true), - LastModificationTime = table.Column(type: "datetime2", nullable: true), - LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), - IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), - DeleterId = table.Column(type: "uniqueidentifier", nullable: true), - DeletionTime = table.Column(type: "datetime2", nullable: true) + ResourceName = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false) }, constraints: table => { @@ -1209,14 +1195,7 @@ namespace Sozsoft.Platform.Migrations ElementId = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true), UserId = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), RoleId = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), - CultureName = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true), - CreationTime = table.Column(type: "datetime2", nullable: false), - CreatorId = table.Column(type: "uniqueidentifier", nullable: true), - LastModificationTime = table.Column(type: "datetime2", nullable: true), - LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), - IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), - DeleterId = table.Column(type: "uniqueidentifier", nullable: true), - DeletionTime = table.Column(type: "datetime2", nullable: true) + CultureName = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true) }, constraints: table => { @@ -1228,14 +1207,7 @@ namespace Sozsoft.Platform.Migrations columns: table => new { Id = table.Column(type: "nvarchar(450)", nullable: false), - Name = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), - CreationTime = table.Column(type: "datetime2", nullable: false), - CreatorId = table.Column(type: "uniqueidentifier", nullable: true), - LastModificationTime = table.Column(type: "datetime2", nullable: true), - LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), - IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), - DeleterId = table.Column(type: "uniqueidentifier", nullable: true), - DeletionTime = table.Column(type: "datetime2", nullable: true) + Name = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false) }, constraints: table => { @@ -1959,14 +1931,7 @@ namespace Sozsoft.Platform.Migrations CultureName = table.Column(type: "nvarchar(10)", maxLength: 10, nullable: false), Key = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true), ResourceName = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true), - Value = table.Column(type: "nvarchar(max)", maxLength: 4096, nullable: false), - CreationTime = table.Column(type: "datetime2", nullable: false), - CreatorId = table.Column(type: "uniqueidentifier", nullable: true), - LastModificationTime = table.Column(type: "datetime2", nullable: true), - LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), - IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), - DeleterId = table.Column(type: "uniqueidentifier", nullable: true), - DeletionTime = table.Column(type: "datetime2", nullable: true) + Value = table.Column(type: "nvarchar(max)", maxLength: 4096, nullable: false) }, constraints: table => { diff --git a/api/src/Sozsoft.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs b/api/src/Sozsoft.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs index 94c8fb7..cfcc1c3 100644 --- a/api/src/Sozsoft.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs +++ b/api/src/Sozsoft.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs @@ -30,49 +30,19 @@ namespace Sozsoft.Platform.Migrations .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); - b.Property("CreationTime") - .HasColumnType("datetime2") - .HasColumnName("CreationTime"); - - b.Property("CreatorId") - .HasColumnType("uniqueidentifier") - .HasColumnName("CreatorId"); - b.Property("CultureName") .IsRequired() .HasMaxLength(10) .HasColumnType("nvarchar(10)"); - b.Property("DeleterId") - .HasColumnType("uniqueidentifier") - .HasColumnName("DeleterId"); - - b.Property("DeletionTime") - .HasColumnType("datetime2") - .HasColumnName("DeletionTime"); - b.Property("DisplayName") .IsRequired() .HasMaxLength(64) .HasColumnType("nvarchar(64)"); - b.Property("IsDeleted") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false) - .HasColumnName("IsDeleted"); - b.Property("IsEnabled") .HasColumnType("bit"); - b.Property("LastModificationTime") - .HasColumnType("datetime2") - .HasColumnName("LastModificationTime"); - - b.Property("LastModifierId") - .HasColumnType("uniqueidentifier") - .HasColumnName("LastModifierId"); - b.Property("TwoLetterISOLanguageName") .IsRequired() .HasMaxLength(2) @@ -94,41 +64,11 @@ namespace Sozsoft.Platform.Migrations .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); - b.Property("CreationTime") - .HasColumnType("datetime2") - .HasColumnName("CreationTime"); - - b.Property("CreatorId") - .HasColumnType("uniqueidentifier") - .HasColumnName("CreatorId"); - - b.Property("DeleterId") - .HasColumnType("uniqueidentifier") - .HasColumnName("DeleterId"); - - b.Property("DeletionTime") - .HasColumnType("datetime2") - .HasColumnName("DeletionTime"); - - b.Property("IsDeleted") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false) - .HasColumnName("IsDeleted"); - b.Property("Key") .IsRequired() .HasMaxLength(128) .HasColumnType("nvarchar(128)"); - b.Property("LastModificationTime") - .HasColumnType("datetime2") - .HasColumnName("LastModificationTime"); - - b.Property("LastModifierId") - .HasColumnType("uniqueidentifier") - .HasColumnName("LastModifierId"); - b.Property("ResourceName") .IsRequired() .HasMaxLength(64) @@ -148,45 +88,15 @@ namespace Sozsoft.Platform.Migrations .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); - b.Property("CreationTime") - .HasColumnType("datetime2") - .HasColumnName("CreationTime"); - - b.Property("CreatorId") - .HasColumnType("uniqueidentifier") - .HasColumnName("CreatorId"); - b.Property("CultureName") .IsRequired() .HasMaxLength(10) .HasColumnType("nvarchar(10)"); - b.Property("DeleterId") - .HasColumnType("uniqueidentifier") - .HasColumnName("DeleterId"); - - b.Property("DeletionTime") - .HasColumnType("datetime2") - .HasColumnName("DeletionTime"); - - b.Property("IsDeleted") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false) - .HasColumnName("IsDeleted"); - b.Property("Key") .HasMaxLength(128) .HasColumnType("nvarchar(128)"); - b.Property("LastModificationTime") - .HasColumnType("datetime2") - .HasColumnName("LastModificationTime"); - - b.Property("LastModifierId") - .HasColumnType("uniqueidentifier") - .HasColumnName("LastModifierId"); - b.Property("ResourceName") .HasMaxLength(64) .HasColumnType("nvarchar(64)"); @@ -2811,14 +2721,6 @@ namespace Sozsoft.Platform.Migrations .HasMaxLength(128) .HasColumnType("nvarchar(128)"); - b.Property("CreationTime") - .HasColumnType("datetime2") - .HasColumnName("CreationTime"); - - b.Property("CreatorId") - .HasColumnType("uniqueidentifier") - .HasColumnName("CreatorId"); - b.Property("CssClass") .HasMaxLength(128) .HasColumnType("nvarchar(128)"); @@ -2827,14 +2729,6 @@ namespace Sozsoft.Platform.Migrations .HasMaxLength(64) .HasColumnType("nvarchar(64)"); - b.Property("DeleterId") - .HasColumnType("uniqueidentifier") - .HasColumnName("DeleterId"); - - b.Property("DeletionTime") - .HasColumnType("datetime2") - .HasColumnName("DeletionTime"); - b.Property("DisplayName") .IsRequired() .HasMaxLength(128) @@ -2848,23 +2742,9 @@ namespace Sozsoft.Platform.Migrations .HasMaxLength(64) .HasColumnType("nvarchar(64)"); - b.Property("IsDeleted") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false) - .HasColumnName("IsDeleted"); - b.Property("IsDisabled") .HasColumnType("bit"); - b.Property("LastModificationTime") - .HasColumnType("datetime2") - .HasColumnName("LastModificationTime"); - - b.Property("LastModifierId") - .HasColumnType("uniqueidentifier") - .HasColumnName("LastModifierId"); - b.Property("Order") .HasColumnType("int"); @@ -2905,36 +2785,6 @@ namespace Sozsoft.Platform.Migrations b.Property("Id") .HasColumnType("nvarchar(450)"); - b.Property("CreationTime") - .HasColumnType("datetime2") - .HasColumnName("CreationTime"); - - b.Property("CreatorId") - .HasColumnType("uniqueidentifier") - .HasColumnName("CreatorId"); - - b.Property("DeleterId") - .HasColumnType("uniqueidentifier") - .HasColumnName("DeleterId"); - - b.Property("DeletionTime") - .HasColumnType("datetime2") - .HasColumnName("DeletionTime"); - - b.Property("IsDeleted") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false) - .HasColumnName("IsDeleted"); - - b.Property("LastModificationTime") - .HasColumnType("datetime2") - .HasColumnName("LastModificationTime"); - - b.Property("LastModifierId") - .HasColumnType("uniqueidentifier") - .HasColumnName("LastModifierId"); - b.Property("Name") .IsRequired() .HasMaxLength(128) diff --git a/ui/src/views/admin/listForm/wizard/WizardFileManager.tsx b/ui/src/views/admin/listForm/wizard/WizardFileManager.tsx index 2454ce9..c129c7f 100644 --- a/ui/src/views/admin/listForm/wizard/WizardFileManager.tsx +++ b/ui/src/views/admin/listForm/wizard/WizardFileManager.tsx @@ -1,10 +1,10 @@ -import { useState, useEffect, useCallback } from 'react' +import { useState, useEffect, useCallback, useMemo } from 'react' import { useNavigate } from 'react-router-dom' import classNames from 'classnames' -import { Button, Notification, toast } from '@/components/ui' +import { Button, Input, Notification, toast } from '@/components/ui' import Container from '@/components/shared/Container' import { WizardFileInfoDto } from '@/proxy/admin/list-form/models' -import { FaTrash, FaSync, FaDatabase, FaPlus, FaExclamationTriangle } from 'react-icons/fa' +import { FaTrash, FaSync, FaDatabase, FaPlus, FaExclamationTriangle, FaSearch } from 'react-icons/fa' import { deleteWizardFile, getWizardFiles } from '@/services/wizard.service' import { useCurrentMenuIcon } from '@/utils/hooks/useCurrentMenuIcon' import { useLocalization } from '@/utils/hooks/useLocalization' @@ -37,6 +37,17 @@ const WizardFileManager = () => { const [loading, setLoading] = useState(false) const [deletingFile, setDeletingFile] = useState(null) const [confirm, setConfirm] = useState(null) + const [search, setSearch] = useState('') + + const filteredFiles = useMemo(() => { + const q = search.trim().toLowerCase() + if (!q) return files + return files.filter( + (f) => + (f.wizardName ?? '').toLowerCase().includes(q) || + (f.listFormCode ?? '').toLowerCase().includes(q), + ) + }, [files, search]) const loadFiles = useCallback(async () => { setLoading(true) @@ -96,7 +107,17 @@ const WizardFileManager = () => { {translate('::App.Listforms.WizardManager') || 'Wizard Seed Dosyaları'} -
+
+
+ + setSearch(e.target.value)} + /> +