From eb23174f7a3016711ae39f7eb5f8de0a597fb77d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sedat=20=C3=96ZT=C3=9CRK?= <76204082+iamsedatozturk@users.noreply.github.com> Date: Thu, 19 Jun 2025 10:15:26 +0300 Subject: [PATCH] =?UTF-8?q?ListFormSeeder=20d=C3=BCzenlemesi=20ve=20Login?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Eğer ilgili form numarası yoksa kayıt ekleniyor --- .../Seeds/ListFormsSeeder.cs | 3465 +++++++++-------- .../Seeds/SeederData.json | 44 +- .../PlatformConsts.cs | 56 +- .../components/layouts/AuthLayout/Simple.tsx | 5 +- ui/src/components/ui/Avatar/Avatar.tsx | 3 + ui/src/views/auth/Login.tsx | 12 +- 6 files changed, 1825 insertions(+), 1760 deletions(-) diff --git a/api/src/Kurs.Platform.DbMigrator/Seeds/ListFormsSeeder.cs b/api/src/Kurs.Platform.DbMigrator/Seeds/ListFormsSeeder.cs index c557fa24..f7bee51a 100644 --- a/api/src/Kurs.Platform.DbMigrator/Seeds/ListFormsSeeder.cs +++ b/api/src/Kurs.Platform.DbMigrator/Seeds/ListFormsSeeder.cs @@ -45,38 +45,24 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency public async Task SeedAsync(DataSeedContext context) { - if (await _listFormRepository.GetCountAsync() > 0) - { - return; - } - var lookupQueryLanguage = $"SELECT \"{DbTablePrefix}LanguageKey\".\"Key\", CONCAT(\"{DbTablePrefix}LanguageKey\".\"Key\", ' (', \"{DbTablePrefix}LanguageText\".\"Value\", ')') AS \"Name\" FROM \"{DbTablePrefix}LanguageKey\" LEFT OUTER JOIN \"{DbTablePrefix}LanguageText\" ON \"{DbTablePrefix}LanguageKey\".\"Key\" = \"{DbTablePrefix}LanguageText\".\"Key\" AND \"{DbTablePrefix}LanguageKey\".\"ResourceName\" = \"{DbTablePrefix}LanguageText\".\"ResourceName\" WHERE \"{DbTablePrefix}LanguageKey\".\"IsDeleted\" = 'false' AND \"{DbTablePrefix}LanguageText\".\"IsDeleted\" = 'false' AND \"{DbTablePrefix}LanguageText\".\"CultureName\" = 'tr' ORDER BY \"{DbTablePrefix}LanguageKey\".\"Key\";"; var lookupQueryCulture = $"SELECT \"CultureName\" AS \"Key\", \"DisplayName\" AS \"Name\", \"CreationTime\" FROM \"{DbTablePrefix}Language\" WHERE \"IsEnabled\" = 'true' and \"IsDeleted\" = 'false'"; - var adminUser = _identityUserManager.FindByNameAsync(PlatformConsts.AbpIdentity.User.AdminEmailDefaultValue); - - string roleId = null; - string userId = null; - if (adminUser != null && adminUser.Result != null) - { - userId = adminUser.Result.UserName.ToString(); - var userRole = _identityRoleManager.GetByIdAsync(adminUser.Result.Roles.FirstOrDefault().RoleId); - if (userRole != null && userRole.Result != null) - roleId = userRole.Result.Name.ToString(); - } - #region Form - #region Languages - var formLanguage = await _listFormRepository.InsertAsync( - new ListForm() - { - ListFormType = ListFormTypeEnum.Form, - IsSubForm = false, - SubFormsJson = JsonSerializer.Serialize(new List() { + + #region Language + if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Forms.FormLanguage)) + { + var formLanguage = await _listFormRepository.InsertAsync( + new ListForm() + { + ListFormType = ListFormTypeEnum.Form, + IsSubForm = false, + SubFormsJson = JsonSerializer.Serialize(new List() { new { TabTitle = "Language Texts", TabType = ListFormTabTypeEnum.List, - Code = ListFormCodes.LanguageText, + Code = ListFormCodes.Lists.LanguageText, Relation = new List() { new { ParentFieldName = "CultureName", @@ -95,31 +81,32 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency } } } - }), - CultureName = LanguageCodes.En, - ListFormCode = ListFormCodes.Forms.FormLanguage, - Name = AppCodes.Languages.Language, - Title = AppCodes.Languages.Language, - DataSourceCode = SeedConsts.DataSources.DefaultCode, - IsTenant = false, - IsOrganizationUnit = false, - Description = AppCodes.Languages.Language, - SelectCommandType = SelectCommandTypeEnum.Table, - SelectCommand = DbTablePrefix + "Language", - KeyFieldName = "Id", - KeyFieldDbSourceType = DbType.Guid, - DefaultFilter = "\"IsDeleted\" = 'false'", - SortMode = GridOptions.SortModeSingle, - PermissionJson = JsonSerializer.Serialize(new PermissionCrudDto - { - C = AppCodes.Languages.Language + ".Create", - R = AppCodes.Languages.Language, - U = AppCodes.Languages.Language + ".Update", - D = AppCodes.Languages.Language + ".Delete", - E = AppCodes.Languages.Language + ".Export" - }), - DeleteCommand = $"UPDATE \"{DbTablePrefix}Language\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", - DeleteFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { + }), + CultureName = LanguageCodes.En, + ListFormCode = ListFormCodes.Forms.FormLanguage, + Name = AppCodes.Languages.Language, + Title = AppCodes.Languages.Language, + DataSourceCode = SeedConsts.DataSources.DefaultCode, + IsTenant = false, + IsBranch = false, + IsOrganizationUnit = false, + Description = AppCodes.Languages.Language, + SelectCommandType = SelectCommandTypeEnum.Table, + SelectCommand = DbTablePrefix + "Language", + KeyFieldName = "Id", + KeyFieldDbSourceType = DbType.Guid, + DefaultFilter = "\"IsDeleted\" = 'false'", + SortMode = GridOptions.SortModeSingle, + PermissionJson = JsonSerializer.Serialize(new PermissionCrudDto + { + C = AppCodes.Languages.Language + ".Create", + R = AppCodes.Languages.Language, + U = AppCodes.Languages.Language + ".Update", + D = AppCodes.Languages.Language + ".Delete", + E = AppCodes.Languages.Language + ".Export" + }), + DeleteCommand = $"UPDATE \"{DbTablePrefix}Language\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", + DeleteFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { new() { FieldName = "DeleterId", FieldDbType = DbType.Guid, @@ -130,15 +117,15 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency FieldDbType = DbType.Guid, Value = "@ID", CustomValueType = FieldCustomValueTypeEnum.CustomKey } - }), - EditingOptionJson = JsonSerializer.Serialize(new GridEditingDto - { - AllowDeleting = true, - AllowAdding = true, - AllowUpdating = true, - ConfirmDelete = true, - }), - EditingFormJson = JsonSerializer.Serialize(new List() { + }), + EditingOptionJson = JsonSerializer.Serialize(new GridEditingDto + { + AllowDeleting = true, + AllowAdding = true, + AllowUpdating = true, + ConfirmDelete = true, + }), + EditingFormJson = JsonSerializer.Serialize(new List() { new() { Order = 1, ColCount = 1, @@ -152,8 +139,8 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency new() { Order = 5, DataField = "MultipleCultures", ColSpan = 2, IsRequired = false, EditorType2=EditorTypes.dxTagBox }, ] } - }), - InsertFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { + }), + InsertFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { new() { FieldName = "CreationTime", FieldDbType = DbType.DateTime, @@ -169,18 +156,18 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency FieldDbType = DbType.Boolean, Value = "false", CustomValueType = FieldCustomValueTypeEnum.Value } - }), - FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { + }), + FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { new() { FieldName = "IsEnabled", FieldDbType = DbType.Boolean, Value = "true", CustomValueType = FieldCustomValueTypeEnum.Value } - }) - } - ); - await _listFormFieldRepository.InsertManyAsync([ - new() { + }) + } + ); + await _listFormFieldRepository.InsertManyAsync([ + new() { ListFormCode = formLanguage.ListFormCode, RoleId = null, UserId = null, @@ -371,89 +358,95 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency }), }, ]); + } #endregion + #endregion #region List - #region Tenants - var listFormTenants = await _listFormRepository.InsertAsync( - new ListForm() - { - CultureName = LanguageCodes.En, - ListFormCode = ListFormCodes.Tenants, - Name = TenantManagementPermissions.Tenants.Default, - Title = TenantManagementPermissions.Tenants.Default, - DataSourceCode = SeedConsts.DataSources.DefaultCode, - IsTenant = false, - IsOrganizationUnit = false, - Description = TenantManagementPermissions.Tenants.Default, - SelectCommandType = SelectCommandTypeEnum.Table, - SelectCommand = "AbpTenants", - KeyFieldName = "Id", - KeyFieldDbSourceType = DbType.Guid, - SortMode = GridOptions.SortModeSingle, - FilterRowJson = JsonSerializer.Serialize(new GridFilterRowDto + + #region Tenant + if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.Tenant)) + { + var listFormTenants = await _listFormRepository.InsertAsync( + new ListForm() { - Visible = true - }), - HeaderFilterJson = JsonSerializer.Serialize(new - { - Visible = true - }), - SearchPanelJson = JsonSerializer.Serialize(new - { - Visible = true - }), - GroupPanelJson = JsonSerializer.Serialize(new - { - Visible = true - }), - SelectionJson = JsonSerializer.Serialize(new SelectionDto - { - Mode = GridOptions.SelectionModeSingle, - AllowSelectAll = false - }), - ColumnOptionJson = JsonSerializer.Serialize(new - { - ColumnFixingEnabled = true, - ColumnChooserEnabled = true - }), - PermissionJson = JsonSerializer.Serialize(new PermissionCrudDto - { - C = TenantManagementPermissions.Tenants.Create, - R = TenantManagementPermissions.Tenants.Default, - U = TenantManagementPermissions.Tenants.Update, - D = TenantManagementPermissions.Tenants.Delete, - E = TenantManagementPermissions.Tenants.Default + ".Export" - }), - PagerOptionJson = JsonSerializer.Serialize(new GridPagerOptionDto - { - Visible = true, - AllowedPageSizes = "10,20,50,100", - ShowPageSizeSelector = true, - ShowNavigationButtons = true, - ShowInfo = false, - InfoText = "Page {0} of {1} ({2} items)", - DisplayMode = GridColumnOptions.PagerDisplayModeAdaptive, - ScrollingMode = GridColumnOptions.ScrollingModeStandard, - LoadPanelEnabled = "auto", - LoadPanelText = "Loading..." - }), - EditingOptionJson = JsonSerializer.Serialize(new GridEditingDto - { - Popup = new GridEditingPopupDto() + CultureName = LanguageCodes.En, + ListFormCode = ListFormCodes.Lists.Tenant, + Name = TenantManagementPermissions.Tenants.Default, + Title = TenantManagementPermissions.Tenants.Default, + DataSourceCode = SeedConsts.DataSources.DefaultCode, + IsTenant = false, + IsBranch = false, + IsOrganizationUnit = false, + Description = TenantManagementPermissions.Tenants.Default, + SelectCommandType = SelectCommandTypeEnum.Table, + SelectCommand = "AbpTenants", + KeyFieldName = "Id", + KeyFieldDbSourceType = DbType.Guid, + SortMode = GridOptions.SortModeSingle, + FilterRowJson = JsonSerializer.Serialize(new GridFilterRowDto + { + Visible = true + }), + HeaderFilterJson = JsonSerializer.Serialize(new + { + Visible = true + }), + SearchPanelJson = JsonSerializer.Serialize(new + { + Visible = true + }), + GroupPanelJson = JsonSerializer.Serialize(new + { + Visible = true + }), + SelectionJson = JsonSerializer.Serialize(new SelectionDto + { + Mode = GridOptions.SelectionModeSingle, + AllowSelectAll = false + }), + ColumnOptionJson = JsonSerializer.Serialize(new + { + ColumnFixingEnabled = true, + ColumnChooserEnabled = true + }), + PermissionJson = JsonSerializer.Serialize(new PermissionCrudDto + { + C = TenantManagementPermissions.Tenants.Create, + R = TenantManagementPermissions.Tenants.Default, + U = TenantManagementPermissions.Tenants.Update, + D = TenantManagementPermissions.Tenants.Delete, + E = TenantManagementPermissions.Tenants.Default + ".Export" + }), + PagerOptionJson = JsonSerializer.Serialize(new GridPagerOptionDto + { + Visible = true, + AllowedPageSizes = "10,20,50,100", + ShowPageSizeSelector = true, + ShowNavigationButtons = true, + ShowInfo = false, + InfoText = "Page {0} of {1} ({2} items)", + DisplayMode = GridColumnOptions.PagerDisplayModeAdaptive, + ScrollingMode = GridColumnOptions.ScrollingModeStandard, + LoadPanelEnabled = "auto", + LoadPanelText = "Loading..." + }), + EditingOptionJson = JsonSerializer.Serialize(new GridEditingDto + { + Popup = new GridEditingPopupDto() + { + Title = "Tenant Form", + Width = 500, + Height = 550 + }, + AllowDeleting = true, + AllowAdding = true, + AllowUpdating = true, + SendOnlyChangedFormValuesUpdate = false, + }), + EditingFormJson = JsonSerializer.Serialize(new List() { - Title = "Tenant Form", - Width = 500, - Height = 550 - }, - AllowDeleting = true, - AllowAdding = true, - AllowUpdating = true, - SendOnlyChangedFormValuesUpdate = false, - }), - EditingFormJson = JsonSerializer.Serialize(new List() - { new() { Order=1, ColCount=1, ColSpan=2, ItemType="group", Items = [ new EditingFormItemDto { Order=1, DataField="Name", ColSpan=2, IsRequired=true, EditorType2=EditorTypes.dxTextBox }, @@ -477,8 +470,8 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency new EditingFormItemDto { Order=7, DataField="Website", ColSpan=2, IsRequired=true, EditorType2=EditorTypes.dxTextBox }, ] } - }), - CommandColumnJson = JsonSerializer.Serialize(new CommandColumnDto[] { + }), + CommandColumnJson = JsonSerializer.Serialize(new CommandColumnDto[] { new CommandColumnDto() { Hint = "Manage", Text = "Manage", @@ -489,32 +482,32 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency id = "@Id" }) }, - }), - InsertServiceAddress = "list-form-dynamic-api/tenant-insert", - UpdateServiceAddress = "list-form-dynamic-api/tenant-update", - DeleteCommand = "DELETE FROM \"AbpTenants\" WHERE \"Id\"=@Id", - DeleteFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { + }), + InsertServiceAddress = "list-form-dynamic-api/tenant-insert", + UpdateServiceAddress = "list-form-dynamic-api/tenant-update", + DeleteCommand = "DELETE FROM \"AbpTenants\" WHERE \"Id\"=@Id", + DeleteFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { new() { FieldName = "Id", FieldDbType = DbType.Guid, Value = "@ID", CustomValueType = FieldCustomValueTypeEnum.CustomKey } - }), - FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { + }), + FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { new FieldsDefaultValue() { FieldName = "IsActive", FieldDbType = DbType.Boolean, Value = "true", CustomValueType = FieldCustomValueTypeEnum.Value } - }) + }) - } - ); + } + ); - #region Tenants Fields - await _listFormFieldRepository.InsertManyAsync( - [ - new ListFormField + #region Tenants Fields + await _listFormFieldRepository.InsertManyAsync( + [ + new ListFormField { ListFormCode = listFormTenants.ListFormCode, RoleId = null, @@ -945,19 +938,24 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency }) }, ]); - #endregion + #endregion + + } #endregion - #region Permissions - var listFormPermissions = await _listFormRepository.InsertAsync( + #region Permission + if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.Permission)) + { + var listFormPermissions = await _listFormRepository.InsertAsync( new ListForm() { CultureName = LanguageCodes.En, - ListFormCode = ListFormCodes.Permission, + ListFormCode = ListFormCodes.Lists.Permission, Name = AbpIdentity.Permissions.Default, Title = AbpIdentity.Permissions.Default, DataSourceCode = SeedConsts.DataSources.DefaultCode, IsTenant = false, + IsBranch = false, IsOrganizationUnit = false, Description = AbpIdentity.Permissions.Default, SelectCommandType = SelectCommandTypeEnum.Table, @@ -1052,9 +1050,9 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency } ); - #region Permission Fields - await _listFormFieldRepository.InsertManyAsync(new ListFormField[] - { + #region Permission Fields + await _listFormFieldRepository.InsertManyAsync(new ListFormField[] + { new ListFormField { ListFormCode = listFormPermissions.ListFormCode, @@ -1274,19 +1272,23 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency IsPivot = true }) } - }); - #endregion + }); + #endregion + } #endregion - #region Roles - var listFormRoles = await _listFormRepository.InsertAsync( + #region Role + if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.Role)) + { + var listFormRoles = await _listFormRepository.InsertAsync( new ListForm() { CultureName = LanguageCodes.En, - ListFormCode = ListFormCodes.Roles, + ListFormCode = ListFormCodes.Lists.Role, Name = IdentityPermissions.Roles.Default, Title = IdentityPermissions.Roles.Default, IsTenant = true, + IsBranch = false, IsOrganizationUnit = false, DataSourceCode = SeedConsts.DataSources.DefaultCode, Description = IdentityPermissions.Roles.Default, @@ -1388,9 +1390,9 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency } ); - #region Roles Fields - await _listFormFieldRepository.InsertManyAsync(new ListFormField[] - { + #region Roles Fields + await _listFormFieldRepository.InsertManyAsync(new ListFormField[] + { new ListFormField { ListFormCode = listFormRoles.ListFormCode, @@ -1475,19 +1477,24 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency IsPivot = true }) }, - }); - #endregion + }); + #endregion + } #endregion - #region Users - var listFormUsers = await _listFormRepository.InsertAsync( + #region User + if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.User)) + { + var listFormUsers = await _listFormRepository.InsertAsync( new ListForm() { CultureName = LanguageCodes.En, - ListFormCode = ListFormCodes.Users, + ListFormCode = ListFormCodes.Lists.User, Name = IdentityPermissions.Users.Default, Title = IdentityPermissions.Users.Default, IsTenant = true, + IsBranch = false, + IsOrganizationUnit = false, DataSourceCode = SeedConsts.DataSources.DefaultCode, Description = IdentityPermissions.Users.Default, SelectCommandType = SelectCommandTypeEnum.Table, @@ -1599,10 +1606,10 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency } ); - #region Users Fields - await _listFormFieldRepository.InsertManyAsync( - [ - new ListFormField + #region Users Fields + await _listFormFieldRepository.InsertManyAsync( + [ + new ListFormField { ListFormCode = listFormUsers.ListFormCode, RoleId = null, @@ -1798,64 +1805,67 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency }) }, ]); + #endregion + } #endregion - #endregion - - #region Languages - var listFormLanguages = await _listFormRepository.InsertAsync( - new ListForm() - { - CultureName = LanguageCodes.En, - ListFormCode = ListFormCodes.Language, - Name = AppCodes.Languages.Language, - Title = AppCodes.Languages.Language, - DataSourceCode = SeedConsts.DataSources.DefaultCode, - IsTenant = false, - IsOrganizationUnit = false, - Description = AppCodes.Languages.Language, - SelectCommandType = SelectCommandTypeEnum.Table, - SelectCommand = DbTablePrefix + "Language", - KeyFieldName = "Id", - KeyFieldDbSourceType = DbType.Guid, - DefaultFilter = "\"IsDeleted\" = 'false'", - SortMode = GridOptions.SortModeSingle, - FilterRowJson = JsonSerializer.Serialize(new GridFilterRowDto + #region Language + if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.Language)) + { + var listFormLanguages = await _listFormRepository.InsertAsync( + new ListForm() { - Visible = true - }), - HeaderFilterJson = JsonSerializer.Serialize(new - { - Visible = true - }), - SearchPanelJson = JsonSerializer.Serialize(new - { - Visible = true - }), - GroupPanelJson = JsonSerializer.Serialize(new - { - Visible = true - }), - SelectionJson = JsonSerializer.Serialize(new SelectionDto - { - Mode = GridOptions.SelectionModeSingle, - AllowSelectAll = false - }), - ColumnOptionJson = JsonSerializer.Serialize(new - { - ColumnFixingEnabled = true, - ColumnChooserEnabled = true - }), - PermissionJson = JsonSerializer.Serialize(new PermissionCrudDto - { - C = AppCodes.Languages.Language + ".Create", - R = AppCodes.Languages.Language, - U = AppCodes.Languages.Language + ".Update", - D = AppCodes.Languages.Language + ".Delete", - E = AppCodes.Languages.Language + ".Export", - }), - DeleteCommand = $"UPDATE \"{DbTablePrefix}Language\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", - DeleteFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { + CultureName = LanguageCodes.En, + ListFormCode = ListFormCodes.Lists.Language, + Name = AppCodes.Languages.Language, + Title = AppCodes.Languages.Language, + DataSourceCode = SeedConsts.DataSources.DefaultCode, + IsTenant = false, + IsBranch = false, + IsOrganizationUnit = false, + Description = AppCodes.Languages.Language, + SelectCommandType = SelectCommandTypeEnum.Table, + SelectCommand = DbTablePrefix + "Language", + KeyFieldName = "Id", + KeyFieldDbSourceType = DbType.Guid, + DefaultFilter = "\"IsDeleted\" = 'false'", + SortMode = GridOptions.SortModeSingle, + FilterRowJson = JsonSerializer.Serialize(new GridFilterRowDto + { + Visible = true + }), + HeaderFilterJson = JsonSerializer.Serialize(new + { + Visible = true + }), + SearchPanelJson = JsonSerializer.Serialize(new + { + Visible = true + }), + GroupPanelJson = JsonSerializer.Serialize(new + { + Visible = true + }), + SelectionJson = JsonSerializer.Serialize(new SelectionDto + { + Mode = GridOptions.SelectionModeSingle, + AllowSelectAll = false + }), + ColumnOptionJson = JsonSerializer.Serialize(new + { + ColumnFixingEnabled = true, + ColumnChooserEnabled = true + }), + PermissionJson = JsonSerializer.Serialize(new PermissionCrudDto + { + C = AppCodes.Languages.Language + ".Create", + R = AppCodes.Languages.Language, + U = AppCodes.Languages.Language + ".Update", + D = AppCodes.Languages.Language + ".Delete", + E = AppCodes.Languages.Language + ".Export", + }), + DeleteCommand = $"UPDATE \"{DbTablePrefix}Language\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", + DeleteFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { new FieldsDefaultValue() { FieldName = "DeleterId", FieldDbType = DbType.Guid, @@ -1866,34 +1876,34 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency FieldDbType = DbType.Guid, Value = "@ID", CustomValueType = FieldCustomValueTypeEnum.CustomKey } - }), - PagerOptionJson = JsonSerializer.Serialize(new GridPagerOptionDto - { - Visible = true, - AllowedPageSizes = "10,20,50,100", - ShowPageSizeSelector = true, - ShowNavigationButtons = true, - ShowInfo = false, - InfoText = "Page {0} of {1} ({2} items)", - DisplayMode = GridColumnOptions.PagerDisplayModeAdaptive, - ScrollingMode = GridColumnOptions.ScrollingModeStandard, - LoadPanelEnabled = "auto", - LoadPanelText = "Loading..." - }), - EditingOptionJson = JsonSerializer.Serialize(new GridEditingDto - { - Popup = new GridEditingPopupDto() + }), + PagerOptionJson = JsonSerializer.Serialize(new GridPagerOptionDto { - Title = "Language Form", - Width = 600, - Height = 300 - }, - AllowDeleting = true, - AllowAdding = true, - AllowUpdating = true, - SendOnlyChangedFormValuesUpdate = false, - }), - EditingFormJson = JsonSerializer.Serialize(new List() { + Visible = true, + AllowedPageSizes = "10,20,50,100", + ShowPageSizeSelector = true, + ShowNavigationButtons = true, + ShowInfo = false, + InfoText = "Page {0} of {1} ({2} items)", + DisplayMode = GridColumnOptions.PagerDisplayModeAdaptive, + ScrollingMode = GridColumnOptions.ScrollingModeStandard, + LoadPanelEnabled = "auto", + LoadPanelText = "Loading..." + }), + EditingOptionJson = JsonSerializer.Serialize(new GridEditingDto + { + Popup = new GridEditingPopupDto() + { + Title = "Language Form", + Width = 600, + Height = 300 + }, + AllowDeleting = true, + AllowAdding = true, + AllowUpdating = true, + SendOnlyChangedFormValuesUpdate = false, + }), + EditingFormJson = JsonSerializer.Serialize(new List() { //["CultureName","UiCultureName","DisplayName","IsEnabled","MultipleCultures"] new() { Order=1,ColCount=1,ColSpan=2,ItemType="group", Items= [ @@ -1904,8 +1914,8 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency new EditingFormItemDto { Order = 5, DataField = "MultipleCultures", ColSpan = 2, IsRequired = false, EditorType2=EditorTypes.dxTagBox }, ] } - }), - InsertFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { + }), + InsertFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { new FieldsDefaultValue() { FieldName = "CreationTime", FieldDbType = DbType.DateTime, @@ -1921,15 +1931,15 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency FieldDbType = DbType.Boolean, Value = "false", CustomValueType = FieldCustomValueTypeEnum.Value } - }), - FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { + }), + FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { new FieldsDefaultValue() { FieldName = "IsEnabled", FieldDbType = DbType.Boolean, Value = "true", CustomValueType = FieldCustomValueTypeEnum.Value } - }), - CommandColumnJson = JsonSerializer.Serialize(new CommandColumnDto[] { + }), + CommandColumnJson = JsonSerializer.Serialize(new CommandColumnDto[] { new() { Hint = "Manage", Text ="Manage", @@ -1937,12 +1947,12 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency AuthName=AppCodes.IpRestrictions + ".Update", Url=$"/form/{ListFormCodes.Forms.FormLanguage}/@Id" }, - }), - } - ); + }), + } + ); - #region Language Fields - await _listFormFieldRepository.InsertManyAsync(new ListFormField[] { + #region Language Fields + await _listFormFieldRepository.InsertManyAsync(new ListFormField[] { new ListFormField { ListFormCode = listFormLanguages.ListFormCode, @@ -2139,64 +2149,67 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency }, }); - #endregion - + #endregion + } #endregion #region LanguageText - var listFormLanguageTexts = await _listFormRepository.InsertAsync( - new ListForm() - { - CultureName = LanguageCodes.En, - ListFormCode = ListFormCodes.LanguageText, - Name = AppCodes.Languages.LanguageText, - Title = AppCodes.Languages.LanguageText, - DataSourceCode = SeedConsts.DataSources.DefaultCode, - IsTenant = false, - IsOrganizationUnit = false, - Description = AppCodes.Languages.LanguageText, - SelectCommandType = SelectCommandTypeEnum.Table, - SelectCommand = DbTablePrefix + "LanguageText", - KeyFieldName = "Id", - KeyFieldDbSourceType = DbType.Guid, - DefaultFilter = "\"IsDeleted\" = 'false'", - SortMode = GridOptions.SortModeSingle, - FilterRowJson = JsonSerializer.Serialize(new GridFilterRowDto + if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.LanguageText)) + { + var listFormLanguageTexts = await _listFormRepository.InsertAsync( + new ListForm() { - Visible = true - }), - HeaderFilterJson = JsonSerializer.Serialize(new - { - Visible = true - }), - SearchPanelJson = JsonSerializer.Serialize(new - { - Visible = true - }), - GroupPanelJson = JsonSerializer.Serialize(new - { - Visible = true - }), - SelectionJson = JsonSerializer.Serialize(new SelectionDto - { - Mode = GridOptions.SelectionModeSingle, - AllowSelectAll = false - }), - ColumnOptionJson = JsonSerializer.Serialize(new - { - ColumnFixingEnabled = true, - ColumnChooserEnabled = true - }), - PermissionJson = JsonSerializer.Serialize(new PermissionCrudDto - { - C = AppCodes.Languages.LanguageText + ".Create", - R = AppCodes.Languages.LanguageText, - U = AppCodes.Languages.LanguageText + ".Update", - D = AppCodes.Languages.LanguageText + ".Delete", - E = AppCodes.Languages.LanguageText + ".Export" - }), - DeleteCommand = $"UPDATE \"{DbTablePrefix}LanguageText\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", - DeleteFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { + CultureName = LanguageCodes.En, + ListFormCode = ListFormCodes.Lists.LanguageText, + Name = AppCodes.Languages.LanguageText, + Title = AppCodes.Languages.LanguageText, + DataSourceCode = SeedConsts.DataSources.DefaultCode, + IsTenant = false, + IsBranch = false, + IsOrganizationUnit = false, + Description = AppCodes.Languages.LanguageText, + SelectCommandType = SelectCommandTypeEnum.Table, + SelectCommand = DbTablePrefix + "LanguageText", + KeyFieldName = "Id", + KeyFieldDbSourceType = DbType.Guid, + DefaultFilter = "\"IsDeleted\" = 'false'", + SortMode = GridOptions.SortModeSingle, + FilterRowJson = JsonSerializer.Serialize(new GridFilterRowDto + { + Visible = true + }), + HeaderFilterJson = JsonSerializer.Serialize(new + { + Visible = true + }), + SearchPanelJson = JsonSerializer.Serialize(new + { + Visible = true + }), + GroupPanelJson = JsonSerializer.Serialize(new + { + Visible = true + }), + SelectionJson = JsonSerializer.Serialize(new SelectionDto + { + Mode = GridOptions.SelectionModeSingle, + AllowSelectAll = false + }), + ColumnOptionJson = JsonSerializer.Serialize(new + { + ColumnFixingEnabled = true, + ColumnChooserEnabled = true + }), + PermissionJson = JsonSerializer.Serialize(new PermissionCrudDto + { + C = AppCodes.Languages.LanguageText + ".Create", + R = AppCodes.Languages.LanguageText, + U = AppCodes.Languages.LanguageText + ".Update", + D = AppCodes.Languages.LanguageText + ".Delete", + E = AppCodes.Languages.LanguageText + ".Export" + }), + DeleteCommand = $"UPDATE \"{DbTablePrefix}LanguageText\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", + DeleteFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { new FieldsDefaultValue() { FieldName = "DeleterId", FieldDbType = DbType.Guid, @@ -2207,34 +2220,34 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency FieldDbType = DbType.Guid, Value = "@ID", CustomValueType = FieldCustomValueTypeEnum.CustomKey } - }), - PagerOptionJson = JsonSerializer.Serialize(new GridPagerOptionDto - { - Visible = true, - AllowedPageSizes = "10,20,50,100", - ShowPageSizeSelector = true, - ShowNavigationButtons = true, - ShowInfo = false, - InfoText = "Page {0} of {1} ({2} items)", - DisplayMode = GridColumnOptions.PagerDisplayModeAdaptive, - ScrollingMode = GridColumnOptions.ScrollingModeStandard, - LoadPanelEnabled = "auto", - LoadPanelText = "Loading..." - }), - EditingOptionJson = JsonSerializer.Serialize(new GridEditingDto - { - Popup = new GridEditingPopupDto() + }), + PagerOptionJson = JsonSerializer.Serialize(new GridPagerOptionDto { - Title = "LanguageText Form", - Width = 800, - Height = 300 - }, - AllowDeleting = true, - AllowAdding = true, - AllowUpdating = true, - SendOnlyChangedFormValuesUpdate = false, - }), - EditingFormJson = JsonSerializer.Serialize(new List() { + Visible = true, + AllowedPageSizes = "10,20,50,100", + ShowPageSizeSelector = true, + ShowNavigationButtons = true, + ShowInfo = false, + InfoText = "Page {0} of {1} ({2} items)", + DisplayMode = GridColumnOptions.PagerDisplayModeAdaptive, + ScrollingMode = GridColumnOptions.ScrollingModeStandard, + LoadPanelEnabled = "auto", + LoadPanelText = "Loading..." + }), + EditingOptionJson = JsonSerializer.Serialize(new GridEditingDto + { + Popup = new GridEditingPopupDto() + { + Title = "LanguageText Form", + Width = 800, + Height = 300 + }, + AllowDeleting = true, + AllowAdding = true, + AllowUpdating = true, + SendOnlyChangedFormValuesUpdate = false, + }), + EditingFormJson = JsonSerializer.Serialize(new List() { //Items=["CultureName","ResourceName","Key","Value"] }, new() { Order=1,ColCount=1,ColSpan=2,ItemType="group", Items= [ @@ -2244,8 +2257,8 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency new EditingFormItemDto { Order = 4, DataField = "Value", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxTextBox }, ] } - }), - InsertFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { + }), + InsertFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { new FieldsDefaultValue() { FieldName = "CreationTime", FieldDbType = DbType.DateTime, @@ -2261,13 +2274,13 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency FieldDbType = DbType.Boolean, Value = "false", CustomValueType = FieldCustomValueTypeEnum.Value } - }), - } - ); + }), + } + ); - #region LanguageText Fields - await _listFormFieldRepository.InsertManyAsync([ - new ListFormField + #region LanguageText Fields + await _listFormFieldRepository.InsertManyAsync([ + new ListFormField { ListFormCode = listFormLanguageTexts.ListFormCode, RoleId = null, @@ -2444,19 +2457,23 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency }, ]); - #endregion + #endregion + } #endregion - #region Menus - var listFormMenus = await _listFormRepository.InsertAsync( + #region Menu + if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.Menu)) + { + var listFormMenus = await _listFormRepository.InsertAsync( new ListForm() { CultureName = LanguageCodes.En, - ListFormCode = ListFormCodes.Menu, + ListFormCode = ListFormCodes.Lists.Menu, Name = AppCodes.Menus, Title = AppCodes.Menus, DataSourceCode = SeedConsts.DataSources.DefaultCode, IsTenant = false, + IsBranch = false, IsOrganizationUnit = false, Description = AppCodes.Menus, SelectCommandType = SelectCommandTypeEnum.Table, @@ -2582,8 +2599,8 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency } ); - #region Menu Fields - await _listFormFieldRepository.InsertManyAsync(new ListFormField[] { + #region Menu Fields + await _listFormFieldRepository.InsertManyAsync(new ListFormField[] { new ListFormField { ListFormCode = listFormMenus.ListFormCode, @@ -2939,57 +2956,61 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency }, }); - #endregion + #endregion + } #endregion - #region ListForms - var listForms = await _listFormRepository.InsertAsync( - new ListForm() - { - CultureName = LanguageCodes.En, - ListFormCode = ListFormCodes.Listform, - Name = AppCodes.Listforms.Listform, - Title = AppCodes.Listforms.Listform, - DataSourceCode = SeedConsts.DataSources.DefaultCode, - IsTenant = false, - IsOrganizationUnit = false, - Description = AppCodes.Listforms.Listform, - SelectCommandType = SelectCommandTypeEnum.Table, - SelectCommand = DbTablePrefix + "ListForm", - KeyFieldName = "Id", - KeyFieldDbSourceType = DbType.Guid, - DefaultFilter = "\"IsDeleted\" = 'false'", - SortMode = GridOptions.SortModeMultiple, - FilterRowJson = JsonSerializer.Serialize(new GridFilterRowDto + #region ListForm + if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.Listform)) + { + var listForms = await _listFormRepository.InsertAsync( + new ListForm() { - Visible = true, - ApplyFilter = GridOptions.FilterRowApplyFilterAuto - }), - HeaderFilterJson = JsonSerializer.Serialize(new - { - Visible = true - }), - SearchPanelJson = JsonSerializer.Serialize(new - { - Visible = true - }), - GroupPanelJson = JsonSerializer.Serialize(new - { - Visible = true - }), - SelectionJson = JsonSerializer.Serialize(new SelectionDto - { - AllowSelectAll = true, - Mode = GridOptions.SelectionModeMultiple, - SelectAllMode = GridOptions.SelectionAllModeAllPages - }), - ColumnOptionJson = JsonSerializer.Serialize(new - { - ColumnFixingEnabled = true, - ColumnChooserEnabled = true - }), - DeleteCommand = $"UPDATE \"{DbTablePrefix}ListForm\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", - DeleteFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { + CultureName = LanguageCodes.En, + ListFormCode = ListFormCodes.Lists.Listform, + Name = AppCodes.Listforms.Listform, + Title = AppCodes.Listforms.Listform, + DataSourceCode = SeedConsts.DataSources.DefaultCode, + IsTenant = false, + IsBranch = false, + IsOrganizationUnit = false, + Description = AppCodes.Listforms.Listform, + SelectCommandType = SelectCommandTypeEnum.Table, + SelectCommand = DbTablePrefix + "ListForm", + KeyFieldName = "Id", + KeyFieldDbSourceType = DbType.Guid, + DefaultFilter = "\"IsDeleted\" = 'false'", + SortMode = GridOptions.SortModeMultiple, + FilterRowJson = JsonSerializer.Serialize(new GridFilterRowDto + { + Visible = true, + ApplyFilter = GridOptions.FilterRowApplyFilterAuto + }), + HeaderFilterJson = JsonSerializer.Serialize(new + { + Visible = true + }), + SearchPanelJson = JsonSerializer.Serialize(new + { + Visible = true + }), + GroupPanelJson = JsonSerializer.Serialize(new + { + Visible = true + }), + SelectionJson = JsonSerializer.Serialize(new SelectionDto + { + AllowSelectAll = true, + Mode = GridOptions.SelectionModeMultiple, + SelectAllMode = GridOptions.SelectionAllModeAllPages + }), + ColumnOptionJson = JsonSerializer.Serialize(new + { + ColumnFixingEnabled = true, + ColumnChooserEnabled = true + }), + DeleteCommand = $"UPDATE \"{DbTablePrefix}ListForm\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", + DeleteFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { new FieldsDefaultValue() { FieldName = "DeleterId", FieldDbType = DbType.Guid, @@ -3000,42 +3021,42 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency FieldDbType = DbType.Guid, Value = "@ID", CustomValueType = FieldCustomValueTypeEnum.CustomKey } - }), - PermissionJson = JsonSerializer.Serialize(new PermissionCrudDto - { - C = AppCodes.Listforms.Listform + ".Create", - R = AppCodes.Listforms.Listform, - U = AppCodes.Listforms.Listform + ".Update", - D = AppCodes.Listforms.Listform + ".Delete", - E = AppCodes.Listforms.Listform + ".Export" - }), - PagerOptionJson = JsonSerializer.Serialize(new GridPagerOptionDto - { - Visible = true, - AllowedPageSizes = "10,20,50,100", - ShowPageSizeSelector = true, - ShowNavigationButtons = true, - ShowInfo = false, - InfoText = "Page {0} of {1} ({2} items)", - DisplayMode = GridColumnOptions.PagerDisplayModeAdaptive, - ScrollingMode = GridColumnOptions.ScrollingModeStandard, - LoadPanelEnabled = "auto", - LoadPanelText = "Loading..." - }), - EditingOptionJson = JsonSerializer.Serialize(new GridEditingDto - { - Popup = new GridEditingPopupDto() + }), + PermissionJson = JsonSerializer.Serialize(new PermissionCrudDto { - Title = "ListForms Form", - Width = 800, - Height = 500 - }, - AllowDeleting = true, - AllowAdding = true, - AllowUpdating = true, - SendOnlyChangedFormValuesUpdate = false, - }), - EditingFormJson = JsonSerializer.Serialize(new List() { + C = AppCodes.Listforms.Listform + ".Create", + R = AppCodes.Listforms.Listform, + U = AppCodes.Listforms.Listform + ".Update", + D = AppCodes.Listforms.Listform + ".Delete", + E = AppCodes.Listforms.Listform + ".Export" + }), + PagerOptionJson = JsonSerializer.Serialize(new GridPagerOptionDto + { + Visible = true, + AllowedPageSizes = "10,20,50,100", + ShowPageSizeSelector = true, + ShowNavigationButtons = true, + ShowInfo = false, + InfoText = "Page {0} of {1} ({2} items)", + DisplayMode = GridColumnOptions.PagerDisplayModeAdaptive, + ScrollingMode = GridColumnOptions.ScrollingModeStandard, + LoadPanelEnabled = "auto", + LoadPanelText = "Loading..." + }), + EditingOptionJson = JsonSerializer.Serialize(new GridEditingDto + { + Popup = new GridEditingPopupDto() + { + Title = "ListForms Form", + Width = 800, + Height = 500 + }, + AllowDeleting = true, + AllowAdding = true, + AllowUpdating = true, + SendOnlyChangedFormValuesUpdate = false, + }), + EditingFormJson = JsonSerializer.Serialize(new List() { //Items=["CultureName","Name","Description","ListFormCode","SelectCommandType","SelectCommand","TableName","KeyFieldName", //"KeyFieldDbSourceType","Title","SortMode","PermissionJson","DeleteServiceAddress","InsertServiceAddress","UpdateServiceAddress"] }, new() { Order=1,ColCount=1,ColSpan=2,ItemType="group", Items= @@ -3069,8 +3090,8 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency ] } - }), - InsertFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { + }), + InsertFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { new FieldsDefaultValue() { FieldName = "CreationTime", FieldDbType = DbType.DateTime, @@ -3086,8 +3107,8 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency FieldDbType = DbType.Boolean, Value = "false", CustomValueType = FieldCustomValueTypeEnum.Value } - }), - CommandColumnJson = JsonSerializer.Serialize(new CommandColumnDto[] { + }), + CommandColumnJson = JsonSerializer.Serialize(new CommandColumnDto[] { new() { Hint = "Manage Listform", Text ="Manage", @@ -3102,14 +3123,14 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency AuthName=AppCodes.Listforms.Listform, Url="/list/@ListFormCode" } - }), - StateStoringJson = JsonSerializer.Serialize(new StateStoringDto - { - Enabled = true, - StorageKey = "listFormGridStorage", - Type = "custom" - }), - FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { + }), + StateStoringJson = JsonSerializer.Serialize(new StateStoringDto + { + Enabled = true, + StorageKey = "listFormGridStorage", + Type = "custom" + }), + FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { new FieldsDefaultValue() { FieldName = "ListFormType", FieldDbType = DbType.String, @@ -3155,14 +3176,14 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency FieldDbType = DbType.String, Value = GridOptions.SortModeNone, CustomValueType = FieldCustomValueTypeEnum.Value }, - }), + }), - } - ); + } + ); - #region ListForms Fields - await _listFormFieldRepository.InsertManyAsync(new ListFormField[] - { + #region ListForms Fields + await _listFormFieldRepository.InsertManyAsync(new ListFormField[] + { new ListFormField { ListFormCode = listForms.ListFormCode, @@ -3795,64 +3816,68 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency IsPivot = true }) }, - }); - #endregion + }); + #endregion + } #endregion - #region SettingDefinitions - var listFormSettingDefinitions = await _listFormRepository.InsertAsync( - new ListForm() - { - CultureName = LanguageCodes.En, - ListFormCode = ListFormCodes.SettingDefinition, - Name = AppCodes.Settings.SettingDefinitions, - Title = AppCodes.Settings.SettingDefinitions, - DataSourceCode = SeedConsts.DataSources.DefaultCode, - IsTenant = false, - IsOrganizationUnit = false, - Description = AppCodes.Settings.SettingDefinitions, - SelectCommandType = SelectCommandTypeEnum.Table, - SelectCommand = DbTablePrefix + "SettingDefinition", - KeyFieldName = "Id", - KeyFieldDbSourceType = DbType.Guid, - DefaultFilter = "\"IsDeleted\" = 'false'", - SortMode = GridOptions.SortModeSingle, - FilterRowJson = JsonSerializer.Serialize(new GridFilterRowDto + #region SettingDefinition + if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.SettingDefinition)) + { + var listFormSettingDefinitions = await _listFormRepository.InsertAsync( + new ListForm() { - Visible = true - }), - HeaderFilterJson = JsonSerializer.Serialize(new - { - Visible = true - }), - SearchPanelJson = JsonSerializer.Serialize(new - { - Visible = true - }), - GroupPanelJson = JsonSerializer.Serialize(new - { - Visible = true - }), - SelectionJson = JsonSerializer.Serialize(new SelectionDto - { - Mode = GridOptions.SelectionModeSingle, - AllowSelectAll = false - }), - ColumnOptionJson = JsonSerializer.Serialize(new - { - ColumnFixingEnabled = true, - ColumnChooserEnabled = true - }), - PermissionJson = JsonSerializer.Serialize(new PermissionCrudDto - { - C = AppCodes.Settings.SettingDefinitions + ".Create", - R = AppCodes.Settings.SettingDefinitions, - U = AppCodes.Settings.SettingDefinitions + ".Update", - D = AppCodes.Settings.SettingDefinitions + ".Delete", - E = AppCodes.Settings.SettingDefinitions + ".Export" - }), - DeleteCommand = $"UPDATE \"{DbTablePrefix}SettingDefinition\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", - DeleteFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { + CultureName = LanguageCodes.En, + ListFormCode = ListFormCodes.Lists.SettingDefinition, + Name = AppCodes.Settings.SettingDefinitions, + Title = AppCodes.Settings.SettingDefinitions, + DataSourceCode = SeedConsts.DataSources.DefaultCode, + IsTenant = false, + IsBranch = false, + IsOrganizationUnit = false, + Description = AppCodes.Settings.SettingDefinitions, + SelectCommandType = SelectCommandTypeEnum.Table, + SelectCommand = DbTablePrefix + "SettingDefinition", + KeyFieldName = "Id", + KeyFieldDbSourceType = DbType.Guid, + DefaultFilter = "\"IsDeleted\" = 'false'", + SortMode = GridOptions.SortModeSingle, + FilterRowJson = JsonSerializer.Serialize(new GridFilterRowDto + { + Visible = true + }), + HeaderFilterJson = JsonSerializer.Serialize(new + { + Visible = true + }), + SearchPanelJson = JsonSerializer.Serialize(new + { + Visible = true + }), + GroupPanelJson = JsonSerializer.Serialize(new + { + Visible = true + }), + SelectionJson = JsonSerializer.Serialize(new SelectionDto + { + Mode = GridOptions.SelectionModeSingle, + AllowSelectAll = false + }), + ColumnOptionJson = JsonSerializer.Serialize(new + { + ColumnFixingEnabled = true, + ColumnChooserEnabled = true + }), + PermissionJson = JsonSerializer.Serialize(new PermissionCrudDto + { + C = AppCodes.Settings.SettingDefinitions + ".Create", + R = AppCodes.Settings.SettingDefinitions, + U = AppCodes.Settings.SettingDefinitions + ".Update", + D = AppCodes.Settings.SettingDefinitions + ".Delete", + E = AppCodes.Settings.SettingDefinitions + ".Export" + }), + DeleteCommand = $"UPDATE \"{DbTablePrefix}SettingDefinition\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", + DeleteFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { new FieldsDefaultValue() { FieldName = "DeleterId", FieldDbType = DbType.Guid, @@ -3863,34 +3888,34 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency FieldDbType = DbType.Guid, Value = "@ID", CustomValueType = FieldCustomValueTypeEnum.CustomKey } - }), - PagerOptionJson = JsonSerializer.Serialize(new GridPagerOptionDto - { - Visible = true, - AllowedPageSizes = "10,20,50,100", - ShowPageSizeSelector = true, - ShowNavigationButtons = true, - ShowInfo = false, - InfoText = "Page {0} of {1} ({2} items)", - DisplayMode = GridColumnOptions.PagerDisplayModeAdaptive, - ScrollingMode = GridColumnOptions.ScrollingModeStandard, - LoadPanelEnabled = "auto", - LoadPanelText = "Loading..." - }), - EditingOptionJson = JsonSerializer.Serialize(new GridEditingDto - { - Popup = new GridEditingPopupDto() + }), + PagerOptionJson = JsonSerializer.Serialize(new GridPagerOptionDto { - Title = "SettingDefinition Form", - Width = 800, - Height = 400 - }, - AllowDeleting = true, - AllowAdding = true, - AllowUpdating = true, - SendOnlyChangedFormValuesUpdate = false, - }), - EditingFormJson = JsonSerializer.Serialize(new List() { + Visible = true, + AllowedPageSizes = "10,20,50,100", + ShowPageSizeSelector = true, + ShowNavigationButtons = true, + ShowInfo = false, + InfoText = "Page {0} of {1} ({2} items)", + DisplayMode = GridColumnOptions.PagerDisplayModeAdaptive, + ScrollingMode = GridColumnOptions.ScrollingModeStandard, + LoadPanelEnabled = "auto", + LoadPanelText = "Loading..." + }), + EditingOptionJson = JsonSerializer.Serialize(new GridEditingDto + { + Popup = new GridEditingPopupDto() + { + Title = "SettingDefinition Form", + Width = 800, + Height = 400 + }, + AllowDeleting = true, + AllowAdding = true, + AllowUpdating = true, + SendOnlyChangedFormValuesUpdate = false, + }), + EditingFormJson = JsonSerializer.Serialize(new List() { //Items=["MainGroupKey","SubGroupKey","Code","NameKey","DescriptionKey","DefaultValue","IsVisibleToClients","Providers", //"IsInherited","IsEncrypted","RequiredPermissionName","DataType","SelectOptions","Order"] }, new() { Order=1,ColCount=1,ColSpan=2,ItemType="group", Items= @@ -3911,8 +3936,8 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency new EditingFormItemDto { Order = 14, DataField = "Order", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxNumberBox }, ] } - }), - InsertFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { + }), + InsertFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { new FieldsDefaultValue() { FieldName = "CreationTime", FieldDbType = DbType.DateTime, @@ -3928,8 +3953,8 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency FieldDbType = DbType.Boolean, Value = "false", CustomValueType = FieldCustomValueTypeEnum.Value } - }), - FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { + }), + FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { new FieldsDefaultValue() { FieldName = "IsVisibleToClients", FieldDbType = DbType.Boolean, @@ -3945,12 +3970,12 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency FieldDbType = DbType.Boolean, Value = "false", CustomValueType = FieldCustomValueTypeEnum.Value }, - }), - } - ); + }), + } + ); - #region SettingDefinition Fields - await _listFormFieldRepository.InsertManyAsync(new ListFormField[] { + #region SettingDefinition Fields + await _listFormFieldRepository.InsertManyAsync(new ListFormField[] { new ListFormField { ListFormCode = listFormSettingDefinitions.ListFormCode, @@ -4449,63 +4474,67 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency }) }, }); - #endregion + #endregion + } #endregion #region Chart - var listFormCharts = await _listFormRepository.InsertAsync( - new ListForm() - { - CultureName = LanguageCodes.En, - ListFormCode = ListFormCodes.Chart, - Name = AppCodes.Listforms.Chart, - Title = AppCodes.Listforms.Chart, - DataSourceCode = SeedConsts.DataSources.DefaultCode, - IsTenant = false, - IsOrganizationUnit = false, - Description = AppCodes.Listforms.Chart, - SelectCommandType = SelectCommandTypeEnum.Table, - SelectCommand = DbTablePrefix + "Chart", - KeyFieldName = "Id", - KeyFieldDbSourceType = DbType.Guid, - DefaultFilter = "\"IsDeleted\" = 'false'", - SortMode = GridOptions.SortModeSingle, - FilterRowJson = JsonSerializer.Serialize(new GridFilterRowDto + if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.Chart)) + { + var listFormCharts = await _listFormRepository.InsertAsync( + new ListForm() { - Visible = true - }), - HeaderFilterJson = JsonSerializer.Serialize(new - { - Visible = true - }), - SearchPanelJson = JsonSerializer.Serialize(new - { - Visible = true - }), - GroupPanelJson = JsonSerializer.Serialize(new - { - Visible = true - }), - SelectionJson = JsonSerializer.Serialize(new SelectionDto - { - Mode = GridOptions.SelectionModeSingle, - AllowSelectAll = false - }), - ColumnOptionJson = JsonSerializer.Serialize(new - { - ColumnFixingEnabled = true, - ColumnChooserEnabled = true - }), - PermissionJson = JsonSerializer.Serialize(new PermissionCrudDto - { - C = AppCodes.Listforms.Chart + ".Create", - R = AppCodes.Listforms.Chart, - U = AppCodes.Listforms.Chart + ".Update", - D = AppCodes.Listforms.Chart + ".Delete", - E = AppCodes.Listforms.Chart + ".Export" - }), - DeleteCommand = $"UPDATE \"{DbTablePrefix}Chart\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", - DeleteFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { + CultureName = LanguageCodes.En, + ListFormCode = ListFormCodes.Lists.Chart, + Name = AppCodes.Listforms.Chart, + Title = AppCodes.Listforms.Chart, + DataSourceCode = SeedConsts.DataSources.DefaultCode, + IsTenant = false, + IsBranch = false, + IsOrganizationUnit = false, + Description = AppCodes.Listforms.Chart, + SelectCommandType = SelectCommandTypeEnum.Table, + SelectCommand = DbTablePrefix + "Chart", + KeyFieldName = "Id", + KeyFieldDbSourceType = DbType.Guid, + DefaultFilter = "\"IsDeleted\" = 'false'", + SortMode = GridOptions.SortModeSingle, + FilterRowJson = JsonSerializer.Serialize(new GridFilterRowDto + { + Visible = true + }), + HeaderFilterJson = JsonSerializer.Serialize(new + { + Visible = true + }), + SearchPanelJson = JsonSerializer.Serialize(new + { + Visible = true + }), + GroupPanelJson = JsonSerializer.Serialize(new + { + Visible = true + }), + SelectionJson = JsonSerializer.Serialize(new SelectionDto + { + Mode = GridOptions.SelectionModeSingle, + AllowSelectAll = false + }), + ColumnOptionJson = JsonSerializer.Serialize(new + { + ColumnFixingEnabled = true, + ColumnChooserEnabled = true + }), + PermissionJson = JsonSerializer.Serialize(new PermissionCrudDto + { + C = AppCodes.Listforms.Chart + ".Create", + R = AppCodes.Listforms.Chart, + U = AppCodes.Listforms.Chart + ".Update", + D = AppCodes.Listforms.Chart + ".Delete", + E = AppCodes.Listforms.Chart + ".Export" + }), + DeleteCommand = $"UPDATE \"{DbTablePrefix}Chart\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", + DeleteFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { new FieldsDefaultValue() { FieldName = "DeleterId", FieldDbType = DbType.Guid, @@ -4516,34 +4545,34 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency FieldDbType = DbType.Guid, Value = "@ID", CustomValueType = FieldCustomValueTypeEnum.CustomKey } - }), - PagerOptionJson = JsonSerializer.Serialize(new GridPagerOptionDto - { - Visible = true, - AllowedPageSizes = "10,20,50,100", - ShowPageSizeSelector = true, - ShowNavigationButtons = true, - ShowInfo = false, - InfoText = "Page {0} of {1} ({2} items)", - DisplayMode = GridColumnOptions.PagerDisplayModeAdaptive, - ScrollingMode = GridColumnOptions.ScrollingModeStandard, - LoadPanelEnabled = "auto", - LoadPanelText = "Loading..." - }), - EditingOptionJson = JsonSerializer.Serialize(new GridEditingDto - { - Popup = new GridEditingPopupDto() + }), + PagerOptionJson = JsonSerializer.Serialize(new GridPagerOptionDto { - Title = "Chart Form", - Width = 600, - Height = 300 - }, - AllowDeleting = true, - AllowAdding = true, - AllowUpdating = true, - SendOnlyChangedFormValuesUpdate = false, - }), - EditingFormJson = JsonSerializer.Serialize(new List() { + Visible = true, + AllowedPageSizes = "10,20,50,100", + ShowPageSizeSelector = true, + ShowNavigationButtons = true, + ShowInfo = false, + InfoText = "Page {0} of {1} ({2} items)", + DisplayMode = GridColumnOptions.PagerDisplayModeAdaptive, + ScrollingMode = GridColumnOptions.ScrollingModeStandard, + LoadPanelEnabled = "auto", + LoadPanelText = "Loading..." + }), + EditingOptionJson = JsonSerializer.Serialize(new GridEditingDto + { + Popup = new GridEditingPopupDto() + { + Title = "Chart Form", + Width = 600, + Height = 300 + }, + AllowDeleting = true, + AllowAdding = true, + AllowUpdating = true, + SendOnlyChangedFormValuesUpdate = false, + }), + EditingFormJson = JsonSerializer.Serialize(new List() { //Items=["ChartCode","CultureName","UserId","RoleId"] } new EditingFormDto() { Order=1,ColCount=1,ColSpan=2,ItemType="group", Items= [ @@ -4554,8 +4583,8 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency ] } - }), - InsertFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { + }), + InsertFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { new FieldsDefaultValue() { FieldName = "CreationTime", FieldDbType = DbType.DateTime, @@ -4571,8 +4600,8 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency FieldDbType = DbType.Boolean, Value = "false", CustomValueType = FieldCustomValueTypeEnum.Value } - }), - CommandColumnJson = JsonSerializer.Serialize(new CommandColumnDto[] { + }), + CommandColumnJson = JsonSerializer.Serialize(new CommandColumnDto[] { new() { Hint = "Manage Chart", Text ="Manage", @@ -4587,12 +4616,12 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency AuthName=AppCodes.Listforms.Chart, Url="/chart/@ChartCode" } - }), - } - ); + }), + } + ); - #region Chart Fields - await _listFormFieldRepository.InsertManyAsync(new ListFormField[] { + #region Chart Fields + await _listFormFieldRepository.InsertManyAsync(new ListFormField[] { new ListFormField { ListFormCode = listFormCharts.ListFormCode, @@ -4758,64 +4787,67 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency }) } }); + #endregion + } #endregion - #endregion - - #region Data Sources - var listFormDataSources = await _listFormRepository.InsertAsync( - new ListForm() - { - CultureName = LanguageCodes.En, - ListFormCode = ListFormCodes.DataSource, - Name = AppCodes.Listforms.DataSource, - Title = AppCodes.Listforms.DataSource, - DataSourceCode = SeedConsts.DataSources.DefaultCode, - IsTenant = false, - IsOrganizationUnit = false, - Description = AppCodes.Listforms.DataSource, - SelectCommandType = SelectCommandTypeEnum.Table, - SelectCommand = DbTablePrefix + "DataSource", - KeyFieldName = "Id", - KeyFieldDbSourceType = DbType.Guid, - DefaultFilter = "\"IsDeleted\" = 'false'", - SortMode = GridOptions.SortModeSingle, - FilterRowJson = JsonSerializer.Serialize(new GridFilterRowDto + #region Data Source + if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.DataSource)) + { + var listFormDataSources = await _listFormRepository.InsertAsync( + new ListForm() { - Visible = true - }), - HeaderFilterJson = JsonSerializer.Serialize(new - { - Visible = true - }), - SearchPanelJson = JsonSerializer.Serialize(new - { - Visible = true - }), - GroupPanelJson = JsonSerializer.Serialize(new - { - Visible = true - }), - SelectionJson = JsonSerializer.Serialize(new SelectionDto - { - Mode = GridOptions.SelectionModeSingle, - AllowSelectAll = false - }), - ColumnOptionJson = JsonSerializer.Serialize(new - { - ColumnFixingEnabled = true, - ColumnChooserEnabled = true - }), - PermissionJson = JsonSerializer.Serialize(new PermissionCrudDto - { - C = AppCodes.Listforms.DataSource + ".Create", - R = AppCodes.Listforms.DataSource, - U = AppCodes.Listforms.DataSource + ".Update", - D = AppCodes.Listforms.DataSource + ".Delete", - E = AppCodes.Listforms.DataSource + ".Export", - }), - DeleteCommand = $"UPDATE \"{DbTablePrefix}DataSource\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", - DeleteFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { + CultureName = LanguageCodes.En, + ListFormCode = ListFormCodes.Lists.DataSource, + Name = AppCodes.Listforms.DataSource, + Title = AppCodes.Listforms.DataSource, + DataSourceCode = SeedConsts.DataSources.DefaultCode, + IsTenant = false, + IsBranch = false, + IsOrganizationUnit = false, + Description = AppCodes.Listforms.DataSource, + SelectCommandType = SelectCommandTypeEnum.Table, + SelectCommand = DbTablePrefix + "DataSource", + KeyFieldName = "Id", + KeyFieldDbSourceType = DbType.Guid, + DefaultFilter = "\"IsDeleted\" = 'false'", + SortMode = GridOptions.SortModeSingle, + FilterRowJson = JsonSerializer.Serialize(new GridFilterRowDto + { + Visible = true + }), + HeaderFilterJson = JsonSerializer.Serialize(new + { + Visible = true + }), + SearchPanelJson = JsonSerializer.Serialize(new + { + Visible = true + }), + GroupPanelJson = JsonSerializer.Serialize(new + { + Visible = true + }), + SelectionJson = JsonSerializer.Serialize(new SelectionDto + { + Mode = GridOptions.SelectionModeSingle, + AllowSelectAll = false + }), + ColumnOptionJson = JsonSerializer.Serialize(new + { + ColumnFixingEnabled = true, + ColumnChooserEnabled = true + }), + PermissionJson = JsonSerializer.Serialize(new PermissionCrudDto + { + C = AppCodes.Listforms.DataSource + ".Create", + R = AppCodes.Listforms.DataSource, + U = AppCodes.Listforms.DataSource + ".Update", + D = AppCodes.Listforms.DataSource + ".Delete", + E = AppCodes.Listforms.DataSource + ".Export", + }), + DeleteCommand = $"UPDATE \"{DbTablePrefix}DataSource\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", + DeleteFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { new FieldsDefaultValue() { FieldName = "DeleterId", FieldDbType = DbType.Guid, @@ -4826,34 +4858,34 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency FieldDbType = DbType.Guid, Value = "@ID", CustomValueType = FieldCustomValueTypeEnum.CustomKey } - }), - PagerOptionJson = JsonSerializer.Serialize(new GridPagerOptionDto - { - Visible = true, - AllowedPageSizes = "10,20,50,100", - ShowPageSizeSelector = true, - ShowNavigationButtons = true, - ShowInfo = false, - InfoText = "Page {0} of {1} ({2} items)", - DisplayMode = GridColumnOptions.PagerDisplayModeAdaptive, - ScrollingMode = GridColumnOptions.ScrollingModeStandard, - LoadPanelEnabled = "auto", - LoadPanelText = "Loading..." - }), - EditingOptionJson = JsonSerializer.Serialize(new GridEditingDto - { - Popup = new GridEditingPopupDto() + }), + PagerOptionJson = JsonSerializer.Serialize(new GridPagerOptionDto { - Title = "Data Source Form", - Width = 800, - Height = 500 - }, - AllowDeleting = true, - AllowAdding = true, - AllowUpdating = true, - SendOnlyChangedFormValuesUpdate = false, - }), - EditingFormJson = JsonSerializer.Serialize(new List() { + Visible = true, + AllowedPageSizes = "10,20,50,100", + ShowPageSizeSelector = true, + ShowNavigationButtons = true, + ShowInfo = false, + InfoText = "Page {0} of {1} ({2} items)", + DisplayMode = GridColumnOptions.PagerDisplayModeAdaptive, + ScrollingMode = GridColumnOptions.ScrollingModeStandard, + LoadPanelEnabled = "auto", + LoadPanelText = "Loading..." + }), + EditingOptionJson = JsonSerializer.Serialize(new GridEditingDto + { + Popup = new GridEditingPopupDto() + { + Title = "Data Source Form", + Width = 800, + Height = 500 + }, + AllowDeleting = true, + AllowAdding = true, + AllowUpdating = true, + SendOnlyChangedFormValuesUpdate = false, + }), + EditingFormJson = JsonSerializer.Serialize(new List() { //Items=["Code","DataSourceType","ConnectionString"] } new() { Order=1,ColCount=1,ColSpan=2,ItemType="group", Items= [ @@ -4862,8 +4894,8 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency new EditingFormItemDto { Order = 3, DataField = "ConnectionString", ColSpan = 2, IsRequired = false, EditorType2=EditorTypes.dxTextArea, EditorOptions="{\"height\":200}" }, ] } - }), - InsertFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { + }), + InsertFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { new FieldsDefaultValue() { FieldName = "CreationTime", FieldDbType = DbType.DateTime, @@ -4874,12 +4906,12 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency FieldDbType = DbType.Guid, Value = "@USERID", CustomValueType = FieldCustomValueTypeEnum.CustomKey } - }), - } - ); + }), + } + ); - #region Data Source Fields - await _listFormFieldRepository.InsertManyAsync(new ListFormField[] { + #region Data Source Fields + await _listFormFieldRepository.InsertManyAsync(new ListFormField[] { new ListFormField { ListFormCode = listFormDataSources.ListFormCode, @@ -5004,58 +5036,61 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency }) }, }); - #endregion - + #endregion + } #endregion #region Background Worker var configurationSection = _configuration.GetSection("OpenIddict:Applications"); var swaggerRootUrl = configurationSection["Platform_Swagger:RootUrl"]?.TrimEnd('/'); - var listFormBackgroundWorkers = await _listFormRepository.InsertAsync( - new ListForm() - { - CultureName = LanguageCodes.En, - ListFormCode = ListFormCodes.BackgroundWorker, - Name = AppCodes.BackgroundWorkers, - Title = AppCodes.BackgroundWorkers, - DataSourceCode = SeedConsts.DataSources.DefaultCode, - IsTenant = false, - IsOrganizationUnit = false, - Description = AppCodes.BackgroundWorkers, - SelectCommandType = SelectCommandTypeEnum.Table, - SelectCommand = DbTablePrefix + "BackgroundWorker", - KeyFieldName = "Id", - KeyFieldDbSourceType = DbType.Guid, - DefaultFilter = "\"IsDeleted\" = 'false'", - SortMode = GridOptions.SortModeSingle, - FilterRowJson = JsonSerializer.Serialize(new GridFilterRowDto + if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.BackgroundWorker)) + { + var listFormBackgroundWorkers = await _listFormRepository.InsertAsync( + new ListForm() { - Visible = true - }), - HeaderFilterJson = JsonSerializer.Serialize(new - { - Visible = true - }), - SearchPanelJson = JsonSerializer.Serialize(new - { - Visible = true - }), - GroupPanelJson = JsonSerializer.Serialize(new - { - Visible = true - }), - SelectionJson = JsonSerializer.Serialize(new SelectionDto - { - Mode = GridOptions.SelectionModeSingle, - AllowSelectAll = false - }), - ColumnOptionJson = JsonSerializer.Serialize(new - { - ColumnFixingEnabled = true, - ColumnChooserEnabled = true - }), - CommandColumnJson = JsonSerializer.Serialize(new CommandColumnDto[] { + CultureName = LanguageCodes.En, + ListFormCode = ListFormCodes.Lists.BackgroundWorker, + Name = AppCodes.BackgroundWorkers, + Title = AppCodes.BackgroundWorkers, + DataSourceCode = SeedConsts.DataSources.DefaultCode, + IsTenant = false, + IsBranch = false, + IsOrganizationUnit = false, + Description = AppCodes.BackgroundWorkers, + SelectCommandType = SelectCommandTypeEnum.Table, + SelectCommand = DbTablePrefix + "BackgroundWorker", + KeyFieldName = "Id", + KeyFieldDbSourceType = DbType.Guid, + DefaultFilter = "\"IsDeleted\" = 'false'", + SortMode = GridOptions.SortModeSingle, + FilterRowJson = JsonSerializer.Serialize(new GridFilterRowDto + { + Visible = true + }), + HeaderFilterJson = JsonSerializer.Serialize(new + { + Visible = true + }), + SearchPanelJson = JsonSerializer.Serialize(new + { + Visible = true + }), + GroupPanelJson = JsonSerializer.Serialize(new + { + Visible = true + }), + SelectionJson = JsonSerializer.Serialize(new SelectionDto + { + Mode = GridOptions.SelectionModeSingle, + AllowSelectAll = false + }), + ColumnOptionJson = JsonSerializer.Serialize(new + { + ColumnFixingEnabled = true, + ColumnChooserEnabled = true + }), + CommandColumnJson = JsonSerializer.Serialize(new CommandColumnDto[] { new() { ButtonPosition= UiCommandButtonPositionTypeEnum.Toolbar, Hint = "Hangfire Login", @@ -5077,17 +5112,17 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency AuthName=AppCodes.BackgroundWorkers, OnClick="UiEvalService.ApiGenerateBackgroundWorkers();" }, - }), - PermissionJson = JsonSerializer.Serialize(new PermissionCrudDto - { - C = AppCodes.BackgroundWorkers + ".Create", - R = AppCodes.BackgroundWorkers, - U = AppCodes.BackgroundWorkers + ".Update", - D = AppCodes.BackgroundWorkers + ".Delete", - E = AppCodes.BackgroundWorkers + ".Export", - }), - DeleteCommand = $"UPDATE \"{DbTablePrefix}BackgroundWorker\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", - DeleteFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { + }), + PermissionJson = JsonSerializer.Serialize(new PermissionCrudDto + { + C = AppCodes.BackgroundWorkers + ".Create", + R = AppCodes.BackgroundWorkers, + U = AppCodes.BackgroundWorkers + ".Update", + D = AppCodes.BackgroundWorkers + ".Delete", + E = AppCodes.BackgroundWorkers + ".Export", + }), + DeleteCommand = $"UPDATE \"{DbTablePrefix}BackgroundWorker\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", + DeleteFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { new FieldsDefaultValue() { FieldName = "DeleterId", FieldDbType = DbType.Guid, @@ -5098,34 +5133,34 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency FieldDbType = DbType.Guid, Value = "@ID", CustomValueType = FieldCustomValueTypeEnum.CustomKey } - }), - PagerOptionJson = JsonSerializer.Serialize(new GridPagerOptionDto - { - Visible = true, - AllowedPageSizes = "10,20,50,100", - ShowPageSizeSelector = true, - ShowNavigationButtons = true, - ShowInfo = false, - InfoText = "Page {0} of {1} ({2} items)", - DisplayMode = GridColumnOptions.PagerDisplayModeAdaptive, - ScrollingMode = GridColumnOptions.ScrollingModeStandard, - LoadPanelEnabled = "auto", - LoadPanelText = "Loading..." - }), - EditingOptionJson = JsonSerializer.Serialize(new GridEditingDto - { - Popup = new GridEditingPopupDto() + }), + PagerOptionJson = JsonSerializer.Serialize(new GridPagerOptionDto { - Title = "Background Worker Form", - Width = 800, - Height = 500 - }, - AllowDeleting = true, - AllowAdding = true, - AllowUpdating = true, - SendOnlyChangedFormValuesUpdate = false, - }), - EditingFormJson = JsonSerializer.Serialize(new List() { + Visible = true, + AllowedPageSizes = "10,20,50,100", + ShowPageSizeSelector = true, + ShowNavigationButtons = true, + ShowInfo = false, + InfoText = "Page {0} of {1} ({2} items)", + DisplayMode = GridColumnOptions.PagerDisplayModeAdaptive, + ScrollingMode = GridColumnOptions.ScrollingModeStandard, + LoadPanelEnabled = "auto", + LoadPanelText = "Loading..." + }), + EditingOptionJson = JsonSerializer.Serialize(new GridEditingDto + { + Popup = new GridEditingPopupDto() + { + Title = "Background Worker Form", + Width = 800, + Height = 500 + }, + AllowDeleting = true, + AllowAdding = true, + AllowUpdating = true, + SendOnlyChangedFormValuesUpdate = false, + }), + EditingFormJson = JsonSerializer.Serialize(new List() { //Items= new EditingFormItemDto[] { } } //Items=["Name", "Cron", "WorkerType", "BeforeSp", "AfterSp", "Options", "IsActive"] } new() { Order=1,ColCount=1,ColSpan=2,ItemType="group",Items= [ @@ -5145,8 +5180,8 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency new EditingFormItemDto { Order = 4, DataField = "Options:Tablo", ColSpan = 2, IsRequired = false, EditorType2=EditorTypes.dxTextBox }, ] } - }), - InsertFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { + }), + InsertFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { new FieldsDefaultValue() { FieldName = "CreationTime", FieldDbType = DbType.DateTime, @@ -5157,19 +5192,19 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency FieldDbType = DbType.Guid, Value = "@USERID", CustomValueType = FieldCustomValueTypeEnum.CustomKey } - }), - FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { + }), + FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { new FieldsDefaultValue() { FieldName = "IsActive", FieldDbType = DbType.Boolean, Value = "true", CustomValueType = FieldCustomValueTypeEnum.Value } - }) - } - ); + }) + } + ); - #region Background Worker Fields - await _listFormFieldRepository.InsertManyAsync(new ListFormField[] { + #region Background Worker Fields + await _listFormFieldRepository.InsertManyAsync(new ListFormField[] { new() { ListFormCode = listFormBackgroundWorkers.ListFormCode, RoleId = null, @@ -5398,64 +5433,67 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency }) }, }); + #endregion + } #endregion - #endregion - - #region Notification Rules - var listFormNotificationRules = await _listFormRepository.InsertAsync( - new ListForm() - { - CultureName = LanguageCodes.En, - ListFormCode = ListFormCodes.NotificationRule, - Name = AppCodes.Notifications.NotificationRules, - Title = AppCodes.Notifications.NotificationRules, - DataSourceCode = SeedConsts.DataSources.DefaultCode, - IsTenant = false, - IsOrganizationUnit = false, - Description = AppCodes.Notifications.NotificationRules, - SelectCommandType = SelectCommandTypeEnum.Table, - SelectCommand = DbTablePrefix + "NotificationRule", - KeyFieldName = "Id", - KeyFieldDbSourceType = DbType.Guid, - DefaultFilter = "\"IsDeleted\" = 'false'", - SortMode = GridOptions.SortModeSingle, - FilterRowJson = JsonSerializer.Serialize(new GridFilterRowDto + #region Notification Rule + if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.NotificationRule)) + { + var listFormNotificationRules = await _listFormRepository.InsertAsync( + new ListForm() { - Visible = true - }), - HeaderFilterJson = JsonSerializer.Serialize(new - { - Visible = true - }), - SearchPanelJson = JsonSerializer.Serialize(new - { - Visible = true - }), - GroupPanelJson = JsonSerializer.Serialize(new - { - Visible = true - }), - SelectionJson = JsonSerializer.Serialize(new SelectionDto - { - Mode = GridOptions.SelectionModeSingle, - AllowSelectAll = false - }), - ColumnOptionJson = JsonSerializer.Serialize(new - { - ColumnFixingEnabled = true, - ColumnChooserEnabled = true - }), - PermissionJson = JsonSerializer.Serialize(new PermissionCrudDto - { - C = AppCodes.Notifications.NotificationRules + ".Create", - R = AppCodes.Notifications.NotificationRules, - U = AppCodes.Notifications.NotificationRules + ".Update", - D = AppCodes.Notifications.NotificationRules + ".Delete", - E = AppCodes.Notifications.NotificationRules + ".Export", - }), - DeleteCommand = $"UPDATE \"{DbTablePrefix}NotificationRule\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", - DeleteFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { + CultureName = LanguageCodes.En, + ListFormCode = ListFormCodes.Lists.NotificationRule, + Name = AppCodes.Notifications.NotificationRules, + Title = AppCodes.Notifications.NotificationRules, + DataSourceCode = SeedConsts.DataSources.DefaultCode, + IsTenant = false, + IsBranch = false, + IsOrganizationUnit = false, + Description = AppCodes.Notifications.NotificationRules, + SelectCommandType = SelectCommandTypeEnum.Table, + SelectCommand = DbTablePrefix + "NotificationRule", + KeyFieldName = "Id", + KeyFieldDbSourceType = DbType.Guid, + DefaultFilter = "\"IsDeleted\" = 'false'", + SortMode = GridOptions.SortModeSingle, + FilterRowJson = JsonSerializer.Serialize(new GridFilterRowDto + { + Visible = true + }), + HeaderFilterJson = JsonSerializer.Serialize(new + { + Visible = true + }), + SearchPanelJson = JsonSerializer.Serialize(new + { + Visible = true + }), + GroupPanelJson = JsonSerializer.Serialize(new + { + Visible = true + }), + SelectionJson = JsonSerializer.Serialize(new SelectionDto + { + Mode = GridOptions.SelectionModeSingle, + AllowSelectAll = false + }), + ColumnOptionJson = JsonSerializer.Serialize(new + { + ColumnFixingEnabled = true, + ColumnChooserEnabled = true + }), + PermissionJson = JsonSerializer.Serialize(new PermissionCrudDto + { + C = AppCodes.Notifications.NotificationRules + ".Create", + R = AppCodes.Notifications.NotificationRules, + U = AppCodes.Notifications.NotificationRules + ".Update", + D = AppCodes.Notifications.NotificationRules + ".Delete", + E = AppCodes.Notifications.NotificationRules + ".Export", + }), + DeleteCommand = $"UPDATE \"{DbTablePrefix}NotificationRule\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", + DeleteFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { new FieldsDefaultValue() { FieldName = "DeleterId", FieldDbType = DbType.Guid, @@ -5466,34 +5504,34 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency FieldDbType = DbType.Guid, Value = "@ID", CustomValueType = FieldCustomValueTypeEnum.CustomKey } - }), - PagerOptionJson = JsonSerializer.Serialize(new GridPagerOptionDto - { - Visible = true, - AllowedPageSizes = "10,20,50,100", - ShowPageSizeSelector = true, - ShowNavigationButtons = true, - ShowInfo = false, - InfoText = "Page {0} of {1} ({2} items)", - DisplayMode = GridColumnOptions.PagerDisplayModeAdaptive, - ScrollingMode = GridColumnOptions.ScrollingModeStandard, - LoadPanelEnabled = "auto", - LoadPanelText = "Loading..." - }), - EditingOptionJson = JsonSerializer.Serialize(new GridEditingDto - { - Popup = new GridEditingPopupDto() + }), + PagerOptionJson = JsonSerializer.Serialize(new GridPagerOptionDto { - Title = "Notification Rule Form", - Width = 800, - Height = 500 - }, - AllowDeleting = true, - AllowAdding = true, - AllowUpdating = true, - SendOnlyChangedFormValuesUpdate = false, - }), - EditingFormJson = JsonSerializer.Serialize(new List() { + Visible = true, + AllowedPageSizes = "10,20,50,100", + ShowPageSizeSelector = true, + ShowNavigationButtons = true, + ShowInfo = false, + InfoText = "Page {0} of {1} ({2} items)", + DisplayMode = GridColumnOptions.PagerDisplayModeAdaptive, + ScrollingMode = GridColumnOptions.ScrollingModeStandard, + LoadPanelEnabled = "auto", + LoadPanelText = "Loading..." + }), + EditingOptionJson = JsonSerializer.Serialize(new GridEditingDto + { + Popup = new GridEditingPopupDto() + { + Title = "Notification Rule Form", + Width = 800, + Height = 500 + }, + AllowDeleting = true, + AllowAdding = true, + AllowUpdating = true, + SendOnlyChangedFormValuesUpdate = false, + }), + EditingFormJson = JsonSerializer.Serialize(new List() { new() { Order=1,ColCount=1,ColSpan=2,ItemType="group", Items= [ new EditingFormItemDto { Order = 1, DataField = "NotificationType", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxSelectBox, EditorOptions="{ \"showClearButton\" : true }" }, @@ -5505,8 +5543,8 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency new EditingFormItemDto { Order = 7, DataField = "IsCustomized", ColSpan = 2, IsRequired = false, EditorType2=EditorTypes.dxCheckBox }, ] } - }), - InsertFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { + }), + InsertFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { new() { FieldName = "CreationTime", FieldDbType = DbType.DateTime, @@ -5517,8 +5555,8 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency FieldDbType = DbType.Guid, Value = "@USERID", CustomValueType = FieldCustomValueTypeEnum.CustomKey }, - }), - FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { + }), + FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { new() { FieldName = "IsActive", FieldDbType = DbType.Boolean, @@ -5534,8 +5572,8 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency FieldDbType = DbType.Boolean, Value = "false", CustomValueType = FieldCustomValueTypeEnum.Value } - }), - CommandColumnJson = JsonSerializer.Serialize(new CommandColumnDto[] { + }), + CommandColumnJson = JsonSerializer.Serialize(new CommandColumnDto[] { new CommandColumnDto() { Hint = "Create", Text = "Create", @@ -5546,13 +5584,13 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency id = "@Id" }) }, - }), - } - ); + }), + } + ); - #region Notification Rule Fields - await _listFormFieldRepository.InsertManyAsync([ - new ListFormField + #region Notification Rule Fields + await _listFormFieldRepository.InsertManyAsync([ + new ListFormField { ListFormCode = listFormNotificationRules.ListFormCode, RoleId = null, @@ -5805,64 +5843,67 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency }) }, ]); + #endregion + } #endregion - #endregion - - #region Notifications - var listFormNotifications = await _listFormRepository.InsertAsync( - new ListForm() - { - CultureName = LanguageCodes.En, - ListFormCode = ListFormCodes.Notification, - Name = AppCodes.Notifications.Notification, - Title = AppCodes.Notifications.Notification, - DataSourceCode = SeedConsts.DataSources.DefaultCode, - IsTenant = false, - IsOrganizationUnit = false, - Description = AppCodes.Notifications.Notification, - SelectCommandType = SelectCommandTypeEnum.Table, - SelectCommand = DbTablePrefix + "Notification", - KeyFieldName = "Id", - KeyFieldDbSourceType = DbType.Guid, - DefaultFilter = "\"IsDeleted\" = 'false'", - SortMode = GridOptions.SortModeSingle, - FilterRowJson = JsonSerializer.Serialize(new GridFilterRowDto + #region Notification + if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.Notification)) + { + var listFormNotifications = await _listFormRepository.InsertAsync( + new ListForm() { - Visible = true - }), - HeaderFilterJson = JsonSerializer.Serialize(new - { - Visible = true - }), - SearchPanelJson = JsonSerializer.Serialize(new - { - Visible = true - }), - GroupPanelJson = JsonSerializer.Serialize(new - { - Visible = true - }), - SelectionJson = JsonSerializer.Serialize(new SelectionDto - { - Mode = GridOptions.SelectionModeSingle, - AllowSelectAll = false - }), - ColumnOptionJson = JsonSerializer.Serialize(new - { - ColumnFixingEnabled = true, - ColumnChooserEnabled = true - }), - PermissionJson = JsonSerializer.Serialize(new PermissionCrudDto - { - C = AppCodes.Notifications.Notification + ".Create", - R = AppCodes.Notifications.Notification, - U = AppCodes.Notifications.Notification + ".Update", - D = AppCodes.Notifications.Notification + ".Delete", - E = AppCodes.Notifications.Notification + ".Export", - }), - DeleteCommand = $"UPDATE \"{DbTablePrefix}Notification\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", - DeleteFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { + CultureName = LanguageCodes.En, + ListFormCode = ListFormCodes.Lists.Notification, + Name = AppCodes.Notifications.Notification, + Title = AppCodes.Notifications.Notification, + DataSourceCode = SeedConsts.DataSources.DefaultCode, + IsTenant = false, + IsBranch = false, + IsOrganizationUnit = false, + Description = AppCodes.Notifications.Notification, + SelectCommandType = SelectCommandTypeEnum.Table, + SelectCommand = DbTablePrefix + "Notification", + KeyFieldName = "Id", + KeyFieldDbSourceType = DbType.Guid, + DefaultFilter = "\"IsDeleted\" = 'false'", + SortMode = GridOptions.SortModeSingle, + FilterRowJson = JsonSerializer.Serialize(new GridFilterRowDto + { + Visible = true + }), + HeaderFilterJson = JsonSerializer.Serialize(new + { + Visible = true + }), + SearchPanelJson = JsonSerializer.Serialize(new + { + Visible = true + }), + GroupPanelJson = JsonSerializer.Serialize(new + { + Visible = true + }), + SelectionJson = JsonSerializer.Serialize(new SelectionDto + { + Mode = GridOptions.SelectionModeSingle, + AllowSelectAll = false + }), + ColumnOptionJson = JsonSerializer.Serialize(new + { + ColumnFixingEnabled = true, + ColumnChooserEnabled = true + }), + PermissionJson = JsonSerializer.Serialize(new PermissionCrudDto + { + C = AppCodes.Notifications.Notification + ".Create", + R = AppCodes.Notifications.Notification, + U = AppCodes.Notifications.Notification + ".Update", + D = AppCodes.Notifications.Notification + ".Delete", + E = AppCodes.Notifications.Notification + ".Export", + }), + DeleteCommand = $"UPDATE \"{DbTablePrefix}Notification\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", + DeleteFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { new FieldsDefaultValue() { FieldName = "DeleterId", FieldDbType = DbType.Guid, @@ -5873,33 +5914,33 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency FieldDbType = DbType.Guid, Value = "@ID", CustomValueType = FieldCustomValueTypeEnum.CustomKey } - }), - PagerOptionJson = JsonSerializer.Serialize(new GridPagerOptionDto - { - Visible = true, - AllowedPageSizes = "10,20,50,100", - ShowPageSizeSelector = true, - ShowNavigationButtons = true, - ShowInfo = false, - InfoText = "Page {0} of {1} ({2} items)", - DisplayMode = GridColumnOptions.PagerDisplayModeAdaptive, - ScrollingMode = GridColumnOptions.ScrollingModeStandard, - LoadPanelEnabled = "auto", - LoadPanelText = "Loading..." - }), - EditingOptionJson = JsonSerializer.Serialize(new GridEditingDto - { - AllowDeleting = false, - AllowAdding = false, - AllowUpdating = false, - SendOnlyChangedFormValuesUpdate = false, - }) - } - ); + }), + PagerOptionJson = JsonSerializer.Serialize(new GridPagerOptionDto + { + Visible = true, + AllowedPageSizes = "10,20,50,100", + ShowPageSizeSelector = true, + ShowNavigationButtons = true, + ShowInfo = false, + InfoText = "Page {0} of {1} ({2} items)", + DisplayMode = GridColumnOptions.PagerDisplayModeAdaptive, + ScrollingMode = GridColumnOptions.ScrollingModeStandard, + LoadPanelEnabled = "auto", + LoadPanelText = "Loading..." + }), + EditingOptionJson = JsonSerializer.Serialize(new GridEditingDto + { + AllowDeleting = false, + AllowAdding = false, + AllowUpdating = false, + SendOnlyChangedFormValuesUpdate = false, + }) + } + ); - #region Notification Fields - await _listFormFieldRepository.InsertManyAsync([ - new ListFormField + #region Notification Fields + await _listFormFieldRepository.InsertManyAsync([ + new ListFormField { ListFormCode = listFormNotifications.ListFormCode, RoleId = null, @@ -6136,64 +6177,67 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency }) }, ]); - #endregion - + #endregion + } #endregion #region Ip Restriction - var listFormIpRestrictions = await _listFormRepository.InsertAsync( - new ListForm() - { - CultureName = LanguageCodes.En, - ListFormCode = ListFormCodes.IpRestriction, - Name = AppCodes.IpRestrictions, - Title = AppCodes.IpRestrictions, - DataSourceCode = SeedConsts.DataSources.DefaultCode, - IsTenant = true, - IsOrganizationUnit = false, - Description = AppCodes.IpRestrictions, - SelectCommandType = SelectCommandTypeEnum.Table, - SelectCommand = DbTablePrefix + "IpRestriction", - KeyFieldName = "Id", - KeyFieldDbSourceType = DbType.Guid, - DefaultFilter = "\"IsDeleted\" = 'false'", - SortMode = GridOptions.SortModeSingle, - FilterRowJson = JsonSerializer.Serialize(new GridFilterRowDto + if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.IpRestriction)) + { + var listFormIpRestrictions = await _listFormRepository.InsertAsync( + new ListForm() { - Visible = true - }), - HeaderFilterJson = JsonSerializer.Serialize(new - { - Visible = true - }), - SearchPanelJson = JsonSerializer.Serialize(new - { - Visible = true - }), - GroupPanelJson = JsonSerializer.Serialize(new - { - Visible = true - }), - SelectionJson = JsonSerializer.Serialize(new SelectionDto - { - Mode = GridOptions.SelectionModeSingle, - AllowSelectAll = false - }), - ColumnOptionJson = JsonSerializer.Serialize(new - { - ColumnFixingEnabled = true, - ColumnChooserEnabled = true - }), - PermissionJson = JsonSerializer.Serialize(new PermissionCrudDto - { - C = AppCodes.IpRestrictions + ".Create", - R = AppCodes.IpRestrictions, - U = AppCodes.IpRestrictions + ".Update", - D = AppCodes.IpRestrictions + ".Delete", - E = AppCodes.IpRestrictions + ".Export", - }), - DeleteCommand = $"UPDATE \"{DbTablePrefix}IpRestriction\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", - DeleteFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { + CultureName = LanguageCodes.En, + ListFormCode = ListFormCodes.Lists.IpRestriction, + Name = AppCodes.IpRestrictions, + Title = AppCodes.IpRestrictions, + DataSourceCode = SeedConsts.DataSources.DefaultCode, + IsTenant = true, + IsBranch = false, + IsOrganizationUnit = false, + Description = AppCodes.IpRestrictions, + SelectCommandType = SelectCommandTypeEnum.Table, + SelectCommand = DbTablePrefix + "IpRestriction", + KeyFieldName = "Id", + KeyFieldDbSourceType = DbType.Guid, + DefaultFilter = "\"IsDeleted\" = 'false'", + SortMode = GridOptions.SortModeSingle, + FilterRowJson = JsonSerializer.Serialize(new GridFilterRowDto + { + Visible = true + }), + HeaderFilterJson = JsonSerializer.Serialize(new + { + Visible = true + }), + SearchPanelJson = JsonSerializer.Serialize(new + { + Visible = true + }), + GroupPanelJson = JsonSerializer.Serialize(new + { + Visible = true + }), + SelectionJson = JsonSerializer.Serialize(new SelectionDto + { + Mode = GridOptions.SelectionModeSingle, + AllowSelectAll = false + }), + ColumnOptionJson = JsonSerializer.Serialize(new + { + ColumnFixingEnabled = true, + ColumnChooserEnabled = true + }), + PermissionJson = JsonSerializer.Serialize(new PermissionCrudDto + { + C = AppCodes.IpRestrictions + ".Create", + R = AppCodes.IpRestrictions, + U = AppCodes.IpRestrictions + ".Update", + D = AppCodes.IpRestrictions + ".Delete", + E = AppCodes.IpRestrictions + ".Export", + }), + DeleteCommand = $"UPDATE \"{DbTablePrefix}IpRestriction\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", + DeleteFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { new FieldsDefaultValue() { FieldName = "DeleterId", FieldDbType = DbType.Guid, @@ -6204,34 +6248,34 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency FieldDbType = DbType.Guid, Value = "@ID", CustomValueType = FieldCustomValueTypeEnum.CustomKey } - }), - PagerOptionJson = JsonSerializer.Serialize(new GridPagerOptionDto - { - Visible = true, - AllowedPageSizes = "10,20,50,100", - ShowPageSizeSelector = true, - ShowNavigationButtons = true, - ShowInfo = false, - InfoText = "Page {0} of {1} ({2} items)", - DisplayMode = GridColumnOptions.PagerDisplayModeAdaptive, - ScrollingMode = GridColumnOptions.ScrollingModeStandard, - LoadPanelEnabled = "auto", - LoadPanelText = "Loading..." - }), - EditingOptionJson = JsonSerializer.Serialize(new GridEditingDto - { - Popup = new GridEditingPopupDto() + }), + PagerOptionJson = JsonSerializer.Serialize(new GridPagerOptionDto { - Title = "Ip Restriction Form", - Width = 800, - Height = 500 - }, - AllowDeleting = true, - AllowAdding = true, - AllowUpdating = true, - SendOnlyChangedFormValuesUpdate = false, - }), - EditingFormJson = JsonSerializer.Serialize(new List() { + Visible = true, + AllowedPageSizes = "10,20,50,100", + ShowPageSizeSelector = true, + ShowNavigationButtons = true, + ShowInfo = false, + InfoText = "Page {0} of {1} ({2} items)", + DisplayMode = GridColumnOptions.PagerDisplayModeAdaptive, + ScrollingMode = GridColumnOptions.ScrollingModeStandard, + LoadPanelEnabled = "auto", + LoadPanelText = "Loading..." + }), + EditingOptionJson = JsonSerializer.Serialize(new GridEditingDto + { + Popup = new GridEditingPopupDto() + { + Title = "Ip Restriction Form", + Width = 800, + Height = 500 + }, + AllowDeleting = true, + AllowAdding = true, + AllowUpdating = true, + SendOnlyChangedFormValuesUpdate = false, + }), + EditingFormJson = JsonSerializer.Serialize(new List() { new() { Order=1,ColCount=1,ColSpan=2,ItemType="group", Items= [ new EditingFormItemDto { Order = 1, DataField = "ResourceType", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxSelectBox, EditorOptions="{ \"showClearButton\" : true }" }, @@ -6239,8 +6283,8 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency new EditingFormItemDto { Order = 3, DataField = "IP", ColSpan = 2, IsRequired = false, EditorType2=EditorTypes.dxTextBox }, ] } - }), - InsertFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { + }), + InsertFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { new FieldsDefaultValue() { FieldName = "CreationTime", FieldDbType = DbType.DateTime, @@ -6251,13 +6295,13 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency FieldDbType = DbType.Guid, Value = "@USERID", CustomValueType = FieldCustomValueTypeEnum.CustomKey } - }), - } - ); + }), + } + ); - #region Ip Restriction Fields - await _listFormFieldRepository.InsertManyAsync([ - new() { + #region Ip Restriction Fields + await _listFormFieldRepository.InsertManyAsync([ + new() { ListFormCode = listFormIpRestrictions.ListFormCode, RoleId = null, UserId = null, @@ -6386,55 +6430,58 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency }) }, ]); + #endregion + } #endregion - #endregion - - #region Public Apis - var listFormPublicApis = await _listFormRepository.InsertAsync( - new ListForm() - { - CultureName = LanguageCodes.En, - ListFormCode = ListFormCodes.PublicApi, - Name = AppCodes.PublicApis, - Title = AppCodes.PublicApis, - DataSourceCode = SeedConsts.DataSources.DefaultCode, - IsTenant = false, - IsOrganizationUnit = false, - Description = AppCodes.PublicApis, - SelectCommandType = SelectCommandTypeEnum.Table, - SelectCommand = DbTablePrefix + "PublicApi", - KeyFieldName = "Id", - KeyFieldDbSourceType = DbType.Guid, - DefaultFilter = "\"IsDeleted\" = 'false'", - SortMode = GridOptions.SortModeSingle, - FilterRowJson = JsonSerializer.Serialize(new GridFilterRowDto + #region Public Api + if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.PublicApi)) + { + var listFormPublicApis = await _listFormRepository.InsertAsync( + new ListForm() { - Visible = true - }), - HeaderFilterJson = JsonSerializer.Serialize(new - { - Visible = true - }), - SearchPanelJson = JsonSerializer.Serialize(new - { - Visible = true - }), - GroupPanelJson = JsonSerializer.Serialize(new - { - Visible = true - }), - SelectionJson = JsonSerializer.Serialize(new SelectionDto - { - Mode = GridOptions.SelectionModeSingle, - AllowSelectAll = false - }), - ColumnOptionJson = JsonSerializer.Serialize(new - { - ColumnFixingEnabled = true, - ColumnChooserEnabled = true - }), - CommandColumnJson = JsonSerializer.Serialize(new CommandColumnDto[] { + CultureName = LanguageCodes.En, + ListFormCode = ListFormCodes.Lists.PublicApi, + Name = AppCodes.PublicApis, + Title = AppCodes.PublicApis, + DataSourceCode = SeedConsts.DataSources.DefaultCode, + IsTenant = false, + IsBranch = false, + IsOrganizationUnit = false, + Description = AppCodes.PublicApis, + SelectCommandType = SelectCommandTypeEnum.Table, + SelectCommand = DbTablePrefix + "PublicApi", + KeyFieldName = "Id", + KeyFieldDbSourceType = DbType.Guid, + DefaultFilter = "\"IsDeleted\" = 'false'", + SortMode = GridOptions.SortModeSingle, + FilterRowJson = JsonSerializer.Serialize(new GridFilterRowDto + { + Visible = true + }), + HeaderFilterJson = JsonSerializer.Serialize(new + { + Visible = true + }), + SearchPanelJson = JsonSerializer.Serialize(new + { + Visible = true + }), + GroupPanelJson = JsonSerializer.Serialize(new + { + Visible = true + }), + SelectionJson = JsonSerializer.Serialize(new SelectionDto + { + Mode = GridOptions.SelectionModeSingle, + AllowSelectAll = false + }), + ColumnOptionJson = JsonSerializer.Serialize(new + { + ColumnFixingEnabled = true, + ColumnChooserEnabled = true + }), + CommandColumnJson = JsonSerializer.Serialize(new CommandColumnDto[] { new() { ButtonPosition= UiCommandButtonPositionTypeEnum.Toolbar, Hint = "Swagger", @@ -6442,17 +6489,17 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency AuthName=AppCodes.PublicApis, Url= swaggerRootUrl + "/swagger/index.html", }, - }), - PermissionJson = JsonSerializer.Serialize(new PermissionCrudDto - { - C = AppCodes.PublicApis + ".Create", - R = AppCodes.PublicApis, - U = AppCodes.PublicApis + ".Update", - D = AppCodes.PublicApis + ".Delete", - E = AppCodes.PublicApis + ".Export", - }), - DeleteCommand = $"UPDATE \"{DbTablePrefix}PublicApi\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", - DeleteFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { + }), + PermissionJson = JsonSerializer.Serialize(new PermissionCrudDto + { + C = AppCodes.PublicApis + ".Create", + R = AppCodes.PublicApis, + U = AppCodes.PublicApis + ".Update", + D = AppCodes.PublicApis + ".Delete", + E = AppCodes.PublicApis + ".Export", + }), + DeleteCommand = $"UPDATE \"{DbTablePrefix}PublicApi\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", + DeleteFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { new() { FieldName = "DeleterId", FieldDbType = DbType.Guid, @@ -6463,34 +6510,34 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency FieldDbType = DbType.Guid, Value = "@ID", CustomValueType = FieldCustomValueTypeEnum.CustomKey } - }), - PagerOptionJson = JsonSerializer.Serialize(new GridPagerOptionDto - { - Visible = true, - AllowedPageSizes = "10,20,50,100", - ShowPageSizeSelector = true, - ShowNavigationButtons = true, - ShowInfo = false, - InfoText = "Page {0} of {1} ({2} items)", - DisplayMode = GridColumnOptions.PagerDisplayModeAdaptive, - ScrollingMode = GridColumnOptions.ScrollingModeStandard, - LoadPanelEnabled = "auto", - LoadPanelText = "Loading..." - }), - EditingOptionJson = JsonSerializer.Serialize(new GridEditingDto - { - Popup = new GridEditingPopupDto() + }), + PagerOptionJson = JsonSerializer.Serialize(new GridPagerOptionDto { - Title = "Public Api Form", - Width = 800, - Height = 500 - }, - AllowDeleting = true, - AllowAdding = true, - AllowUpdating = true, - SendOnlyChangedFormValuesUpdate = false, - }), - EditingFormJson = JsonSerializer.Serialize(new List() { + Visible = true, + AllowedPageSizes = "10,20,50,100", + ShowPageSizeSelector = true, + ShowNavigationButtons = true, + ShowInfo = false, + InfoText = "Page {0} of {1} ({2} items)", + DisplayMode = GridColumnOptions.PagerDisplayModeAdaptive, + ScrollingMode = GridColumnOptions.ScrollingModeStandard, + LoadPanelEnabled = "auto", + LoadPanelText = "Loading..." + }), + EditingOptionJson = JsonSerializer.Serialize(new GridEditingDto + { + Popup = new GridEditingPopupDto() + { + Title = "Public Api Form", + Width = 800, + Height = 500 + }, + AllowDeleting = true, + AllowAdding = true, + AllowUpdating = true, + SendOnlyChangedFormValuesUpdate = false, + }), + EditingFormJson = JsonSerializer.Serialize(new List() { new() { Order=1,ColCount=1,ColSpan=2,ItemType="group", Items= [ new EditingFormItemDto { Order = 1, DataField = "Name", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxTextBox }, @@ -6503,8 +6550,8 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency new EditingFormItemDto { Order = 8, DataField = "Description", ColSpan = 2, IsRequired = false, EditorType2=EditorTypes.dxTextArea }, ] } - }), - InsertFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { + }), + InsertFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { new FieldsDefaultValue() { FieldName = "CreationTime", FieldDbType = DbType.DateTime, @@ -6515,13 +6562,13 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency FieldDbType = DbType.Guid, Value = "@USERID", CustomValueType = FieldCustomValueTypeEnum.CustomKey } - }), - } - ); + }), + } + ); - #region Public Api Fields - await _listFormFieldRepository.InsertManyAsync([ - new() { + #region Public Api Fields + await _listFormFieldRepository.InsertManyAsync([ + new() { ListFormCode = listFormPublicApis.ListFormCode, RoleId = null, UserId = null, @@ -6777,89 +6824,92 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency }) }, ]); + #endregion + } #endregion - #endregion - - #region Permission Groups - var listFormPermissionGroups = await _listFormRepository.InsertAsync( - new ListForm() - { - CultureName = LanguageCodes.En, - ListFormCode = ListFormCodes.PermissionGroup, - Name = AbpIdentity.PermissionGroups.Default, - Title = AbpIdentity.PermissionGroups.Default, - DataSourceCode = SeedConsts.DataSources.DefaultCode, - IsTenant = false, - IsOrganizationUnit = false, - Description = AbpIdentity.PermissionGroups.Default, - SelectCommandType = SelectCommandTypeEnum.Table, - SelectCommand = "AbpPermissionGroups", - KeyFieldName = "Id", - KeyFieldDbSourceType = DbType.Guid, - SortMode = GridOptions.SortModeSingle, - FilterRowJson = JsonSerializer.Serialize(new GridFilterRowDto + #region Permission Group + if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.PermissionGroup)) + { + var listFormPermissionGroups = await _listFormRepository.InsertAsync( + new ListForm() { - Visible = true - }), - HeaderFilterJson = JsonSerializer.Serialize(new - { - Visible = true - }), - SearchPanelJson = JsonSerializer.Serialize(new - { - Visible = true - }), - GroupPanelJson = JsonSerializer.Serialize(new - { - Visible = true - }), - SelectionJson = JsonSerializer.Serialize(new SelectionDto - { - Mode = GridOptions.SelectionModeSingle, - AllowSelectAll = false - }), - ColumnOptionJson = JsonSerializer.Serialize(new - { - ColumnFixingEnabled = true, - ColumnChooserEnabled = true - }), - PermissionJson = JsonSerializer.Serialize(new PermissionCrudDto - { - C = AbpIdentity.PermissionGroups.Create, - R = AbpIdentity.PermissionGroups.Default, - U = AbpIdentity.PermissionGroups.Update, - D = AbpIdentity.PermissionGroups.Delete, - E = AbpIdentity.PermissionGroups.Export, - }), - PagerOptionJson = JsonSerializer.Serialize(new GridPagerOptionDto - { - Visible = true, - AllowedPageSizes = "10,20,50,100", - ShowPageSizeSelector = true, - ShowNavigationButtons = true, - ShowInfo = false, - InfoText = "Page {0} of {1} ({2} items)", - DisplayMode = GridColumnOptions.PagerDisplayModeAdaptive, - ScrollingMode = GridColumnOptions.ScrollingModeStandard, - LoadPanelEnabled = "auto", - LoadPanelText = "Loading..." - }), - EditingOptionJson = JsonSerializer.Serialize(new GridEditingDto - { - Popup = new GridEditingPopupDto() + CultureName = LanguageCodes.En, + ListFormCode = ListFormCodes.Lists.PermissionGroup, + Name = AbpIdentity.PermissionGroups.Default, + Title = AbpIdentity.PermissionGroups.Default, + DataSourceCode = SeedConsts.DataSources.DefaultCode, + IsTenant = false, + IsBranch = false, + IsOrganizationUnit = false, + Description = AbpIdentity.PermissionGroups.Default, + SelectCommandType = SelectCommandTypeEnum.Table, + SelectCommand = "AbpPermissionGroups", + KeyFieldName = "Id", + KeyFieldDbSourceType = DbType.Guid, + SortMode = GridOptions.SortModeSingle, + FilterRowJson = JsonSerializer.Serialize(new GridFilterRowDto + { + Visible = true + }), + HeaderFilterJson = JsonSerializer.Serialize(new + { + Visible = true + }), + SearchPanelJson = JsonSerializer.Serialize(new + { + Visible = true + }), + GroupPanelJson = JsonSerializer.Serialize(new + { + Visible = true + }), + SelectionJson = JsonSerializer.Serialize(new SelectionDto + { + Mode = GridOptions.SelectionModeSingle, + AllowSelectAll = false + }), + ColumnOptionJson = JsonSerializer.Serialize(new + { + ColumnFixingEnabled = true, + ColumnChooserEnabled = true + }), + PermissionJson = JsonSerializer.Serialize(new PermissionCrudDto + { + C = AbpIdentity.PermissionGroups.Create, + R = AbpIdentity.PermissionGroups.Default, + U = AbpIdentity.PermissionGroups.Update, + D = AbpIdentity.PermissionGroups.Delete, + E = AbpIdentity.PermissionGroups.Export, + }), + PagerOptionJson = JsonSerializer.Serialize(new GridPagerOptionDto + { + Visible = true, + AllowedPageSizes = "10,20,50,100", + ShowPageSizeSelector = true, + ShowNavigationButtons = true, + ShowInfo = false, + InfoText = "Page {0} of {1} ({2} items)", + DisplayMode = GridColumnOptions.PagerDisplayModeAdaptive, + ScrollingMode = GridColumnOptions.ScrollingModeStandard, + LoadPanelEnabled = "auto", + LoadPanelText = "Loading..." + }), + EditingOptionJson = JsonSerializer.Serialize(new GridEditingDto + { + Popup = new GridEditingPopupDto() + { + Title = "Permissio Groups Form", + Width = 800, + Height = 350 + }, + AllowDeleting = true, + AllowAdding = true, + AllowUpdating = true, + SendOnlyChangedFormValuesUpdate = false, + }), + EditingFormJson = JsonSerializer.Serialize(new List() { - Title = "Permissio Groups Form", - Width = 800, - Height = 350 - }, - AllowDeleting = true, - AllowAdding = true, - AllowUpdating = true, - SendOnlyChangedFormValuesUpdate = false, - }), - EditingFormJson = JsonSerializer.Serialize(new List() - { new() { Order=1, ColCount=1, ColSpan=2, ItemType="group", Items = [ new EditingFormItemDto { Order=1, DataField="Name", ColSpan=2, IsRequired=true, EditorType2=EditorTypes.dxTextBox }, @@ -6867,20 +6917,20 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency new EditingFormItemDto { Order=3, DataField="ExtraProperties", ColSpan=2, IsRequired=true, EditorType2=EditorTypes.dxTextBox }, ] } - }), - FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { + }), + FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { new FieldsDefaultValue() { FieldName = "ExtraProperties", FieldDbType = DbType.String, Value = "{}", CustomValueType = FieldCustomValueTypeEnum.Value }, - }) - } - ); + }) + } + ); - #region Permission Groups Fields - await _listFormFieldRepository.InsertManyAsync(new ListFormField[] - { + #region Permission Groups Fields + await _listFormFieldRepository.InsertManyAsync(new ListFormField[] + { new() { ListFormCode = listFormPermissionGroups.ListFormCode, RoleId = null, @@ -6984,89 +7034,93 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency IsPivot = true }) }, - }); - #endregion + }); + #endregion + } #endregion #region Global Search - var listFormGlobalSearch = await _listFormRepository.InsertAsync( - new ListForm() - { - CultureName = LanguageCodes.En, - ListFormCode = ListFormCodes.GlobalSearch, - Name = AppCodes.Settings.GlobalSearch, - Title = AppCodes.Settings.GlobalSearch, - DataSourceCode = SeedConsts.DataSources.DefaultCode, - IsTenant = true, - IsOrganizationUnit = false, - Description = AppCodes.Settings.GlobalSearch, - SelectCommandType = SelectCommandTypeEnum.Table, - SelectCommand = DbTablePrefix + "GlobalSearch", - KeyFieldName = "Id", - KeyFieldDbSourceType = DbType.Int32, - SortMode = GridOptions.SortModeSingle, - FilterRowJson = JsonSerializer.Serialize(new GridFilterRowDto + if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.GlobalSearch)) + { + var listFormGlobalSearch = await _listFormRepository.InsertAsync( + new ListForm() { - Visible = true - }), - HeaderFilterJson = JsonSerializer.Serialize(new - { - Visible = true - }), - SearchPanelJson = JsonSerializer.Serialize(new - { - Visible = true - }), - GroupPanelJson = JsonSerializer.Serialize(new - { - Visible = true - }), - SelectionJson = JsonSerializer.Serialize(new SelectionDto - { - Mode = GridOptions.SelectionModeSingle, - AllowSelectAll = false - }), - ColumnOptionJson = JsonSerializer.Serialize(new - { - ColumnFixingEnabled = true, - ColumnChooserEnabled = true - }), - PermissionJson = JsonSerializer.Serialize(new PermissionCrudDto - { - C = AppCodes.Settings.GlobalSearch + ".Create", - R = AppCodes.Settings.GlobalSearch, - U = AppCodes.Settings.GlobalSearch + ".Update", - D = AppCodes.Settings.GlobalSearch + ".Delete", - E = AppCodes.Settings.GlobalSearch + ".Export", - }), - PagerOptionJson = JsonSerializer.Serialize(new GridPagerOptionDto - { - Visible = true, - AllowedPageSizes = "10,20,50,100", - ShowPageSizeSelector = true, - ShowNavigationButtons = true, - ShowInfo = false, - InfoText = "Page {0} of {1} ({2} items)", - DisplayMode = GridColumnOptions.PagerDisplayModeAdaptive, - ScrollingMode = GridColumnOptions.ScrollingModeStandard, - LoadPanelEnabled = "auto", - LoadPanelText = "Loading..." - }), - EditingOptionJson = JsonSerializer.Serialize(new GridEditingDto - { - Popup = new GridEditingPopupDto() + CultureName = LanguageCodes.En, + ListFormCode = ListFormCodes.Lists.GlobalSearch, + Name = AppCodes.Settings.GlobalSearch, + Title = AppCodes.Settings.GlobalSearch, + DataSourceCode = SeedConsts.DataSources.DefaultCode, + IsTenant = true, + IsBranch = false, + IsOrganizationUnit = false, + Description = AppCodes.Settings.GlobalSearch, + SelectCommandType = SelectCommandTypeEnum.Table, + SelectCommand = DbTablePrefix + "GlobalSearch", + KeyFieldName = "Id", + KeyFieldDbSourceType = DbType.Int32, + SortMode = GridOptions.SortModeSingle, + FilterRowJson = JsonSerializer.Serialize(new GridFilterRowDto + { + Visible = true + }), + HeaderFilterJson = JsonSerializer.Serialize(new + { + Visible = true + }), + SearchPanelJson = JsonSerializer.Serialize(new + { + Visible = true + }), + GroupPanelJson = JsonSerializer.Serialize(new + { + Visible = true + }), + SelectionJson = JsonSerializer.Serialize(new SelectionDto + { + Mode = GridOptions.SelectionModeSingle, + AllowSelectAll = false + }), + ColumnOptionJson = JsonSerializer.Serialize(new + { + ColumnFixingEnabled = true, + ColumnChooserEnabled = true + }), + PermissionJson = JsonSerializer.Serialize(new PermissionCrudDto + { + C = AppCodes.Settings.GlobalSearch + ".Create", + R = AppCodes.Settings.GlobalSearch, + U = AppCodes.Settings.GlobalSearch + ".Update", + D = AppCodes.Settings.GlobalSearch + ".Delete", + E = AppCodes.Settings.GlobalSearch + ".Export", + }), + PagerOptionJson = JsonSerializer.Serialize(new GridPagerOptionDto + { + Visible = true, + AllowedPageSizes = "10,20,50,100", + ShowPageSizeSelector = true, + ShowNavigationButtons = true, + ShowInfo = false, + InfoText = "Page {0} of {1} ({2} items)", + DisplayMode = GridColumnOptions.PagerDisplayModeAdaptive, + ScrollingMode = GridColumnOptions.ScrollingModeStandard, + LoadPanelEnabled = "auto", + LoadPanelText = "Loading..." + }), + EditingOptionJson = JsonSerializer.Serialize(new GridEditingDto + { + Popup = new GridEditingPopupDto() + { + Title = "Global Search Form", + Width = 500, + Height = 350 + }, + AllowDeleting = true, + AllowAdding = true, + AllowUpdating = true, + SendOnlyChangedFormValuesUpdate = false, + }), + EditingFormJson = JsonSerializer.Serialize(new List() { - Title = "Global Search Form", - Width = 500, - Height = 350 - }, - AllowDeleting = true, - AllowAdding = true, - AllowUpdating = true, - SendOnlyChangedFormValuesUpdate = false, - }), - EditingFormJson = JsonSerializer.Serialize(new List() - { new() { Order=1, ColCount=1, ColSpan=2, ItemType="group", Items = [ new EditingFormItemDto { Order=1, DataField="System", ColSpan=2, IsRequired=true, EditorType2=EditorTypes.dxTextBox }, @@ -7076,8 +7130,8 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency new EditingFormItemDto { Order=5, DataField="Weight", ColSpan=2, IsRequired=true, EditorType2=EditorTypes.dxNumberBox }, ] } - }), - FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { + }), + FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { new FieldsDefaultValue() { FieldName = "System", FieldDbType = DbType.String, @@ -7088,14 +7142,14 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency FieldDbType = DbType.Single, Value = "1.0", CustomValueType = FieldCustomValueTypeEnum.Value }, - }) - } - ); + }) + } + ); - #region Global Search Fields - await _listFormFieldRepository.InsertManyAsync( - [ - new() { + #region Global Search Fields + await _listFormFieldRepository.InsertManyAsync( + [ + new() { ListFormCode = listFormGlobalSearch.ListFormCode, RoleId = null, UserId = null, @@ -7251,80 +7305,84 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency }) }, ]); - #endregion + #endregion + } #endregion - #region Security Logs - var listFormSecurityLog = await _listFormRepository.InsertAsync( - new ListForm() - { - CultureName = LanguageCodes.En, - ListFormCode = ListFormCodes.SecurityLog, - Name = AppCodes.IdentityPermissions.Users.SecurityLogs, - Title = AppCodes.IdentityPermissions.Users.SecurityLogs, - DataSourceCode = SeedConsts.DataSources.DefaultCode, - IsTenant = true, - IsOrganizationUnit = false, - Description = AppCodes.IdentityPermissions.Users.SecurityLogs, - SelectCommandType = SelectCommandTypeEnum.Table, - SelectCommand = "AbpSecurityLogs", - KeyFieldName = "Id", - KeyFieldDbSourceType = DbType.Guid, - SortMode = GridOptions.SortModeSingle, - FilterRowJson = JsonSerializer.Serialize(new GridFilterRowDto + #region Security Log + if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.SecurityLog)) + { + var listFormSecurityLog = await _listFormRepository.InsertAsync( + new ListForm() { - Visible = true - }), - HeaderFilterJson = JsonSerializer.Serialize(new - { - Visible = true - }), - SearchPanelJson = JsonSerializer.Serialize(new - { - Visible = true - }), - GroupPanelJson = JsonSerializer.Serialize(new - { - Visible = true - }), - SelectionJson = JsonSerializer.Serialize(new SelectionDto - { - Mode = GridOptions.SelectionModeSingle, - AllowSelectAll = false - }), - ColumnOptionJson = JsonSerializer.Serialize(new - { - ColumnFixingEnabled = true, - ColumnChooserEnabled = true - }), - PermissionJson = JsonSerializer.Serialize(new PermissionCrudDto - { - C = AppCodes.IdentityPermissions.Users.SecurityLogs + ".Create", - R = AppCodes.IdentityPermissions.Users.SecurityLogs, - U = AppCodes.IdentityPermissions.Users.SecurityLogs + ".Update", - D = AppCodes.IdentityPermissions.Users.SecurityLogs + ".Delete", - E = AppCodes.IdentityPermissions.Users.SecurityLogs + ".Export", - }), - PagerOptionJson = JsonSerializer.Serialize(new GridPagerOptionDto - { - Visible = true, - AllowedPageSizes = "10,20,50,100", - ShowPageSizeSelector = true, - ShowNavigationButtons = true, - ShowInfo = false, - InfoText = "Page {0} of {1} ({2} items)", - DisplayMode = GridColumnOptions.PagerDisplayModeAdaptive, - ScrollingMode = GridColumnOptions.ScrollingModeStandard, - LoadPanelEnabled = "auto", - LoadPanelText = "Loading..." - }), - } - ); + CultureName = LanguageCodes.En, + ListFormCode = ListFormCodes.Lists.SecurityLog, + Name = AppCodes.IdentityPermissions.Users.SecurityLogs, + Title = AppCodes.IdentityPermissions.Users.SecurityLogs, + DataSourceCode = SeedConsts.DataSources.DefaultCode, + IsTenant = true, + IsBranch = false, + IsOrganizationUnit = false, + Description = AppCodes.IdentityPermissions.Users.SecurityLogs, + SelectCommandType = SelectCommandTypeEnum.Table, + SelectCommand = "AbpSecurityLogs", + KeyFieldName = "Id", + KeyFieldDbSourceType = DbType.Guid, + SortMode = GridOptions.SortModeSingle, + FilterRowJson = JsonSerializer.Serialize(new GridFilterRowDto + { + Visible = true + }), + HeaderFilterJson = JsonSerializer.Serialize(new + { + Visible = true + }), + SearchPanelJson = JsonSerializer.Serialize(new + { + Visible = true + }), + GroupPanelJson = JsonSerializer.Serialize(new + { + Visible = true + }), + SelectionJson = JsonSerializer.Serialize(new SelectionDto + { + Mode = GridOptions.SelectionModeSingle, + AllowSelectAll = false + }), + ColumnOptionJson = JsonSerializer.Serialize(new + { + ColumnFixingEnabled = true, + ColumnChooserEnabled = true + }), + PermissionJson = JsonSerializer.Serialize(new PermissionCrudDto + { + C = AppCodes.IdentityPermissions.Users.SecurityLogs + ".Create", + R = AppCodes.IdentityPermissions.Users.SecurityLogs, + U = AppCodes.IdentityPermissions.Users.SecurityLogs + ".Update", + D = AppCodes.IdentityPermissions.Users.SecurityLogs + ".Delete", + E = AppCodes.IdentityPermissions.Users.SecurityLogs + ".Export", + }), + PagerOptionJson = JsonSerializer.Serialize(new GridPagerOptionDto + { + Visible = true, + AllowedPageSizes = "10,20,50,100", + ShowPageSizeSelector = true, + ShowNavigationButtons = true, + ShowInfo = false, + InfoText = "Page {0} of {1} ({2} items)", + DisplayMode = GridColumnOptions.PagerDisplayModeAdaptive, + ScrollingMode = GridColumnOptions.ScrollingModeStandard, + LoadPanelEnabled = "auto", + LoadPanelText = "Loading..." + }), + } + ); - #region Security Logs Fields - await _listFormFieldRepository.InsertManyAsync( - [ - new() { + #region Security Logs Fields + await _listFormFieldRepository.InsertManyAsync( + [ + new() { ListFormCode = listFormSecurityLog.ListFormCode, RoleId = null, UserId = null, @@ -7584,74 +7642,78 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency }) }, ]); - #endregion + #endregion + } #endregion - #region Audit Logs - var listFormAuditLog = await _listFormRepository.InsertAsync( - new ListForm() - { - CultureName = LanguageCodes.En, - ListFormCode = ListFormCodes.AuditLog, - Name = AppCodes.AuditLogs, - Title = AppCodes.AuditLogs, - DataSourceCode = SeedConsts.DataSources.DefaultCode, - IsTenant = true, - IsOrganizationUnit = false, - Description = AppCodes.AuditLogs, - SelectCommandType = SelectCommandTypeEnum.Table, - SelectCommand = "AbpAuditLogs", - KeyFieldName = "Id", - KeyFieldDbSourceType = DbType.Guid, - SortMode = GridOptions.SortModeSingle, - FilterRowJson = JsonSerializer.Serialize(new GridFilterRowDto + #region Audit Log + if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.AuditLog)) + { + var listFormAuditLog = await _listFormRepository.InsertAsync( + new ListForm() { - Visible = true - }), - HeaderFilterJson = JsonSerializer.Serialize(new - { - Visible = true - }), - SearchPanelJson = JsonSerializer.Serialize(new - { - Visible = true - }), - GroupPanelJson = JsonSerializer.Serialize(new - { - Visible = true - }), - SelectionJson = JsonSerializer.Serialize(new SelectionDto - { - Mode = GridOptions.SelectionModeSingle, - AllowSelectAll = false - }), - ColumnOptionJson = JsonSerializer.Serialize(new - { - ColumnFixingEnabled = true, - ColumnChooserEnabled = true - }), - PermissionJson = JsonSerializer.Serialize(new PermissionCrudDto - { - C = AppCodes.AuditLogs + ".Create", - R = AppCodes.AuditLogs, - U = AppCodes.AuditLogs + ".Update", - D = AppCodes.AuditLogs + ".Delete", - E = AppCodes.AuditLogs + ".Export", - }), - PagerOptionJson = JsonSerializer.Serialize(new GridPagerOptionDto - { - Visible = true, - AllowedPageSizes = "10,20,50,100", - ShowPageSizeSelector = true, - ShowNavigationButtons = true, - ShowInfo = false, - InfoText = "Page {0} of {1} ({2} items)", - DisplayMode = GridColumnOptions.PagerDisplayModeAdaptive, - ScrollingMode = GridColumnOptions.ScrollingModeStandard, - LoadPanelEnabled = "auto", - LoadPanelText = "Loading..." - }), - CommandColumnJson = JsonSerializer.Serialize(new CommandColumnDto[] { + CultureName = LanguageCodes.En, + ListFormCode = ListFormCodes.Lists.AuditLog, + Name = AppCodes.AuditLogs, + Title = AppCodes.AuditLogs, + DataSourceCode = SeedConsts.DataSources.DefaultCode, + IsTenant = true, + IsBranch = false, + IsOrganizationUnit = false, + Description = AppCodes.AuditLogs, + SelectCommandType = SelectCommandTypeEnum.Table, + SelectCommand = "AbpAuditLogs", + KeyFieldName = "Id", + KeyFieldDbSourceType = DbType.Guid, + SortMode = GridOptions.SortModeSingle, + FilterRowJson = JsonSerializer.Serialize(new GridFilterRowDto + { + Visible = true + }), + HeaderFilterJson = JsonSerializer.Serialize(new + { + Visible = true + }), + SearchPanelJson = JsonSerializer.Serialize(new + { + Visible = true + }), + GroupPanelJson = JsonSerializer.Serialize(new + { + Visible = true + }), + SelectionJson = JsonSerializer.Serialize(new SelectionDto + { + Mode = GridOptions.SelectionModeSingle, + AllowSelectAll = false + }), + ColumnOptionJson = JsonSerializer.Serialize(new + { + ColumnFixingEnabled = true, + ColumnChooserEnabled = true + }), + PermissionJson = JsonSerializer.Serialize(new PermissionCrudDto + { + C = AppCodes.AuditLogs + ".Create", + R = AppCodes.AuditLogs, + U = AppCodes.AuditLogs + ".Update", + D = AppCodes.AuditLogs + ".Delete", + E = AppCodes.AuditLogs + ".Export", + }), + PagerOptionJson = JsonSerializer.Serialize(new GridPagerOptionDto + { + Visible = true, + AllowedPageSizes = "10,20,50,100", + ShowPageSizeSelector = true, + ShowNavigationButtons = true, + ShowInfo = false, + InfoText = "Page {0} of {1} ({2} items)", + DisplayMode = GridColumnOptions.PagerDisplayModeAdaptive, + ScrollingMode = GridColumnOptions.ScrollingModeStandard, + LoadPanelEnabled = "auto", + LoadPanelText = "Loading..." + }), + CommandColumnJson = JsonSerializer.Serialize(new CommandColumnDto[] { new CommandColumnDto() { Hint = "Details", Text = "Details", @@ -7661,14 +7723,14 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency id = "@Id", }) }, - }), - } - ); + }), + } + ); - #region Audit Logs Fields - await _listFormFieldRepository.InsertManyAsync( - [ - new() { + #region Audit Logs Fields + await _listFormFieldRepository.InsertManyAsync( + [ + new() { ListFormCode = listFormAuditLog.ListFormCode, RoleId = null, UserId = null, @@ -7902,89 +7964,93 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency }) }, ]); - #endregion + #endregion + } #endregion - #region Branches - var listFormBranches = await _listFormRepository.InsertAsync( - new ListForm() - { - CultureName = LanguageCodes.En, - ListFormCode = ListFormCodes.Branch, - Name = AppCodes.Branches, - Title = AppCodes.Branches, - DataSourceCode = SeedConsts.DataSources.DefaultCode, - IsTenant = false, - IsOrganizationUnit = false, - Description = AppCodes.Branches, - SelectCommandType = SelectCommandTypeEnum.Table, - SelectCommand = DbTablePrefix + "Branch", - KeyFieldName = "Id", - KeyFieldDbSourceType = DbType.Guid, - DefaultFilter = "\"IsDeleted\" = 'false'", - SortMode = GridOptions.SortModeSingle, - FilterRowJson = JsonSerializer.Serialize(new GridFilterRowDto + #region Branche + if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.Branch)) + { + var listFormBranches = await _listFormRepository.InsertAsync( + new ListForm() { - Visible = true - }), - HeaderFilterJson = JsonSerializer.Serialize(new - { - Visible = true - }), - SearchPanelJson = JsonSerializer.Serialize(new - { - Visible = true - }), - GroupPanelJson = JsonSerializer.Serialize(new - { - Visible = true - }), - SelectionJson = JsonSerializer.Serialize(new SelectionDto - { - Mode = GridOptions.SelectionModeSingle, - AllowSelectAll = false - }), - ColumnOptionJson = JsonSerializer.Serialize(new - { - ColumnFixingEnabled = true, - ColumnChooserEnabled = true - }), - PermissionJson = JsonSerializer.Serialize(new PermissionCrudDto - { - C = AppCodes.Branches + ".Create", - R = AppCodes.Branches, - U = AppCodes.Branches + ".Update", - D = AppCodes.Branches + ".Delete", - E = AppCodes.Branches + ".Export" - }), - PagerOptionJson = JsonSerializer.Serialize(new GridPagerOptionDto - { - Visible = true, - AllowedPageSizes = "10,20,50,100", - ShowPageSizeSelector = true, - ShowNavigationButtons = true, - ShowInfo = false, - InfoText = "Page {0} of {1} ({2} items)", - DisplayMode = GridColumnOptions.PagerDisplayModeAdaptive, - ScrollingMode = GridColumnOptions.ScrollingModeStandard, - LoadPanelEnabled = "auto", - LoadPanelText = "Loading..." - }), - EditingOptionJson = JsonSerializer.Serialize(new GridEditingDto - { - Popup = new GridEditingPopupDto() + CultureName = LanguageCodes.En, + ListFormCode = ListFormCodes.Lists.Branch, + Name = AppCodes.Branches, + Title = AppCodes.Branches, + DataSourceCode = SeedConsts.DataSources.DefaultCode, + IsTenant = false, + IsBranch = false, + IsOrganizationUnit = false, + Description = AppCodes.Branches, + SelectCommandType = SelectCommandTypeEnum.Table, + SelectCommand = DbTablePrefix + "Branch", + KeyFieldName = "Id", + KeyFieldDbSourceType = DbType.Guid, + DefaultFilter = "\"IsDeleted\" = 'false'", + SortMode = GridOptions.SortModeSingle, + FilterRowJson = JsonSerializer.Serialize(new GridFilterRowDto + { + Visible = true + }), + HeaderFilterJson = JsonSerializer.Serialize(new + { + Visible = true + }), + SearchPanelJson = JsonSerializer.Serialize(new + { + Visible = true + }), + GroupPanelJson = JsonSerializer.Serialize(new + { + Visible = true + }), + SelectionJson = JsonSerializer.Serialize(new SelectionDto + { + Mode = GridOptions.SelectionModeSingle, + AllowSelectAll = false + }), + ColumnOptionJson = JsonSerializer.Serialize(new + { + ColumnFixingEnabled = true, + ColumnChooserEnabled = true + }), + PermissionJson = JsonSerializer.Serialize(new PermissionCrudDto + { + C = AppCodes.Branches + ".Create", + R = AppCodes.Branches, + U = AppCodes.Branches + ".Update", + D = AppCodes.Branches + ".Delete", + E = AppCodes.Branches + ".Export" + }), + PagerOptionJson = JsonSerializer.Serialize(new GridPagerOptionDto + { + Visible = true, + AllowedPageSizes = "10,20,50,100", + ShowPageSizeSelector = true, + ShowNavigationButtons = true, + ShowInfo = false, + InfoText = "Page {0} of {1} ({2} items)", + DisplayMode = GridColumnOptions.PagerDisplayModeAdaptive, + ScrollingMode = GridColumnOptions.ScrollingModeStandard, + LoadPanelEnabled = "auto", + LoadPanelText = "Loading..." + }), + EditingOptionJson = JsonSerializer.Serialize(new GridEditingDto + { + Popup = new GridEditingPopupDto() + { + Title = "Branch Form", + Width = 500, + Height = 550 + }, + AllowDeleting = true, + AllowAdding = true, + AllowUpdating = true, + SendOnlyChangedFormValuesUpdate = false, + }), + EditingFormJson = JsonSerializer.Serialize(new List() { - Title = "Branch Form", - Width = 500, - Height = 550 - }, - AllowDeleting = true, - AllowAdding = true, - AllowUpdating = true, - SendOnlyChangedFormValuesUpdate = false, - }), - EditingFormJson = JsonSerializer.Serialize(new List() - { new() { Order=1, ColCount=1, ColSpan=2, ItemType="group", Items = [ new EditingFormItemDto { Order=1, DataField="TenantId", ColSpan=2, IsRequired=true, EditorType2=EditorTypes.dxSelectBox, EditorOptions="{ \"showClearButton\" : true }" }, @@ -8009,9 +8075,9 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency new EditingFormItemDto { Order=7, DataField="Website", ColSpan=2, IsRequired=true, EditorType2=EditorTypes.dxTextBox, EditorOptions="{ \"showClearButton\" : true }" }, ] } - }), - DeleteCommand = $"UPDATE \"{DbTablePrefix}Branch\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", - DeleteFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { + }), + DeleteCommand = $"UPDATE \"{DbTablePrefix}Branch\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", + DeleteFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { new() { FieldName = "DeleterId", FieldDbType = DbType.Guid, @@ -8022,8 +8088,8 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency FieldDbType = DbType.Guid, Value = "@ID", CustomValueType = FieldCustomValueTypeEnum.CustomKey } - }), - InsertFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { + }), + InsertFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { new FieldsDefaultValue() { FieldName = "CreationTime", FieldDbType = DbType.DateTime, @@ -8034,22 +8100,22 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency FieldDbType = DbType.Guid, Value = "@USERID", CustomValueType = FieldCustomValueTypeEnum.CustomKey } - }), - FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { + }), + FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { new() { FieldName = "IsActive", FieldDbType = DbType.Boolean, Value = "true", CustomValueType = FieldCustomValueTypeEnum.Value } - }) + }) - } - ); + } + ); - #region Branches Fields - await _listFormFieldRepository.InsertManyAsync( - [ - new ListFormField + #region Branches Fields + await _listFormFieldRepository.InsertManyAsync( + [ + new ListFormField { ListFormCode = listFormBranches.ListFormCode, RoleId = null, @@ -8512,88 +8578,92 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency }) }, ]); - #endregion + #endregion + } #endregion - #region ClaimTypes - var listFormClaimTypes = await _listFormRepository.InsertAsync( - new ListForm() - { - CultureName = LanguageCodes.En, - ListFormCode = ListFormCodes.ClaimTypes, - Name = AppCodes.IdentityPermissions.Users.ClaimTypes, - Title = AppCodes.IdentityPermissions.Users.ClaimTypes, - DataSourceCode = SeedConsts.DataSources.DefaultCode, - IsTenant = false, - IsOrganizationUnit = false, - Description = AppCodes.IdentityPermissions.Users.ClaimTypes, - SelectCommandType = SelectCommandTypeEnum.Table, - SelectCommand = "AbpClaimTypes", - KeyFieldName = "Id", - KeyFieldDbSourceType = DbType.Guid, - SortMode = GridOptions.SortModeSingle, - FilterRowJson = JsonSerializer.Serialize(new GridFilterRowDto + #region ClaimType + if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.ClaimType)) + { + var listFormClaimTypes = await _listFormRepository.InsertAsync( + new ListForm() { - Visible = true - }), - HeaderFilterJson = JsonSerializer.Serialize(new - { - Visible = true - }), - SearchPanelJson = JsonSerializer.Serialize(new - { - Visible = true - }), - GroupPanelJson = JsonSerializer.Serialize(new - { - Visible = true - }), - SelectionJson = JsonSerializer.Serialize(new SelectionDto - { - Mode = GridOptions.SelectionModeSingle, - AllowSelectAll = false - }), - ColumnOptionJson = JsonSerializer.Serialize(new - { - ColumnFixingEnabled = true, - ColumnChooserEnabled = true - }), - PermissionJson = JsonSerializer.Serialize(new PermissionCrudDto - { - C = AppCodes.IdentityPermissions.Users.ClaimTypes + ".Create", - R = AppCodes.IdentityPermissions.Users.ClaimTypes, - U = AppCodes.IdentityPermissions.Users.ClaimTypes + ".Update", - D = AppCodes.IdentityPermissions.Users.ClaimTypes + ".Delete", - E = AppCodes.IdentityPermissions.Users.ClaimTypes + ".Export" - }), - PagerOptionJson = JsonSerializer.Serialize(new GridPagerOptionDto - { - Visible = true, - AllowedPageSizes = "10,20,50,100", - ShowPageSizeSelector = true, - ShowNavigationButtons = true, - ShowInfo = false, - InfoText = "Page {0} of {1} ({2} items)", - DisplayMode = GridColumnOptions.PagerDisplayModeAdaptive, - ScrollingMode = GridColumnOptions.ScrollingModeStandard, - LoadPanelEnabled = "auto", - LoadPanelText = "Loading..." - }), - EditingOptionJson = JsonSerializer.Serialize(new GridEditingDto - { - Popup = new GridEditingPopupDto() + CultureName = LanguageCodes.En, + ListFormCode = ListFormCodes.Lists.ClaimType, + Name = AppCodes.IdentityPermissions.Users.ClaimTypes, + Title = AppCodes.IdentityPermissions.Users.ClaimTypes, + DataSourceCode = SeedConsts.DataSources.DefaultCode, + IsTenant = false, + IsBranch = false, + IsOrganizationUnit = false, + Description = AppCodes.IdentityPermissions.Users.ClaimTypes, + SelectCommandType = SelectCommandTypeEnum.Table, + SelectCommand = "AbpClaimTypes", + KeyFieldName = "Id", + KeyFieldDbSourceType = DbType.Guid, + SortMode = GridOptions.SortModeSingle, + FilterRowJson = JsonSerializer.Serialize(new GridFilterRowDto + { + Visible = true + }), + HeaderFilterJson = JsonSerializer.Serialize(new + { + Visible = true + }), + SearchPanelJson = JsonSerializer.Serialize(new + { + Visible = true + }), + GroupPanelJson = JsonSerializer.Serialize(new + { + Visible = true + }), + SelectionJson = JsonSerializer.Serialize(new SelectionDto + { + Mode = GridOptions.SelectionModeSingle, + AllowSelectAll = false + }), + ColumnOptionJson = JsonSerializer.Serialize(new + { + ColumnFixingEnabled = true, + ColumnChooserEnabled = true + }), + PermissionJson = JsonSerializer.Serialize(new PermissionCrudDto + { + C = AppCodes.IdentityPermissions.Users.ClaimTypes + ".Create", + R = AppCodes.IdentityPermissions.Users.ClaimTypes, + U = AppCodes.IdentityPermissions.Users.ClaimTypes + ".Update", + D = AppCodes.IdentityPermissions.Users.ClaimTypes + ".Delete", + E = AppCodes.IdentityPermissions.Users.ClaimTypes + ".Export" + }), + PagerOptionJson = JsonSerializer.Serialize(new GridPagerOptionDto + { + Visible = true, + AllowedPageSizes = "10,20,50,100", + ShowPageSizeSelector = true, + ShowNavigationButtons = true, + ShowInfo = false, + InfoText = "Page {0} of {1} ({2} items)", + DisplayMode = GridColumnOptions.PagerDisplayModeAdaptive, + ScrollingMode = GridColumnOptions.ScrollingModeStandard, + LoadPanelEnabled = "auto", + LoadPanelText = "Loading..." + }), + EditingOptionJson = JsonSerializer.Serialize(new GridEditingDto + { + Popup = new GridEditingPopupDto() + { + Title = "Claim Types Form", + Width = 500, + Height = 550 + }, + AllowDeleting = true, + AllowAdding = true, + AllowUpdating = true, + SendOnlyChangedFormValuesUpdate = false, + }), + EditingFormJson = JsonSerializer.Serialize(new List() { - Title = "Claim Types Form", - Width = 500, - Height = 550 - }, - AllowDeleting = true, - AllowAdding = true, - AllowUpdating = true, - SendOnlyChangedFormValuesUpdate = false, - }), - EditingFormJson = JsonSerializer.Serialize(new List() - { new() { Order=1, ColCount=1, ColSpan=2, ItemType="group", Items = [ new EditingFormItemDto { Order=1, DataField="Name", ColSpan=2, IsRequired=true, EditorType2=EditorTypes.dxTextBox, EditorOptions="{ \"showClearButton\" : true }" }, @@ -8605,17 +8675,17 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency new EditingFormItemDto { Order=7, DataField="Description", ColSpan=2, IsRequired=false, EditorType2=EditorTypes.dxTextBox, EditorOptions="{ \"showClearButton\" : true }" }, ] } - }), - DeleteCommand = "DELETE FROM \"AbpClaimTypes\" WHERE \"Id\"=@Id", - DeleteFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { + }), + DeleteCommand = "DELETE FROM \"AbpClaimTypes\" WHERE \"Id\"=@Id", + DeleteFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { new() { FieldName = "Id", FieldDbType = DbType.Guid, Value = "@ID", CustomValueType = FieldCustomValueTypeEnum.CustomKey } - }), - InsertCommand = "INSERT INTO \"AbpClaimTypes\" (\"Id\",\"ValueType\",\"Required\",\"IsStatic\",\"Name\",\"ConcurrencyStamp\",\"ExtraProperties\") OUTPUT Inserted.Id VALUES (@Id,@ValueType,@Required,@IsStatic,@Name,@ConcurrencyStamp,@ExtraProperties)", - InsertFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { + }), + InsertCommand = "INSERT INTO \"AbpClaimTypes\" (\"Id\",\"ValueType\",\"Required\",\"IsStatic\",\"Name\",\"ConcurrencyStamp\",\"ExtraProperties\") OUTPUT Inserted.Id VALUES (@Id,@ValueType,@Required,@IsStatic,@Name,@ConcurrencyStamp,@ExtraProperties)", + InsertFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { new() { FieldName = "ConcurrencyStamp", FieldDbType = DbType.Guid, @@ -8625,9 +8695,9 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency FieldName = "ExtraProperties", FieldDbType = DbType.String, Value = "{}", - CustomValueType = FieldCustomValueTypeEnum.Value } - }), - FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { + CustomValueType = FieldCustomValueTypeEnum.Value } + }), + FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { new() { FieldName = "Required", FieldDbType = DbType.Boolean, @@ -8643,15 +8713,15 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency FieldDbType = DbType.Int16, Value = "0", CustomValueType = FieldCustomValueTypeEnum.Value } - }) + }) - } - ); + } + ); - #region ClaimTypes Fields - await _listFormFieldRepository.InsertManyAsync( - [ - new ListFormField + #region ClaimTypes Fields + await _listFormFieldRepository.InsertManyAsync( + [ + new ListFormField { ListFormCode = listFormClaimTypes.ListFormCode, RoleId = null, @@ -8794,7 +8864,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency { IsPivot = true }) - }, + }, new ListFormField { ListFormCode = listFormClaimTypes.ListFormCode, @@ -8876,8 +8946,9 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency IsPivot = true }) } - ]); - #endregion + ]); + #endregion + } #endregion #endregion } diff --git a/api/src/Kurs.Platform.DbMigrator/Seeds/SeederData.json b/api/src/Kurs.Platform.DbMigrator/Seeds/SeederData.json index 3f210088..d6375fb4 100644 --- a/api/src/Kurs.Platform.DbMigrator/Seeds/SeederData.json +++ b/api/src/Kurs.Platform.DbMigrator/Seeds/SeederData.json @@ -5773,7 +5773,7 @@ "Code": "AbpTenantManagement.Tenants", "DisplayName": "AbpTenantManagement.Tenants", "Order": 1, - "Url": "/list/List-0001", + "Url": "/list/list-tenant", "Icon": "FcDepartment", "RequiredPermissionName": "AbpTenantManagement.Tenants", "IsDisabled": false @@ -5783,7 +5783,7 @@ "Code": "App.Branches", "DisplayName": "App.Branches", "Order": 2, - "Url": "/list/List-0022", + "Url": "/list/list-branch", "Icon": "FcShop", "RequiredPermissionName": "App.Branches", "IsDisabled": false @@ -5803,7 +5803,7 @@ "Code": "App.Settings.SettingDefinitions", "DisplayName": "App.Settings.SettingDefinitions", "Order": 1, - "Url": "/list/List-0009", + "Url": "/list/list-settingdefinition", "Icon": "FcSupport", "RequiredPermissionName": "App.Settings.SettingDefinitions", "IsDisabled": false @@ -5813,7 +5813,7 @@ "Code": "App.Settings.GlobalSearch", "DisplayName": "App.Settings.GlobalSearch", "Order": 2, - "Url": "/list/List-0018", + "Url": "/list/list-globalsearch", "Icon": "FcSearch", "RequiredPermissionName": "App.Settings.GlobalSearch", "IsDisabled": false @@ -5833,7 +5833,7 @@ "Code": "App.Languages.Language", "DisplayName": "App.Languages.Language", "Order": 1, - "Url": "/list/List-0005", + "Url": "/list/list-language", "Icon": "FcGraduationCap", "RequiredPermissionName": "App.Languages.Language", "IsDisabled": false @@ -5843,7 +5843,7 @@ "Code": "App.Languages.LanguageText", "DisplayName": "App.Languages.LanguageText", "Order": 2, - "Url": "/list/List-0006", + "Url": "/list/list-languagetext", "Icon": "FcMindMap", "RequiredPermissionName": "App.Languages.LanguageText", "IsDisabled": false @@ -5853,7 +5853,7 @@ "Code": "App.Menus", "DisplayName": "App.Menus", "Order": 5, - "Url": "/list/List-0007", + "Url": "/list/list-menu", "Icon": "FcMenu", "RequiredPermissionName": "App.Menus", "IsDisabled": false @@ -5893,7 +5893,7 @@ "Code": "Abp.Identity.PermissionGroups", "DisplayName": "Abp.Identity.PermissionGroups", "Order": 1, - "Url": "/list/List-0017", + "Url": "/list/list-permissiongroup", "Icon": "FcEngineering", "RequiredPermissionName": "Abp.Identity.PermissionGroups", "IsDisabled": false @@ -5903,7 +5903,7 @@ "Code": "Abp.Identity.Permissions", "DisplayName": "Abp.Identity.Permissions", "Order": 2, - "Url": "/list/List-0002", + "Url": "/list/list-permission", "Icon": "FcSupport", "RequiredPermissionName": "Abp.Identity.Permissions", "IsDisabled": false @@ -5913,7 +5913,7 @@ "Code": "AbpIdentity.Roles", "DisplayName": "AbpIdentity.Roles", "Order": 3, - "Url": "/list/List-0003", + "Url": "/list/list-role", "Icon": "FcFlowChart", "RequiredPermissionName": "AbpIdentity.Roles", "IsDisabled": false @@ -5923,7 +5923,7 @@ "Code": "AbpIdentity.Users", "DisplayName": "AbpIdentity.Users", "Order": 4, - "Url": "/list/List-0004", + "Url": "/list/list-user", "Icon": "FcBusinessman", "RequiredPermissionName": "AbpIdentity.Users", "IsDisabled": false @@ -5943,7 +5943,7 @@ "Code": "AbpIdentity.Users.ClaimType", "DisplayName": "AbpIdentity.Users.ClaimType", "Order": 6, - "Url": "/list/List-0022", + "Url": "/list/list-claimtype", "Icon": "FcOrganization", "RequiredPermissionName": "AbpIdentity.Users.ClaimType", "IsDisabled": false @@ -5953,7 +5953,7 @@ "Code": "App.IpRestrictions", "DisplayName": "App.IpRestrictions", "Order": 7, - "Url": "/list/List-0015", + "Url": "/list/list-iprestriction", "Icon": "FcNfcSign", "RequiredPermissionName": "App.IpRestrictions", "IsDisabled": false @@ -5963,7 +5963,7 @@ "Code": "AbpIdentity.Users.SecurityLog", "DisplayName": "AbpIdentity.Users.SecurityLog", "Order": 8, - "Url": "/list/List-0019", + "Url": "/list/list-securitylog", "Icon": "FcPrivacy", "RequiredPermissionName": "AbpIdentity.Users.SecurityLog", "IsDisabled": false @@ -5983,7 +5983,7 @@ "Code": "App.Listforms.DataSource", "DisplayName": "App.Listforms.DataSource", "Order": 1, - "Url": "/list/List-0011", + "Url": "/list/list-datasource", "Icon": "FcAcceptDatabase", "RequiredPermissionName": "App.Listforms.DataSource", "IsDisabled": false @@ -6003,7 +6003,7 @@ "Code": "App.Listforms.Listform", "DisplayName": "App.Listforms.Listform", "Order": 3, - "Url": "/list/List-0008", + "Url": "/list/list-listform", "Icon": "FcDataSheet", "RequiredPermissionName": "App.Listforms.Listform", "IsDisabled": false @@ -6013,7 +6013,7 @@ "Code": "App.Listforms.Chart", "DisplayName": "App.Listforms.Chart", "Order": 4, - "Url": "/list/List-0010", + "Url": "/list/list-chart", "Icon": "FcTodoList", "RequiredPermissionName": "App.Listforms.Chart", "IsDisabled": false @@ -6033,7 +6033,7 @@ "Code": "App.Notifications.NotificationRules", "DisplayName": "App.Notifications.NotificationRules", "Order": 1, - "Url": "/list/List-0013", + "Url": "/list/list-notificationrule", "Icon": "FcLibrary", "RequiredPermissionName": "App.Notifications.NotificationRules", "IsDisabled": false @@ -6043,7 +6043,7 @@ "Code": "App.Notifications.Notification", "DisplayName": "App.Notifications.Notification", "Order": 2, - "Url": "/list/List-0014", + "Url": "/list/list-notification", "Icon": "FcBrokenLink", "RequiredPermissionName": "App.Notifications.Notification", "IsDisabled": false @@ -6053,7 +6053,7 @@ "Code": "App.BackgroundWorkers", "DisplayName": "App.BackgroundWorkers", "Order": 8, - "Url": "/list/List-0012", + "Url": "/list/list-backgroundworker", "Icon": "FcWorkflow", "RequiredPermissionName": "App.BackgroundWorkers", "IsDisabled": false @@ -6063,7 +6063,7 @@ "Code": "App.PublicApis", "DisplayName": "App.PublicApis", "Order": 9, - "Url": "/list/List-0016", + "Url": "/list/list-publicapi", "Icon": "FcMindMap", "RequiredPermissionName": "App.PublicApis", "IsDisabled": false @@ -6073,7 +6073,7 @@ "Code": "App.AuditLogs", "DisplayName": "App.AuditLogs", "Order": 3, - "Url": "/list/List-0020", + "Url": "/list/list-auditlog", "Icon": "FcMultipleInputs", "RequiredPermissionName": "App.AuditLogs", "IsDisabled": false diff --git a/api/src/Kurs.Platform.Domain.Shared/PlatformConsts.cs b/api/src/Kurs.Platform.Domain.Shared/PlatformConsts.cs index 01fac3f9..fd805301 100644 --- a/api/src/Kurs.Platform.Domain.Shared/PlatformConsts.cs +++ b/api/src/Kurs.Platform.Domain.Shared/PlatformConsts.cs @@ -40,7 +40,7 @@ public static class PlatformConsts public const string Email = "Email"; public const string Website = "Website"; } - + public static class AbpIdentity { public const string GroupName = $"{Prefix.Abp}.Identity"; @@ -307,36 +307,36 @@ public static class PlatformConsts public static class ListFormCodes { - public const string Tenants = "List-0001"; - public const string Permission = "List-0002"; - public const string Roles = "List-0003"; - public const string Users = "List-0004"; - public const string Language = "List-0005"; - public const string LanguageText = "List-0006"; - public const string Menu = "List-0007"; - public const string Listform = "List-0008"; - public const string SettingDefinition = "List-0009"; - public const string Chart = "List-0010"; - public const string DataSource = "List-0011"; - public const string BackgroundWorker = "List-0012"; - public const string NotificationRule = "List-0013"; - public const string Notification = "List-0014"; - public const string IpRestriction = "List-0015"; - public const string PublicApi = "List-0016"; - public const string PermissionGroup = "List-0017"; - public const string GlobalSearch = "List-0018"; - public const string SecurityLog = "List-0019"; - public const string AuditLog = "List-0020"; - public const string Branch = "List-0021"; - public const string ClaimTypes = "List-0022"; - public const string ListformField = "List-1000"; - public const string Order = "List-Order"; - public const string Complaint = "List-Complaint"; - public const string Shipment = "List-Shipment"; + public static class Lists + { + public const string Tenant = "list-tenant"; + public const string Permission = "list-permission"; + public const string Role = "list-role"; + public const string User = "list-user"; + public const string Language = "list-language"; + public const string LanguageText = "list-languagetext"; + public const string Menu = "list-menu"; + public const string Listform = "list-listform"; + public const string SettingDefinition = "list-settingdefinition"; + public const string Chart = "list-chart"; + public const string DataSource = "list-datasource"; + public const string BackgroundWorker = "list-backgroundworker"; + public const string NotificationRule = "list-notificationrule"; + public const string Notification = "list-notification"; + public const string IpRestriction = "list-iprestriction"; + public const string PublicApi = "list-publicapi"; + public const string PermissionGroup = "list-permissiongroup"; + public const string GlobalSearch = "list-globalsearch"; + public const string SecurityLog = "list-securitylog"; + public const string AuditLog = "list-auditlog"; + public const string Branch = "list-branch"; + public const string ClaimType = "list-claimtype"; + public const string ListformField = "list-listformfield"; + } public static class Forms { - public const string FormLanguage = "Form-Language"; + public const string FormLanguage = "form-language"; } } diff --git a/ui/src/components/layouts/AuthLayout/Simple.tsx b/ui/src/components/layouts/AuthLayout/Simple.tsx index 27205ea8..ba2a83ab 100644 --- a/ui/src/components/layouts/AuthLayout/Simple.tsx +++ b/ui/src/components/layouts/AuthLayout/Simple.tsx @@ -63,7 +63,7 @@ const Simple = ({ children, content, ...rest }: SimpleProps) => { {...innerProps} >
- +
{isSelected && } @@ -77,8 +77,9 @@ const Simple = ({ children, content, ...rest }: SimpleProps) => { diff --git a/ui/src/components/ui/Avatar/Avatar.tsx b/ui/src/components/ui/Avatar/Avatar.tsx index 8746483d..d0d9f958 100644 --- a/ui/src/components/ui/Avatar/Avatar.tsx +++ b/ui/src/components/ui/Avatar/Avatar.tsx @@ -12,6 +12,7 @@ export interface AvatarProps extends CommonProps { shape?: Exclude | 'square' src?: string srcSet?: string + title?: string } const Avatar = forwardRef((props, ref) => { @@ -23,6 +24,7 @@ const Avatar = forwardRef((props, ref) => { size = 'md', src, srcSet, + title, ...rest } = props @@ -78,6 +80,7 @@ const Avatar = forwardRef((props, ref) => { className={`avatar-img avatar-${shape}`} src={src} srcSet={srcSet} + title={title} alt={alt} loading="lazy" onError={({ currentTarget }) => { diff --git a/ui/src/views/auth/Login.tsx b/ui/src/views/auth/Login.tsx index 26081a55..5f1e0ea2 100644 --- a/ui/src/views/auth/Login.tsx +++ b/ui/src/views/auth/Login.tsx @@ -2,7 +2,6 @@ import { FailedSignInResponse } from '@/@types/auth' import ActionLink from '@/components/shared/ActionLink' import Captcha from '@/components/shared/Captcha' import PasswordInput from '@/components/shared/PasswordInput' -import { Avatar, Select } from '@/components/ui' import Alert from '@/components/ui/Alert' import Button from '@/components/ui/Button' import Checkbox from '@/components/ui/Checkbox' @@ -17,16 +16,9 @@ import useTimeOutMessage from '@/utils/hooks/useTimeOutMessage' import { TurnstileInstance } from '@marsidev/react-turnstile' import { Field, Form, Formik } from 'formik' import { motion } from 'framer-motion' -import { useEffect, useMemo, useRef, useState } from 'react' +import { useEffect, useRef, useState } from 'react' import { useNavigate } from 'react-router-dom' import * as Yup from 'yup' -import { components } from 'react-select' -import { HiArrowLeft, HiCheck } from 'react-icons/hi' -import { SelectBoxOption } from '@/shared/types' -import i18n from 'i18next' -import appConfig from '@/configs/app.config' -import { dateLocales } from '@/locales' -import dayjs from 'dayjs' type SignInFormSchema = { userName: string @@ -209,8 +201,6 @@ const Login = () => { } }, [isMultiTenant]) - console.log(currentCulture) - return (