Skip to content

Commit

Permalink
Merge branch 'develop' into improvement.sort-native
Browse files Browse the repository at this point in the history
  • Loading branch information
diegolmello authored Jul 17, 2020
2 parents ee74550 + 52b82e5 commit 693e454
Show file tree
Hide file tree
Showing 139 changed files with 13,040 additions and 10,039 deletions.
12 changes: 5 additions & 7 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ defaults: &defaults

macos: &macos
macos:
xcode: "11.2.1"
xcode: "11.5.0"

bash-env: &bash-env
BASH_ENV: "~/.nvm/nvm.sh"
Expand Down Expand Up @@ -33,14 +33,12 @@ save-npm-cache-mac: &save-npm-cache-mac
- ./node_modules

install-node: &install-node
name: Install Node 10
name: Install Node
command: |
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.6/install.sh | bash
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash
source ~/.nvm/nvm.sh
# https://github.com/creationix/nvm/issues/1394
set +e
nvm install 10
echo 'export PATH="/home/circleci/.nvm/versions/node/v10.20.1/bin:$PATH"' >> ~/.bash_profile
INSTALLED_NODE=`nvm which current`
echo "export PATH=\"${INSTALLED_NODE%%/node}:\$PATH\"" >> ~/.bash_profile
source ~/.bash_profile
restore-gems-cache: &restore-gems-cache
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,5 @@ buck-out/
coverage

