Skip to content
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

fix: "Status" column values in "Custom Status" page table not translated #34857

Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
ab07b1a
Add translation to statusType in CustomUserStatusRow
AyushKumar123456789 Dec 31, 2024
8a11de9
added changeset
AyushKumar123456789 Dec 31, 2024
6a093f2
fix lint
yash-rajpal Dec 31, 2024
68f0368
improve changeset
yash-rajpal Dec 31, 2024
442f656
Update .changeset/seven-otters-worry.md
yash-rajpal Dec 31, 2024
317675f
increase code readibility and use capitalized translation strings
yash-rajpal Dec 31, 2024
33de5bc
Merge branch 'develop' into fix-CustomStatus_Presence_not_translated_…
casalsgh Jan 6, 2025
31b3c6e
Merge branch 'develop' into fix-CustomStatus_Presence_not_translated_…
yash-rajpal Jan 8, 2025
7a48906
Merge branch 'develop' into fix-CustomStatus_Presence_not_translated_…
kodiakhq[bot] Jan 8, 2025
744d1b1
Merge branch 'develop' into fix-CustomStatus_Presence_not_translated_…
kodiakhq[bot] Jan 8, 2025
f10f833
Merge branch 'develop' into fix-CustomStatus_Presence_not_translated_…
scuciatto Jan 20, 2025
7a3f1c7
Merge branch 'develop' into fix-CustomStatus_Presence_not_translated_…
kodiakhq[bot] Jan 20, 2025
3d8bb2b
Merge branch 'develop' into fix-CustomStatus_Presence_not_translated_…
kodiakhq[bot] Jan 20, 2025
3cadf2a
Merge branch 'RocketChat:develop' into fix-CustomStatus_Presence_not_…
AyushKumar123456789 Jan 26, 2025
689f79d
improve code by using existing UserStatus enum
AyushKumar123456789 Jan 26, 2025
921a76a
fix: review
dougfabris Feb 4, 2025
be00bb0
Merge branch 'develop' into fix-CustomStatus_Presence_not_translated_…
dougfabris Feb 7, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/seven-otters-worry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@rocket.chat/meteor': patch
---

Fixes an issue where custom status' values in the custom status page table were not being properly translated
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type { IUserStatus } from '@rocket.chat/core-typings';
import type { CSSProperties, ReactElement } from 'react';
import { useTranslation } from 'react-i18next';

import { GenericTableRow, GenericTableCell } from '../../../../components/GenericTable';
import MarkdownText from '../../../../components/MarkdownText';
@@ -13,6 +14,7 @@ type CustomUserStatusRowProps = {

const CustomUserStatusRow = ({ status, onClick }: CustomUserStatusRowProps): ReactElement => {
const { _id, name, statusType } = status;
const { t } = useTranslation();

return (
<GenericTableRow
@@ -28,7 +30,7 @@ const CustomUserStatusRow = ({ status, onClick }: CustomUserStatusRowProps): Rea
<MarkdownText content={name} parseEmoji={true} variant='inline' />
</GenericTableCell>
<GenericTableCell fontScale='p2' color='default' style={style}>
{statusType}
{t(statusType)}
</GenericTableCell>
</GenericTableRow>
);

Unchanged files with check annotations Beta

const api = this;
(operations[method as keyof Operations<TPathPattern, TOptions>] as Record<string, any>).action =
async function _internalRouteActionHandler() {
this.requestIp = getRequestIP(this.request)!;

Check warning on line 570 in apps/meteor/app/api/server/api.ts

GitHub Actions / 🔎 Code Check / Code Lint

Forbidden non-null assertion
if (options.authRequired || options.authOrAnonRequired) {
const user = await api.authenticatedRoute(this.request);
this.user = user!;

Check warning on line 574 in apps/meteor/app/api/server/api.ts

GitHub Actions / 🔎 Code Check / Code Lint

Forbidden non-null assertion
this.userId = String(this.request.headers['x-user-id']);
this.token = (this.request.headers['x-auth-token'] &&

Check warning on line 576 in apps/meteor/app/api/server/api.ts

GitHub Actions / 🔎 Code Check / Code Lint

Forbidden non-null assertion
Accounts._hashLoginToken(String(this.request.headers['x-auth-token'])))!;
}
connection,
};
Accounts._setAccountData(connection.id, 'loginToken', this.token!);

Check warning on line 653 in apps/meteor/app/api/server/api.ts

GitHub Actions / 🔎 Code Check / Code Lint

Forbidden non-null assertion
this.userId &&
(await api.processTwoFactor({
const { modifiedCount } = await updateAuditedByUser({
_id: this.userId,
username: this.user.username!,

Check warning on line 42 in apps/meteor/app/api/server/v1/assets.ts

GitHub Actions / 🔎 Code Check / Code Lint

Forbidden non-null assertion
ip: this.requestIp,
useragent: this.request.headers['user-agent'] || '',
})(Settings.updateValueById, key, value);
const { modifiedCount } = await updateAuditedByUser({
_id: this.userId,
username: this.user.username!,

Check warning on line 79 in apps/meteor/app/api/server/v1/assets.ts

GitHub Actions / 🔎 Code Check / Code Lint

Forbidden non-null assertion
ip: this.requestIp,
useragent: this.request.headers['user-agent'] || '',
})(Settings.updateValueById, key, value);
const auditSettingOperation = updateAuditedByUser({
_id: this.userId,
username: this.user.username!,

Check warning on line 689 in apps/meteor/app/api/server/v1/misc.ts

GitHub Actions / 🔎 Code Check / Code Lint

Forbidden non-null assertion
ip: this.requestIp,
useragent: this.request.headers['user-agent'] || '',
});
return resetAuditedSettingByUser({
_id: this.userId,
username: this.user.username!,

Check warning on line 709 in apps/meteor/app/api/server/v1/misc.ts

GitHub Actions / 🔎 Code Check / Code Lint

Forbidden non-null assertion
ip: this.requestIp,
useragent: this.request.headers['user-agent'] || '',
})(Settings.resetValueById, settingId);
const auditSettingOperation = updateAuditedByUser({
_id: this.userId,
username: this.user.username!,

Check warning on line 213 in apps/meteor/app/api/server/v1/settings.ts

GitHub Actions / 🔎 Code Check / Code Lint

Forbidden non-null assertion
ip: this.requestIp,
useragent: this.request.headers['user-agent'] || '',
});
const room = await Rooms.findOneById(rid);
await Room.beforeTopicChange(room!);

Check warning on line 25 in apps/meteor/app/channel-settings/server/functions/saveRoomTopic.ts

GitHub Actions / 🔎 Code Check / Code Lint

Forbidden non-null assertion
const update = await Rooms.setTopicById(rid, roomTopic);
if (update && sendMessage) {