-
Notifications
You must be signed in to change notification settings - Fork 13.9k
feat: add the admin user status switch and the status-disabled hints #42066
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
0090bb5
b9d255b
ae05a9e
7f2f22b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| import { Box, Icon } from '@rocket.chat/fuselage'; | ||
| import { useTranslation } from 'react-i18next'; | ||
|
|
||
| type UserStatusDisabledInfoProps = { workspace: boolean }; | ||
|
|
||
| const UserStatusDisabledInfo = ({ workspace }: UserStatusDisabledInfoProps) => { | ||
| const { t } = useTranslation(); | ||
|
|
||
| const reason = workspace ? t('User_status_disabled_on_this_workspace') : t('User_status_disabled_by_an_admin'); | ||
|
|
||
| return ( | ||
| <Box display='flex' role='img' aria-label={reason} title={reason}> | ||
| <Icon name='info-circled' size='x20' color='info' /> | ||
| </Box> | ||
| ); | ||
| }; | ||
|
|
||
| export default UserStatusDisabledInfo; |
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -49,8 +49,8 @@ declare module '@rocket.chat/ui-contexts' { | |
| pattern: '/admin/integrations/:context?/:type?/:id?'; | ||
| }; | ||
| 'user-status': { | ||
| pathname: `/admin/user-status${`/${string}` | ''}${`/${string}` | ''}`; | ||
| pattern: '/admin/user-status/:context?/:id?'; | ||
| pathname: `/admin/user-status${`/${string}` | ''}${`/${string}` | ''}${`/${string}` | ''}`; | ||
| pattern: '/admin/user-status/:tab?/:context?/:id?'; | ||
| }; | ||
| 'emoji-custom': { | ||
| pathname: `/admin/emoji${`/${string}` | ''}${`/${string}` | ''}`; | ||
|
|
@@ -176,9 +176,9 @@ registerAdminRoute('/integrations/:context?/:type?/:id?', { | |
| component: lazy(() => import('./integrations/IntegrationsRoute')), | ||
| }); | ||
|
|
||
| registerAdminRoute('/user-status/:context?/:id?', { | ||
| registerAdminRoute('/user-status/:tab?/:context?/:id?', { | ||
|
coderabbitai[bot] marked this conversation as resolved.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P2: Handle the legacy Prompt for AI agents
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Intentional: |
||
| name: 'user-status', | ||
| component: lazy(() => import('./customUserStatus/CustomUserStatusRoute')), | ||
| component: lazy(() => import('./statusAndPresence/StatusAndPresenceRoute')), | ||
| }); | ||
|
|
||
| registerAdminRoute('/emoji/:context?/:id?', { | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -62,9 +62,9 @@ export const { | |||||
| }, | ||||||
| { | ||||||
| href: '/admin/user-status', | ||||||
| i18nLabel: 'User_Status', | ||||||
| i18nLabel: 'Status_and_presence', | ||||||
| icon: 'user', | ||||||
| permissionGranted: (): boolean => hasAtLeastOnePermission(['manage-user-status']), | ||||||
| permissionGranted: (): boolean => hasAtLeastOnePermission(['manage-user-status', 'edit-other-user-info']), | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win Match sidebar visibility to the available tabs. A user with only
Suggested change
🤖 Prompt for AI Agents
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P2: When a user has only Prompt for AI agents
cubic-dev-ai[bot] marked this conversation as resolved.
|
||||||
| }, | ||||||
| { | ||||||
| href: '/admin/permissions', | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| import { AccordionItem, Callout, FieldGroup } from '@rocket.chat/fuselage'; | ||
| import type { ReactNode } from 'react'; | ||
| import { memo } from 'react'; | ||
| import { useTranslation } from 'react-i18next'; | ||
|
|
||
| import Setting from '../settings/Setting'; | ||
| import SettingsGroupPage from '../settings/SettingsGroupPage'; | ||
|
|
||
| const SettingsTab = ({ tabs, headerButtons }: { tabs: ReactNode; headerButtons?: ReactNode }) => { | ||
| const { t } = useTranslation(); | ||
|
|
||
| return ( | ||
| <SettingsGroupPage _id='Accounts' i18nLabel='Status_and_presence' tabs={tabs} headerButtons={headerButtons}> | ||
| <AccordionItem noncollapsible title=''> | ||
| <FieldGroup> | ||
| <Setting settingId='Accounts_UserStatus_Enabled' /> | ||
| <Setting settingId='Accounts_AllowUserStatusMessageChange' /> | ||
| <Setting settingId='Accounts_AllowInvisibleStatusOption' /> | ||
| <Setting settingId='Accounts_StatusVisibility_Enabled' /> | ||
| <Callout icon='info-circled'>{t('Admins_cannot_see_concealed_presence')}</Callout> | ||
| </FieldGroup> | ||
| </AccordionItem> | ||
| </SettingsGroupPage> | ||
| ); | ||
| }; | ||
|
|
||
| export default memo(SettingsTab); |
Uh oh!
There was an error while loading. Please reload this page.