.vscode/
e2e/docker/rc_test_env/docker-compose.yml
e2e/docker/data/db
2 changes: 1 addition & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ android {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode VERSIONCODE as Integer
versionName "4.9.0"
versionName "4.10.0"
vectorDrawables.useSupportLibrary = true
manifestPlaceholders = [BugsnagAPIKey: BugsnagAPIKey as String]
missingDimensionStrategy "RNNotifications.reactNativeVersion", "reactNative60" // See note below!
Expand Down
2 changes: 1 addition & 1 deletion app/containers/Avatar.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';
import { View } from 'react-native';
import FastImage from 'react-native-fast-image';
import FastImage from '@rocket.chat/react-native-fast-image';
import Touchable from 'react-native-platform-touchable';
import { settings as RocketChatSettings } from '@rocket.chat/sdk';

Expand Down
2 changes: 1 addition & 1 deletion app/containers/EmojiPicker/CustomEmoji.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import FastImage from 'react-native-fast-image';
import FastImage from '@rocket.chat/react-native-fast-image';
import PropTypes from 'prop-types';

const CustomEmoji = React.memo(({ baseUrl, emoji, style }) => (
Expand Down
2 changes: 2 additions & 0 deletions app/containers/InAppNotification/NotifierComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ const NotifierComponent = React.memo(({

if (isMasterDetail) {
Navigation.navigate('DrawerNavigator');
} else {
Navigation.navigate('RoomsListView');
}
goRoom({ item, isMasterDetail });
hideNotification();
Expand Down
51 changes: 41 additions & 10 deletions app/containers/LoginServices.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,32 @@ import {
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { Base64 } from 'js-base64';
import * as AppleAuthentication from 'expo-apple-authentication';

import { withTheme } from '../theme';
import sharedStyles from '../views/Styles';
import { themes } from '../constants/colors';
import { loginRequest as loginRequestAction } from '../actions/login';
import Button from './Button';
import OrSeparator from './OrSeparator';
import Touch from '../utils/touch';
import I18n from '../i18n';
import random from '../utils/random';
import RocketChat from '../lib/rocketchat';

const BUTTON_HEIGHT = 48;
const SERVICE_HEIGHT = 58;
const BORDER_RADIUS = 2;
const SERVICES_COLLAPSED_HEIGHT = 174;

const styles = StyleSheet.create({
serviceButton: {
borderRadius: 2,
borderRadius: BORDER_RADIUS,
marginBottom: 10
},
serviceButtonContainer: {
borderRadius: 2,
borderRadius: BORDER_RADIUS,
width: '100%',
height: 48,
height: BUTTON_HEIGHT,
flexDirection: 'row',
alignItems: 'center',
justifyContent: 'center',
Expand Down Expand Up @@ -187,6 +190,21 @@ class LoginServices extends React.PureComponent {
this.openOAuth({ url, ssoToken, authType: 'cas' });
}

onPressAppleLogin = async() => {
try {
const { fullName, email, identityToken } = await AppleAuthentication.signInAsync({
requestedScopes: [
AppleAuthentication.AppleAuthenticationScope.FULL_NAME,
AppleAuthentication.AppleAuthenticationScope.EMAIL
]
});

await RocketChat.loginOAuthOrSso({ fullName, email, identityToken });
} catch {
// Do nothing
}
}

getOAuthState = () => {
const credentialToken = random(43);
return Base64.encodeURI(JSON.stringify({ loginStyle: 'popup', credentialToken, isCordova: true }));
Expand Down Expand Up @@ -262,6 +280,7 @@ class LoginServices extends React.PureComponent {
}

renderItem = (service) => {
const { CAS_enabled, theme } = this.props;
let { name } = service;
name = name === 'meteor-developer' ? 'meteor' : name;
const icon = `icon_${ name }`;
Expand All @@ -285,11 +304,27 @@ class LoginServices extends React.PureComponent {
onPress = () => this.onPressCas();
break;
}
case 'apple': {
onPress = () => this.onPressAppleLogin();
break;
}
default:
break;
}

if (name === 'apple') {
return (
<AppleAuthentication.AppleAuthenticationButton
buttonType={AppleAuthentication.AppleAuthenticationButtonType.CONTINUE}
buttonStyle={theme === 'light' ? AppleAuthentication.AppleAuthenticationButtonStyle.BLACK : AppleAuthentication.AppleAuthenticationButtonStyle.WHITE}
cornerRadius={BORDER_RADIUS}
style={[styles.serviceButton, { height: BUTTON_HEIGHT }]}
onPress={onPress}
/>
);
}

name = name.charAt(0).toUpperCase() + name.slice(1);
const { CAS_enabled, theme } = this.props;
let buttonText;
if (isSaml || (service.service === 'cas' && CAS_enabled)) {
buttonText = <Text style={[styles.serviceName, isSaml && { color: service.buttonLabelColor }]}>{name}</Text>;
Expand Down Expand Up @@ -356,8 +391,4 @@ const mapStateToProps = state => ({
services: state.login.services
});

const mapDispatchToProps = dispatch => ({
loginRequest: params => dispatch(loginRequestAction(params))
});

export default connect(mapStateToProps, mapDispatchToProps)(withTheme(LoginServices));
export default connect(mapStateToProps)(withTheme(LoginServices));
8 changes: 7 additions & 1 deletion app/containers/MessageActions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,13 @@ const MessageActions = React.memo(forwardRef(({
hideActionSheet();
};

const handleReadReceipt = message => Navigation.navigate('ReadReceiptsView', { messageId: message.id });
const handleReadReceipt = (message) => {
if (isMasterDetail) {
Navigation.navigate('ModalStackNavigator', { screen: 'ReadReceiptsView', params: { messageId: message.id } });
} else {
Navigation.navigate('ReadReceiptsView', { messageId: message.id });
}
};

const handleToggleTranslation = async(message) => {
try {
Expand Down
2 changes: 1 addition & 1 deletion app/containers/MessageBox/CommandsPreview/Item.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useContext, useState } from 'react';
import PropTypes from 'prop-types';
import { TouchableOpacity } from 'react-native';
import FastImage from 'react-native-fast-image';
import FastImage from '@rocket.chat/react-native-fast-image';

import styles from '../styles';
import { CustomIcon } from '../../../lib/Icons';
Expand Down
2 changes: 1 addition & 1 deletion app/containers/MessageBox/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -908,7 +908,7 @@ class MessageBox extends Component {
return (
<>
{commandsPreviewAndMentions}
<View style={[styles.composer, { borderTopColor: themes[theme].separatorColor }]}>
<View style={[styles.composer, { borderTopColor: themes[theme].borderColor }]}>
{replyPreview}
<View
style={[
Expand Down
2 changes: 1 addition & 1 deletion app/containers/MessageBox/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default StyleSheet.create({
},
composer: {
flexDirection: 'column',
borderTopWidth: StyleSheet.hairlineWidth
borderTopWidth: 1
},
textArea: {
flexDirection: 'row',
Expand Down
2 changes: 1 addition & 1 deletion app/containers/UIKit/Image.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import { View, StyleSheet } from 'react-native';
import FastImage from 'react-native-fast-image';
import FastImage from '@rocket.chat/react-native-fast-image';
import PropTypes from 'prop-types';
import { BLOCK_CONTEXT } from '@rocket.chat/ui-kit';

Expand Down
2 changes: 1 addition & 1 deletion app/containers/UIKit/MultiSelect/Chips.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import { Text, View } from 'react-native';
import PropTypes from 'prop-types';
import Touchable from 'react-native-platform-touchable';
import FastImage from 'react-native-fast-image';
import FastImage from '@rocket.chat/react-native-fast-image';

import { themes } from '../../../constants/colors';
import { textParser } from '../utils';
Expand Down
2 changes: 1 addition & 1 deletion app/containers/UIKit/MultiSelect/Items.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import { Text, FlatList } from 'react-native';
import PropTypes from 'prop-types';
import Touchable from 'react-native-platform-touchable';
import FastImage from 'react-native-fast-image';
import FastImage from '@rocket.chat/react-native-fast-image';

import Separator from '../../Separator';
import Check from '../../Check';
Expand Down
2 changes: 1 addition & 1 deletion app/containers/markdown/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -383,9 +383,9 @@ class Markdown extends PureComponent {
m = m.replace(/^\[([\s]]*)\]\(([^)]*)\)\s/, '').trim();

if (preview) {
m = m.replace(/\n+/g, ' ');
m = shortnameToUnicode(m);
m = removeMarkdown(m);
m = m.replace(/\n+/g, ' ');
return (
<Text accessibilityLabel={m} style={[styles.text, { color: themes[theme].bodyText }, ...style]} numberOfLines={numberOfLines} testID={testID}>
{m}
Expand Down
2 changes: 1 addition & 1 deletion app/containers/message/Image.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useContext } from 'react';
import { View } from 'react-native';
import PropTypes from 'prop-types';
import FastImage from 'react-native-fast-image';
import FastImage from '@rocket.chat/react-native-fast-image';
import equal from 'deep-equal';
import { createImageProgress } from 'react-native-image-progress';
import * as Progress from 'react-native-progress';
Expand Down
2 changes: 1 addition & 1 deletion app/containers/message/Urls.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
View, Text, StyleSheet, Clipboard
} from 'react-native';
import PropTypes from 'prop-types';
import FastImage from 'react-native-fast-image';
import FastImage from '@rocket.chat/react-native-fast-image';
import isEqual from 'lodash/isEqual';

import Touchable from './Touchable';
Expand Down
Loading

0 comments on commit 693e454

Please sign in to comment.