Dinamik Route Düzenlemeleri

This commit is contained in:
Sedat Öztürk 2025-06-29 15:49:56 +03:00
parent bbdd47d562
commit 5621495da8
5 changed files with 354 additions and 8 deletions

View file

@ -11016,13 +11016,13 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency
#endregion
#region BlogPost
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.BlogPosts))
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.BlogPost))
{
var listFormBlogPosts = await _listFormRepository.InsertAsync(
new ListForm
{
CultureName = LanguageCodes.En,
ListFormCode = ListFormCodes.Lists.BlogPosts,
ListFormCode = ListFormCodes.Lists.BlogPost,
Name = AppCodes.BlogManagement.BlogPosts,
Title = AppCodes.BlogManagement.BlogPosts,
DataSourceCode = SeedConsts.DataSources.DefaultCode,
@ -11495,6 +11495,288 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency
}
#endregion
#region Route
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.Route))
{
var listFormRoute = await _listFormRepository.InsertAsync(
new ListForm
{
CultureName = LanguageCodes.En,
ListFormCode = ListFormCodes.Lists.Route,
Name = AppCodes.Routes,
Title = AppCodes.Routes,
DataSourceCode = SeedConsts.DataSources.DefaultCode,
IsTenant = false,
IsBranch = false,
IsOrganizationUnit = false,
Description = AppCodes.Routes,
SelectCommandType = SelectCommandTypeEnum.Table,
SelectCommand = SelectCommandByTableName("Route"),
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 = false }),
SelectionJson = JsonSerializer.Serialize(new SelectionDto
{
Mode = GridOptions.SelectionModeSingle,
AllowSelectAll = false
}),
ColumnOptionJson = JsonSerializer.Serialize(new
{
ColumnFixingEnabled = true,
}),
PermissionJson = JsonSerializer.Serialize(new PermissionCrudDto
{
C = AppCodes.Routes + ".Create",
R = AppCodes.Routes,
U = AppCodes.Routes + ".Update",
D = AppCodes.Routes + ".Delete",
E = AppCodes.Routes + ".Export"
}),
DeleteCommand = $"UPDATE \"{DbTablePrefix}Route\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id",
DeleteFieldsDefaultValueJson = JsonSerializer.Serialize(new[]
{
new FieldsDefaultValue
{
FieldName = "DeleterId",
FieldDbType = DbType.Guid,
Value = "@USERID",
CustomValueType = FieldCustomValueTypeEnum.CustomKey
},
new FieldsDefaultValue
{
FieldName = "Id",
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
{
Title = "Route Form",
Width = 500,
Height = 300
},
AllowDeleting = true,
AllowAdding = true,
AllowUpdating = true,
SendOnlyChangedFormValuesUpdate = false
}),
EditingFormJson = JsonSerializer.Serialize(new List<EditingFormDto>
{
new()
{
Order = 1,
ColCount = 1,
ColSpan = 2,
ItemType = "group",
Items =
[
new EditingFormItemDto { Order = 1, DataField = "Key", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxTextBox },
new EditingFormItemDto { Order = 2, DataField = "Path", ColSpan = 2, EditorType2 = EditorTypes.dxTextBox },
new EditingFormItemDto { Order = 3, DataField = "ComponentPath", ColSpan = 2, EditorType2 = EditorTypes.dxTextBox },
new EditingFormItemDto { Order = 4, DataField = "RouteType", ColSpan = 2, EditorType2 = EditorTypes.dxSelectBox },
new EditingFormItemDto { Order = 5, DataField = "Authority", ColSpan = 2, EditorType2 = EditorTypes.dxTextBox }
]
}
}),
InsertFieldsDefaultValueJson = JsonSerializer.Serialize(new[]
{
new FieldsDefaultValue
{
FieldName = "CreationTime",
FieldDbType = DbType.DateTime,
Value = "@NOW",
CustomValueType = FieldCustomValueTypeEnum.CustomKey
},
new FieldsDefaultValue
{
FieldName = "CreatorId",
FieldDbType = DbType.Guid,
Value = "@USERID",
CustomValueType = FieldCustomValueTypeEnum.CustomKey
}
})
});
#region Route Fields
await _listFormFieldRepository.InsertManyAsync([
new()
{
ListFormCode = listFormRoute.ListFormCode,
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.Routes + ".Create",
R = AppCodes.Routes,
U = AppCodes.Routes + ".Update",
E = true,
Deny = false
})
},
new()
{
ListFormCode = listFormRoute.ListFormCode,
CultureName = LanguageCodes.En,
SourceDbType = DbType.String,
FieldName = "Key",
Width = 300,
ListOrderNo = 2,
Visible = true,
IsActive = true,
IsDeleted = false,
AllowSearch = true,
ValidationRuleJson = JsonSerializer.Serialize(new[]
{
new ValidationRuleDto { Type = "required" }
}),
PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto
{
C = AppCodes.Routes + ".Create",
R = AppCodes.Routes,
U = AppCodes.Routes + ".Update",
E = true,
Deny = false
})
},
new()
{
ListFormCode = listFormRoute.ListFormCode,
CultureName = LanguageCodes.En,
SourceDbType = DbType.String,
FieldName = "Path",
Width = 300,
ListOrderNo = 3,
Visible = true,
IsActive = true,
IsDeleted = false,
AllowSearch = true,
ValidationRuleJson = JsonSerializer.Serialize(new[]
{
new ValidationRuleDto { Type = "required" }
}),
PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto
{
C = AppCodes.Routes + ".Create",
R = AppCodes.Routes,
U = AppCodes.Routes + ".Update",
E = true,
Deny = false
})
},
new()
{
ListFormCode = listFormRoute.ListFormCode,
CultureName = LanguageCodes.En,
SourceDbType = DbType.String,
FieldName = "ComponentPath",
Width = 300,
ListOrderNo = 4,
Visible = true,
IsActive = true,
IsDeleted = false,
AllowSearch = true,
ValidationRuleJson = JsonSerializer.Serialize(new[]
{
new ValidationRuleDto { Type = "required" }
}),
PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto
{
C = AppCodes.Routes + ".Create",
R = AppCodes.Routes,
U = AppCodes.Routes + ".Update",
E = true,
Deny = false
})
},
new()
{
ListFormCode = listFormRoute.ListFormCode,
CultureName = LanguageCodes.En,
SourceDbType = DbType.String,
FieldName = "RouteType",
Width = 120,
ListOrderNo = 5,
Visible = true,
IsActive = true,
IsDeleted = false,
AllowSearch = false,
LookupJson = JsonSerializer.Serialize(new LookupDto
{
DataSourceType = UiLookupDataSourceTypeEnum.StaticData,
DisplayExpr = "name",
ValueExpr = "key",
LookupQuery = JsonSerializer.Serialize(new LookupDataDto[] {
new () { Key="public",Name="Public" },
new () { Key="protected",Name="Protected" },
}),
}),
ValidationRuleJson = JsonSerializer.Serialize(new[]
{
new ValidationRuleDto { Type = "required" }
}),
PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto
{
C = AppCodes.Routes + ".Create",
R = AppCodes.Routes,
U = AppCodes.Routes + ".Update",
E = true,
Deny = false
})
},
new()
{
ListFormCode = listFormRoute.ListFormCode,
CultureName = LanguageCodes.En,
SourceDbType = DbType.String,
FieldName = "Authority",
Width = 120,
ListOrderNo = 6,
Visible = true,
IsActive = true,
IsDeleted = false,
AllowSearch = true,
PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto
{
C = AppCodes.Routes + ".Create",
R = AppCodes.Routes,
U = AppCodes.Routes + ".Update",
E = true,
Deny = false
})
}
]);
#endregion
}
#endregion
#endregion
}
}

