Добавить UI настроек и inbox автомодерации.
CI / test (push) Failing after 3m46s
CI / push-image (push) Has been skipped
CI / deploy-ift (push) Has been skipped
CI / ci-done (push) Failing after 0s
CI / e2e-ift (push) Has been skipped
CI / deploy-stage (push) Has been skipped
CI / e2e-stage (push) Has been skipped
CI / test (push) Failing after 3m46s
CI / push-image (push) Has been skipped
CI / deploy-ift (push) Has been skipped
CI / ci-done (push) Failing after 0s
CI / e2e-ift (push) Has been skipped
CI / deploy-stage (push) Has been skipped
CI / e2e-stage (push) Has been skipped
Refs EventHub/EventHubFrontAdmin#40 Refs EventHub/EventHubFrontAdmin#41
This commit is contained in:
@@ -7,12 +7,14 @@ export const ROUTE_ACCESS: Record<string, AdminRole[] | undefined> = {
|
||||
'/monitoring': undefined,
|
||||
'/inbox/reports': ['superadmin', 'admin', 'moderator'],
|
||||
'/inbox/tickets': ['superadmin', 'admin', 'support'],
|
||||
'/inbox/automod': ['superadmin', 'admin', 'moderator'],
|
||||
'/users': ['superadmin', 'admin'],
|
||||
'/calendars': ['superadmin', 'admin'],
|
||||
'/events': ['superadmin', 'admin'],
|
||||
'/reports': ['superadmin', 'admin', 'moderator'],
|
||||
'/reviews': ['superadmin', 'admin', 'moderator'],
|
||||
'/banned-words': ['superadmin', 'admin'],
|
||||
'/automod-settings': ['superadmin', 'admin'],
|
||||
'/tickets': ['superadmin', 'admin', 'support'],
|
||||
'/subscriptions': ['superadmin', 'admin'],
|
||||
'/admins': ['superadmin'],
|
||||
@@ -39,6 +41,7 @@ export const NAV_GROUPS: NavGroup[] = [
|
||||
items: [
|
||||
{ key: '/inbox/reports', label: 'nav.inboxReports', roles: ['superadmin', 'admin', 'moderator'] },
|
||||
{ key: '/inbox/tickets', label: 'nav.inboxTickets', roles: ['superadmin', 'admin', 'support'] },
|
||||
{ key: '/inbox/automod', label: 'nav.inboxAutomod', roles: ['superadmin', 'admin', 'moderator'] },
|
||||
],
|
||||
},
|
||||
{
|
||||
@@ -66,6 +69,7 @@ export const NAV_GROUPS: NavGroup[] = [
|
||||
{ key: '/reports', label: 'nav.reports', roles: ['superadmin', 'admin', 'moderator'] },
|
||||
{ key: '/reviews', label: 'nav.reviews', roles: ['superadmin', 'admin', 'moderator'] },
|
||||
{ key: '/banned-words', label: 'nav.bannedWords', roles: ['superadmin', 'admin'] },
|
||||
{ key: '/automod-settings', label: 'nav.automodSettings', roles: ['superadmin', 'admin'] },
|
||||
{ key: '/tickets', label: 'nav.tickets', roles: ['superadmin', 'admin', 'support'] },
|
||||
],
|
||||
},
|
||||
@@ -129,13 +133,14 @@ export function getMenuSelectedKey(pathname: string): string {
|
||||
return pathname;
|
||||
}
|
||||
|
||||
const WS_NOTIFICATION_ROUTES: Record<'report_created' | 'ticket_created', string> = {
|
||||
const WS_NOTIFICATION_ROUTES: Record<'report_created' | 'ticket_created' | 'automod_hit', string> = {
|
||||
report_created: '/inbox/reports',
|
||||
ticket_created: '/inbox/tickets',
|
||||
automod_hit: '/inbox/automod',
|
||||
};
|
||||
|
||||
export function canReceiveWsNotification(
|
||||
type: 'report_created' | 'ticket_created',
|
||||
type: 'report_created' | 'ticket_created' | 'automod_hit',
|
||||
role: string | undefined
|
||||
): boolean {
|
||||
return canAccessRoute(WS_NOTIFICATION_ROUTES[type], role);
|
||||
|
||||
Reference in New Issue
Block a user