From b90cf9e486010864eaafddb8723920234bb92a54 Mon Sep 17 00:00:00 2001 From: Djorkaeff Alexandre Date: Fri, 7 Feb 2020 10:24:16 -0300 Subject: [PATCH] [NEW] Omnichannel Beta (#1674) --- .../src/main/res/drawable-hdpi/livechat.png | Bin 0 -> 488 bytes .../src/main/res/drawable-mdpi/livechat.png | Bin 0 -> 759 bytes .../src/main/res/drawable-xhdpi/livechat.png | Bin 0 -> 820 bytes .../src/main/res/drawable-xxhdpi/livechat.png | Bin 0 -> 1332 bytes .../main/res/drawable-xxxhdpi/livechat.png | Bin 0 -> 1506 bytes app/containers/RoomTypeIcon.js | 2 ++ app/lib/rocketchat.js | 2 +- app/notifications/push/index.js | 7 ++++-- app/sagas/deepLinking.js | 2 +- app/views/RoomActionsView/index.js | 3 +++ app/views/RoomInfoView/index.js | 2 +- app/views/RoomView/Header/Icon.js | 2 ++ app/views/RoomsListView/index.js | 3 +-- .../Icons/livechat.imageset/Contents.json | 23 ++++++++++++++++++ .../Icons/livechat.imageset/livechat.png | Bin 0 -> 488 bytes .../Icons/livechat.imageset/livechat@2x.png | Bin 0 -> 820 bytes .../Icons/livechat.imageset/livechat@3x.png | Bin 0 -> 1332 bytes 17 files changed, 39 insertions(+), 7 deletions(-) create mode 100644 android/app/src/main/res/drawable-hdpi/livechat.png create mode 100644 android/app/src/main/res/drawable-mdpi/livechat.png create mode 100644 android/app/src/main/res/drawable-xhdpi/livechat.png create mode 100644 android/app/src/main/res/drawable-xxhdpi/livechat.png create mode 100644 android/app/src/main/res/drawable-xxxhdpi/livechat.png create mode 100644 ios/RocketChatRN/Images.xcassets/Icons/livechat.imageset/Contents.json create mode 100644 ios/RocketChatRN/Images.xcassets/Icons/livechat.imageset/livechat.png create mode 100644 ios/RocketChatRN/Images.xcassets/Icons/livechat.imageset/livechat@2x.png create mode 100644 ios/RocketChatRN/Images.xcassets/Icons/livechat.imageset/livechat@3x.png diff --git a/android/app/src/main/res/drawable-hdpi/livechat.png b/android/app/src/main/res/drawable-hdpi/livechat.png new file mode 100644 index 0000000000000000000000000000000000000000..b2190ca7387884eedfa726d6b7a650a2145da348 GIT binary patch literal 488 zcmVP)) z0x=NBcXKI#60iUzqxj+nVh2YD&;fR!6`&PxR3IJ53_9bCqAB4z5ML#Cf0OVb9NZk^ z@Syv0o9yl{o8+G(`s>C;395QlPl@Wz7htVN!~U;;4g_%5W|UU~px72&<$*T>_m9p) z!E`?(3>f5#!LCydeIcl^3AzSUs$N2nyt~ersij|r(MtUAv<)FT)*Z76_Ou?1m*XM} zOhgj;ZGxgK%$a_Bx&^3b-BKzi&1`%P$P6|8Qtsh{rZHww$;Kr8Y_$xTbZxepm3`&` z1I8Hcv{DKy)tX}S)zJDmUg}~xUtW+rc%7Qb-uyDQ1|C#v9VWDA z!@gI6gAs1*0@vAmSp;MtTw2!qcJ5A()?v$0DVv* ed)c@9|Lhx4WR+7)@o04b0000cxF#Sh0lu~6LS(z~B(jANegGv=n3!|V zQMPI#(F?uHo%oZWM-1PvL3k|0mtGNlg@`%d=44q%mk6gp&_yPni?3$_{*^c-J<*a* zhQSBKUNR(CtMM{hejv)ni^wsb)N{#_Cu2)dU=%*fy3_MK2m-i6wtBBm!AIngbvN(s z8RS4&vNa|pzjOZS!So&az7Lw9yNax8rs?v!vZGgdx^syU;pu1`MSFR&YimH-%6&bI ztwg|=CLl`_^Ua5z{z*0xv=>FIvD~tBbQ2t>OAgo(FHI~Jy2CM{>OcY5c7-4#E0uER z%1$rbtL-!x!mhS*bXrnWC_z*zefaZ>1(<{^GG;e7Hg|TB;H|hg{Vu;Pq{;6*&4$1~6FdP3PQJs}&~< z^9?c1+46h3Wb$U9r8k{`_(VnKq#&c*5e zJUup)LxMS-WJU6g}^JUyj}byjNvWNWjIC#3dhM%u+v zHvscr(q;tph)1oCYLVW7kLHA<^mgw&w4t94IxK+582gMf)^2i2lY p-bfEDfw;gAbMKPv?Jceie*t5<7|EnVNQ(df002ovPDHLkV1i@KOdS9K literal 0 HcmV?d00001 diff --git a/android/app/src/main/res/drawable-xhdpi/livechat.png b/android/app/src/main/res/drawable-xhdpi/livechat.png new file mode 100644 index 0000000000000000000000000000000000000000..64e12138a2b2e262c8da86cce3f1e05796b0bdc9 GIT binary patch literal 820 zcmV-41Izr0P)2EYyA25^F;C%|daPG>?UA{T&m(dm+I z6Wgy(&X?`jShh*J@oxdblAiuNNl#A(C@Cpf3PJ&dXsmgr(?Y}s5D2zb@hb=xT$V&Q zG~BCWDSyl%C%FXr!YuCqiP~&oEv-EP_6_H1kVj}{fkJEwGR?z#Z|OoXNB6p!Rb(cC zx8laJUh}7w0vE|0@B;EeOV&1LIS@Nu4Cr}1h&QqT z=Xwe`;cRF-xsGDvU}82SKGydE) zLYJm2MDs}`+>;5XM-U5Egzs^KD*g{LX2GM&Kbe3+$u971PseUy52|d3EN{%ChLVcA z)ZVjR9z;(jKcAeOc6IC*_Mm4tEC9u$3Qp0;dND(l{{$g8lIMEjU=;$<;7hxHYl*J0 z4;gs2K+QXKfR53;OE yzkki&zIpePiw|!T)D8yNmy>Tcl$4Y_E&l*Sh#~acv|Z8w0000o5dw|rrK<)M=Z!u#R zMT*)GlLJ)h0SYrn1E&(X(^*O~kcc9w&A^b^rkEc^eNxDXRGC_y`Iw*pz zBE=UXSP3P-b^d6B9((Bb?z-;N4&+R(f-TFgNmH(~Mejil@Q=3f{BZw!$dTLxv)DSB za)-NVL7ot_G3YJkW$j!9hhmLjkFQpTBFIs6X2HshS!^p-EP)3|E)wj5kWavnUU=L$ z>)dvQP>pq5j=N7^v@z$pjt3bqAtTZVHZevl5^X_XHpg_d!!O6S?JduPI$x{F*IJFf z5X_PpJm60&kbz7VzBIS6CItKx*~rTb2En(kn|_I5;lRRY*<&7$@fae)@17s+KLkw# zWI!OSM>d3Fdv_)gt8g3#YPHaH7YFO|+aMxss9^+}XbV=>jkE%f*S=W23FZya08zt$ zm%iQ_Xre7x2x>$fN5FeoXHzA5dU~dfQvMKi3k2~EXreWSE$fy=rqLQ{U^jerbTA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e6f_wu4#8W7ljC(e`rKKilK#v8wEOmd%Fm+Nl0xcwd zYJ>2L7HB|=fKgV!0QoVLjKiH&$C^ic3N)Z;4#ZRo4F3E*YnPxMxkE|&92skZ1`36< z;!`xnS0W~wG*hVGq>jE@2$~uPf@t+HRGqxifk=&cRN>@>YT&DekJm@ z7TO|D`}kmLu$Rl-$~AAK+t0v|&KL}TP6 zB0p2^tFnOdq${_G@-(iZ40;519||D*m?yBBYY`z4`xwE4tn`T(8U{(yPx-{DZ;*P- zI=bEm;h*Qt^dSd@BgHb&QD%-_zhX3kvoD8L7QxKTw|5Y44!;SAHjW0rZC&)i4Tr&t zVwqx}*hxk3HgNxY1Zyzq6_kxZ0;=d~!Ev^FT%4rruSLs&Y$ksGa{ zppg2tELRLbh(Nj+AG07So;(yvy#Xy8hX?z!ppnulm9mKQ`cV8qlmGWOlrr3=_dP&o zW%|y{@yWk`zk2t<`Dx+LS@%H3yC-k{IRTB-rQB5^HTVi6MBbGvsA}yUS@m{s@Lc<; zqR~PdRpKoBd^AMl>?W3~aCRc4oW7JFg2Kb@YQ`HNmIWje@7k@gS4%kmS~KSphW2{Je^ee0{I z6i}EVf#@B)`t>Ms$fDRr?*16O+; } if (type === 'd') { return ; + } if (type === 'l') { + return ; } return ; }); diff --git a/app/lib/rocketchat.js b/app/lib/rocketchat.js index 75d343c542..d173122d3c 100644 --- a/app/lib/rocketchat.js +++ b/app/lib/rocketchat.js @@ -949,7 +949,7 @@ const RocketChat = { }, roomTypeToApiType(t) { const types = { - c: 'channels', d: 'im', p: 'groups' + c: 'channels', d: 'im', p: 'groups', l: 'channels' }; return types[t]; }, diff --git a/app/notifications/push/index.js b/app/notifications/push/index.js index 37b2b0391c..865a6ad613 100644 --- a/app/notifications/push/index.js +++ b/app/notifications/push/index.js @@ -14,9 +14,12 @@ export const onNotification = (notification) => { } = EJSON.parse(data.ejson); const types = { - c: 'channel', d: 'direct', p: 'group' + c: 'channel', d: 'direct', p: 'group', l: 'channels' }; - const roomName = type === 'd' ? sender.username : name; + let roomName = type === 'd' ? sender.username : name; + if (type === 'l') { + roomName = sender.name; + } const params = { host, diff --git a/app/sagas/deepLinking.js b/app/sagas/deepLinking.js index ef66fac4f1..ddc8af0ecf 100644 --- a/app/sagas/deepLinking.js +++ b/app/sagas/deepLinking.js @@ -13,7 +13,7 @@ import EventEmitter from '../utils/events'; import { appStart } from '../actions'; const roomTypes = { - channel: 'c', direct: 'd', group: 'p' + channel: 'c', direct: 'd', group: 'p', channels: 'l' }; const handleInviteLink = function* handleInviteLink({ params, requireLogin = false }) { diff --git a/app/views/RoomActionsView/index.js b/app/views/RoomActionsView/index.js index a1de380226..18e4a05796 100644 --- a/app/views/RoomActionsView/index.js +++ b/app/views/RoomActionsView/index.js @@ -349,7 +349,10 @@ class RoomActionsView extends React.Component { renderItem: this.renderItem }); } + } else if (t === 'l') { + sections[2].data = [notificationsAction]; } + return sections; } diff --git a/app/views/RoomInfoView/index.js b/app/views/RoomInfoView/index.js index f19fdfb728..ada9df185a 100644 --- a/app/views/RoomInfoView/index.js +++ b/app/views/RoomInfoView/index.js @@ -117,7 +117,7 @@ class RoomInfoView extends React.Component { } } const permissions = await RocketChat.hasPermission([PERMISSION_EDIT_ROOM], room.rid); - if (permissions[PERMISSION_EDIT_ROOM] && !room.prid) { + if (permissions[PERMISSION_EDIT_ROOM] && !room.prid && this.t !== 'l') { navigation.setParams({ showEdit: true }); } } diff --git a/app/views/RoomView/Header/Icon.js b/app/views/RoomView/Header/Icon.js index 7247d88fed..de490b7d46 100644 --- a/app/views/RoomView/Header/Icon.js +++ b/app/views/RoomView/Header/Icon.js @@ -40,6 +40,8 @@ const Icon = React.memo(({ type, status, theme }) => { icon = 'thread'; } else if (type === 'c') { icon = 'hashtag'; + } else if (type === 'l') { + icon = 'livechat'; } else { icon = 'lock'; } diff --git a/app/views/RoomsListView/index.js b/app/views/RoomsListView/index.js index 845f28f293..468370a7ea 100644 --- a/app/views/RoomsListView/index.js +++ b/app/views/RoomsListView/index.js @@ -380,8 +380,7 @@ class RoomsListView extends React.Component { .get('subscriptions') .query( Q.where('archived', false), - Q.where('open', true), - Q.where('t', Q.notEq('l')) + Q.where('open', true) ) .observeWithColumns(['room_updated_at', 'unread', 'alert', 'user_mentions', 'f', 't']); diff --git a/ios/RocketChatRN/Images.xcassets/Icons/livechat.imageset/Contents.json b/ios/RocketChatRN/Images.xcassets/Icons/livechat.imageset/Contents.json new file mode 100644 index 0000000000..e3919e8e02 --- /dev/null +++ b/ios/RocketChatRN/Images.xcassets/Icons/livechat.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "livechat.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "livechat@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "livechat@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/ios/RocketChatRN/Images.xcassets/Icons/livechat.imageset/livechat.png b/ios/RocketChatRN/Images.xcassets/Icons/livechat.imageset/livechat.png new file mode 100644 index 0000000000000000000000000000000000000000..b2190ca7387884eedfa726d6b7a650a2145da348 GIT binary patch literal 488 zcmVP)) z0x=NBcXKI#60iUzqxj+nVh2YD&;fR!6`&PxR3IJ53_9bCqAB4z5ML#Cf0OVb9NZk^ z@Syv0o9yl{o8+G(`s>C;395QlPl@Wz7htVN!~U;;4g_%5W|UU~px72&<$*T>_m9p) z!E`?(3>f5#!LCydeIcl^3AzSUs$N2nyt~ersij|r(MtUAv<)FT)*Z76_Ou?1m*XM} zOhgj;ZGxgK%$a_Bx&^3b-BKzi&1`%P$P6|8Qtsh{rZHww$;Kr8Y_$xTbZxepm3`&` z1I8Hcv{DKy)tX}S)zJDmUg}~xUtW+rc%7Qb-uyDQ1|C#v9VWDA z!@gI6gAs1*0@vAmSp;MtTw2!qcJ5A()?v$0DVv* ed)c@9|Lhx4WR+7)@o04b00002EYyA25^F;C%|daPG>?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