Listform Wizard Manager güncellemeleri
This commit is contained in:
parent
a72faa083c
commit
d44555ad6a
20 changed files with 247 additions and 408 deletions
|
|
@ -4,7 +4,7 @@ using Volo.Abp.Application.Dtos;
|
|||
|
||||
namespace Sozsoft.Languages;
|
||||
|
||||
public class LanguageDto : FullAuditedEntityDto<Guid>
|
||||
public class LanguageDto : EntityDto<Guid>
|
||||
{
|
||||
[Required]
|
||||
public string CultureName { get; set; }
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ using Volo.Abp.Application.Dtos;
|
|||
|
||||
namespace Sozsoft.Languages;
|
||||
|
||||
public class LanguageKeyDto : FullAuditedEntityDto<Guid>
|
||||
public class LanguageKeyDto : EntityDto<Guid>
|
||||
{
|
||||
[Required]
|
||||
public string Key { get; set; }
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ using Volo.Abp.Application.Dtos;
|
|||
|
||||
namespace Sozsoft.Languages;
|
||||
|
||||
public class LanguageTextDto : FullAuditedEntityDto<Guid>
|
||||
public class LanguageTextDto : EntityDto<Guid>
|
||||
{
|
||||
public string CultureName { get; set; }
|
||||
public string ResourceName { get; set; }
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@ public class LanguagesApplicationAutoMapperProfile : Profile
|
|||
|
||||
CreateMap<LanguageTextCreateUpdateDto, LanguageText>()
|
||||
.IgnoreAllPropertiesWithAnInaccessibleSetter()
|
||||
.IgnoreFullAuditedObjectProperties()
|
||||
.ForMember(dest => dest.LanguageKey, opt => opt.Ignore());
|
||||
|
||||
CreateMap<LanguageKey, LanguageTextTranslatedDto>()
|
||||
|
|
|
|||
|
|
@ -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<Guid>
|
||||
public class Language : Entity<Guid>
|
||||
{
|
||||
public string CultureName { get; set; }
|
||||
public string UiCultureName { get; set; }
|
||||
|
|
|
|||
|
|
@ -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<Guid>
|
||||
public class LanguageKey : Entity<Guid>
|
||||
{
|
||||
public string Key { get; set; }
|
||||
public string ResourceName { get; set; }
|
||||
|
|
|
|||
|
|
@ -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<Guid>
|
||||
public class LanguageText : Entity<Guid>
|
||||
{
|
||||
public string CultureName { get; set; }
|
||||
public string? Key { get; set; }
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -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 }
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -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<EditingFormDto>() {
|
||||
|
|
@ -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),
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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": []
|
||||
}
|
||||
}
|
||||
|
|
@ -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<string>(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
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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<Guid>
|
||||
public class Menu : Entity<Guid>
|
||||
{
|
||||
public string Code { get; set; }
|
||||
public string DisplayName { get; set; }
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
using Volo.Abp.Domain.Entities.Auditing;
|
||||
using Volo.Abp.Domain.Entities;
|
||||
|
||||
namespace Sozsoft.Platform.Entities;
|
||||
|
||||
public class MenuGroup : FullAuditedEntity<string>
|
||||
public class MenuGroup : Entity<string>
|
||||
{
|
||||
public string Name { get; set; }
|
||||
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ using Volo.Abp.EntityFrameworkCore;
|
|||
namespace Sozsoft.Platform.Migrations
|
||||
{
|
||||
[DbContext(typeof(PlatformDbContext))]
|
||||
[Migration("20260501150322_Initial")]
|
||||
[Migration("20260502173210_Initial")]
|
||||
partial class Initial
|
||||
{
|
||||
/// <inheritdoc />
|
||||
|
|
@ -33,49 +33,19 @@ namespace Sozsoft.Platform.Migrations
|
|||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("CreationTime")
|
||||
.HasColumnType("datetime2")
|
||||
.HasColumnName("CreationTime");
|
||||
|
||||
b.Property<Guid?>("CreatorId")
|
||||
.HasColumnType("uniqueidentifier")
|
||||
.HasColumnName("CreatorId");
|
||||
|
||||
b.Property<string>("CultureName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(10)
|
||||
.HasColumnType("nvarchar(10)");
|
||||
|
||||
b.Property<Guid?>("DeleterId")
|
||||
.HasColumnType("uniqueidentifier")
|
||||
.HasColumnName("DeleterId");
|
||||
|
||||
b.Property<DateTime?>("DeletionTime")
|
||||
.HasColumnType("datetime2")
|
||||
.HasColumnName("DeletionTime");
|
||||
|
||||
b.Property<string>("DisplayName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(64)
|
||||
.HasColumnType("nvarchar(64)");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bit")
|
||||
.HasDefaultValue(false)
|
||||
.HasColumnName("IsDeleted");
|
||||
|
||||
b.Property<bool>("IsEnabled")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<DateTime?>("LastModificationTime")
|
||||
.HasColumnType("datetime2")
|
||||
.HasColumnName("LastModificationTime");
|
||||
|
||||
b.Property<Guid?>("LastModifierId")
|
||||
.HasColumnType("uniqueidentifier")
|
||||
.HasColumnName("LastModifierId");
|
||||
|
||||
b.Property<string>("TwoLetterISOLanguageName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(2)
|
||||
|
|
@ -97,41 +67,11 @@ namespace Sozsoft.Platform.Migrations
|
|||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("CreationTime")
|
||||
.HasColumnType("datetime2")
|
||||
.HasColumnName("CreationTime");
|
||||
|
||||
b.Property<Guid?>("CreatorId")
|
||||
.HasColumnType("uniqueidentifier")
|
||||
.HasColumnName("CreatorId");
|
||||
|
||||
b.Property<Guid?>("DeleterId")
|
||||
.HasColumnType("uniqueidentifier")
|
||||
.HasColumnName("DeleterId");
|
||||
|
||||
b.Property<DateTime?>("DeletionTime")
|
||||
.HasColumnType("datetime2")
|
||||
.HasColumnName("DeletionTime");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bit")
|
||||
.HasDefaultValue(false)
|
||||
.HasColumnName("IsDeleted");
|
||||
|
||||
b.Property<string>("Key")
|
||||
.IsRequired()
|
||||
.HasMaxLength(128)
|
||||
.HasColumnType("nvarchar(128)");
|
||||
|
||||
b.Property<DateTime?>("LastModificationTime")
|
||||
.HasColumnType("datetime2")
|
||||
.HasColumnName("LastModificationTime");
|
||||
|
||||
b.Property<Guid?>("LastModifierId")
|
||||
.HasColumnType("uniqueidentifier")
|
||||
.HasColumnName("LastModifierId");
|
||||
|
||||
b.Property<string>("ResourceName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(64)
|
||||
|
|
@ -151,45 +91,15 @@ namespace Sozsoft.Platform.Migrations
|
|||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("CreationTime")
|
||||
.HasColumnType("datetime2")
|
||||
.HasColumnName("CreationTime");
|
||||
|
||||
b.Property<Guid?>("CreatorId")
|
||||
.HasColumnType("uniqueidentifier")
|
||||
.HasColumnName("CreatorId");
|
||||
|
||||
b.Property<string>("CultureName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(10)
|
||||
.HasColumnType("nvarchar(10)");
|
||||
|
||||
b.Property<Guid?>("DeleterId")
|
||||
.HasColumnType("uniqueidentifier")
|
||||
.HasColumnName("DeleterId");
|
||||
|
||||
b.Property<DateTime?>("DeletionTime")
|
||||
.HasColumnType("datetime2")
|
||||
.HasColumnName("DeletionTime");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bit")
|
||||
.HasDefaultValue(false)
|
||||
.HasColumnName("IsDeleted");
|
||||
|
||||
b.Property<string>("Key")
|
||||
.HasMaxLength(128)
|
||||
.HasColumnType("nvarchar(128)");
|
||||
|
||||
b.Property<DateTime?>("LastModificationTime")
|
||||
.HasColumnType("datetime2")
|
||||
.HasColumnName("LastModificationTime");
|
||||
|
||||
b.Property<Guid?>("LastModifierId")
|
||||
.HasColumnType("uniqueidentifier")
|
||||
.HasColumnName("LastModifierId");
|
||||
|
||||
b.Property<string>("ResourceName")
|
||||
.HasMaxLength(64)
|
||||
.HasColumnType("nvarchar(64)");
|
||||
|
|
@ -2814,14 +2724,6 @@ namespace Sozsoft.Platform.Migrations
|
|||
.HasMaxLength(128)
|
||||
.HasColumnType("nvarchar(128)");
|
||||
|
||||
b.Property<DateTime>("CreationTime")
|
||||
.HasColumnType("datetime2")
|
||||
.HasColumnName("CreationTime");
|
||||
|
||||
b.Property<Guid?>("CreatorId")
|
||||
.HasColumnType("uniqueidentifier")
|
||||
.HasColumnName("CreatorId");
|
||||
|
||||
b.Property<string>("CssClass")
|
||||
.HasMaxLength(128)
|
||||
.HasColumnType("nvarchar(128)");
|
||||
|
|
@ -2830,14 +2732,6 @@ namespace Sozsoft.Platform.Migrations
|
|||
.HasMaxLength(64)
|
||||
.HasColumnType("nvarchar(64)");
|
||||
|
||||
b.Property<Guid?>("DeleterId")
|
||||
.HasColumnType("uniqueidentifier")
|
||||
.HasColumnName("DeleterId");
|
||||
|
||||
b.Property<DateTime?>("DeletionTime")
|
||||
.HasColumnType("datetime2")
|
||||
.HasColumnName("DeletionTime");
|
||||
|
||||
b.Property<string>("DisplayName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(128)
|
||||
|
|
@ -2851,23 +2745,9 @@ namespace Sozsoft.Platform.Migrations
|
|||
.HasMaxLength(64)
|
||||
.HasColumnType("nvarchar(64)");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bit")
|
||||
.HasDefaultValue(false)
|
||||
.HasColumnName("IsDeleted");
|
||||
|
||||
b.Property<bool>("IsDisabled")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<DateTime?>("LastModificationTime")
|
||||
.HasColumnType("datetime2")
|
||||
.HasColumnName("LastModificationTime");
|
||||
|
||||
b.Property<Guid?>("LastModifierId")
|
||||
.HasColumnType("uniqueidentifier")
|
||||
.HasColumnName("LastModifierId");
|
||||
|
||||
b.Property<int>("Order")
|
||||
.HasColumnType("int");
|
||||
|
||||
|
|
@ -2908,36 +2788,6 @@ namespace Sozsoft.Platform.Migrations
|
|||
b.Property<string>("Id")
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<DateTime>("CreationTime")
|
||||
.HasColumnType("datetime2")
|
||||
.HasColumnName("CreationTime");
|
||||
|
||||
b.Property<Guid?>("CreatorId")
|
||||
.HasColumnType("uniqueidentifier")
|
||||
.HasColumnName("CreatorId");
|
||||
|
||||
b.Property<Guid?>("DeleterId")
|
||||
.HasColumnType("uniqueidentifier")
|
||||
.HasColumnName("DeleterId");
|
||||
|
||||
b.Property<DateTime?>("DeletionTime")
|
||||
.HasColumnType("datetime2")
|
||||
.HasColumnName("DeletionTime");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bit")
|
||||
.HasDefaultValue(false)
|
||||
.HasColumnName("IsDeleted");
|
||||
|
||||
b.Property<DateTime?>("LastModificationTime")
|
||||
.HasColumnType("datetime2")
|
||||
.HasColumnName("LastModificationTime");
|
||||
|
||||
b.Property<Guid?>("LastModifierId")
|
||||
.HasColumnType("uniqueidentifier")
|
||||
.HasColumnName("LastModifierId");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasMaxLength(128)
|
||||
|
|
@ -1036,14 +1036,7 @@ namespace Sozsoft.Platform.Migrations
|
|||
UiCultureName = table.Column<string>(type: "nvarchar(10)", maxLength: 10, nullable: false),
|
||||
DisplayName = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
|
||||
IsEnabled = table.Column<bool>(type: "bit", nullable: false),
|
||||
TwoLetterISOLanguageName = table.Column<string>(type: "nvarchar(2)", maxLength: 2, nullable: false),
|
||||
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
|
||||
DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true)
|
||||
TwoLetterISOLanguageName = table.Column<string>(type: "nvarchar(2)", maxLength: 2, nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
|
|
@ -1057,14 +1050,7 @@ namespace Sozsoft.Platform.Migrations
|
|||
{
|
||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
Key = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false),
|
||||
ResourceName = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
|
||||
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
|
||||
DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true)
|
||||
ResourceName = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
|
|
@ -1209,14 +1195,7 @@ namespace Sozsoft.Platform.Migrations
|
|||
ElementId = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
|
||||
UserId = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true),
|
||||
RoleId = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true),
|
||||
CultureName = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
|
||||
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
|
||||
DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true)
|
||||
CultureName = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
|
|
@ -1228,14 +1207,7 @@ namespace Sozsoft.Platform.Migrations
|
|||
columns: table => new
|
||||
{
|
||||
Id = table.Column<string>(type: "nvarchar(450)", nullable: false),
|
||||
Name = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false),
|
||||
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
|
||||
DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true)
|
||||
Name = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
|
|
@ -1959,14 +1931,7 @@ namespace Sozsoft.Platform.Migrations
|
|||
CultureName = table.Column<string>(type: "nvarchar(10)", maxLength: 10, nullable: false),
|
||||
Key = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true),
|
||||
ResourceName = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
|
||||
Value = table.Column<string>(type: "nvarchar(max)", maxLength: 4096, nullable: false),
|
||||
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
|
||||
DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true)
|
||||
Value = table.Column<string>(type: "nvarchar(max)", maxLength: 4096, nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
|
|
@ -30,49 +30,19 @@ namespace Sozsoft.Platform.Migrations
|
|||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("CreationTime")
|
||||
.HasColumnType("datetime2")
|
||||
.HasColumnName("CreationTime");
|
||||
|
||||
b.Property<Guid?>("CreatorId")
|
||||
.HasColumnType("uniqueidentifier")
|
||||
.HasColumnName("CreatorId");
|
||||
|
||||
b.Property<string>("CultureName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(10)
|
||||
.HasColumnType("nvarchar(10)");
|
||||
|
||||
b.Property<Guid?>("DeleterId")
|
||||
.HasColumnType("uniqueidentifier")
|
||||
.HasColumnName("DeleterId");
|
||||
|
||||
b.Property<DateTime?>("DeletionTime")
|
||||
.HasColumnType("datetime2")
|
||||
.HasColumnName("DeletionTime");
|
||||
|
||||
b.Property<string>("DisplayName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(64)
|
||||
.HasColumnType("nvarchar(64)");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bit")
|
||||
.HasDefaultValue(false)
|
||||
.HasColumnName("IsDeleted");
|
||||
|
||||
b.Property<bool>("IsEnabled")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<DateTime?>("LastModificationTime")
|
||||
.HasColumnType("datetime2")
|
||||
.HasColumnName("LastModificationTime");
|
||||
|
||||
b.Property<Guid?>("LastModifierId")
|
||||
.HasColumnType("uniqueidentifier")
|
||||
.HasColumnName("LastModifierId");
|
||||
|
||||
b.Property<string>("TwoLetterISOLanguageName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(2)
|
||||
|
|
@ -94,41 +64,11 @@ namespace Sozsoft.Platform.Migrations
|
|||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("CreationTime")
|
||||
.HasColumnType("datetime2")
|
||||
.HasColumnName("CreationTime");
|
||||
|
||||
b.Property<Guid?>("CreatorId")
|
||||
.HasColumnType("uniqueidentifier")
|
||||
.HasColumnName("CreatorId");
|
||||
|
||||
b.Property<Guid?>("DeleterId")
|
||||
.HasColumnType("uniqueidentifier")
|
||||
.HasColumnName("DeleterId");
|
||||
|
||||
b.Property<DateTime?>("DeletionTime")
|
||||
.HasColumnType("datetime2")
|
||||
.HasColumnName("DeletionTime");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bit")
|
||||
.HasDefaultValue(false)
|
||||
.HasColumnName("IsDeleted");
|
||||
|
||||
b.Property<string>("Key")
|
||||
.IsRequired()
|
||||
.HasMaxLength(128)
|
||||
.HasColumnType("nvarchar(128)");
|
||||
|
||||
b.Property<DateTime?>("LastModificationTime")
|
||||
.HasColumnType("datetime2")
|
||||
.HasColumnName("LastModificationTime");
|
||||
|
||||
b.Property<Guid?>("LastModifierId")
|
||||
.HasColumnType("uniqueidentifier")
|
||||
.HasColumnName("LastModifierId");
|
||||
|
||||
b.Property<string>("ResourceName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(64)
|
||||
|
|
@ -148,45 +88,15 @@ namespace Sozsoft.Platform.Migrations
|
|||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("CreationTime")
|
||||
.HasColumnType("datetime2")
|
||||
.HasColumnName("CreationTime");
|
||||
|
||||
b.Property<Guid?>("CreatorId")
|
||||
.HasColumnType("uniqueidentifier")
|
||||
.HasColumnName("CreatorId");
|
||||
|
||||
b.Property<string>("CultureName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(10)
|
||||
.HasColumnType("nvarchar(10)");
|
||||
|
||||
b.Property<Guid?>("DeleterId")
|
||||
.HasColumnType("uniqueidentifier")
|
||||
.HasColumnName("DeleterId");
|
||||
|
||||
b.Property<DateTime?>("DeletionTime")
|
||||
.HasColumnType("datetime2")
|
||||
.HasColumnName("DeletionTime");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bit")
|
||||
.HasDefaultValue(false)
|
||||
.HasColumnName("IsDeleted");
|
||||
|
||||
b.Property<string>("Key")
|
||||
.HasMaxLength(128)
|
||||
.HasColumnType("nvarchar(128)");
|
||||
|
||||
b.Property<DateTime?>("LastModificationTime")
|
||||
.HasColumnType("datetime2")
|
||||
.HasColumnName("LastModificationTime");
|
||||
|
||||
b.Property<Guid?>("LastModifierId")
|
||||
.HasColumnType("uniqueidentifier")
|
||||
.HasColumnName("LastModifierId");
|
||||
|
||||
b.Property<string>("ResourceName")
|
||||
.HasMaxLength(64)
|
||||
.HasColumnType("nvarchar(64)");
|
||||
|
|
@ -2811,14 +2721,6 @@ namespace Sozsoft.Platform.Migrations
|
|||
.HasMaxLength(128)
|
||||
.HasColumnType("nvarchar(128)");
|
||||
|
||||
b.Property<DateTime>("CreationTime")
|
||||
.HasColumnType("datetime2")
|
||||
.HasColumnName("CreationTime");
|
||||
|
||||
b.Property<Guid?>("CreatorId")
|
||||
.HasColumnType("uniqueidentifier")
|
||||
.HasColumnName("CreatorId");
|
||||
|
||||
b.Property<string>("CssClass")
|
||||
.HasMaxLength(128)
|
||||
.HasColumnType("nvarchar(128)");
|
||||
|
|
@ -2827,14 +2729,6 @@ namespace Sozsoft.Platform.Migrations
|
|||
.HasMaxLength(64)
|
||||
.HasColumnType("nvarchar(64)");
|
||||
|
||||
b.Property<Guid?>("DeleterId")
|
||||
.HasColumnType("uniqueidentifier")
|
||||
.HasColumnName("DeleterId");
|
||||
|
||||
b.Property<DateTime?>("DeletionTime")
|
||||
.HasColumnType("datetime2")
|
||||
.HasColumnName("DeletionTime");
|
||||
|
||||
b.Property<string>("DisplayName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(128)
|
||||
|
|
@ -2848,23 +2742,9 @@ namespace Sozsoft.Platform.Migrations
|
|||
.HasMaxLength(64)
|
||||
.HasColumnType("nvarchar(64)");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bit")
|
||||
.HasDefaultValue(false)
|
||||
.HasColumnName("IsDeleted");
|
||||
|
||||
b.Property<bool>("IsDisabled")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<DateTime?>("LastModificationTime")
|
||||
.HasColumnType("datetime2")
|
||||
.HasColumnName("LastModificationTime");
|
||||
|
||||
b.Property<Guid?>("LastModifierId")
|
||||
.HasColumnType("uniqueidentifier")
|
||||
.HasColumnName("LastModifierId");
|
||||
|
||||
b.Property<int>("Order")
|
||||
.HasColumnType("int");
|
||||
|
||||
|
|
@ -2905,36 +2785,6 @@ namespace Sozsoft.Platform.Migrations
|
|||
b.Property<string>("Id")
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<DateTime>("CreationTime")
|
||||
.HasColumnType("datetime2")
|
||||
.HasColumnName("CreationTime");
|
||||
|
||||
b.Property<Guid?>("CreatorId")
|
||||
.HasColumnType("uniqueidentifier")
|
||||
.HasColumnName("CreatorId");
|
||||
|
||||
b.Property<Guid?>("DeleterId")
|
||||
.HasColumnType("uniqueidentifier")
|
||||
.HasColumnName("DeleterId");
|
||||
|
||||
b.Property<DateTime?>("DeletionTime")
|
||||
.HasColumnType("datetime2")
|
||||
.HasColumnName("DeletionTime");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bit")
|
||||
.HasDefaultValue(false)
|
||||
.HasColumnName("IsDeleted");
|
||||
|
||||
b.Property<DateTime?>("LastModificationTime")
|
||||
.HasColumnType("datetime2")
|
||||
.HasColumnName("LastModificationTime");
|
||||
|
||||
b.Property<Guid?>("LastModifierId")
|
||||
.HasColumnType("uniqueidentifier")
|
||||
.HasColumnName("LastModifierId");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasMaxLength(128)
|
||||
|
|
|
|||
|
|
@ -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<string | null>(null)
|
||||
const [confirm, setConfirm] = useState<ConfirmState | null>(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ı'}
|
||||
</h4>
|
||||
|
||||
<div className="flex gap-1 ml-auto">
|
||||
<div className="flex gap-1 ml-auto items-center">
|
||||
<div className="relative">
|
||||
<FaSearch className="absolute left-2 top-1/2 -translate-y-1/2 text-gray-400 text-xs pointer-events-none" />
|
||||
<Input
|
||||
size="sm"
|
||||
className="pl-6 w-44"
|
||||
placeholder={translate('::App.Platform.Search') || 'Search...'}
|
||||
value={search}
|
||||
onChange={(e) => setSearch(e.target.value)}
|
||||
/>
|
||||
</div>
|
||||
<Button
|
||||
size="sm"
|
||||
variant="default"
|
||||
|
|
@ -120,7 +141,7 @@ const WizardFileManager = () => {
|
|||
|
||||
<div className="mt-4">
|
||||
|
||||
{files.length === 0 && !loading && (
|
||||
{filteredFiles.length === 0 && !loading && (
|
||||
<p className="text-xs text-gray-400 text-center py-4">
|
||||
Henüz kaydedilmiş wizard dosyası yok.
|
||||
</p>
|
||||
|
|
@ -131,13 +152,13 @@ const WizardFileManager = () => {
|
|||
)}
|
||||
|
||||
<div className="space-y-2">
|
||||
{files.map((f) => (
|
||||
{filteredFiles.map((f) => (
|
||||
<div
|
||||
key={f.fileName}
|
||||
className="flex items-center justify-between p-3 rounded-lg border border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-800"
|
||||
>
|
||||
<div className="flex items-center gap-3 min-w-0">
|
||||
<FaDatabase className="text-indigo-400 shrink-0" />
|
||||
<FaDatabase className="text-indigo-400 shrink-0 text-lg" />
|
||||
<div className="min-w-0">
|
||||
<div className="font-medium text-sm text-gray-800 dark:text-gray-200 truncate">
|
||||
{f.wizardName || f.fileName}
|
||||
|
|
@ -159,7 +180,7 @@ const WizardFileManager = () => {
|
|||
</span>
|
||||
)}
|
||||
<Button
|
||||
size="xs"
|
||||
size="sm"
|
||||
variant="plain"
|
||||
className="text-red-500 hover:bg-red-50 dark:hover:bg-red-900/20"
|
||||
type="button"
|
||||
|
|
|
|||
Loading…
Reference in a new issue