View file

@ -5263,6 +5263,12 @@
"tr": "Tanımlamalar",
"en": "Definitions"
},
{
"resourceName": "Platform",
"key": "App.Routes",
"tr": "Rotalar",
"en": "Routes"
},
{
"resourceName": "Platform",
"key": "App.Definitions.Sector",
@ -6868,11 +6874,21 @@
"RequiredPermissionName": "App.PublicApis",
"IsDisabled": false
},
{
"ParentCode": "App.Saas",
"Code": "App.Routes",
"DisplayName": "App.Routes",
"Order": 10,
"Url": "/admin/list/list-route",
"Icon": "FaSynagogue",
"RequiredPermissionName": "App.Routes",
"IsDisabled": false
},
{
"ParentCode": "App.Saas",
"Code": "App.BlogManagement",
"DisplayName": "App.BlogManagement",
"Order": 10,
"Order": 11,
"Url": null,
"Icon": "FcTemplate",
"RequiredPermissionName": null,
@ -6893,7 +6909,7 @@
"Code": "App.BlogManagement.Posts",
"DisplayName": "App.BlogManagement.Posts",
"Order": 2,
"Url": "/admin/list/list-blogposts",
"Url": "/admin/list/list-blogpost",
"Icon": "FaWeixin",
"RequiredPermissionName": "App.BlogManagement.Posts",
"IsDisabled": false
@ -6902,7 +6918,7 @@
"ParentCode": "App.Saas",
"Code": "App.ForumManagement",
"DisplayName": "App.ForumManagement",
"Order": 11,
"Order": 12,
"Url": "/saas/forumManagement",
"Icon": "FcReading",
"RequiredPermissionName": "App.ForumManagement",
@ -7197,6 +7213,10 @@
{
"Name": "App.Definitions",
"DisplayName": "App.Definitions"
},
{
"Name": "App.Routes",
"DisplayName": "App.Routes"
}
],
"PermissionDefinitionRecords": [
@ -7296,6 +7316,14 @@
"IsEnabled": true,
"MultiTenancySide": 2
},
{
"GroupName": "App.Routes",
"Name": "App.Routes",
"ParentName": null,
"DisplayName": "App.Routes",
"IsEnabled": true,
"MultiTenancySide": 2
},
{
"GroupName": "App.Languages",
"Name": "App.Languages.Language",
@ -7856,6 +7884,38 @@
"IsEnabled": true,
"MultiTenancySide": 2
},
{
"GroupName": "App.Routes",
"Name": "App.Routes.Create",
"ParentName": "App.Routes",
"DisplayName": "Create",
"IsEnabled": true,
"MultiTenancySide": 2
},
{
"GroupName": "App.Routes",
"Name": "App.Routes.Delete",
"ParentName": "App.Routes",
"DisplayName": "Delete",
"IsEnabled": true,
"MultiTenancySide": 2
},
{
"GroupName": "App.Routes",
"Name": "App.Routes.Export",
"ParentName": "App.Routes",
"DisplayName": "Export",
"IsEnabled": true,
"MultiTenancySide": 2
},
{
"GroupName": "App.Routes",
"Name": "App.Routes.Update",
"ParentName": "App.Routes",
"DisplayName": "Update",
"IsEnabled": true,
"MultiTenancySide": 2
},
{
"GroupName": "AbpIdentity",
"Name": "App.ClaimType.Create",

View file

@ -359,7 +359,8 @@ public static class PlatformConsts
public const string SkillType = "list-skilltype";
public const string UomCategory = "list-uomcategory";
public const string BlogCategory = "list-blogcategory";
public const string BlogPosts = "list-blogposts";
public const string BlogPost = "list-blogpost";
public const string Route = "list-route";
public const string ListformField = "list-listformfield";
}

View file

@ -352,7 +352,7 @@ public static class SeedConsts
public static class BlogManagement
{
public const string Default = Prefix.App + ".BlogManagement";
public const string BlogPosts = Default + ".Posts";
public const string BlogCategory = Default + ".Category";
}
@ -381,6 +381,9 @@ public static class SeedConsts
public const string SkillType = Default + ".SkillType";
public const string UomCategory = Default + ".UomCategory";
}
public const string Routes = Prefix.App + ".Routes";
}
public static class DataSources

View file

@ -168,7 +168,7 @@ const useFilters = ({
} else if (itemData.id === 'openPivotGrid') {
navigate(`/pivot/${listFormCode}`)
} else if (itemData.id === 'openManage') {
window.open(`/admin/listform/edit/${listFormCode}`, isPwaMode ? '_self' : '_blank')
window.open(`/saas/listform/edit/${listFormCode}`, isPwaMode ? '_self' : '_blank')
} else if (itemData.id === 'clearFilter') {
// gridin bütün filtrelerini temizle
const grid = gridRef.current?.instance