diff --git a/.changeset/empty-pans-love.md b/.changeset/empty-pans-love.md new file mode 100644 index 000000000000..a3ab8e26c8aa --- /dev/null +++ b/.changeset/empty-pans-love.md @@ -0,0 +1,6 @@ +--- +"@rocket.chat/meteor": patch +"@rocket.chat/i18n": patch +--- + +Fixes the incorrect registration status shown on admin users page for federated remote users. diff --git a/apps/meteor/client/views/admin/users/UsersTable/UsersTableRow.tsx b/apps/meteor/client/views/admin/users/UsersTable/UsersTableRow.tsx index 47c08815c6f8..2442f8395d03 100644 --- a/apps/meteor/client/views/admin/users/UsersTable/UsersTableRow.tsx +++ b/apps/meteor/client/views/admin/users/UsersTable/UsersTableRow.tsx @@ -42,10 +42,32 @@ const UsersTableRow = ({ }: UsersTableRowProps): ReactElement => { const { t } = useTranslation(); - const { _id, emails, username = '', name = '', roles, status, active, avatarETag, lastLogin, type, freeSwitchExtension } = user; + const { + _id, + emails, + username = '', + name = '', + roles, + status, + active, + avatarETag, + lastLogin, + type, + freeSwitchExtension, + federated, + } = user; + const registrationStatusText = useMemo(() => { const usersExcludedFromPending = ['bot', 'app']; + if (!active && lastLogin) { + return t('Deactivated'); + } + + if (federated) { + return t('Federated'); + } + if (!lastLogin && !usersExcludedFromPending.includes(type)) { return t('Pending'); } @@ -53,11 +75,7 @@ const UsersTableRow = ({ if (active && lastLogin) { return t('Active'); } - - if (!active && lastLogin) { - return t('Deactivated'); - } - }, [active, lastLogin, t, type]); + }, [active, lastLogin, t, type, federated]); const roleNames = (roles || []) .map((roleId) => (Roles.findOne(roleId, { fields: { name: 1 } }) as IRole | undefined)?.name) diff --git a/packages/i18n/src/locales/en.i18n.json b/packages/i18n/src/locales/en.i18n.json index 3ba0b961b6ee..b23646f9360a 100644 --- a/packages/i18n/src/locales/en.i18n.json +++ b/packages/i18n/src/locales/en.i18n.json @@ -2428,6 +2428,7 @@ "Federation_Matrix_serve_well_known_Alert": "Keep this off if using DNS srv records for federation, or use a reverse proxy to return static JSON if federation traffic is heavy. Read mode.", "Federation_Matrix_check_configuration": "Verify configuration", "Federation_Matrix_configuration_status": "Configuration status", + "Federated": "Federated", "Field": "Field", "Field_removed": "Field removed", "Field_required": "Field required",