Skip to content

Commit 5893181

Browse files
committed
Merge branch 'develop' into feat.block-room-content-e2ee
# Conflicts: # app/views/RoomView/RightButtons.tsx
2 parents c04087e + 4c8caf0 commit 5893181

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+820
-94
lines changed

__tests__/containers/message/__snapshots__/Message.stories.storyshot

+3-1
Large diffs are not rendered by default.

app/actions/actionsTypes.ts

+1
Original file line numberDiff line numberDiff line change
@@ -96,5 +96,6 @@ export const VIDEO_CONF = createRequestTypes('VIDEO_CONF', [
9696
'ACCEPT_CALL',
9797
'SET_CALLING'
9898
]);
99+
export const TROUBLESHOOTING_NOTIFICATION = createRequestTypes('TROUBLESHOOTING_NOTIFICATION', ['INIT', 'SET']);
99100
export const SUPPORTED_VERSIONS = createRequestTypes('SUPPORTED_VERSIONS', ['SET']);
100101
export const IN_APP_FEEDBACK = createRequestTypes('IN_APP_FEEDBACK', ['SET', 'REMOVE', 'CLEAR']);
+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import { Action } from 'redux';
2+
3+
import { TROUBLESHOOTING_NOTIFICATION } from './actionsTypes';
4+
import { ITroubleshootingNotification } from '../reducers/troubleshootingNotification';
5+
6+
type TSetTroubleshootingNotification = Action & { payload: Partial<ITroubleshootingNotification> };
7+
8+
export type TActionTroubleshootingNotification = Action & TSetTroubleshootingNotification;
9+
10+
export function initTroubleshootingNotification(): Action {
11+
return {
12+
type: TROUBLESHOOTING_NOTIFICATION.INIT
13+
};
14+
}
15+
16+
export function setTroubleshootingNotification(payload: Partial<ITroubleshootingNotification>): TSetTroubleshootingNotification {
17+
return {
18+
type: TROUBLESHOOTING_NOTIFICATION.SET,
19+
payload
20+
};
21+
}

