Dinamik route düzenlemeleri
This commit is contained in:
parent
954555c375
commit
bbdd47d562
12 changed files with 38 additions and 22 deletions
|
|
@ -10743,7 +10743,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency
|
|||
D = AppCodes.BlogManagement.BlogCategory + ".Delete",
|
||||
E = AppCodes.BlogManagement.BlogCategory + ".Export"
|
||||
}),
|
||||
DeleteCommand = $"UPDATE \"{DbTablePrefix}BlogCategories\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id",
|
||||
DeleteCommand = $"UPDATE \"{DbTablePrefix}BlogCategory\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id",
|
||||
DeleteFieldsDefaultValueJson = JsonSerializer.Serialize(new[]
|
||||
{
|
||||
new FieldsDefaultValue
|
||||
|
|
@ -11332,7 +11332,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency
|
|||
DataSourceType = UiLookupDataSourceTypeEnum.Query,
|
||||
DisplayExpr = "Name",
|
||||
ValueExpr = "Key",
|
||||
LookupQuery = $"SELECT \"{DbTablePrefix}BlogCategories\".\"Id\" AS \"Key\", \"{DbTablePrefix}BlogCategories\".\"Name\" as \"Name\" FROM \"{DbTablePrefix}BlogCategories\" ORDER BY \"{DbTablePrefix}BlogCategories\".\"Name\""
|
||||
LookupQuery = $"SELECT \"{DbTablePrefix}BlogCategory\".\"Id\" AS \"Key\", \"{DbTablePrefix}BlogCategory\".\"Name\" as \"Name\" FROM \"{DbTablePrefix}BlogCategory\" ORDER BY \"{DbTablePrefix}BlogCategory\".\"Name\""
|
||||
}),
|
||||
PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto
|
||||
{
|
||||
|
|
|
|||
|
|
@ -6903,7 +6903,7 @@
|
|||
"Code": "App.ForumManagement",
|
||||
"DisplayName": "App.ForumManagement",
|
||||
"Order": 11,
|
||||
"Url": "/admin/forumManagement",
|
||||
"Url": "/saas/forumManagement",
|
||||
"Icon": "FcReading",
|
||||
"RequiredPermissionName": "App.ForumManagement",
|
||||
"IsDisabled": false
|
||||
|
|
@ -21521,7 +21521,7 @@
|
|||
},
|
||||
{
|
||||
"key": "saas.forumManagement",
|
||||
"path": "/admin/forumManagement",
|
||||
"path": "/saas/forumManagement",
|
||||
"componentPath": "@/views/forum/Management",
|
||||
"routeType": "protected",
|
||||
"authority": []
|
||||
|
|
@ -21535,22 +21535,22 @@
|
|||
},
|
||||
{
|
||||
"key": "admin.profile.general",
|
||||
"path": "/admin/settings/general",
|
||||
"componentPath": "@/views/auth/Settings",
|
||||
"path": "/admin/profile/general",
|
||||
"componentPath": "@/views/admin/profile/Profile",
|
||||
"routeType": "protected",
|
||||
"authority": []
|
||||
},
|
||||
{
|
||||
"key": "admin.profile.password",
|
||||
"path": "/admin/settings/password",
|
||||
"componentPath": "@/views/auth/Settings",
|
||||
"path": "/admin/profile/password",
|
||||
"componentPath": "@/views/admin/profile/Profile",
|
||||
"routeType": "protected",
|
||||
"authority": []
|
||||
},
|
||||
{
|
||||
"key": "admin.profile.notificationSettings",
|
||||
"path": "/admin/settings/notification-settings",
|
||||
"componentPath": "@/views/auth/Settings",
|
||||
"path": "/admin/profile/notification-settings",
|
||||
"componentPath": "@/views/admin/profile/Profile",
|
||||
"routeType": "protected",
|
||||
"authority": []
|
||||
},
|
||||
|
|
|
|||
|
|
@ -501,6 +501,8 @@ public class PlatformDbContext :
|
|||
b.ToTable(PlatformConsts.DbTablePrefix + nameof(Route), PlatformConsts.DbSchema);
|
||||
b.ConfigureByConvention();
|
||||
|
||||
b.HasIndex(x => x.Key).IsUnique();
|
||||
|
||||
b.Property(x => x.Key).IsRequired().HasMaxLength(128);
|
||||
b.Property(x => x.Path).IsRequired().HasMaxLength(256);
|
||||
b.Property(x => x.ComponentPath).IsRequired().HasMaxLength(256);
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ using Volo.Abp.EntityFrameworkCore;
|
|||
namespace Kurs.Platform.Migrations
|
||||
{
|
||||
[DbContext(typeof(PlatformDbContext))]
|
||||
[Migration("20250628190318_AddRoutes")]
|
||||
[Migration("20250629111850_AddRoutes")]
|
||||
partial class AddRoutes
|
||||
{
|
||||
/// <inheritdoc />
|
||||
|
|
@ -2342,6 +2342,9 @@ namespace Kurs.Platform.Migrations
|
|||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("Key")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("PRoute", (string)null);
|
||||
});
|
||||
|
||||
|
|
@ -172,6 +172,12 @@ namespace Kurs.Platform.Migrations
|
|||
table.PrimaryKey("PK_PRoute", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_PRoute_Key",
|
||||
table: "PRoute",
|
||||
column: "Key",
|
||||
unique: true);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_PBlogPost_PBlogCategory_CategoryId",
|
||||
table: "PBlogPost",
|
||||
|
|
@ -2339,6 +2339,9 @@ namespace Kurs.Platform.Migrations
|
|||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("Key")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("PRoute", (string)null);
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ define(['./workbox-54d0af47'], (function (workbox) { 'use strict';
|
|||
"revision": "3ca0b8505b4bec776b69afdba2768812"
|
||||
}, {
|
||||
"url": "index.html",
|
||||
"revision": "0.vvrlobooaco"
|
||||
"revision": "0.v7smivsqf3o"
|
||||
}], {});
|
||||
workbox.cleanupOutdatedCaches();
|
||||
workbox.registerRoute(new workbox.NavigationRoute(workbox.createHandlerBoundToURL("index.html"), {
|
||||
|
|
|
|||
|
|
@ -19,16 +19,16 @@ export const ROUTES_ENUM = {
|
|||
chartManagement: {
|
||||
edit: '/saas/chart/edit/:chartCode',
|
||||
},
|
||||
forumManagement: '/admin/forumManagement',
|
||||
forumManagement: '/saas/forumManagement',
|
||||
},
|
||||
|
||||
admin: {
|
||||
home: '/home',
|
||||
ai: '/admin/ai',
|
||||
profile: {
|
||||
general: '/admin/settings/general',
|
||||
password: '/admin/settings/password',
|
||||
notificationSettings: '/admin/settings/notification-settings',
|
||||
general: '/admin/profile/general',
|
||||
password: '/admin/profile/password',
|
||||
notificationSettings: '/admin/profile/notification-settings',
|
||||
},
|
||||
activityLog: '/admin/activityLog',
|
||||
changeLog: '/admin/changeLog',
|
||||
|
|
|
|||
|
|
@ -21,13 +21,13 @@ type AccountSetting = {
|
|||
}[]
|
||||
}
|
||||
|
||||
const General = lazy(() => import('./settings/General'))
|
||||
const Password = lazy(() => import('./settings/Password'))
|
||||
const NotificationSettings = lazy(() => import('./settings/NotificationSettings'))
|
||||
const General = lazy(() => import('./components/General'))
|
||||
const Password = lazy(() => import('./components/Password'))
|
||||
const NotificationSettings = lazy(() => import('./components/NotificationSettings'))
|
||||
|
||||
const { TabNav, TabList } = Tabs
|
||||
|
||||
const Settings = () => {
|
||||
const Profile = () => {
|
||||
const { translate } = useLocalization()
|
||||
const settingsMenu: Record<
|
||||
string,
|
||||
|
|
@ -56,10 +56,12 @@ const Settings = () => {
|
|||
const [data, setData] = useState<Partial<AccountSetting>>({})
|
||||
const navigate = useNavigate()
|
||||
|
||||
const PROFILE_BASE_PATH = '/admin/profile'
|
||||
|
||||
const onTabChange = (val: string) => {
|
||||
if (settingsMenu[val]) {
|
||||
setCurrentTab(settingsMenu[val].path)
|
||||
navigate(`${ROUTES_ENUM.protected.admin.settings}/${settingsMenu[val].path}`)
|
||||
navigate(`${PROFILE_BASE_PATH}/${settingsMenu[val].path}`)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -87,4 +89,4 @@ const Settings = () => {
|
|||
)
|
||||
}
|
||||
|
||||
export default Settings
|
||||
export default Profile
|
||||
Loading…
Reference in a new issue