Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…eactNative into feat.watch
  • Loading branch information
djorkaeffalexandre committed Mar 4, 2024
2 parents 539ccf8 + 4c8caf0 commit 885de66
Show file tree
Hide file tree
Showing 48 changed files with 794 additions and 82 deletions.

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions app/actions/actionsTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,5 +96,6 @@ export const VIDEO_CONF = createRequestTypes('VIDEO_CONF', [
'ACCEPT_CALL',
'SET_CALLING'
]);
export const TROUBLESHOOTING_NOTIFICATION = createRequestTypes('TROUBLESHOOTING_NOTIFICATION', ['INIT', 'SET']);
export const SUPPORTED_VERSIONS = createRequestTypes('SUPPORTED_VERSIONS', ['SET']);
export const IN_APP_FEEDBACK = createRequestTypes('IN_APP_FEEDBACK', ['SET', 'REMOVE', 'CLEAR']);
21 changes: 21 additions & 0 deletions app/actions/troubleshootingNotification.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { Action } from 'redux';

import { TROUBLESHOOTING_NOTIFICATION } from './actionsTypes';
import { ITroubleshootingNotification } from '../reducers/troubleshootingNotification';

type TSetTroubleshootingNotification = Action & { payload: Partial<ITroubleshootingNotification> };

export type TActionTroubleshootingNotification = Action & TSetTroubleshootingNotification;

export function initTroubleshootingNotification(): Action {
return {
type: TROUBLESHOOTING_NOTIFICATION.INIT
};
}