app/containers/UIKit/VideoConferenceBlock/components/VideoConferenceBaseContainer.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export const VideoConferenceBaseContainer = ({ variant, children }: VideoConfMes
3636
},
3737
issue: {
3838
icon: 'phone-issue',
39-
color: colors.statusFontOnWarning,
39+
color: colors.statusFontWarning,
4040
backgroundColor: colors.statusBackgroundWarning,
4141
label: i18n.t('Call_issue')
4242
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import React, { memo } from 'react';
2+
import { View } from 'react-native';
3+
4+
import { CustomIcon } from '../../../CustomIcon';
5+
import { useTheme } from '../../../../theme';
6+
import styles from '../../styles';
7+
8+
const Translated = memo(({ isTranslated }: { isTranslated: boolean }) => {
9+
const { colors } = useTheme();
10+
11+
if (!isTranslated) {
12+
return null;
13+
}
14+
15+
return (
16+
<View style={styles.rightIcons}>
17+
<CustomIcon name='language' size={16} color={colors.auxiliaryText} />
18+
</View>
19+
);
20+
});
21+
22+
export default Translated;

app/containers/message/Components/RightIcons/index.tsx

+4-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import Encrypted from './Encrypted';
55
import Edited from './Edited';
66
import MessageError from './MessageError';
77
import ReadReceipt from './ReadReceipt';
8+
import Translated from './Translated';
89
import { MessageType } from '../../../../definitions';
910

1011
const styles = StyleSheet.create({
@@ -20,13 +21,15 @@ interface IRightIcons {
2021
isReadReceiptEnabled?: boolean;
2122
unread?: boolean;
2223
hasError: boolean;
24+
isTranslated: boolean;
2325
}
2426

25-
const RightIcons = ({ type, msg, isEdited, hasError, isReadReceiptEnabled, unread }: IRightIcons) => (
27+
const RightIcons = ({ type, msg, isEdited, hasError, isReadReceiptEnabled, unread, isTranslated }: IRightIcons) => (
2628
<View style={styles.actionIcons}>
2729
<Encrypted type={type} />
2830
<Edited testID={`${msg}-edited`} isEdited={isEdited} />
2931
<MessageError hasError={hasError} />
32+
<Translated isTranslated={isTranslated} />
3033
<ReadReceipt isReadReceiptEnabled={isReadReceiptEnabled} unread={unread} />
3134
</View>
3235
);

app/containers/message/Message.stories.tsx

+11
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,13 @@ export const Edited = () => (
127127
</>
128128
);
129129

130+
export const Translated = () => (
131+
<>
132+
<Message msg='Message header' isTranslated />
133+
<Message msg='Message without header' isTranslated isHeader={false} />
134+
</>
135+
);
136+
130137
export const Encrypted = () => (
131138
<>
132139
<Message msg='Message' type='e2e' />
@@ -939,6 +946,7 @@ export const LongNameUser = () => (
939946
<>
940947
<Message msg={'this is a normal message'} author={longNameAuthor} />
941948
<Message msg={'Edited message'} author={longNameAuthor} isEdited />
949+
<Message msg={'Translated message'} author={longNameAuthor} isTranslated />
942950
<Message msg={'Encrypted message'} author={longNameAuthor} type={E2E_MESSAGE_TYPE} />
943951
<Message msg={'Error message'} author={longNameAuthor} hasError />
944952
<Message msg={'Message with read receipt'} author={longNameAuthor} isReadReceiptEnabled read />
@@ -947,6 +955,7 @@ export const LongNameUser = () => (
947955
msg={'Show all icons '}
948956
author={longNameAuthor}
949957
isEdited
958+
isTranslated
950959
type={E2E_MESSAGE_TYPE}
951960
hasError
952961
isReadReceiptEnabled
@@ -958,6 +967,7 @@ export const LongNameUser = () => (
958967
author={longNameAuthor}
959968
isHeader={false}
960969
isEdited
970+
isTranslated
961971
type={E2E_MESSAGE_TYPE}
962972
hasError
963973
isReadReceiptEnabled
@@ -969,6 +979,7 @@ export const LongNameUser = () => (
969979
author={longNameAuthor}
970980
isHeader={false}
971981
isEdited
982+
isTranslated
972983
type={E2E_MESSAGE_TYPE}
973984
hasError
974985
isReadReceiptEnabled

app/containers/message/Message.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ const Message = React.memo((props: IMessage) => {
117117
hasError={props.hasError}
118118
isReadReceiptEnabled={props.isReadReceiptEnabled}
119119
unread={props.unread}
120+
isTranslated={props.isTranslated}
120121
/>
121122
) : null}
122123
</View>

app/containers/message/User.tsx

+16-1
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,24 @@ interface IMessageUser {
6060
isEdited: boolean;
6161
isReadReceiptEnabled?: boolean;
6262
unread?: boolean;
63+
isTranslated: boolean;
6364
}
6465

6566
const User = React.memo(
66-
({ isHeader, useRealName, author, alias, ts, timeFormat, hasError, navToRoomInfo, type, isEdited, ...props }: IMessageUser) => {
67+
({
68+
isHeader,
69+
useRealName,
70+
author,
71+
alias,
72+
ts,
73+
timeFormat,
74+
hasError,
75+
navToRoomInfo,
76+
type,
77+
isEdited,
78+
isTranslated,
79+
...props
80+
}: IMessageUser) => {
6781
const { user } = useContext(MessageContext);
6882
const { colors } = useTheme();
6983

@@ -110,6 +124,7 @@ const User = React.memo(
110124
hasError={hasError}
111125
isReadReceiptEnabled={props.isReadReceiptEnabled}
112126
unread={props.unread}
127+
isTranslated={isTranslated}
113128
/>
114129
</View>
115130
);

app/definitions/ISubscription.ts

+1
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ export interface ISubscription {
110110
threads: RelationModified<TThreadModel>;
111111
threadMessages: RelationModified<TThreadMessageModel>;
112112
uploads: RelationModified<TUploadModel>;
113+
disableNotifications?: boolean;
113114
}
114115

115116
export type TSubscriptionModel = ISubscription &

app/definitions/redux/index.ts

+4
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ import { IEnterpriseModules } from '../../reducers/enterpriseModules';
4040
import { IVideoConf } from '../../reducers/videoConf';
4141
import { TActionUsersRoles } from '../../actions/usersRoles';
4242
import { TUsersRoles } from '../../reducers/usersRoles';
43+
import { ITroubleshootingNotification } from '../../reducers/troubleshootingNotification';
44+
import { TActionTroubleshootingNotification } from '../../actions/troubleshootingNotification';
4345
import { ISupportedVersionsState } from '../../reducers/supportedVersions';
4446
import { IInAppFeedbackState } from '../../reducers/inAppFeedback';
4547

@@ -67,6 +69,7 @@ export interface IApplicationState {
6769
roles: IRoles;
6870
videoConf: IVideoConf;
6971
usersRoles: TUsersRoles;
72+
troubleshootingNotification: ITroubleshootingNotification;
7073
supportedVersions: ISupportedVersionsState;
7174
inAppFeedback: IInAppFeedbackState;
7275
}
@@ -90,5 +93,6 @@ export type TApplicationActions = TActionActiveUsers &
9093
TActionEnterpriseModules &
9194
TActionVideoConf &
9295
TActionUsersRoles &
96+
TActionTroubleshootingNotification &
9397
TActionSupportedVersions &
9498
TInAppFeedbackAction;

app/definitions/rest/v1/index.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import { E2eEndpoints } from './e2e';
1717
import { SubscriptionsEndpoints } from './subscriptions';
1818
import { VideoConferenceEndpoints } from './videoConference';
1919
import { CommandsEndpoints } from './commands';
20-
import { PushTokenEndpoints } from './pushToken';
20+
import { PushEndpoints } from './push';
2121
import { DirectoryEndpoint } from './directory';
2222
import { AutoTranslateEndpoints } from './autotranslate';
2323
import { ModerationEndpoints } from './moderation';
@@ -41,7 +41,7 @@ export type Endpoints = ChannelsEndpoints &
4141
SubscriptionsEndpoints &
4242
VideoConferenceEndpoints &
4343
CommandsEndpoints &
44-
PushTokenEndpoints &
44+
PushEndpoints &
4545
DirectoryEndpoint &
4646
AutoTranslateEndpoints &
4747
ModerationEndpoints;

app/definitions/rest/v1/push.ts

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
type TPushInfo = {
2+
pushGatewayEnabled: boolean;
3+
defaultPushGateway: boolean;
4+
success: boolean;
5+
};
6+
7+
export type PushEndpoints = {
8+
'push.token': {
9+
POST: (params: { value: string; type: string; appName: string }) => {
10+
result: {
11+
id: string;
12+
token: string;
13+
appName: string;
14+
userId: string;
15+
};
16+
};
17+
};
18+
'push.info': {
19+
GET: () => TPushInfo;
20+
};
21+
'push.test': {
22+
POST: () => { tokensCount: number };
23+
};
24+
};

app/definitions/rest/v1/pushToken.ts

-12
This file was deleted.

app/i18n/locales/en.json

+21
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
"All_users_in_the_channel_can_write_new_messages": "All users in the channel can write new messages",
2525
"All_users_in_the_team_can_write_new_messages": "All users in the team can write new messages",
2626
"Allow_Reactions": "Allow reactions",
27+
"Allow_push_notifications_for_rocket_chat": "Allow push notifications for Rocket.Chat",
2728
"Also_send_thread_message_to_channel_behavior": "Also send thread message to channel",
2829
"Announcement": "Announcement",
2930
"App_users_are_not_allowed_to_log_in_directly": "App users are not allowed to log in directly.",
@@ -102,6 +103,7 @@
102103
"Code_block": "Code block",
103104
"Code_or_password_invalid": "Code or password invalid",
104105
"Collaborative": "Collaborative",
106+
"Community_edition_push_quota": "Community push quota",
105107
"Condensed": "Condensed",
106108
"Confirm": "Confirm",
107109
"Confirmation": "Confirmation",
@@ -134,6 +136,8 @@
134136
"Create_a_new_workspace": "Create a new workspace",
135137
"Create_account": "Create an account",
136138
"Created_snippet": "created a snippet",
139+
"Custom_push_gateway_connected_description": "Your workspace uses a custom push notification gateway. Check with your workspace administrator for any issues.",
140+
"Custom_push_gateway_connection": "Custom Gateway Connection",
137141
"DELETE": "DELETE",
138142
"Dark": "Dark",
139143
"Dark_level": "Dark level",
@@ -156,6 +160,9 @@
156160
"Description": "Description",
157161
"Desktop_Alert_info": "These notifications are delivered in desktop",
158162
"Desktop_Notifications": "Desktop notifications",
163+
"Device_notification_settings": "Device notification settings",
164+
"Device_notifications_alert_description": "Please go to your settings app and enable notifications for Rocket.Chat",
165+
"Device_notifications_alert_title": "Notifications disabled",
159166
"Direct_Messages": "Direct messages",
160167
"Direct_message": "Direct message",
161168
"Direct_message_someone": "Direct message someone",
@@ -174,6 +181,7 @@
174181
"Do_you_have_a_certificate": "Do you have a certificate?",
175182
"Do_you_have_an_account": "Do you have an account?",
176183
"Do_you_really_want_to_key_this_room_question_mark": "Do you really want to {{key}} this room?",
184+
"Documentation": "Documentation",
177185
"Dont_Have_An_Account": "Don't you have an account?",
178186
"Dont_activate": "Don't activate now",
179187
"Downloaded_file": "Downloaded file",
@@ -387,6 +395,7 @@
387395
"No_channels_in_team": "No Channels on this team",
388396
"No_discussions": "No discussions",
389397
"No_files": "No files",
398+
"No_further_action_is_needed": "No further action is needed",
390399
"No_label_provided": "No {{label}} provided.",
391400
"No_limit": "No limit",
392401
"No_match_found": "No match found.",
@@ -404,6 +413,8 @@
404413
"Nothing": "Nothing",
405414
"Nothing_to_save": "Nothing to save!",
406415
"Notification_Preferences": "Notification preferences",
416+
"Notification_delay": "Notification delay",
417+
"Notification_delay_description": "There are factors that can contribute to delayed notifications. Learn more in Rocket.Chat's docs.",
407418
"Notifications": "Notifications",
408419
"Notify_active_in_this_room": "Notify active users in this room",
409420
"Notify_all_in_this_room": "Notify all in this room",
@@ -461,6 +472,10 @@
461472
"Public": "Public",
462473
"Push_Notifications": "Push notifications",
463474
"Push_Notifications_Alert_Info": "These notifications are delivered to you when the app is not open",
475+
"Push_Troubleshooting": "Push Troubleshooting",
476+
"Push_gateway_connected_description": "Send a push notification to yourself to check if the gateway is working",
477+
"Push_gateway_connection": "Push Gateway Connection",
478+
"Push_gateway_not_connected_description": "We're not able to connect to the push gateway. If this issue persists please check with your workspace administrator.",
464479
"Queued_chats": "Queued chats",
465480
"Quote": "Quote",
466481
"RESET": "RESET",
@@ -605,6 +620,7 @@
605620
"Team_not_found": "Team not found",
606621
"Teams": "Teams",
607622
"Terms_of_Service": " Terms of service ",
623+
"Test_push_notification": "Test push notification",
608624
"The_maximum_number_of_users_has_been_reached": "The maximum number of users has been reached.",
609625
"The_room_does_not_exist": "The room does not exist or you may not have access permission",
610626
"The_user_will_be_able_to_type_in_roomName": "The user will be able to type in {{roomName}}",
@@ -625,6 +641,7 @@
625641
"Token_expired": "Your session has expired. Please log in again.",
626642
"Topic": "Topic",
627643
"Translate": "Translate",
644+
"Troubleshooting": "Troubleshooting",
628645
"Try_again": "Try again",
629646
"Two_Factor_Authentication": "Two-factor authentication",
630647
"Type_message": "Type message",
@@ -690,6 +707,8 @@
690707
"Wi_Fi_and_mobile_data": "Wi-Fi and mobile data",
691708
"Without_Servers": "Without workspaces",
692709
"Workspace_URL_Example": "Ex. your-company.rocket.chat",
710+
"Workspace_consumption": "Workspace consumption",
711+
"Workspace_consumption_description": "There’s a set amount of push notifications per month",
693712
"Workspaces": "Workspaces",
694713
"Would_like_to_place_on_hold": "Would you like to place this chat on hold?",
695714
"Would_you_like_to_return_the_inquiry": "Would you like to return the inquiry?",
@@ -720,6 +739,7 @@
720739
"Your_invite_link_will_expire_on__date__or_after__usesLeft__uses": "Your invite link will expire on {{date}} or after {{usesLeft}} uses.",
721740
"Your_invite_link_will_never_expire": "Your invite link will never expire.",
722741
"Your_password_is": "Your password is",
742+
"Your_push_was_sent_to_s_devices": "Your push was sent to {{s}} devices",
723743
"Your_workspace": "Your workspace",
724744
"__count__empty_room_will_be_removed_automatically": "{{count}} empty room will be deleted.",
725745
"__count__empty_rooms_will_be_removed_automatically": "{{count}} empty rooms will be deleted.",
@@ -761,6 +781,7 @@
761781
"error-invalid-file-type": "Invalid file type",
762782
"error-invalid-password": "Invalid password",
763783
"error-invalid-room-name": "{{room_name}} is not a valid room name",
784+
"error-no-tokens-for-this-user": "There are no tokens for this user",
764785
"error-not-allowed": "Not allowed",
765786
"error-not-permission-to-upload-file": "You don't have permission to upload files",
766787
"error-save-image": "Error while saving image",

0 commit comments

Comments
 (0)