From b4100bc6c63174624ea92abfdcfdec9f3eba3e75 Mon Sep 17 00:00:00 2001 From: Diego Mello Date: Mon, 17 Jun 2019 11:53:56 -0300 Subject: [PATCH] [RELEASE] Merge beta into master (#986) --- .circleci/config.yml | 11 +- __mocks__/reactotron-react-native.js | 3 + .../__snapshots__/Storyshots.test.js.snap | 606 ++++++++++++++++++ android/app/build.gradle | 8 +- android/build.gradle | 4 + app/actions/actionsTypes.js | 2 + app/actions/notification.js | 17 + app/actions/server.js | 6 + app/constants/colors.js | 1 + app/constants/settings.js | 9 + app/containers/Check.js | 18 + app/containers/DisclosureIndicator.js | 5 +- app/containers/ListItem.js | 93 +++ app/containers/MessageActions.js | 23 +- app/containers/MessageBox/CommandPreview.js | 47 ++ app/containers/MessageBox/index.js | 217 +++++-- app/containers/MessageBox/styles.js | 33 +- app/containers/SearchBox.js | 4 +- app/containers/Separator.js | 21 + app/containers/message/Message.js | 9 +- app/containers/message/ReadReceipt.js | 21 + app/containers/message/index.js | 10 +- app/containers/message/styles.js | 3 + app/i18n/locales/de.js | 48 +- app/i18n/locales/en.js | 20 +- app/i18n/locales/pt-BR.js | 8 +- app/index.js | 34 +- app/lib/methods/getCustomEmojis.js | 93 +-- app/lib/methods/getPermissions.js | 93 +-- app/lib/methods/getRoles.js | 50 +- app/lib/methods/getSlashCommands.js | 36 ++ app/lib/methods/helpers/normalizeMessage.js | 1 + app/lib/methods/subscriptions/rooms.js | 12 + app/lib/realm.js | 20 +- app/lib/rocketchat.js | 273 ++++---- app/notifications/inApp/index.js | 229 +++++++ app/{ => notifications}/push/index.js | 4 +- app/{ => notifications}/push/push.android.js | 0 app/{ => notifications}/push/push.ios.js | 0 app/reducers/index.js | 2 + app/reducers/notification.js | 24 + app/reducers/server.js | 7 + app/sagas/login.js | 78 ++- app/sagas/rooms.js | 29 +- app/sagas/selectServer.js | 44 +- app/sagas/state.js | 2 +- app/utils/deviceInfo.js | 9 +- app/views/DirectoryView/DirectoryItem.js | 63 ++ app/views/DirectoryView/Options.js | 121 ++++ app/views/DirectoryView/index.js | 248 +++++++ app/views/DirectoryView/styles.js | 151 +++++ app/views/LanguageView/index.js | 158 +++++ app/views/NewMessageView.js | 3 +- app/views/ProfileView/index.js | 9 +- app/views/ReadReceiptView/index.js | 146 +++++ app/views/ReadReceiptView/styles.js | 50 ++ app/views/RoomView/index.js | 9 +- app/views/RoomsListView/Check.js | 8 - .../RoomsListView/Header/Header.android.js | 6 +- app/views/RoomsListView/Header/Header.ios.js | 8 +- app/views/RoomsListView/Header/index.js | 2 +- .../RoomsListView/ListHeader/Directory.js | 30 + app/views/RoomsListView/ListHeader/index.js | 7 +- app/views/RoomsListView/ServerDropdown.js | 2 +- app/views/RoomsListView/SortDropdown.js | 32 +- app/views/RoomsListView/index.js | 30 +- app/views/RoomsListView/styles.js | 14 +- app/views/SettingsView/index.js | 314 ++++----- app/views/SettingsView/styles.js | 12 + app/views/SidebarView/index.js | 4 - app/views/Styles.js | 16 +- e2e/03-forgotpassword.spec.js | 2 +- e2e/04-createuser.spec.js | 4 +- e2e/08-room.spec.js | 27 +- e2e/14-setting.spec.js | 94 +++ ...room.spec.js => 15-joinpublicroom.spec.js} | 33 +- e2e/README.md | 52 ++ e2e/data.js | 6 +- ios/RocketChatRN/Info.plist | 2 +- package.json | 2 +- storybook/stories/Message.js | 24 + yarn.lock | 8 +- 82 files changed, 3350 insertions(+), 634 deletions(-) create mode 100644 __mocks__/reactotron-react-native.js create mode 100644 app/actions/notification.js create mode 100644 app/containers/Check.js create mode 100644 app/containers/ListItem.js create mode 100644 app/containers/MessageBox/CommandPreview.js create mode 100644 app/containers/Separator.js create mode 100644 app/containers/message/ReadReceipt.js create mode 100644 app/lib/methods/getSlashCommands.js create mode 100644 app/notifications/inApp/index.js rename app/{ => notifications}/push/index.js (89%) rename app/{ => notifications}/push/push.android.js (100%) rename app/{ => notifications}/push/push.ios.js (100%) create mode 100644 app/reducers/notification.js create mode 100644 app/views/DirectoryView/DirectoryItem.js create mode 100644 app/views/DirectoryView/Options.js create mode 100644 app/views/DirectoryView/index.js create mode 100644 app/views/DirectoryView/styles.js create mode 100644 app/views/LanguageView/index.js create mode 100644 app/views/ReadReceiptView/index.js create mode 100644 app/views/ReadReceiptView/styles.js delete mode 100644 app/views/RoomsListView/Check.js create mode 100644 app/views/RoomsListView/ListHeader/Directory.js create mode 100644 app/views/SettingsView/styles.js create mode 100644 e2e/14-setting.spec.js rename e2e/{14-joinpublicroom.spec.js => 15-joinpublicroom.spec.js} (86%) create mode 100644 e2e/README.md diff --git a/.circleci/config.yml b/.circleci/config.yml index 5d6138c72..3caf381e3 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -253,9 +253,14 @@ workflows: build-and-test: jobs: - lint-testunit - # - e2e-test: - # requires: - # - lint-testunit + + - e2e-hold: + type: approval + requires: + - lint-testunit + - e2e-test: + requires: + - e2e-hold - ios-build: requires: diff --git a/__mocks__/reactotron-react-native.js b/__mocks__/reactotron-react-native.js new file mode 100644 index 000000000..9180fdfe5 --- /dev/null +++ b/__mocks__/reactotron-react-native.js @@ -0,0 +1,3 @@ +export default { + createSagaMonitor: () => {} +}; diff --git a/__tests__/__snapshots__/Storyshots.test.js.snap b/__tests__/__snapshots__/Storyshots.test.js.snap index 3777a6ea4..335bfb8b3 100644 --- a/__tests__/__snapshots__/Storyshots.test.js.snap +++ b/__tests__/__snapshots__/Storyshots.test.js.snap @@ -9216,6 +9216,612 @@ exports[`Storyshots Message list 1`] = ` + + Message with read receipt + + + + + + + + + + + + + + + diego.mello + + + + 10:00 AM + + + + + + + I’m fine! + + + + + + + + + + + + + + + + + + + I’m fine! + + + + + + + + + + + + + + + + + + + + + + + diego.mello + + + + 10:00 AM + + + + + + + I’m fine! + + + + + + +  + + + + + + + + + + + + + + + I’m fine! + + + + + + +  + + + + + ); + +export default Check; diff --git a/app/containers/DisclosureIndicator.js b/app/containers/DisclosureIndicator.js index 03bed9861..25a284baf 100644 --- a/app/containers/DisclosureIndicator.js +++ b/app/containers/DisclosureIndicator.js @@ -14,9 +14,12 @@ const styles = StyleSheet.create({ } }); +export const DisclosureImage = React.memo(() => ); + const DisclosureIndicator = React.memo(() => ( - + )); + export default DisclosureIndicator; diff --git a/app/containers/ListItem.js b/app/containers/ListItem.js new file mode 100644 index 000000000..069329343 --- /dev/null +++ b/app/containers/ListItem.js @@ -0,0 +1,93 @@ +import React from 'react'; +import { View, Text, StyleSheet } from 'react-native'; +import PropTypes from 'prop-types'; +import { RectButton } from 'react-native-gesture-handler'; + +import { COLOR_TEXT } from '../constants/colors'; +import sharedStyles from '../views/Styles'; + +const styles = StyleSheet.create({ + container: { + flex: 1, + flexDirection: 'row', + alignItems: 'center', + justifyContent: 'center', + height: 56, + paddingHorizontal: 15 + }, + disabled: { + opacity: 0.3 + }, + textContainer: { + flex: 1, + justifyContent: 'center' + }, + title: { + fontSize: 16, + ...sharedStyles.textColorNormal, + ...sharedStyles.textRegular + }, + subtitle: { + fontSize: 14, + ...sharedStyles.textColorNormal, + ...sharedStyles.textRegular + } +}); + +const Content = React.memo(({ + title, subtitle, disabled, testID, right +}) => ( + + + {title} + {subtitle + ? {subtitle} + : null + } + + {right ? right() : null} + +)); + +const Button = React.memo(({ + onPress, ...props +}) => ( + + + +)); + +const Item = React.memo(({ ...props }) => { + if (props.onPress) { + return