From 32bfef256cf6b67f8f776d5918957137c62726b1 Mon Sep 17 00:00:00 2001 From: Djorkaeff Alexandre Date: Wed, 12 Feb 2020 09:39:31 -0300 Subject: [PATCH 1/7] [FIX] Themed Overflow --- app/containers/UIKit/Overflow.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/containers/UIKit/Overflow.js b/app/containers/UIKit/Overflow.js index 8cf5ed63119..6d76f6f3fbb 100644 --- a/app/containers/UIKit/Overflow.js +++ b/app/containers/UIKit/Overflow.js @@ -82,7 +82,7 @@ export const Overflow = ({ hitSlop={BUTTON_HIT_SLOP} style={styles.menu} > - {!loading ? : } + {!loading ? : } Date: Wed, 12 Feb 2020 09:55:12 -0300 Subject: [PATCH 2/7] [FIX] KeyboardAwareScrollView ModalBlocksView --- app/views/ModalBlockView.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/views/ModalBlockView.js b/app/views/ModalBlockView.js index 53a9283d28c..ba4cd963c47 100644 --- a/app/views/ModalBlockView.js +++ b/app/views/ModalBlockView.js @@ -1,8 +1,9 @@ import React from 'react'; -import { StyleSheet, ScrollView, View } from 'react-native'; +import { StyleSheet, View } from 'react-native'; import PropTypes from 'prop-types'; import isEqual from 'lodash/isEqual'; import { connect } from 'react-redux'; +import { KeyboardAwareScrollView } from 'react-native-keyboard-aware-scroll-view'; import { withTheme } from '../theme'; import { themedHeader } from '../utils/navigation'; @@ -224,7 +225,7 @@ class ModalBlockView extends React.Component { const { blocks } = view; return ( - {loading ? : null} - + ); } } From a54cca04c4b8dc656bf2a9d82ba97fdee5b720ca Mon Sep 17 00:00:00 2001 From: Djorkaeff Alexandre Date: Wed, 12 Feb 2020 10:09:28 -0300 Subject: [PATCH 3/7] [FIX] ModalBlocks errors --- app/lib/methods/actions.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/lib/methods/actions.js b/app/lib/methods/actions.js index 4d35e91554d..e2ac96978cd 100644 --- a/app/lib/methods/actions.js +++ b/app/lib/methods/actions.js @@ -133,7 +133,11 @@ export function triggerAction({ try { const { type: interactionType, ...data } = await result.json(); - return resolve(handlePayloadUserInteraction(interactionType, data)); + handlePayloadUserInteraction(interactionType, data); + + if (data.success) { + return resolve(); + } } catch (e) { // modal.close has no body, so result.json will fail // but it returns ok status From 9067bf9655080a3840501ca48d71e1f228b6f9c5 Mon Sep 17 00:00:00 2001 From: Djorkaeff Alexandre Date: Wed, 12 Feb 2020 10:43:31 -0300 Subject: [PATCH 4/7] [FIX] Markdown table --- app/containers/markdown/Table.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/containers/markdown/Table.js b/app/containers/markdown/Table.js index afae21d6bf7..b1bb5a30957 100644 --- a/app/containers/markdown/Table.js +++ b/app/containers/markdown/Table.js @@ -38,7 +38,7 @@ const Table = React.memo(({ ); }; - const onPress = () => Navigation.navigate('TableView', { renderRows, tableWidth: getTableWidth() }); + const onPress = () => Navigation.navigate('MarkdownTableView', { renderRows, tableWidth: getTableWidth() }); return ( From cc8b943e32d5c56b72fe4c615fb50284cdb51235 Mon Sep 17 00:00:00 2001 From: Djorkaeff Alexandre Date: Wed, 12 Feb 2020 11:06:50 -0300 Subject: [PATCH 5/7] [FIX] InApp Notification from Apps/Discussion --- app/actions/notification.js | 2 ++ app/lib/methods/subscriptions/rooms.js | 10 ++++++++++ app/lib/rocketchat.js | 3 +++ app/notifications/inApp/index.js | 13 +++++++++---- app/views/RoomsListView/index.js | 4 +++- 5 files changed, 27 insertions(+), 5 deletions(-) diff --git a/app/actions/notification.js b/app/actions/notification.js index 44f03d8a02e..35fc49d87e2 100644 --- a/app/actions/notification.js +++ b/app/actions/notification.js @@ -4,6 +4,8 @@ export function notificationReceived(params) { return { type: NOTIFICATION.RECEIVED, payload: { + title: params.title, + avatar: params.avatar, message: params.text, payload: params.payload } diff --git a/app/lib/methods/subscriptions/rooms.js b/app/lib/methods/subscriptions/rooms.js index 7a47837eed4..52f527d566b 100644 --- a/app/lib/methods/subscriptions/rooms.js +++ b/app/lib/methods/subscriptions/rooms.js @@ -11,6 +11,7 @@ import { roomsRequest } from '../../../actions/rooms'; import { notificationReceived } from '../../../actions/notification'; import { handlePayloadUserInteraction } from '../actions'; import buildMessage from '../helpers/buildMessage'; +import RocketChat from '../../rocketchat'; const removeListener = listener => listener.stop(); @@ -275,6 +276,15 @@ export default function subscribeRooms() { } if (/notification/.test(ev)) { const [notification] = ddpMessage.fields.args; + try { + const { payload: { rid } } = notification; + const subCollection = db.collections.get('subscriptions'); + const sub = await subCollection.find(rid); + notification.title = RocketChat.getRoomTitle(sub); + notification.avatar = RocketChat.getRoomAvatar(sub); + } catch (e) { + // do nothing + } store.dispatch(notificationReceived(notification)); } if (/uiInteraction/.test(ev)) { diff --git a/app/lib/rocketchat.js b/app/lib/rocketchat.js index ddb1dea8104..b2e8edcde4d 100644 --- a/app/lib/rocketchat.js +++ b/app/lib/rocketchat.js @@ -1131,6 +1131,9 @@ const RocketChat = { const { UI_Use_Real_Name: useRealName } = reduxStore.getState().settings; return ((room.prid || useRealName) && room.fname) || room.name; }, + getRoomAvatar(room) { + return room.prid ? room.fname : room.name; + }, findOrCreateInvite({ rid, days, maxUses }) { // RC 2.4.0 diff --git a/app/notifications/inApp/index.js b/app/notifications/inApp/index.js index 9c562397348..7fbb0856d67 100644 --- a/app/notifications/inApp/index.js +++ b/app/notifications/inApp/index.js @@ -158,15 +158,18 @@ class NotificationBadge extends React.Component { } goToRoom = async() => { - const { notification: { payload }, navigation, baseUrl } = this.props; + const { notification, navigation, baseUrl } = this.props; + const { payload } = notification; const { rid, type, prid } = payload; if (!rid) { return; } const name = type === 'd' ? payload.sender.username : payload.name; + // if not has sub on database, title will be null, so we use payload from notification + const { title = name } = notification; await navigation.navigate('RoomsListView'); navigation.navigate('RoomView', { - rid, name, t: type, prid, baseUrl + rid, name: title, t: type, prid, baseUrl }); this.hide(); } @@ -178,6 +181,8 @@ class NotificationBadge extends React.Component { const { message, payload } = notification; const { type } = payload; const name = type === 'd' ? payload.sender.username : payload.name; + // if not has sub on database, title and avatar will be null, so we use payload from notification + const { title = name, avatar = name } = notification; let top = 0; if (isIOS) { @@ -211,9 +216,9 @@ class NotificationBadge extends React.Component { background={Touchable.SelectableBackgroundBorderless()} > <> - + - {name} + {title} {message} diff --git a/app/views/RoomsListView/index.js b/app/views/RoomsListView/index.js index 611c72d8f3d..e8dca1d813b 100644 --- a/app/views/RoomsListView/index.js +++ b/app/views/RoomsListView/index.js @@ -491,6 +491,8 @@ class RoomsListView extends React.Component { getRoomTitle = item => RocketChat.getRoomTitle(item) + getRoomAvatar = item => RocketChat.getRoomAvatar(item) + goRoom = (item) => { this.cancelSearchingAndroid(); const { navigation } = this.props; @@ -731,7 +733,7 @@ class RoomsListView extends React.Component { userMentions={item.userMentions} isRead={this.getIsRead(item)} favorite={item.f} - avatar={item.name} + avatar={this.getRoomAvatar(item)} lastMessage={item.lastMessage} name={this.getRoomTitle(item)} _updatedAt={item.roomUpdatedAt} From 99f20239bf58a566ccf3bad749bed0c65a7591dc Mon Sep 17 00:00:00 2001 From: Djorkaeff Alexandre Date: Wed, 12 Feb 2020 12:43:49 -0300 Subject: [PATCH 6/7] [FIX] MultiSelect marginBottom --- app/containers/UIKit/MultiSelect/Items.js | 2 +- app/containers/UIKit/MultiSelect/styles.js | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/containers/UIKit/MultiSelect/Items.js b/app/containers/UIKit/MultiSelect/Items.js index 59075c35e90..17b30a52d14 100644 --- a/app/containers/UIKit/MultiSelect/Items.js +++ b/app/containers/UIKit/MultiSelect/Items.js @@ -44,7 +44,7 @@ const Items = ({ } keyExtractor={keyExtractor} diff --git a/app/containers/UIKit/MultiSelect/styles.js b/app/containers/UIKit/MultiSelect/styles.js index d9774d0f69f..f0034364abb 100644 --- a/app/containers/UIKit/MultiSelect/styles.js +++ b/app/containers/UIKit/MultiSelect/styles.js @@ -50,8 +50,11 @@ export default StyleSheet.create({ position: 'absolute', right: 16 }, + itemContent: { + paddingBottom: 36 + }, items: { - height: 200 + height: 226 }, chips: { flexDirection: 'row', From cdbbb680c496a2e6a24630da45f16c97f9156e16 Mon Sep 17 00:00:00 2001 From: Diego Mello Date: Wed, 12 Feb 2020 14:17:44 -0300 Subject: [PATCH 7/7] Apply suggestions from code review --- app/notifications/inApp/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/notifications/inApp/index.js b/app/notifications/inApp/index.js index 7fbb0856d67..4062c1fc408 100644 --- a/app/notifications/inApp/index.js +++ b/app/notifications/inApp/index.js @@ -165,7 +165,7 @@ class NotificationBadge extends React.Component { return; } const name = type === 'd' ? payload.sender.username : payload.name; - // if not has sub on database, title will be null, so we use payload from notification + // if sub is not on local database, title will be null, so we use payload from notification const { title = name } = notification; await navigation.navigate('RoomsListView'); navigation.navigate('RoomView', { @@ -181,7 +181,7 @@ class NotificationBadge extends React.Component { const { message, payload } = notification; const { type } = payload; const name = type === 'd' ? payload.sender.username : payload.name; - // if not has sub on database, title and avatar will be null, so we use payload from notification + // if sub is not on local database, title and avatar will be null, so we use payload from notification const { title = name, avatar = name } = notification; let top = 0;