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",
|
D = AppCodes.BlogManagement.BlogCategory + ".Delete",
|
||||||
E = AppCodes.BlogManagement.BlogCategory + ".Export"
|
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[]
|
DeleteFieldsDefaultValueJson = JsonSerializer.Serialize(new[]
|
||||||
{
|
{
|
||||||
new FieldsDefaultValue
|
new FieldsDefaultValue
|
||||||
|
|
@ -11332,7 +11332,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency
|
||||||
DataSourceType = UiLookupDataSourceTypeEnum.Query,
|
DataSourceType = UiLookupDataSourceTypeEnum.Query,
|
||||||
DisplayExpr = "Name",
|
DisplayExpr = "Name",
|
||||||
ValueExpr = "Key",
|
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
|
PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -6903,7 +6903,7 @@
|
||||||
"Code": "App.ForumManagement",
|
"Code": "App.ForumManagement",
|
||||||
"DisplayName": "App.ForumManagement",
|
"DisplayName": "App.ForumManagement",
|
||||||
"Order": 11,
|
"Order": 11,
|
||||||
"Url": "/admin/forumManagement",
|
"Url": "/saas/forumManagement",
|
||||||
"Icon": "FcReading",
|
"Icon": "FcReading",
|
||||||
"RequiredPermissionName": "App.ForumManagement",
|
"RequiredPermissionName": "App.ForumManagement",
|
||||||
"IsDisabled": false
|
"IsDisabled": false
|
||||||
|
|
@ -21521,7 +21521,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": "saas.forumManagement",
|
"key": "saas.forumManagement",
|
||||||
"path": "/admin/forumManagement",
|
"path": "/saas/forumManagement",
|
||||||
"componentPath": "@/views/forum/Management",
|
"componentPath": "@/views/forum/Management",
|
||||||
"routeType": "protected",
|
"routeType": "protected",
|
||||||
"authority": []
|
"authority": []
|
||||||
|
|
@ -21535,22 +21535,22 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": "admin.profile.general",
|
"key": "admin.profile.general",
|
||||||
"path": "/admin/settings/general",
|
"path": "/admin/profile/general",
|
||||||
"componentPath": "@/views/auth/Settings",
|
"componentPath": "@/views/admin/profile/Profile",
|
||||||
"routeType": "protected",
|
"routeType": "protected",
|
||||||
"authority": []
|
"authority": []
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": "admin.profile.password",
|
"key": "admin.profile.password",
|
||||||
"path": "/admin/settings/password",
|
"path": "/admin/profile/password",
|
||||||
"componentPath": "@/views/auth/Settings",
|
"componentPath": "@/views/admin/profile/Profile",
|
||||||
"routeType": "protected",
|
"routeType": "protected",
|
||||||
"authority": []
|
"authority": []
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": "admin.profile.notificationSettings",
|
"key": "admin.profile.notificationSettings",
|
||||||
"path": "/admin/settings/notification-settings",
|
"path": "/admin/profile/notification-settings",
|
||||||
"componentPath": "@/views/auth/Settings",
|
"componentPath": "@/views/admin/profile/Profile",
|
||||||
"routeType": "protected",
|
"routeType": "protected",
|
||||||
"authority": []
|
"authority": []
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -501,6 +501,8 @@ public class PlatformDbContext :
|
||||||
b.ToTable(PlatformConsts.DbTablePrefix + nameof(Route), PlatformConsts.DbSchema);
|
b.ToTable(PlatformConsts.DbTablePrefix + nameof(Route), PlatformConsts.DbSchema);
|
||||||
b.ConfigureByConvention();
|
b.ConfigureByConvention();
|
||||||
|
|
||||||
|
b.HasIndex(x => x.Key).IsUnique();
|
||||||
|
|
||||||
b.Property(x => x.Key).IsRequired().HasMaxLength(128);
|
b.Property(x => x.Key).IsRequired().HasMaxLength(128);
|
||||||
b.Property(x => x.Path).IsRequired().HasMaxLength(256);
|
b.Property(x => x.Path).IsRequired().HasMaxLength(256);
|
||||||
b.Property(x => x.ComponentPath).IsRequired().HasMaxLength(256);
|
b.Property(x => x.ComponentPath).IsRequired().HasMaxLength(256);
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ using Volo.Abp.EntityFrameworkCore;
|
||||||
namespace Kurs.Platform.Migrations
|
namespace Kurs.Platform.Migrations
|
||||||
{
|
{
|
||||||
[DbContext(typeof(PlatformDbContext))]
|
[DbContext(typeof(PlatformDbContext))]
|
||||||
[Migration("20250628190318_AddRoutes")]
|
[Migration("20250629111850_AddRoutes")]
|
||||||
partial class AddRoutes
|
partial class AddRoutes
|
||||||
{
|
{
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
|
|
@ -2342,6 +2342,9 @@ namespace Kurs.Platform.Migrations
|
||||||
|
|
||||||
b.HasKey("Id");
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("Key")
|
||||||
|
.IsUnique();
|
||||||
|
|
||||||
b.ToTable("PRoute", (string)null);
|
b.ToTable("PRoute", (string)null);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -172,6 +172,12 @@ namespace Kurs.Platform.Migrations
|
||||||
table.PrimaryKey("PK_PRoute", x => x.Id);
|
table.PrimaryKey("PK_PRoute", x => x.Id);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_PRoute_Key",
|
||||||
|
table: "PRoute",
|
||||||
|
column: "Key",
|
||||||
|
unique: true);
|
||||||
|
|
||||||
migrationBuilder.AddForeignKey(
|
migrationBuilder.AddForeignKey(
|
||||||
name: "FK_PBlogPost_PBlogCategory_CategoryId",
|
name: "FK_PBlogPost_PBlogCategory_CategoryId",
|
||||||
table: "PBlogPost",
|
table: "PBlogPost",
|
||||||
|
|
@ -2339,6 +2339,9 @@ namespace Kurs.Platform.Migrations
|
||||||
|
|
||||||
b.HasKey("Id");
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("Key")
|
||||||
|
.IsUnique();
|
||||||
|
|
||||||
b.ToTable("PRoute", (string)null);
|
b.ToTable("PRoute", (string)null);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -82,7 +82,7 @@ define(['./workbox-54d0af47'], (function (workbox) { 'use strict';
|
||||||
"revision": "3ca0b8505b4bec776b69afdba2768812"
|
"revision": "3ca0b8505b4bec776b69afdba2768812"
|
||||||
}, {
|
}, {
|
||||||
"url": "index.html",
|
"url": "index.html",
|
||||||
"revision": "0.vvrlobooaco"
|
"revision": "0.v7smivsqf3o"
|
||||||
}], {});
|
}], {});
|
||||||
workbox.cleanupOutdatedCaches();
|
workbox.cleanupOutdatedCaches();
|
||||||
workbox.registerRoute(new workbox.NavigationRoute(workbox.createHandlerBoundToURL("index.html"), {
|
workbox.registerRoute(new workbox.NavigationRoute(workbox.createHandlerBoundToURL("index.html"), {
|
||||||
|
|
|
||||||
|
|
@ -19,16 +19,16 @@ export const ROUTES_ENUM = {
|
||||||
chartManagement: {
|
chartManagement: {
|
||||||
edit: '/saas/chart/edit/:chartCode',
|
edit: '/saas/chart/edit/:chartCode',
|
||||||
},
|
},
|
||||||
forumManagement: '/admin/forumManagement',
|
forumManagement: '/saas/forumManagement',
|
||||||
},
|
},
|
||||||
|
|
||||||
admin: {
|
admin: {
|
||||||
home: '/home',
|
home: '/home',
|
||||||
ai: '/admin/ai',
|
ai: '/admin/ai',
|
||||||
profile: {
|
profile: {
|
||||||
general: '/admin/settings/general',
|
general: '/admin/profile/general',
|
||||||
password: '/admin/settings/password',
|
password: '/admin/profile/password',
|
||||||
notificationSettings: '/admin/settings/notification-settings',
|
notificationSettings: '/admin/profile/notification-settings',
|
||||||
},
|
},
|
||||||
activityLog: '/admin/activityLog',
|
activityLog: '/admin/activityLog',
|
||||||
changeLog: '/admin/changeLog',
|
changeLog: '/admin/changeLog',
|
||||||
|
|
|
||||||
|
|
@ -21,13 +21,13 @@ type AccountSetting = {
|
||||||
}[]
|
}[]
|
||||||
}
|
}
|
||||||
|
|
||||||
const General = lazy(() => import('./settings/General'))
|
const General = lazy(() => import('./components/General'))
|
||||||
const Password = lazy(() => import('./settings/Password'))
|
const Password = lazy(() => import('./components/Password'))
|
||||||
const NotificationSettings = lazy(() => import('./settings/NotificationSettings'))
|
const NotificationSettings = lazy(() => import('./components/NotificationSettings'))
|
||||||
|
|
||||||
const { TabNav, TabList } = Tabs
|
const { TabNav, TabList } = Tabs
|
||||||
|
|
||||||
const Settings = () => {
|
const Profile = () => {
|
||||||
const { translate } = useLocalization()
|
const { translate } = useLocalization()
|
||||||
const settingsMenu: Record<
|
const settingsMenu: Record<
|
||||||
string,
|
string,
|
||||||
|
|
@ -56,10 +56,12 @@ const Settings = () => {
|
||||||
const [data, setData] = useState<Partial<AccountSetting>>({})
|
const [data, setData] = useState<Partial<AccountSetting>>({})
|
||||||
const navigate = useNavigate()
|
const navigate = useNavigate()
|
||||||
|
|
||||||
|
const PROFILE_BASE_PATH = '/admin/profile'
|
||||||
|
|
||||||
const onTabChange = (val: string) => {
|
const onTabChange = (val: string) => {
|
||||||
if (settingsMenu[val]) {
|
if (settingsMenu[val]) {
|
||||||
setCurrentTab(settingsMenu[val].path)
|
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