export function setTroubleshootingNotification(payload: Partial<ITroubleshootingNotification>): TSetTroubleshootingNotification {
return {
type: TROUBLESHOOTING_NOTIFICATION.SET,
payload
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export const VideoConferenceBaseContainer = ({ variant, children }: VideoConfMes
},
issue: {
icon: 'phone-issue',
color: colors.statusFontOnWarning,
color: colors.statusFontWarning,
backgroundColor: colors.statusBackgroundWarning,
label: i18n.t('Call_issue')
}
Expand Down
22 changes: 22 additions & 0 deletions app/containers/message/Components/RightIcons/Translated.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import React, { memo } from 'react';
import { View } from 'react-native';

import { CustomIcon } from '../../../CustomIcon';
import { useTheme } from '../../../../theme';
import styles from '../../styles';

const Translated = memo(({ isTranslated }: { isTranslated: boolean }) => {
const { colors } = useTheme();

if (!isTranslated) {
return null;
}

return (
<View style={styles.rightIcons}>
<CustomIcon name='language' size={16} color={colors.auxiliaryText} />
</View>
);
});

export default Translated;
5 changes: 4 additions & 1 deletion app/containers/message/Components/RightIcons/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import Encrypted from './Encrypted';
import Edited from './Edited';
import MessageError from './MessageError';
import ReadReceipt from './ReadReceipt';
import Translated from './Translated';
import { MessageType } from '../../../../definitions';

const styles = StyleSheet.create({
Expand All @@ -20,13 +21,15 @@ interface IRightIcons {
isReadReceiptEnabled?: boolean;
unread?: boolean;
hasError: boolean;
isTranslated: boolean;
}

const RightIcons = ({ type, msg, isEdited, hasError, isReadReceiptEnabled, unread }: IRightIcons) => (
const RightIcons = ({ type, msg, isEdited, hasError, isReadReceiptEnabled, unread, isTranslated }: IRightIcons) => (
<View style={styles.actionIcons}>
<Encrypted type={type} />
<Edited testID={`${msg}-edited`} isEdited={isEdited} />
<MessageError hasError={hasError} />
<Translated isTranslated={isTranslated} />
<ReadReceipt isReadReceiptEnabled={isReadReceiptEnabled} unread={unread} />
</View>
);
Expand Down
11 changes: 11 additions & 0 deletions app/containers/message/Message.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,13 @@ export const Edited = () => (
</>
);

export const Translated = () => (
<>
<Message msg='Message header' isTranslated />
<Message msg='Message without header' isTranslated isHeader={false} />
</>
);

export const Encrypted = () => (
<>
<Message msg='Message' type='e2e' />
Expand Down Expand Up @@ -939,6 +946,7 @@ export const LongNameUser = () => (
<>
<Message msg={'this is a normal message'} author={longNameAuthor} />
<Message msg={'Edited message'} author={longNameAuthor} isEdited />
<Message msg={'Translated message'} author={longNameAuthor} isTranslated />
<Message msg={'Encrypted message'} author={longNameAuthor} type={E2E_MESSAGE_TYPE} />
<Message msg={'Error message'} author={longNameAuthor} hasError />
<Message msg={'Message with read receipt'} author={longNameAuthor} isReadReceiptEnabled read />
Expand All @@ -947,6 +955,7 @@ export const LongNameUser = () => (
msg={'Show all icons '}
author={longNameAuthor}
isEdited
isTranslated
type={E2E_MESSAGE_TYPE}
hasError
isReadReceiptEnabled
Expand All @@ -958,6 +967,7 @@ export const LongNameUser = () => (
author={longNameAuthor}
isHeader={false}
isEdited
isTranslated
type={E2E_MESSAGE_TYPE}
hasError
isReadReceiptEnabled
Expand All @@ -969,6 +979,7 @@ export const LongNameUser = () => (
author={longNameAuthor}
isHeader={false}
isEdited
isTranslated
type={E2E_MESSAGE_TYPE}
hasError
isReadReceiptEnabled
Expand Down
1 change: 1 addition & 0 deletions app/containers/message/Message.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ const Message = React.memo((props: IMessage) => {
hasError={props.hasError}
isReadReceiptEnabled={props.isReadReceiptEnabled}
unread={props.unread}
isTranslated={props.isTranslated}
/>
) : null}
</View>
Expand Down
17 changes: 16 additions & 1 deletion app/containers/message/User.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,24 @@ interface IMessageUser {
isEdited: boolean;
isReadReceiptEnabled?: boolean;
unread?: boolean;
isTranslated: boolean;
}

const User = React.memo(
({ isHeader, useRealName, author, alias, ts, timeFormat, hasError, navToRoomInfo, type, isEdited, ...props }: IMessageUser) => {
({
isHeader,
useRealName,
author,
alias,
ts,
timeFormat,
hasError,
navToRoomInfo,
type,
isEdited,
isTranslated,
...props
}: IMessageUser) => {
const { user } = useContext(MessageContext);
const { colors } = useTheme();

Expand Down Expand Up @@ -110,6 +124,7 @@ const User = React.memo(
hasError={hasError}
isReadReceiptEnabled={props.isReadReceiptEnabled}
unread={props.unread}
isTranslated={isTranslated}
/>
</View>
);
Expand Down
1 change: 1 addition & 0 deletions app/definitions/ISubscription.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ export interface ISubscription {
threads: RelationModified<TThreadModel>;
threadMessages: RelationModified<TThreadMessageModel>;
uploads: RelationModified<TUploadModel>;
disableNotifications?: boolean;
}

export type TSubscriptionModel = ISubscription &
Expand Down
4 changes: 4 additions & 0 deletions app/definitions/redux/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ import { IEnterpriseModules } from '../../reducers/enterpriseModules';
import { IVideoConf } from '../../reducers/videoConf';
import { TActionUsersRoles } from '../../actions/usersRoles';
import { TUsersRoles } from '../../reducers/usersRoles';
import { ITroubleshootingNotification } from '../../reducers/troubleshootingNotification';
import { TActionTroubleshootingNotification } from '../../actions/troubleshootingNotification';
import { ISupportedVersionsState } from '../../reducers/supportedVersions';
import { IInAppFeedbackState } from '../../reducers/inAppFeedback';

Expand Down Expand Up @@ -67,6 +69,7 @@ export interface IApplicationState {
roles: IRoles;
videoConf: IVideoConf;
usersRoles: TUsersRoles;
troubleshootingNotification: ITroubleshootingNotification;
supportedVersions: ISupportedVersionsState;
inAppFeedback: IInAppFeedbackState;
}
Expand All @@ -90,5 +93,6 @@ export type TApplicationActions = TActionActiveUsers &
TActionEnterpriseModules &
TActionVideoConf &
TActionUsersRoles &
TActionTroubleshootingNotification &
TActionSupportedVersions &
TInAppFeedbackAction;
4 changes: 2 additions & 2 deletions app/definitions/rest/v1/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { E2eEndpoints } from './e2e';
import { SubscriptionsEndpoints } from './subscriptions';
import { VideoConferenceEndpoints } from './videoConference';
import { CommandsEndpoints } from './commands';
import { PushTokenEndpoints } from './pushToken';
import { PushEndpoints } from './push';
import { DirectoryEndpoint } from './directory';
import { AutoTranslateEndpoints } from './autotranslate';
import { ModerationEndpoints } from './moderation';
Expand All @@ -41,7 +41,7 @@ export type Endpoints = ChannelsEndpoints &
SubscriptionsEndpoints &
VideoConferenceEndpoints &
CommandsEndpoints &
PushTokenEndpoints &
PushEndpoints &
DirectoryEndpoint &
AutoTranslateEndpoints &
ModerationEndpoints;
24 changes: 24 additions & 0 deletions app/definitions/rest/v1/push.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
type TPushInfo = {
pushGatewayEnabled: boolean;
defaultPushGateway: boolean;
success: boolean;
};

export type PushEndpoints = {
'push.token': {
POST: (params: { value: string; type: string; appName: string }) => {
result: {
id: string;
token: string;
appName: string;
userId: string;
};
};
};
'push.info': {
GET: () => TPushInfo;
};
'push.test': {
POST: () => { tokensCount: number };
};
};
12 changes: 0 additions & 12 deletions app/definitions/rest/v1/pushToken.ts

This file was deleted.

21 changes: 21 additions & 0 deletions app/i18n/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"All_users_in_the_channel_can_write_new_messages": "All users in the channel can write new messages",
"All_users_in_the_team_can_write_new_messages": "All users in the team can write new messages",
"Allow_Reactions": "Allow reactions",
"Allow_push_notifications_for_rocket_chat": "Allow push notifications for Rocket.Chat",
"Also_send_thread_message_to_channel_behavior": "Also send thread message to channel",
"Announcement": "Announcement",
"App_users_are_not_allowed_to_log_in_directly": "App users are not allowed to log in directly.",
Expand Down Expand Up @@ -102,6 +103,7 @@
"Code_block": "Code block",
"Code_or_password_invalid": "Code or password invalid",
"Collaborative": "Collaborative",
"Community_edition_push_quota": "Community push quota",
"Condensed": "Condensed",
"Confirm": "Confirm",
"Confirmation": "Confirmation",
Expand Down Expand Up @@ -134,6 +136,8 @@
"Create_a_new_workspace": "Create a new workspace",
"Create_account": "Create an account",
"Created_snippet": "created a snippet",
"Custom_push_gateway_connected_description": "Your workspace uses a custom push notification gateway. Check with your workspace administrator for any issues.",
"Custom_push_gateway_connection": "Custom Gateway Connection",
"DELETE": "DELETE",
"Dark": "Dark",
"Dark_level": "Dark level",
Expand All @@ -156,6 +160,9 @@
"Description": "Description",
"Desktop_Alert_info": "These notifications are delivered in desktop",
"Desktop_Notifications": "Desktop notifications",
"Device_notification_settings": "Device notification settings",
"Device_notifications_alert_description": "Please go to your settings app and enable notifications for Rocket.Chat",
"Device_notifications_alert_title": "Notifications disabled",
"Direct_Messages": "Direct messages",
"Direct_message": "Direct message",
"Direct_message_someone": "Direct message someone",
Expand All @@ -174,6 +181,7 @@
"Do_you_have_a_certificate": "Do you have a certificate?",
"Do_you_have_an_account": "Do you have an account?",
"Do_you_really_want_to_key_this_room_question_mark": "Do you really want to {{key}} this room?",
"Documentation": "Documentation",
"Dont_Have_An_Account": "Don't you have an account?",
"Dont_activate": "Don't activate now",
"Downloaded_file": "Downloaded file",
Expand Down Expand Up @@ -387,6 +395,7 @@
"No_channels_in_team": "No Channels on this team",
"No_discussions": "No discussions",
"No_files": "No files",
"No_further_action_is_needed": "No further action is needed",
"No_label_provided": "No {{label}} provided.",
"No_limit": "No limit",
"No_match_found": "No match found.",
Expand All @@ -404,6 +413,8 @@
"Nothing": "Nothing",
"Nothing_to_save": "Nothing to save!",
"Notification_Preferences": "Notification preferences",
"Notification_delay": "Notification delay",
"Notification_delay_description": "There are factors that can contribute to delayed notifications. Learn more in Rocket.Chat's docs.",
"Notifications": "Notifications",
"Notify_active_in_this_room": "Notify active users in this room",
"Notify_all_in_this_room": "Notify all in this room",
Expand Down Expand Up @@ -461,6 +472,10 @@
"Public": "Public",
"Push_Notifications": "Push notifications",
"Push_Notifications_Alert_Info": "These notifications are delivered to you when the app is not open",
"Push_Troubleshooting": "Push Troubleshooting",
"Push_gateway_connected_description": "Send a push notification to yourself to check if the gateway is working",
"Push_gateway_connection": "Push Gateway Connection",
"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.",
"Queued_chats": "Queued chats",
"Quote": "Quote",
"RESET": "RESET",
Expand Down Expand Up @@ -605,6 +620,7 @@
"Team_not_found": "Team not found",
"Teams": "Teams",
"Terms_of_Service": " Terms of service ",
"Test_push_notification": "Test push notification",
"The_maximum_number_of_users_has_been_reached": "The maximum number of users has been reached.",
"The_room_does_not_exist": "The room does not exist or you may not have access permission",
"The_user_will_be_able_to_type_in_roomName": "The user will be able to type in {{roomName}}",
Expand All @@ -625,6 +641,7 @@
"Token_expired": "Your session has expired. Please log in again.",
"Topic": "Topic",
"Translate": "Translate",
"Troubleshooting": "Troubleshooting",
"Try_again": "Try again",
"Two_Factor_Authentication": "Two-factor authentication",
"Type_message": "Type message",
Expand Down Expand Up @@ -690,6 +707,8 @@
"Wi_Fi_and_mobile_data": "Wi-Fi and mobile data",
"Without_Servers": "Without workspaces",
"Workspace_URL_Example": "Ex. your-company.rocket.chat",
"Workspace_consumption": "Workspace consumption",
"Workspace_consumption_description": "There’s a set amount of push notifications per month",
"Workspaces": "Workspaces",
"Would_like_to_place_on_hold": "Would you like to place this chat on hold?",
"Would_you_like_to_return_the_inquiry": "Would you like to return the inquiry?",
Expand Down Expand Up @@ -720,6 +739,7 @@
"Your_invite_link_will_expire_on__date__or_after__usesLeft__uses": "Your invite link will expire on {{date}} or after {{usesLeft}} uses.",
"Your_invite_link_will_never_expire": "Your invite link will never expire.",
"Your_password_is": "Your password is",
"Your_push_was_sent_to_s_devices": "Your push was sent to {{s}} devices",
"Your_workspace": "Your workspace",
"__count__empty_room_will_be_removed_automatically": "{{count}} empty room will be deleted.",
"__count__empty_rooms_will_be_removed_automatically": "{{count}} empty rooms will be deleted.",
Expand Down Expand Up @@ -761,6 +781,7 @@
"error-invalid-file-type": "Invalid file type",
"error-invalid-password": "Invalid password",
"error-invalid-room-name": "{{room_name}} is not a valid room name",
"error-no-tokens-for-this-user": "There are no tokens for this user",
"error-not-allowed": "Not allowed",
"error-not-permission-to-upload-file": "You don't have permission to upload files",
"error-save-image": "Error while saving image",
Expand Down
Loading

0 comments on commit 885de66

Please sign in to comment.