-
Notifications
You must be signed in to change notification settings - Fork 11.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Introduce User Report Section on Moderation Console (#30554)
Co-authored-by: Douglas Fabris <[email protected]>
- Loading branch information
1 parent
da410ef
commit 2260c04
Showing
34 changed files
with
1,228 additions
and
254 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
'@rocket.chat/model-typings': minor | ||
'@rocket.chat/rest-typings': minor | ||
'@rocket.chat/i18n': minor | ||
'@rocket.chat/meteor': minor | ||
--- | ||
|
||
**Added ‘Reported Users’ Tab to Moderation Console:** Enhances user monitoring by displaying reported users. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
apps/meteor/client/views/admin/moderation/ModConsoleReportDetails.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import type { IUser } from '@rocket.chat/core-typings'; | ||
import { Tabs, TabsItem, ContextualbarHeader, ContextualbarTitle } from '@rocket.chat/fuselage'; | ||
import { useTranslation, useRouter, useRouteParameter } from '@rocket.chat/ui-contexts'; | ||
import React, { useState } from 'react'; | ||
|
||
import { Contextualbar, ContextualbarClose } from '../../../components/Contextualbar'; | ||
import UserMessages from './UserMessages'; | ||
import UserReportInfo from './UserReports/UserReportInfo'; | ||
|
||
type ModConsoleReportDetailsProps = { | ||
userId: IUser['_id']; | ||
default: string; | ||
onRedirect: (mid: string) => void; | ||
}; | ||
|
||
const ModConsoleReportDetails = ({ userId, default: defaultTab, onRedirect }: ModConsoleReportDetailsProps) => { | ||
const t = useTranslation(); | ||
const [tab, setTab] = useState<string>(defaultTab); | ||
const moderationRoute = useRouter(); | ||
|
||
const activeTab = useRouteParameter('tab'); | ||
|
||
return ( | ||
<Contextualbar> | ||
<ContextualbarHeader> | ||
<ContextualbarTitle>{t('Reports')}</ContextualbarTitle> | ||
<ContextualbarClose onClick={() => moderationRoute.navigate(`/admin/moderation/${activeTab}`, { replace: true })} /> | ||
</ContextualbarHeader> | ||
<Tabs paddingBlockStart={8}> | ||
<TabsItem selected={tab === 'messages'} onClick={() => setTab('messages')}> | ||
{t('Messages')} | ||
</TabsItem> | ||
<TabsItem selected={tab === 'users'} onClick={() => setTab('users')}> | ||
{t('User')} | ||
</TabsItem> | ||
</Tabs> | ||
{tab === 'messages' && <UserMessages userId={userId} onRedirect={onRedirect} />} | ||
{tab === 'users' && <UserReportInfo userId={userId} />} | ||
</Contextualbar> | ||
); | ||
}; | ||
|
||
export default ModConsoleReportDetails; |
55 changes: 40 additions & 15 deletions
55
apps/meteor/client/views/admin/moderation/ModerationConsolePage.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.