diff --git a/api/src/Kurs.Platform.DbMigrator/Seeds/ListFormsSeeder.cs b/api/src/Kurs.Platform.DbMigrator/Seeds/ListFormsSeeder.cs index f7bee51a..323cd873 100644 --- a/api/src/Kurs.Platform.DbMigrator/Seeds/ListFormsSeeder.cs +++ b/api/src/Kurs.Platform.DbMigrator/Seeds/ListFormsSeeder.cs @@ -1,7 +1,6 @@ using System; using System.Collections.Generic; using System.Data; -using System.Linq; using System.Text.Json; using System.Threading.Tasks; using Kurs.Languages.Languages; @@ -92,7 +91,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency IsOrganizationUnit = false, Description = AppCodes.Languages.Language, SelectCommandType = SelectCommandTypeEnum.Table, - SelectCommand = DbTablePrefix + "Language", + SelectCommand = SelectCommandByTableName("Language"), KeyFieldName = "Id", KeyFieldDbSourceType = DbType.Guid, DefaultFilter = "\"IsDeleted\" = 'false'", @@ -1285,13 +1284,13 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency { CultureName = LanguageCodes.En, ListFormCode = ListFormCodes.Lists.Role, - Name = IdentityPermissions.Roles.Default, - Title = IdentityPermissions.Roles.Default, + Name = PlatformConsts.IdentityPermissions.Roles.Default, + Title = PlatformConsts.IdentityPermissions.Roles.Default, IsTenant = true, IsBranch = false, IsOrganizationUnit = false, DataSourceCode = SeedConsts.DataSources.DefaultCode, - Description = IdentityPermissions.Roles.Default, + Description = PlatformConsts.IdentityPermissions.Roles.Default, SelectCommandType = SelectCommandTypeEnum.Table, SelectCommand = "AbpRoles", KeyFieldName = "Id", @@ -1325,11 +1324,11 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency }), PermissionJson = JsonSerializer.Serialize(new PermissionCrudDto { - C = IdentityPermissions.Roles.Create, - R = IdentityPermissions.Roles.Default, - U = IdentityPermissions.Roles.Update, - D = IdentityPermissions.Roles.Delete, - E = IdentityPermissions.Roles.Default + ".Export", + C = PlatformConsts.IdentityPermissions.Roles.Create, + R = PlatformConsts.IdentityPermissions.Roles.Default, + U = PlatformConsts.IdentityPermissions.Roles.Update, + D = PlatformConsts.IdentityPermissions.Roles.Delete, + E = PlatformConsts.IdentityPermissions.Roles.Default + ".Export", }), EditingOptionJson = JsonSerializer.Serialize(new GridEditingDto { @@ -1368,7 +1367,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency new CommandColumnDto() { Hint = "Permission", Text = "Permission", - AuthName = IdentityPermissions.Roles.ManagePermissions, + AuthName = PlatformConsts.IdentityPermissions.Roles.ManagePermissions, DialogName = "RolesPermission", DialogParameters = JsonSerializer.Serialize(new { name = "@Name", @@ -1414,9 +1413,9 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency }), PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto { - C = IdentityPermissions.Roles.Create, - R = IdentityPermissions.Roles.Default, - U = IdentityPermissions.Roles.Update, + C = PlatformConsts.IdentityPermissions.Roles.Create, + R = PlatformConsts.IdentityPermissions.Roles.Default, + U = PlatformConsts.IdentityPermissions.Roles.Update, E = true, Deny = false , }), @@ -1440,9 +1439,9 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency IsDeleted = false, PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto { - C = IdentityPermissions.Roles.Create, - R = IdentityPermissions.Roles.Default, - U = IdentityPermissions.Roles.Update, + C = PlatformConsts.IdentityPermissions.Roles.Create, + R = PlatformConsts.IdentityPermissions.Roles.Default, + U = PlatformConsts.IdentityPermissions.Roles.Update, E = true, Deny = false , }), @@ -1466,9 +1465,9 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency IsDeleted = false, PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto { - C = IdentityPermissions.Roles.Create, - R = IdentityPermissions.Roles.Default, - U = IdentityPermissions.Roles.Update, + C = PlatformConsts.IdentityPermissions.Roles.Create, + R = PlatformConsts.IdentityPermissions.Roles.Default, + U = PlatformConsts.IdentityPermissions.Roles.Update, E = true, Deny = false , }), @@ -1490,13 +1489,13 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency { CultureName = LanguageCodes.En, ListFormCode = ListFormCodes.Lists.User, - Name = IdentityPermissions.Users.Default, - Title = IdentityPermissions.Users.Default, + Name = PlatformConsts.IdentityPermissions.Users.Default, + Title = PlatformConsts.IdentityPermissions.Users.Default, IsTenant = true, IsBranch = false, IsOrganizationUnit = false, DataSourceCode = SeedConsts.DataSources.DefaultCode, - Description = IdentityPermissions.Users.Default, + Description = PlatformConsts.IdentityPermissions.Users.Default, SelectCommandType = SelectCommandTypeEnum.Table, SelectCommand = "AbpUsers", KeyFieldName = "Id", @@ -1531,11 +1530,11 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency }), PermissionJson = JsonSerializer.Serialize(new PermissionCrudDto { - C = IdentityPermissions.Users.Create, - R = IdentityPermissions.Users.Default, - U = IdentityPermissions.Users.Update, - D = IdentityPermissions.Users.Delete, - E = IdentityPermissions.Users.Default + ".Export", + C = PlatformConsts.IdentityPermissions.Users.Create, + R = PlatformConsts.IdentityPermissions.Users.Default, + U = PlatformConsts.IdentityPermissions.Users.Update, + D = PlatformConsts.IdentityPermissions.Users.Delete, + E = PlatformConsts.IdentityPermissions.Users.Default + ".Export", }), DeleteCommand = $"UPDATE \"AbpUsers\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", DeleteFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { @@ -1582,13 +1581,13 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency Hint = "Detail", Text ="Detail", UrlTarget="_blank", - AuthName=IdentityPermissions.Users.Update, + AuthName=PlatformConsts.IdentityPermissions.Users.Update, Url="/admin/identity/users/detail/@Id" }, new CommandColumnDto() { Hint = "Permission", Text = "Permission", - AuthName = IdentityPermissions.Users.ManagePermissions, + AuthName = PlatformConsts.IdentityPermissions.Users.ManagePermissions, DialogName = "UsersPermission", DialogParameters = JsonSerializer.Serialize(new { name = "@Email", @@ -1624,9 +1623,9 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency IsDeleted = false, PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto { - C = IdentityPermissions.Users.Create, - R = IdentityPermissions.Users.Default, - U = IdentityPermissions.Users.Update, + C = PlatformConsts.IdentityPermissions.Users.Create, + R = PlatformConsts.IdentityPermissions.Users.Default, + U = PlatformConsts.IdentityPermissions.Users.Update, E = true, Deny = false }), @@ -1654,9 +1653,9 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency }), PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto { - C = IdentityPermissions.Users.Create, - R = IdentityPermissions.Users.Default, - U = IdentityPermissions.Users.Update, + C = PlatformConsts.IdentityPermissions.Users.Create, + R = PlatformConsts.IdentityPermissions.Users.Default, + U = PlatformConsts.IdentityPermissions.Users.Update, E = true, Deny = false }), @@ -1684,9 +1683,9 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency }), PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto { - C = IdentityPermissions.Users.Create, - R = IdentityPermissions.Users.Default, - U = IdentityPermissions.Users.Update, + C = PlatformConsts.IdentityPermissions.Users.Create, + R = PlatformConsts.IdentityPermissions.Users.Default, + U = PlatformConsts.IdentityPermissions.Users.Update, E = true, Deny = false }), @@ -1714,9 +1713,9 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency }), PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto { - C = IdentityPermissions.Users.Create, - R = IdentityPermissions.Users.Default, - U = IdentityPermissions.Users.Update, + C = PlatformConsts.IdentityPermissions.Users.Create, + R = PlatformConsts.IdentityPermissions.Users.Default, + U = PlatformConsts.IdentityPermissions.Users.Update, E = true, Deny = false }), @@ -1741,9 +1740,9 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency AllowSearch = true, PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto { - C = IdentityPermissions.Users.Create, - R = IdentityPermissions.Users.Default, - U = IdentityPermissions.Users.Update, + C = PlatformConsts.IdentityPermissions.Users.Create, + R = PlatformConsts.IdentityPermissions.Users.Default, + U = PlatformConsts.IdentityPermissions.Users.Update, E = true, Deny = false }), @@ -1767,9 +1766,9 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency IsDeleted = false, PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto { - C = IdentityPermissions.Users.Create, - R = IdentityPermissions.Users.Default, - U = IdentityPermissions.Users.Update, + C = PlatformConsts.IdentityPermissions.Users.Create, + R = PlatformConsts.IdentityPermissions.Users.Default, + U = PlatformConsts.IdentityPermissions.Users.Update, E = true, Deny = false }), @@ -1793,9 +1792,9 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency IsDeleted = false, PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto { - C = IdentityPermissions.Users.Create, - R = IdentityPermissions.Users.Default, - U = IdentityPermissions.Users.Update, + C = PlatformConsts.IdentityPermissions.Users.Create, + R = PlatformConsts.IdentityPermissions.Users.Default, + U = PlatformConsts.IdentityPermissions.Users.Update, E = true, Deny = false }), @@ -1825,7 +1824,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency IsOrganizationUnit = false, Description = AppCodes.Languages.Language, SelectCommandType = SelectCommandTypeEnum.Table, - SelectCommand = DbTablePrefix + "Language", + SelectCommand = SelectCommandByTableName("Language"), KeyFieldName = "Id", KeyFieldDbSourceType = DbType.Guid, DefaultFilter = "\"IsDeleted\" = 'false'", @@ -1944,7 +1943,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency Hint = "Manage", Text ="Manage", UrlTarget="_blank", - AuthName=AppCodes.IpRestrictions + ".Update", + AuthName = AppCodes.IdentityManagement.IpRestrictions + ".Update", Url=$"/form/{ListFormCodes.Forms.FormLanguage}/@Id" }, }), @@ -2169,7 +2168,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency IsOrganizationUnit = false, Description = AppCodes.Languages.LanguageText, SelectCommandType = SelectCommandTypeEnum.Table, - SelectCommand = DbTablePrefix + "LanguageText", + SelectCommand = SelectCommandByTableName("LanguageText"), KeyFieldName = "Id", KeyFieldDbSourceType = DbType.Guid, DefaultFilter = "\"IsDeleted\" = 'false'", @@ -2477,7 +2476,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency IsOrganizationUnit = false, Description = AppCodes.Menus, SelectCommandType = SelectCommandTypeEnum.Table, - SelectCommand = DbTablePrefix + "Menu", + SelectCommand = SelectCommandByTableName("Menu"), KeyFieldName = "Id", KeyFieldDbSourceType = DbType.Guid, DefaultFilter = "\"IsDeleted\" = 'false'", @@ -2976,7 +2975,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency IsOrganizationUnit = false, Description = AppCodes.Listforms.Listform, SelectCommandType = SelectCommandTypeEnum.Table, - SelectCommand = DbTablePrefix + "ListForm", + SelectCommand = SelectCommandByTableName("ListForm"), KeyFieldName = "Id", KeyFieldDbSourceType = DbType.Guid, DefaultFilter = "\"IsDeleted\" = 'false'", @@ -3837,7 +3836,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency IsOrganizationUnit = false, Description = AppCodes.Settings.SettingDefinitions, SelectCommandType = SelectCommandTypeEnum.Table, - SelectCommand = DbTablePrefix + "SettingDefinition", + SelectCommand = SelectCommandByTableName("SettingDefinition"), KeyFieldName = "Id", KeyFieldDbSourceType = DbType.Guid, DefaultFilter = "\"IsDeleted\" = 'false'", @@ -4494,7 +4493,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency IsOrganizationUnit = false, Description = AppCodes.Listforms.Chart, SelectCommandType = SelectCommandTypeEnum.Table, - SelectCommand = DbTablePrefix + "Chart", + SelectCommand = SelectCommandByTableName("Chart"), KeyFieldName = "Id", KeyFieldDbSourceType = DbType.Guid, DefaultFilter = "\"IsDeleted\" = 'false'", @@ -4807,7 +4806,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency IsOrganizationUnit = false, Description = AppCodes.Listforms.DataSource, SelectCommandType = SelectCommandTypeEnum.Table, - SelectCommand = DbTablePrefix + "DataSource", + SelectCommand = SelectCommandByTableName("DataSource"), KeyFieldName = "Id", KeyFieldDbSourceType = DbType.Guid, DefaultFilter = "\"IsDeleted\" = 'false'", @@ -5059,7 +5058,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency IsOrganizationUnit = false, Description = AppCodes.BackgroundWorkers, SelectCommandType = SelectCommandTypeEnum.Table, - SelectCommand = DbTablePrefix + "BackgroundWorker", + SelectCommand = SelectCommandByTableName("BackgroundWorker"), KeyFieldName = "Id", KeyFieldDbSourceType = DbType.Guid, DefaultFilter = "\"IsDeleted\" = 'false'", @@ -5453,7 +5452,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency IsOrganizationUnit = false, Description = AppCodes.Notifications.NotificationRules, SelectCommandType = SelectCommandTypeEnum.Table, - SelectCommand = DbTablePrefix + "NotificationRule", + SelectCommand = SelectCommandByTableName("NotificationRule"), KeyFieldName = "Id", KeyFieldDbSourceType = DbType.Guid, DefaultFilter = "\"IsDeleted\" = 'false'", @@ -5863,7 +5862,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency IsOrganizationUnit = false, Description = AppCodes.Notifications.Notification, SelectCommandType = SelectCommandTypeEnum.Table, - SelectCommand = DbTablePrefix + "Notification", + SelectCommand = SelectCommandByTableName("Notification"), KeyFieldName = "Id", KeyFieldDbSourceType = DbType.Guid, DefaultFilter = "\"IsDeleted\" = 'false'", @@ -6189,15 +6188,15 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency { CultureName = LanguageCodes.En, ListFormCode = ListFormCodes.Lists.IpRestriction, - Name = AppCodes.IpRestrictions, - Title = AppCodes.IpRestrictions, + Name = AppCodes.IdentityManagement.IpRestrictions, + Title = AppCodes.IdentityManagement.IpRestrictions, DataSourceCode = SeedConsts.DataSources.DefaultCode, IsTenant = true, IsBranch = false, IsOrganizationUnit = false, - Description = AppCodes.IpRestrictions, + Description = AppCodes.IdentityManagement.IpRestrictions, SelectCommandType = SelectCommandTypeEnum.Table, - SelectCommand = DbTablePrefix + "IpRestriction", + SelectCommand = SelectCommandByTableName("IpRestriction"), KeyFieldName = "Id", KeyFieldDbSourceType = DbType.Guid, DefaultFilter = "\"IsDeleted\" = 'false'", @@ -6230,11 +6229,11 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency }), PermissionJson = JsonSerializer.Serialize(new PermissionCrudDto { - C = AppCodes.IpRestrictions + ".Create", - R = AppCodes.IpRestrictions, - U = AppCodes.IpRestrictions + ".Update", - D = AppCodes.IpRestrictions + ".Delete", - E = AppCodes.IpRestrictions + ".Export", + C = AppCodes.IdentityManagement.IpRestrictions + ".Create", + R = AppCodes.IdentityManagement.IpRestrictions, + U = AppCodes.IdentityManagement.IpRestrictions + ".Update", + D = AppCodes.IdentityManagement.IpRestrictions + ".Delete", + E = AppCodes.IdentityManagement.IpRestrictions + ".Export", }), DeleteCommand = $"UPDATE \"{DbTablePrefix}IpRestriction\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", DeleteFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { @@ -6315,9 +6314,9 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency IsDeleted = false, PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto { - C = AppCodes.IpRestrictions + ".Create", - R = AppCodes.IpRestrictions, - U = AppCodes.IpRestrictions + ".Update", + C = AppCodes.IdentityManagement.IpRestrictions + ".Create", + R = AppCodes.IdentityManagement.IpRestrictions, + U = AppCodes.IdentityManagement.IpRestrictions + ".Update", E = true, Deny = false }), @@ -6358,9 +6357,9 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency }), PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto { - C = AppCodes.IpRestrictions + ".Create", - R = AppCodes.IpRestrictions, - U = AppCodes.IpRestrictions + ".Update", + C = AppCodes.IdentityManagement.IpRestrictions + ".Create", + R = AppCodes.IdentityManagement.IpRestrictions, + U = AppCodes.IdentityManagement.IpRestrictions + ".Update", E = true, Deny = false }), @@ -6391,9 +6390,9 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency }), PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto { - C = AppCodes.IpRestrictions + ".Create", - R = AppCodes.IpRestrictions, - U = AppCodes.IpRestrictions + ".Update", + C = AppCodes.IdentityManagement.IpRestrictions + ".Create", + R = AppCodes.IdentityManagement.IpRestrictions, + U = AppCodes.IdentityManagement.IpRestrictions + ".Update", E = true, Deny = false }), @@ -6418,9 +6417,9 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency AllowSearch = true, PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto { - C = AppCodes.IpRestrictions + ".Create", - R = AppCodes.IpRestrictions, - U = AppCodes.IpRestrictions + ".Update", + C = AppCodes.IdentityManagement.IpRestrictions + ".Create", + R = AppCodes.IdentityManagement.IpRestrictions, + U = AppCodes.IdentityManagement.IpRestrictions + ".Update", E = true, Deny = false }), @@ -6450,7 +6449,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency IsOrganizationUnit = false, Description = AppCodes.PublicApis, SelectCommandType = SelectCommandTypeEnum.Table, - SelectCommand = DbTablePrefix + "PublicApi", + SelectCommand = SelectCommandByTableName("PublicApi"), KeyFieldName = "Id", KeyFieldDbSourceType = DbType.Guid, DefaultFilter = "\"IsDeleted\" = 'false'", @@ -7055,7 +7054,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency IsOrganizationUnit = false, Description = AppCodes.Settings.GlobalSearch, SelectCommandType = SelectCommandTypeEnum.Table, - SelectCommand = DbTablePrefix + "GlobalSearch", + SelectCommand = SelectCommandByTableName("GlobalSearch"), KeyFieldName = "Id", KeyFieldDbSourceType = DbType.Int32, SortMode = GridOptions.SortModeSingle, @@ -7309,344 +7308,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency } #endregion - #region Security Log - if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.SecurityLog)) - { - var listFormSecurityLog = await _listFormRepository.InsertAsync( - new ListForm() - { - 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() { - ListFormCode = listFormSecurityLog.ListFormCode, - RoleId = null, - UserId = null, - CultureName = LanguageCodes.En, - SourceDbType = DbType.Guid, - FieldName = "Id", - Width = 100, - ListOrderNo = 1, - Visible = false, - IsActive = true, - IsDeleted = false, - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.IdentityPermissions.Users.SecurityLogs + ".Create", - R = AppCodes.IdentityPermissions.Users.SecurityLogs, - U = AppCodes.IdentityPermissions.Users.SecurityLogs + ".Update", - E = true, - Deny = false - }), - PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto - { - IsPivot = true - }) - }, - new() { - ListFormCode = listFormSecurityLog.ListFormCode, - RoleId = null, - UserId = null, - CultureName = LanguageCodes.En, - SourceDbType = DbType.DateTime, - FieldName = "CreationTime", - Width = 130, - ListOrderNo = 2, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = true, - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.IdentityPermissions.Users.SecurityLogs + ".Create", - R = AppCodes.IdentityPermissions.Users.SecurityLogs, - U = AppCodes.IdentityPermissions.Users.SecurityLogs + ".Update", - E = true, - Deny = false - }), - PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto - { - IsPivot = true - }) - }, - new() { - ListFormCode = listFormSecurityLog.ListFormCode, - RoleId = null, - UserId = null, - CultureName = LanguageCodes.En, - SourceDbType = DbType.String, - FieldName = "Action", - Width = 100, - ListOrderNo = 3, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = true, - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - R = AppCodes.IdentityPermissions.Users.SecurityLogs, - U = AppCodes.IdentityPermissions.Users.SecurityLogs + ".Update", - C = AppCodes.IdentityPermissions.Users.SecurityLogs + ".Create", - E = true, - Deny = false - }), - PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto - { - IsPivot = true - }) - }, - new() { - ListFormCode = listFormSecurityLog.ListFormCode, - RoleId = null, - UserId = null, - CultureName = LanguageCodes.En, - SourceDbType = DbType.String, - FieldName = "ClientIpAddress", - Width = 100, - ListOrderNo = 4, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = true, - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.IdentityPermissions.Users.SecurityLogs + ".Create", - R = AppCodes.IdentityPermissions.Users.SecurityLogs, - U = AppCodes.IdentityPermissions.Users.SecurityLogs + ".Update", - E = true, - Deny = false - }), - PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto - { - IsPivot = true - }) - }, - new() { - ListFormCode = listFormSecurityLog.ListFormCode, - RoleId = null, - UserId = null, - CultureName = LanguageCodes.En, - SourceDbType = DbType.String, - FieldName = "BrowserInfo", - Width = 300, - ListOrderNo = 5, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = true, - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.IdentityPermissions.Users.SecurityLogs + ".Create", - R = AppCodes.IdentityPermissions.Users.SecurityLogs, - U = AppCodes.IdentityPermissions.Users.SecurityLogs + ".Update", - E = true, - Deny = false - }), - PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto - { - IsPivot = true - }) - }, - new() { - ListFormCode = listFormSecurityLog.ListFormCode, - RoleId = null, - UserId = null, - CultureName = LanguageCodes.En, - SourceDbType = DbType.String, - FieldName = "ApplicationName", - Width = 200, - ListOrderNo = 6, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = true, - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.IdentityPermissions.Users.SecurityLogs + ".Create", - R = AppCodes.IdentityPermissions.Users.SecurityLogs, - U = AppCodes.IdentityPermissions.Users.SecurityLogs + ".Update", - E = true, - Deny = false - }), - PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto - { - IsPivot = true - }) - }, - new() { - ListFormCode = listFormSecurityLog.ListFormCode, - RoleId = null, - UserId = null, - CultureName = LanguageCodes.En, - SourceDbType = DbType.String, - FieldName = "Identity", - Width = 100, - ListOrderNo = 7, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = true, - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - R = AppCodes.IdentityPermissions.Users.SecurityLogs, - U = AppCodes.IdentityPermissions.Users.SecurityLogs + ".Update", - C = AppCodes.IdentityPermissions.Users.SecurityLogs + ".Create", - E = true, - Deny = false - }), - PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto - { - IsPivot = true - }) - }, - new() { - ListFormCode = listFormSecurityLog.ListFormCode, - RoleId = null, - UserId = null, - CultureName = LanguageCodes.En, - SourceDbType = DbType.String, - FieldName = "UserName", - Width = 150, - ListOrderNo = 8, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = true, - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.IdentityPermissions.Users.SecurityLogs + ".Create", - R = AppCodes.IdentityPermissions.Users.SecurityLogs, - U = AppCodes.IdentityPermissions.Users.SecurityLogs + ".Update", - E = true, - Deny = false - }), - PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto - { - IsPivot = true - }) - }, - new() { - ListFormCode = listFormSecurityLog.ListFormCode, - RoleId = null, - UserId = null, - CultureName = LanguageCodes.En, - SourceDbType = DbType.String, - FieldName = "ClientId", - Width = 150, - ListOrderNo = 9, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = true, - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.IdentityPermissions.Users.SecurityLogs + ".Create", - R = AppCodes.IdentityPermissions.Users.SecurityLogs, - U = AppCodes.IdentityPermissions.Users.SecurityLogs + ".Update", - E = true, - Deny = false - }), - PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto - { - IsPivot = true - }) - }, - new() { - ListFormCode = listFormSecurityLog.ListFormCode, - RoleId = null, - UserId = null, - CultureName = LanguageCodes.En, - SourceDbType = DbType.String, - FieldName = "CorrelationId", - Width = 150, - ListOrderNo = 10, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = true, - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.IdentityPermissions.Users.SecurityLogs + ".Create", - R = AppCodes.IdentityPermissions.Users.SecurityLogs, - U = AppCodes.IdentityPermissions.Users.SecurityLogs + ".Update", - E = true, - Deny = false - }), - PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto - { - IsPivot = true - }) - }, - ]); - #endregion - } - #endregion - - #region Audit Log + #region Audit Logs if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.AuditLog)) { var listFormAuditLog = await _listFormRepository.InsertAsync( @@ -7984,7 +7646,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency IsOrganizationUnit = false, Description = AppCodes.Branches, SelectCommandType = SelectCommandTypeEnum.Table, - SelectCommand = DbTablePrefix + "Branch", + SelectCommand = SelectCommandByTableName("Branch"), KeyFieldName = "Id", KeyFieldDbSourceType = DbType.Guid, DefaultFilter = "\"IsDeleted\" = 'false'", @@ -8590,13 +8252,13 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency { CultureName = LanguageCodes.En, ListFormCode = ListFormCodes.Lists.ClaimType, - Name = AppCodes.IdentityPermissions.Users.ClaimTypes, - Title = AppCodes.IdentityPermissions.Users.ClaimTypes, + Name = AppCodes.IdentityManagement.ClaimTypes, + Title = AppCodes.IdentityManagement.ClaimTypes, DataSourceCode = SeedConsts.DataSources.DefaultCode, IsTenant = false, IsBranch = false, IsOrganizationUnit = false, - Description = AppCodes.IdentityPermissions.Users.ClaimTypes, + Description = AppCodes.IdentityManagement.ClaimTypes, SelectCommandType = SelectCommandTypeEnum.Table, SelectCommand = "AbpClaimTypes", KeyFieldName = "Id", @@ -8630,11 +8292,11 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency }), 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" + C = AppCodes.IdentityManagement.ClaimTypes + ".Create", + R = AppCodes.IdentityManagement.ClaimTypes, + U = AppCodes.IdentityManagement.ClaimTypes + ".Update", + D = AppCodes.IdentityManagement.ClaimTypes + ".Delete", + E = AppCodes.IdentityManagement.ClaimTypes + ".Export" }), PagerOptionJson = JsonSerializer.Serialize(new GridPagerOptionDto { @@ -8736,9 +8398,9 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency IsDeleted = false, PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto { - C = AppCodes.IdentityPermissions.Users.ClaimTypes + ".Create", - R = AppCodes.IdentityPermissions.Users.ClaimTypes, - U = AppCodes.IdentityPermissions.Users.ClaimTypes + ".Update", + C = AppCodes.IdentityManagement.ClaimTypes + ".Create", + R = AppCodes.IdentityManagement.ClaimTypes, + U = AppCodes.IdentityManagement.ClaimTypes + ".Update", E = true, Deny = false }), @@ -8763,9 +8425,9 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency AllowSearch = true, PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto { - C = AppCodes.IdentityPermissions.Users.ClaimTypes + ".Create", - R = AppCodes.IdentityPermissions.Users.ClaimTypes, - U = AppCodes.IdentityPermissions.Users.ClaimTypes + ".Update", + C = AppCodes.IdentityManagement.ClaimTypes + ".Create", + R = AppCodes.IdentityManagement.ClaimTypes, + U = AppCodes.IdentityManagement.ClaimTypes + ".Update", E = true, Deny = false }), @@ -8802,9 +8464,9 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency }), PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto { - C = AppCodes.IdentityPermissions.Users.ClaimTypes + ".Create", - R = AppCodes.IdentityPermissions.Users.ClaimTypes, - U = AppCodes.IdentityPermissions.Users.ClaimTypes + ".Update", + C = AppCodes.IdentityManagement.ClaimTypes + ".Create", + R = AppCodes.IdentityManagement.ClaimTypes, + U = AppCodes.IdentityManagement.ClaimTypes + ".Update", E = true, Deny = false }), @@ -8828,9 +8490,9 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency IsDeleted = false, PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto { - C = AppCodes.IdentityPermissions.Users.ClaimTypes + ".Create", - R = AppCodes.IdentityPermissions.Users.ClaimTypes, - U = AppCodes.IdentityPermissions.Users.ClaimTypes + ".Update", + C = AppCodes.IdentityManagement.ClaimTypes + ".Create", + R = AppCodes.IdentityManagement.ClaimTypes, + U = AppCodes.IdentityManagement.ClaimTypes + ".Update", E = true, Deny = false }), @@ -8854,9 +8516,9 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency IsDeleted = false, PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto { - C = AppCodes.IdentityPermissions.Users.ClaimTypes + ".Create", - R = AppCodes.IdentityPermissions.Users.ClaimTypes, - U = AppCodes.IdentityPermissions.Users.ClaimTypes + ".Update", + C = AppCodes.IdentityManagement.ClaimTypes + ".Create", + R = AppCodes.IdentityManagement.ClaimTypes, + U = AppCodes.IdentityManagement.ClaimTypes + ".Update", E = true, Deny = false }), @@ -8881,9 +8543,9 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency AllowSearch = true, PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto { - C = AppCodes.IdentityPermissions.Users.ClaimTypes + ".Create", - R = AppCodes.IdentityPermissions.Users.ClaimTypes, - U = AppCodes.IdentityPermissions.Users.ClaimTypes + ".Update", + C = AppCodes.IdentityManagement.ClaimTypes + ".Create", + R = AppCodes.IdentityManagement.ClaimTypes, + U = AppCodes.IdentityManagement.ClaimTypes + ".Update", E = true, Deny = false }), @@ -8908,9 +8570,9 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency AllowSearch = true, PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto { - C = AppCodes.IdentityPermissions.Users.ClaimTypes + ".Create", - R = AppCodes.IdentityPermissions.Users.ClaimTypes, - U = AppCodes.IdentityPermissions.Users.ClaimTypes + ".Update", + C = AppCodes.IdentityManagement.ClaimTypes + ".Create", + R = AppCodes.IdentityManagement.ClaimTypes, + U = AppCodes.IdentityManagement.ClaimTypes + ".Update", E = true, Deny = false }), @@ -8935,9 +8597,9 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency AllowSearch = true, PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto { - C = AppCodes.IdentityPermissions.Users.ClaimTypes + ".Create", - R = AppCodes.IdentityPermissions.Users.ClaimTypes, - U = AppCodes.IdentityPermissions.Users.ClaimTypes + ".Update", + C = AppCodes.IdentityManagement.ClaimTypes + ".Create", + R = AppCodes.IdentityManagement.ClaimTypes, + U = AppCodes.IdentityManagement.ClaimTypes + ".Update", E = true, Deny = false }), diff --git a/api/src/Kurs.Platform.DbMigrator/Seeds/PlatformDataSeeder.cs b/api/src/Kurs.Platform.DbMigrator/Seeds/PlatformDataSeeder.cs index b53a9dec..4dc97c83 100644 --- a/api/src/Kurs.Platform.DbMigrator/Seeds/PlatformDataSeeder.cs +++ b/api/src/Kurs.Platform.DbMigrator/Seeds/PlatformDataSeeder.cs @@ -6,7 +6,6 @@ using System.Text.Json; using System.Threading.Tasks; using Kurs.Languages.Entities; using Kurs.Notifications.Entities; -using Kurs.Platform.Blog; using Kurs.Platform.Charts.Dto; using Kurs.Platform.Entities; using Kurs.Platform.Enums; @@ -53,6 +52,7 @@ public class PlatformDataSeeder : IDataSeedContributor, ITransientDependency private readonly IRepository _blogCategoryRepository; private readonly IRepository _blogPostsRepository; private readonly IRepository _forumCategoryRepository; + private readonly IRepository _aiBotRepository; public PlatformDataSeeder( IRepository languages, @@ -81,7 +81,8 @@ public class PlatformDataSeeder : IDataSeedContributor, ITransientDependency IRepository contactTitleRepository, IRepository blogCategoryRepository, IRepository blogPostsRepository, - IRepository forumCategoryRepository + IRepository forumCategoryRepository, + IRepository aiBotRepository ) { _languages = languages; @@ -111,6 +112,7 @@ public class PlatformDataSeeder : IDataSeedContributor, ITransientDependency _blogCategoryRepository = blogCategoryRepository; _blogPostsRepository = blogPostsRepository; _forumCategoryRepository = forumCategoryRepository; + _aiBotRepository = aiBotRepository; } private static IConfigurationRoot BuildConfiguration() @@ -596,7 +598,7 @@ public class PlatformDataSeeder : IDataSeedContributor, ITransientDependency )); } } - + foreach (var item in items.ForumCategories) { var exists = await _forumCategoryRepository.AnyAsync(x => x.Name == item.Name); @@ -611,9 +613,22 @@ public class PlatformDataSeeder : IDataSeedContributor, ITransientDependency item.Icon, item.DisplayOrder ); - + await _forumCategoryRepository.InsertAsync(newCategory); } } + + foreach (var item in items.AiBots) + { + var exists = await _aiBotRepository.AnyAsync(x => x.BotName == item.BotName); + + if (!exists) + { + await _aiBotRepository.InsertAsync(new AiBot( + item.Id, + item.BotName + )); + } + } } } diff --git a/api/src/Kurs.Platform.DbMigrator/Seeds/SeederData.json b/api/src/Kurs.Platform.DbMigrator/Seeds/SeederData.json index 33c12539..7296146d 100644 --- a/api/src/Kurs.Platform.DbMigrator/Seeds/SeederData.json +++ b/api/src/Kurs.Platform.DbMigrator/Seeds/SeederData.json @@ -650,16 +650,10 @@ }, { "resourceName": "Platform", - "key": "AbpIdentity.Users.ClaimType", + "key": "App.ClaimType", "en": "Claim Types", "tr": "Talep Tipleri" }, - { - "resourceName": "Platform", - "key": "AbpIdentity.Users.SecurityLog", - "en": "Security Logs", - "tr": "Bağlantı Geçmişi" - }, { "resourceName": "Platform", "key": "App.AuditLogs", @@ -6432,12 +6426,12 @@ }, { "ParentCode": "Abp.Identity", - "Code": "AbpIdentity.Users.ClaimType", - "DisplayName": "AbpIdentity.Users.ClaimType", + "Code": "App.ClaimType", + "DisplayName": "App.ClaimType", "Order": 6, "Url": "/list/list-claimtype", "Icon": "FcOrganization", - "RequiredPermissionName": "AbpIdentity.Users.ClaimType", + "RequiredPermissionName": "App.ClaimType", "IsDisabled": false }, { @@ -6450,16 +6444,6 @@ "RequiredPermissionName": "App.IpRestrictions", "IsDisabled": false }, - { - "ParentCode": "AbpIdentity.Users", - "Code": "AbpIdentity.Users.SecurityLog", - "DisplayName": "AbpIdentity.Users.SecurityLog", - "Order": 8, - "Url": "/list/list-securitylog", - "Icon": "FcPrivacy", - "RequiredPermissionName": "AbpIdentity.Users.SecurityLog", - "IsDisabled": false - }, { "ParentCode": "App.Administration", "Code": "App.AuditLogs", @@ -6596,19 +6580,12 @@ "IsEnabled": true, "MultiTenancySide": 3 }, + { "GroupName": "AbpIdentity", - "Name": "AbpIdentity.Users.SecurityLog", + "Name": "App.ClaimType", "ParentName": null, - "DisplayName": "AbpIdentity.Users.SecurityLog", - "IsEnabled": true, - "MultiTenancySide": 3 - }, - { - "GroupName": "AbpIdentity", - "Name": "AbpIdentity.Users.ClaimType", - "ParentName": null, - "DisplayName": "AbpIdentity.Users.ClaimType", + "DisplayName": "App.ClaimType", "IsEnabled": true, "MultiTenancySide": 3 }, @@ -7052,38 +7029,6 @@ "IsEnabled": true, "MultiTenancySide": 3 }, - { - "GroupName": "AbpIdentity", - "Name": "AbpIdentity.Users.SecurityLog.Create", - "ParentName": "AbpIdentity.Users.SecurityLog", - "DisplayName": "Create", - "IsEnabled": true, - "MultiTenancySide": 3 - }, - { - "GroupName": "AbpIdentity", - "Name": "AbpIdentity.Users.SecurityLog.Delete", - "ParentName": "AbpIdentity.Users.SecurityLog", - "DisplayName": "Delete", - "IsEnabled": true, - "MultiTenancySide": 3 - }, - { - "GroupName": "AbpIdentity", - "Name": "AbpIdentity.Users.SecurityLog.Export", - "ParentName": "AbpIdentity.Users.SecurityLog", - "DisplayName": "Export", - "IsEnabled": true, - "MultiTenancySide": 3 - }, - { - "GroupName": "AbpIdentity", - "Name": "AbpIdentity.Users.SecurityLog.Update", - "ParentName": "AbpIdentity.Users.SecurityLog", - "DisplayName": "Update", - "IsEnabled": true, - "MultiTenancySide": 3 - }, { "GroupName": "AbpIdentity", "Name": "AbpIdentity.Users.Update.ManageRoles", @@ -7238,32 +7183,32 @@ }, { "GroupName": "AbpIdentity", - "Name": "AbpIdentity.Users.ClaimType.Create", - "ParentName": "AbpIdentity.Users.ClaimType", + "Name": "App.ClaimType.Create", + "ParentName": "App.ClaimType", "DisplayName": "Create", "IsEnabled": true, "MultiTenancySide": 3 }, { "GroupName": "AbpIdentity", - "Name": "AbpIdentity.Users.ClaimType.Delete", - "ParentName": "AbpIdentity.Users.ClaimType", + "Name": "App.ClaimType.Delete", + "ParentName": "App.ClaimType", "DisplayName": "Delete", "IsEnabled": true, "MultiTenancySide": 3 }, { "GroupName": "AbpIdentity", - "Name": "AbpIdentity.Users.ClaimType.Export", - "ParentName": "AbpIdentity.Users.ClaimType", + "Name": "App.ClaimType.Export", + "ParentName": "App.ClaimType", "DisplayName": "Export", "IsEnabled": true, "MultiTenancySide": 3 }, { "GroupName": "AbpIdentity", - "Name": "AbpIdentity.Users.ClaimType.Update", - "ParentName": "AbpIdentity.Users.ClaimType", + "Name": "App.ClaimType.Update", + "ParentName": "App.ClaimType", "DisplayName": "Update", "IsEnabled": true, "MultiTenancySide": 3 @@ -20400,5 +20345,11 @@ "DisplayOrder": 4, "IsActive": true } + ], + "AiBots": [ + { + "Id": "1a79a36e-e062-4335-9ddf-0557c60f3ea9", + "BotName": "Chat Bot" + } ] } diff --git a/api/src/Kurs.Platform.DbMigrator/Seeds/SeederDto.cs b/api/src/Kurs.Platform.DbMigrator/Seeds/SeederDto.cs index 5c3070c6..9f8e47b3 100644 --- a/api/src/Kurs.Platform.DbMigrator/Seeds/SeederDto.cs +++ b/api/src/Kurs.Platform.DbMigrator/Seeds/SeederDto.cs @@ -36,6 +36,7 @@ public class SeederDto public List BlogCategories { get; set; } public List BlogPosts { get; set; } public List ForumCategories { get; set; } + public List AiBots { get; set; } } public class ChartsSeedDto @@ -234,4 +235,10 @@ public class ForumCategorySeedDto public string Icon { get; set; } public int DisplayOrder { get; set; } public bool IsActive { get; set; } -} \ No newline at end of file +} + +public class AiBotSeedDto +{ + public Guid Id { get; set; } + public string BotName { get; set; } +} diff --git a/api/src/Kurs.Platform.Domain.Shared/PlatformConsts.cs b/api/src/Kurs.Platform.Domain.Shared/PlatformConsts.cs index 69077b5e..711bbc71 100644 --- a/api/src/Kurs.Platform.Domain.Shared/PlatformConsts.cs +++ b/api/src/Kurs.Platform.Domain.Shared/PlatformConsts.cs @@ -3,6 +3,7 @@ using System.Collections.ObjectModel; using System.Linq; using Kurs.Languages.Languages; using Volo.Abp.Localization; +using Volo.Abp.Reflection; namespace Kurs.Platform; @@ -253,26 +254,23 @@ public static class PlatformConsts public static class AppCodes { public const string Home = Prefix.App + ".Home"; - public const string Setting = Prefix.App + ".Setting"; - - public const string Administration = Prefix.App + ".Administration"; + //Saas + public const string Saas = Prefix.App + ".Saas"; + public const string Branches = Prefix.App + ".Branches"; public static class Settings { public const string Default = Prefix.App + ".Settings"; public const string GlobalSearch = Default + ".GlobalSearch"; public const string SettingDefinitions = Default + ".SettingDefinitions"; } - public static class Languages { public const string Default = Prefix.App + ".Languages"; public const string Language = Default + ".Language"; public const string LanguageText = Default + ".LanguageText"; } - public const string Menus = Prefix.App + ".Menus"; - public static class Listforms { public const string Default = Prefix.App + ".Listforms"; @@ -283,28 +281,45 @@ public static class PlatformConsts public const string ListformField = Default + ".ListformField"; public const string Chart = Default + ".Chart"; } - - public const string BackgroundWorkers = Prefix.App + ".BackgroundWorkers"; - public static class Notifications { public const string Default = Prefix.App + ".Notifications"; public const string NotificationRules = Default + ".NotificationRules"; public const string Notification = Default + ".Notification"; } - - public const string IpRestrictions = Prefix.App + ".IpRestrictions"; + public const string BackgroundWorkers = Prefix.App + ".BackgroundWorkers"; public static class PublicApis { public const string Default = Prefix.App + ".PublicApis"; public const string Get = Default + ".Get"; public const string Post = Default + ".Post"; } - - public const string AuditLogs = Prefix.App + ".AuditLogs"; - public const string Branches = Prefix.App + ".Branches"; + public const string Blog = Prefix.App + ".Blog"; public const string Forum = Prefix.App + ".Forum"; - public const string Blog = Prefix.App + ".Blog"; + + //Administration + public const string Administration = Prefix.App + ".Administration"; + public const string Setting = Prefix.App + ".Setting"; + + public static class IdentityManagement + { + public const string ClaimTypes = Prefix.App + ".ClaimType"; + public const string IpRestrictions = Prefix.App + ".IpRestrictions"; + } + public const string AuditLogs = Prefix.App + ".AuditLogs"; + public static class Definitions + { + public const string Default = Prefix.App + ".Definitions"; + public const string Sector = Default + ".Sector"; + public const string ContactTag = Default + ".ContactTag"; + public const string ContactTitle = Default + ".ContactTitle"; + public const string Currency = Default + ".Currency"; + public const string CountryGroup = Default + ".CountryGroup"; + public const string Country = Default + ".Country"; + public const string State = Default + ".State"; + public const string SkillType = Default + ".SkillType"; + public const string UomCategory = Default + ".UomCategory"; + } } public static class ListFormCodes @@ -333,12 +348,23 @@ public static class PlatformConsts public const string AuditLog = "list-auditlog"; public const string Branch = "list-branch"; public const string ClaimType = "list-claimtype"; + public const string Sector = "list-sector"; + public const string ContactTag = "list-contactTag"; + public const string ContactTitle = "list-contactTitle"; + public const string Currency = "list-currency"; + public const string CountryGroup = "list-countryGroup"; + public const string Country = "list-country"; + public const string State = "list-state"; + public const string SkillType = "list-skillType"; + public const string UomCategory = "list-uomCategory"; public const string ListformField = "list-listformfield"; } public static class Forms { public const string FormLanguage = "form-language"; + public const string FormUomCategory = "form-uomCategory"; + public const string FormSkillType = "form-skillType"; } } @@ -1233,4 +1259,42 @@ public static class PlatformConsts } } + public static class IdentityPermissions + { + public const string GroupName = "AbpIdentity"; + + public static class Roles + { + public const string Default = GroupName + ".Roles"; + public const string Create = Default + ".Create"; + public const string Update = Default + ".Update"; + public const string Delete = Default + ".Delete"; + public const string ManagePermissions = Default + ".ManagePermissions"; + } + + public static class Users + { + public const string Default = GroupName + ".Users"; + public const string Create = Default + ".Create"; + public const string Update = Default + ".Update"; + public const string Delete = Default + ".Delete"; + public const string ManagePermissions = Default + ".ManagePermissions"; + public const string ManageRoles = Update + ".ManageRoles"; + } + + public static class UserLookup + { + public const string Default = GroupName + ".UserLookup"; + } + + public static string[] GetAll() + { + return ReflectionHelper.GetPublicConstantsRecursively(typeof(IdentityPermissions)); + } + } + + public static string SelectCommandByTableName(string TableName) + { + return DbTablePrefix + TableName; + } } diff --git a/api/src/Kurs.Platform.Domain/Data/SeedConsts.cs b/api/src/Kurs.Platform.Domain/Data/SeedConsts.cs index 4b5ca545..cf6a2fbd 100644 --- a/api/src/Kurs.Platform.Domain/Data/SeedConsts.cs +++ b/api/src/Kurs.Platform.Domain/Data/SeedConsts.cs @@ -307,38 +307,23 @@ public static class SeedConsts public static class AppCodes { public const string Home = Prefix.App + ".Home"; - public const string Setting = Prefix.App + ".Setting"; + + //Saas public const string Saas = Prefix.App + ".Saas"; - public const string Administration = Prefix.App + ".Administration"; - - public static class IdentityPermissions - { - public const string GroupName = "AbpIdentity"; - - public static class Users - { - public const string Default = GroupName + ".Users"; - public const string SecurityLogs = Default + ".SecurityLog"; - public const string ClaimTypes = Default + ".ClaimType"; - } - } - + public const string Branches = Prefix.App + ".Branches"; public static class Settings { public const string Default = Prefix.App + ".Settings"; public const string GlobalSearch = Default + ".GlobalSearch"; public const string SettingDefinitions = Default + ".SettingDefinitions"; } - public static class Languages { public const string Default = Prefix.App + ".Languages"; public const string Language = Default + ".Language"; public const string LanguageText = Default + ".LanguageText"; } - public const string Menus = Prefix.App + ".Menus"; - public static class Listforms { public const string Default = Prefix.App + ".Listforms"; @@ -349,22 +334,39 @@ public static class SeedConsts public const string ListformField = Default + ".ListformField"; public const string Chart = Default + ".Chart"; } - - public const string BackgroundWorkers = Prefix.App + ".BackgroundWorkers"; - public static class Notifications { public const string Default = Prefix.App + ".Notifications"; public const string NotificationRules = Default + ".NotificationRules"; public const string Notification = Default + ".Notification"; } - - public const string IpRestrictions = Prefix.App + ".IpRestrictions"; + public const string BackgroundWorkers = Prefix.App + ".BackgroundWorkers"; public const string PublicApis = Prefix.App + ".PublicApis"; - public const string AuditLogs = Prefix.App + ".AuditLogs"; - public const string Branches = Prefix.App + ".Branches"; - public const string Forum = Prefix.App + ".Forum"; public const string Blog = Prefix.App + ".Blog"; + public const string Forum = Prefix.App + ".Forum"; + + //Administration + public const string Administration = Prefix.App + ".Administration"; + public const string Setting = Prefix.App + ".Setting"; + public static class IdentityManagement + { + public const string ClaimTypes = Prefix.App + ".ClaimType"; + public const string IpRestrictions = Prefix.App + ".IpRestrictions"; + } + public const string AuditLogs = Prefix.App + ".AuditLogs"; + public static class Definitions + { + public const string Default = Prefix.App + ".Definitions"; + public const string Sector = Default + ".Sector"; + public const string ContactTag = Default + ".ContactTag"; + public const string ContactTitle = Default + ".ContactTitle"; + public const string Currency = Default + ".Currency"; + public const string CountryGroup = Default + ".CountryGroup"; + public const string Country = Default + ".Country"; + public const string State = Default + ".State"; + public const string SkillType = Default + ".SkillType"; + public const string UomCategory = Default + ".UomCategory"; + } } public static class DataSources diff --git a/api/src/Kurs.Platform.Domain/Entities/AiBot.cs b/api/src/Kurs.Platform.Domain/Entities/AiBot.cs index c1f80ecc..a8d3b4dc 100644 --- a/api/src/Kurs.Platform.Domain/Entities/AiBot.cs +++ b/api/src/Kurs.Platform.Domain/Entities/AiBot.cs @@ -5,5 +5,12 @@ namespace Kurs.Platform.Entities; public class AiBot : Entity { - public string BotName { get; set; } + public string BotName { get; set; } + + public AiBot(Guid id, string botName) + { + Id = Id; + BotName = botName; + } } + diff --git a/api/src/Kurs.Platform.EntityFrameworkCore/DatabaseMigrationEventHandlerBase.cs b/api/src/Kurs.Platform.EntityFrameworkCore/DatabaseMigrationEventHandlerBase.cs index 49a50cb4..802d8fdc 100644 --- a/api/src/Kurs.Platform.EntityFrameworkCore/DatabaseMigrationEventHandlerBase.cs +++ b/api/src/Kurs.Platform.EntityFrameworkCore/DatabaseMigrationEventHandlerBase.cs @@ -245,20 +245,20 @@ public class DatabaseMigrationEventHandler : { await PermissionGrantRepository.InsertManyAsync( [ - new(Guid.NewGuid(), IdentityPermissions.Roles.Default, "R", PlatformConsts.AbpIdentity.User.AdminRoleName, eventData.TenantId), - new(Guid.NewGuid(), IdentityPermissions.Roles.Create, "R", PlatformConsts.AbpIdentity.User.AdminRoleName, eventData.TenantId), - new(Guid.NewGuid(), IdentityPermissions.Roles.Delete, "R", PlatformConsts.AbpIdentity.User.AdminRoleName, eventData.TenantId), - new(Guid.NewGuid(), IdentityPermissions.Roles.Update, "R", PlatformConsts.AbpIdentity.User.AdminRoleName, eventData.TenantId), - new(Guid.NewGuid(), IdentityPermissions.Roles.Default + ".Export", "R", PlatformConsts.AbpIdentity.User.AdminRoleName, eventData.TenantId), - new(Guid.NewGuid(), IdentityPermissions.Roles.ManagePermissions, "R", PlatformConsts.AbpIdentity.User.AdminRoleName, eventData.TenantId), - new(Guid.NewGuid(), IdentityPermissions.Users.Default, "R", PlatformConsts.AbpIdentity.User.AdminRoleName, eventData.TenantId), - new(Guid.NewGuid(), IdentityPermissions.Users.Create, "R", PlatformConsts.AbpIdentity.User.AdminRoleName, eventData.TenantId), - new(Guid.NewGuid(), IdentityPermissions.Users.Delete, "R", PlatformConsts.AbpIdentity.User.AdminRoleName, eventData.TenantId), - new(Guid.NewGuid(), IdentityPermissions.Users.Update, "R", PlatformConsts.AbpIdentity.User.AdminRoleName, eventData.TenantId), - new(Guid.NewGuid(), IdentityPermissions.Users.ManagePermissions, "R", PlatformConsts.AbpIdentity.User.AdminRoleName, eventData.TenantId), - new(Guid.NewGuid(), IdentityPermissions.Users.Default + ".Export", "R", PlatformConsts.AbpIdentity.User.AdminRoleName, eventData.TenantId), - new(Guid.NewGuid(), IdentityPermissions.Users.ManageRoles, "R", PlatformConsts.AbpIdentity.User.AdminRoleName, eventData.TenantId), - new(Guid.NewGuid(), IdentityPermissions.UserLookup.Default, "R", PlatformConsts.AbpIdentity.User.AdminRoleName, eventData.TenantId), + new(Guid.NewGuid(), PlatformConsts.IdentityPermissions.Roles.Default, "R", PlatformConsts.AbpIdentity.User.AdminRoleName, eventData.TenantId), + new(Guid.NewGuid(), PlatformConsts.IdentityPermissions.Roles.Create, "R", PlatformConsts.AbpIdentity.User.AdminRoleName, eventData.TenantId), + new(Guid.NewGuid(), PlatformConsts.IdentityPermissions.Roles.Delete, "R", PlatformConsts.AbpIdentity.User.AdminRoleName, eventData.TenantId), + new(Guid.NewGuid(), PlatformConsts.IdentityPermissions.Roles.Update, "R", PlatformConsts.AbpIdentity.User.AdminRoleName, eventData.TenantId), + new(Guid.NewGuid(), PlatformConsts.IdentityPermissions.Roles.Default + ".Export", "R", PlatformConsts.AbpIdentity.User.AdminRoleName, eventData.TenantId), + new(Guid.NewGuid(), PlatformConsts.IdentityPermissions.Roles.ManagePermissions, "R", PlatformConsts.AbpIdentity.User.AdminRoleName, eventData.TenantId), + new(Guid.NewGuid(), PlatformConsts.IdentityPermissions.Users.Default, "R", PlatformConsts.AbpIdentity.User.AdminRoleName, eventData.TenantId), + new(Guid.NewGuid(), PlatformConsts.IdentityPermissions.Users.Create, "R", PlatformConsts.AbpIdentity.User.AdminRoleName, eventData.TenantId), + new(Guid.NewGuid(), PlatformConsts.IdentityPermissions.Users.Delete, "R", PlatformConsts.AbpIdentity.User.AdminRoleName, eventData.TenantId), + new(Guid.NewGuid(), PlatformConsts.IdentityPermissions.Users.Update, "R", PlatformConsts.AbpIdentity.User.AdminRoleName, eventData.TenantId), + new(Guid.NewGuid(), PlatformConsts.IdentityPermissions.Users.ManagePermissions, "R", PlatformConsts.AbpIdentity.User.AdminRoleName, eventData.TenantId), + new(Guid.NewGuid(), PlatformConsts.IdentityPermissions.Users.Default + ".Export", "R", PlatformConsts.AbpIdentity.User.AdminRoleName, eventData.TenantId), + new(Guid.NewGuid(), PlatformConsts.IdentityPermissions.Users.ManageRoles, "R", PlatformConsts.AbpIdentity.User.AdminRoleName, eventData.TenantId), + new(Guid.NewGuid(), PlatformConsts.IdentityPermissions.UserLookup.Default, "R", PlatformConsts.AbpIdentity.User.AdminRoleName, eventData.TenantId), ]); } } diff --git a/api/src/Kurs.Platform.EntityFrameworkCore/SeederConst.cs b/api/src/Kurs.Platform.EntityFrameworkCore/SeederConst.cs deleted file mode 100644 index dbb9e2e4..00000000 --- a/api/src/Kurs.Platform.EntityFrameworkCore/SeederConst.cs +++ /dev/null @@ -1,71 +0,0 @@ -using Volo.Abp.Reflection; -using static Kurs.Platform.PlatformConsts; - -namespace Kurs.Platform.Migrations; - -public static class TenantManagementPermissions -{ - public const string GroupName = "AbpTenantManagement"; - - public static class Tenants - { - public const string Default = GroupName + ".Tenants"; - public const string Create = Default + ".Create"; - public const string Update = Default + ".Update"; - public const string Delete = Default + ".Delete"; - public const string ManageFeatures = Default + ".ManageFeatures"; - public const string ManageConnectionStrings = Default + ".ManageConnectionStrings"; - } - - public static string[] GetAll() - { - return ReflectionHelper.GetPublicConstantsRecursively(typeof(TenantManagementPermissions)); - } -} - -public static class AbpIdentity -{ - public const string GroupName = $"{Prefix.Abp}.Identity"; - - public static class Permissions - { - public const string Default = GroupName + ".Permissions"; - public const string Create = Default + ".Create"; - public const string Update = Default + ".Update"; - public const string Delete = Default + ".Delete"; - } -} - -public static class IdentityPermissions -{ - public const string GroupName = "AbpIdentity"; - - public static class Roles - { - public const string Default = GroupName + ".Roles"; - public const string Create = Default + ".Create"; - public const string Update = Default + ".Update"; - public const string Delete = Default + ".Delete"; - public const string ManagePermissions = Default + ".ManagePermissions"; - } - - public static class Users - { - public const string Default = GroupName + ".Users"; - public const string Create = Default + ".Create"; - public const string Update = Default + ".Update"; - public const string Delete = Default + ".Delete"; - public const string ManagePermissions = Default + ".ManagePermissions"; - public const string ManageRoles = Update + ".ManageRoles"; - } - - public static class UserLookup - { - public const string Default = GroupName + ".UserLookup"; - } - - public static string[] GetAll() - { - return ReflectionHelper.GetPublicConstantsRecursively(typeof(IdentityPermissions)); - } -} diff --git a/ui/dev-dist/sw.js b/ui/dev-dist/sw.js index d12408cc..e2240917 100644 --- a/ui/dev-dist/sw.js +++ b/ui/dev-dist/sw.js @@ -82,7 +82,7 @@ define(['./workbox-54d0af47'], (function (workbox) { 'use strict'; "revision": "3ca0b8505b4bec776b69afdba2768812" }, { "url": "index.html", - "revision": "0.edm7dfkr7s" + "revision": "0.flj9lansh4" }], {}); workbox.cleanupOutdatedCaches(); workbox.registerRoute(new workbox.NavigationRoute(workbox.createHandlerBoundToURL("index.html"), {