From e2d45165abe4ae4fdf2347eb6991613f38debb30 Mon Sep 17 00:00:00 2001 From: Avinash Lingaloo Date: Tue, 17 May 2022 22:19:55 +0400 Subject: [PATCH] MM-43584 - Gekidou Mute Channel SnackBar (#6241) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * add remote action updateChannelNotifyProps * Squashed commit of the following: commit f093cd3409e5b6c9101d65e74b4e2eed3fb55097 Author: Avinash Lingaloo Date: Mon May 2 12:12:43 2022 +0400 revert changes made to the ephemeral store commit aabe8bd17e0acde927ce208bf114f2cedd45c977 Merge: 18df47210 ee01febbb Author: Avinash Lingaloo Date: Mon May 2 12:09:50 2022 +0400 Merge branch 'gekidou' into gekidou-snack-bars commit 18df472108a935372cc7bee3668f196f0389e807 Author: Avinash Lingaloo Date: Mon May 2 12:04:53 2022 +0400 fix timer not stopping commit 5910238aaa8d535070e83c311c51361b8f7a2921 Author: Avinash Lingaloo Date: Fri Apr 29 18:19:18 2022 +0400 style fix commit def4ad4cfdb031fae0b1e2b2cac83a18bee72961 Author: Avinash Lingaloo Date: Fri Apr 29 14:36:36 2022 +0400 eslint fix commit 99fa65e780d0e89ba3d0e1a44464128f59336aeb Author: Avinash Lingaloo Date: Fri Apr 29 14:18:03 2022 +0400 fix styling commit cf335e28b05f9f6b63bdc3405215f2cc799f3690 Author: Avinash Lingaloo Date: Fri Apr 29 13:54:05 2022 +0400 fix layoutAnimation commit d1dacbba73eff5a998d61b1d109ab155023bb6ef Author: Avinash Lingaloo Date: Fri Apr 29 13:43:04 2022 +0400 add exitingg layoutAnimation commit bb1156c3da9357ab969e1b2d3a5b900d54c226f2 Author: Avinash Lingaloo Date: Fri Apr 29 13:26:37 2022 +0400 add entering layoutAnimation commit 36d7286acdd2e728de5978c9c0dbce97ade6b309 Merge: 177281fbe 22a173ec9 Author: Avinash Lingaloo Date: Fri Apr 29 11:41:30 2022 +0400 Merge branch 'gekidou' into gekidou-snack-bars commit 177281fbeb31d6260f7f8a62ac8113a4ac0b670d Author: Avinash Lingaloo Date: Fri Apr 29 11:41:06 2022 +0400 cancelled timers on panning start commit 6925cf59aad1be3001a3b538a4725dac4364c871 Merge: e294a3a19 dad63b87b Author: Avinash Lingaloo Date: Thu Apr 28 17:36:11 2022 +0400 rebasing commit e294a3a1991a9fc8d341c465d3b3cc9eb66b3a04 Author: Avinash Lingaloo Date: Thu Apr 28 17:14:33 2022 +0400 dismiss overlay on tabPress commit 9a57a0866fd53992519c34c0df423bfb910da35d Author: Avinash Lingaloo Date: Thu Apr 28 16:59:07 2022 +0400 dismiss overlay on tabPress commit c7eef4b3048da94fdda4690a5a2b6f62a63348b4 Author: Avinash Lingaloo Date: Thu Apr 28 15:55:33 2022 +0400 dismiss overlay on navigating away commit 58a364171e7057ede5100f47df90fe591a16238e Author: Avinash Lingaloo Date: Thu Apr 28 15:25:27 2022 +0400 dismiss overlay on navigating away commit 3c53e7d6a79a1db31c9b06906c5af70380df214d Author: Avinash Lingaloo Date: Thu Apr 28 13:42:10 2022 +0400 checks for ongoing animation commit e62a4ee2a25c505a84fcf1d4ae8597ef0821d6bd Author: Avinash Lingaloo Date: Thu Apr 28 13:14:39 2022 +0400 removed toast keyword commit bc014b86e9498169b357943889cf0d929316d2ee Author: Avinash Lingaloo Date: Thu Apr 28 12:54:55 2022 +0400 PanGesture- fine tuning the animation PanGesture- wip commit 8f675566e7e687eeaded6d1fa1a7f1473a8e2a2c Author: Avinash Lingaloo Date: Thu Apr 28 12:09:35 2022 +0400 PanGesture- wip commit eb2a63c75fd0d3b6edc82772537048f4a28e48ea Author: Elias Nahum Date: Wed Apr 27 11:17:13 2022 -0400 snack positioning and touches commit 6db7f0e0e7f7229fe107c2a6480b7f3a8ec057da Author: Avinash Lingaloo Date: Wed Apr 27 16:43:47 2022 +0400 using EphemeralStore and listeners to discard overlays commit 99a9a527899442d1ca8e047f7e7230878c41057e Merge: 5237401f5 776f56efb Author: Avinash Lingaloo Date: Wed Apr 27 14:51:32 2022 +0400 Merge branch 'gekidou' into gekidou-snack-bars commit 5237401f524165b83410928a184872b69aaa7554 Author: Avinash Lingaloo Date: Wed Apr 27 13:16:47 2022 +0400 able to touch through on iOS commit 7dc5c5c39e801d75eaba1cfbb477b8b6ef39e713 Author: Avinash Lingaloo Date: Tue Apr 26 15:17:53 2022 +0400 adding PanGesture adding PanGesture- wip PanGesture- wip commit 772654f7e52ab00a7b2b28f316c6872e96e5c3f1 Author: Avinash Lingaloo Date: Thu Apr 21 13:57:42 2022 +0400 update message to text commit 53c7ca68ba1b934ddded40602cc9bf040d1ae7c1 Author: Avinash Lingaloo Date: Thu Apr 21 13:40:30 2022 +0400 adjust width commit 0c20bd7e737bdd9f67a83bc943a30c9db061d9b5 Author: Avinash Lingaloo Date: Wed Apr 20 18:05:44 2022 +0400 changed location to sourceScreen in post.tsx commit efbccbb7104ebfa7025a631b44eccb277583b9aa Author: Avinash Lingaloo Date: Wed Apr 20 18:04:19 2022 +0400 removed space commit cc400482bda201d1c1208698bdefe127888be6d5 Author: Avinash Lingaloo Date: Wed Apr 20 18:01:23 2022 +0400 corrections from reviews commit 4204b6c656078069eb33fbc67fd1c36c5f0753ff Author: Avinash Lingaloo Date: Wed Apr 20 14:47:52 2022 +0400 Update en.json commit 80f6d675f502c205d8b9fead6a47aa2b0f0d63ec Merge: c59a2cfc0 c1e71b09c Author: Avinash Lingaloo Date: Wed Apr 20 14:27:33 2022 +0400 Merge branch 'gekidou' into gekidou-snack-bars commit c59a2cfc0532277284deac1d347ba0228974a9da Author: Avinash Lingaloo Date: Wed Apr 20 13:58:22 2022 +0400 removed offSetY commit a65af7057be3caacbed1e9aa705bce73fc14e7b3 Author: Avinash Lingaloo Date: Wed Apr 20 12:24:02 2022 +0400 styling tablet wip tablet portrait commit 3ef280c80cf25120e6df6c3920abfa4a9559d2cb Author: Avinash Lingaloo Date: Tue Apr 19 16:10:37 2022 +0400 styling mobile wip * Squashed commit of the following: commit ab09b39c77cb6f8e69f0fc7b73af8839e5800ac6 Merge: 038476c01 362db9d98 Author: Avinash Lingaloo Date: Thu May 5 15:06:12 2022 +0400 Merge branch 'gekidou' into gekidou-snack-bars commit 038476c01a2a809bc127a34e40e028a4ebc1d4ea Author: Avinash Lingaloo Date: Thu May 5 15:05:24 2022 +0400 bumping the toast vertically by 4px commit 362db9d98d05e84dc0dbccac61c73e30c978d104 Author: Shaz MJ Date: Thu May 5 11:17:33 2022 +1000 Moves collapse animation to FlatList, updates timings (#6220) * Moves collapse animation to FlatList, updates timings * dev review * filters unreads from other categories & removes duplicate Co-authored-by: Elias Nahum Co-authored-by: Mattermod commit 14abe4d2aceadb152fbfc8d3e46b05341d565ea9 Author: Elias Nahum Date: Wed May 4 17:26:32 2022 -0400 Remove jcenter (#6226) commit c8e46607b7264fc65a4063de5eaf143649067a72 Author: Elias Nahum Date: Wed May 4 13:13:23 2022 -0400 upgrade exoplayer commit 32fd8e3cdadeb20721fcf1fecf60ec183d29d5f5 Author: Elias Nahum Date: Wed May 4 12:15:13 2022 -0400 Add ellipsis to server displayName & url (#6223) commit abc5dc4bc3a091040c82938d4a132afded35984b Author: Elias Nahum Date: Wed May 4 09:55:51 2022 -0400 Fix GM display name (#6215) commit ecfbb934a8011509f7bdb1218e4434c1cc8ed84d Author: Elias Nahum Date: Wed May 4 09:51:14 2022 -0400 [Gekidou] Exclude muted channels from unread badges (#6208) * Exclude muted channels from unread badges * Gekidou unreads mention fix (#6221) * Removes muted channels without mentions from grouped unreads * show channel if unread and have no mentions when unread up top Co-authored-by: Elias Nahum Co-authored-by: Shaz MJ commit 588491f58209446cd5be1e4220b08f717170f15a Author: Elias Nahum Date: Wed May 4 09:32:43 2022 -0400 Fix alignment of custom status (#6211) commit 4fc077caefa689bbeaa80033ebbb392d66021be3 Author: Elias Nahum Date: Wed May 4 09:13:17 2022 -0400 Fetch missing custom emojis (#6216) commit 3aa0425fdd3f06d4e8c0a9edc953304691ae72ee Author: Elias Nahum Date: Wed May 4 09:12:37 2022 -0400 Preserve notifications when tapping or clearing notifications from a channel (#6209) commit bd50422167fe00ec3808bcdaab067100fed78c27 Author: Elias Nahum Date: Tue May 3 17:26:35 2022 -0400 Hide archive channels in channel list (#6214) commit 43c43e50d4dd7aaacc5469b0f0775f419020fd02 Author: Elias Nahum Date: Tue May 3 14:43:55 2022 -0400 Do not set new line message indicator on own posts (#6206) commit f973ac8016a83aa896f5e8f912267ad58159f97a Author: Elias Nahum Date: Tue May 3 14:29:37 2022 -0400 [Gekidou] Find channels (remote) (#6203) * Display local results * Fix queryPreferencesByCategoryAndName to observeWithColumns value * Find channels (remote) * ux feedback review * dev review * dev review 2 * Fetch deleted channels from other teams commit bb42339c42ef3cfc1ff17ea57613a52a3fa360d9 Author: Elias Nahum Date: Tue May 3 11:58:47 2022 -0400 Increase tap area of the + button on home screen (#6207) commit 02b42954642be57f75f44e255b1274ebb0269fde Author: Daniel Espino García Date: Tue May 3 17:22:21 2022 +0200 [Gekidou] [MM-39936] Add Select Team Screen (#6180) * Add Select Team Screen * Fixes for iPhone and iPad * Fix tests * Address feedback * Fix tests * Theme illustration * Address feedback and fixes * Remove database warnings by avoiding recalculations on repeated events. * Address feedback * Remove unneeded catch Co-authored-by: Daniel Espino commit 2376dc934cb755b00dadbe59b951e5020c8bc05e Author: Elias Nahum Date: Tue May 3 08:54:13 2022 -0400 Fix Back button position in Navigation Header (#6204) commit f093cd3409e5b6c9101d65e74b4e2eed3fb55097 Author: Avinash Lingaloo Date: Mon May 2 12:12:43 2022 +0400 revert changes made to the ephemeral store commit aabe8bd17e0acde927ce208bf114f2cedd45c977 Merge: 18df47210 ee01febbb Author: Avinash Lingaloo Date: Mon May 2 12:09:50 2022 +0400 Merge branch 'gekidou' into gekidou-snack-bars commit 18df472108a935372cc7bee3668f196f0389e807 Author: Avinash Lingaloo Date: Mon May 2 12:04:53 2022 +0400 fix timer not stopping commit 5910238aaa8d535070e83c311c51361b8f7a2921 Author: Avinash Lingaloo Date: Fri Apr 29 18:19:18 2022 +0400 style fix commit def4ad4cfdb031fae0b1e2b2cac83a18bee72961 Author: Avinash Lingaloo Date: Fri Apr 29 14:36:36 2022 +0400 eslint fix commit 99fa65e780d0e89ba3d0e1a44464128f59336aeb Author: Avinash Lingaloo Date: Fri Apr 29 14:18:03 2022 +0400 fix styling commit cf335e28b05f9f6b63bdc3405215f2cc799f3690 Author: Avinash Lingaloo Date: Fri Apr 29 13:54:05 2022 +0400 fix layoutAnimation commit d1dacbba73eff5a998d61b1d109ab155023bb6ef Author: Avinash Lingaloo Date: Fri Apr 29 13:43:04 2022 +0400 add exitingg layoutAnimation commit bb1156c3da9357ab969e1b2d3a5b900d54c226f2 Author: Avinash Lingaloo Date: Fri Apr 29 13:26:37 2022 +0400 add entering layoutAnimation commit 36d7286acdd2e728de5978c9c0dbce97ade6b309 Merge: 177281fbe 22a173ec9 Author: Avinash Lingaloo Date: Fri Apr 29 11:41:30 2022 +0400 Merge branch 'gekidou' into gekidou-snack-bars commit 177281fbeb31d6260f7f8a62ac8113a4ac0b670d Author: Avinash Lingaloo Date: Fri Apr 29 11:41:06 2022 +0400 cancelled timers on panning start commit 6925cf59aad1be3001a3b538a4725dac4364c871 Merge: e294a3a19 dad63b87b Author: Avinash Lingaloo Date: Thu Apr 28 17:36:11 2022 +0400 rebasing commit e294a3a1991a9fc8d341c465d3b3cc9eb66b3a04 Author: Avinash Lingaloo Date: Thu Apr 28 17:14:33 2022 +0400 dismiss overlay on tabPress commit 9a57a0866fd53992519c34c0df423bfb910da35d Author: Avinash Lingaloo Date: Thu Apr 28 16:59:07 2022 +0400 dismiss overlay on tabPress commit c7eef4b3048da94fdda4690a5a2b6f62a63348b4 Author: Avinash Lingaloo Date: Thu Apr 28 15:55:33 2022 +0400 dismiss overlay on navigating away commit 58a364171e7057ede5100f47df90fe591a16238e Author: Avinash Lingaloo Date: Thu Apr 28 15:25:27 2022 +0400 dismiss overlay on navigating away commit 3c53e7d6a79a1db31c9b06906c5af70380df214d Author: Avinash Lingaloo Date: Thu Apr 28 13:42:10 2022 +0400 checks for ongoing animation commit e62a4ee2a25c505a84fcf1d4ae8597ef0821d6bd Author: Avinash Lingaloo Date: Thu Apr 28 13:14:39 2022 +0400 removed toast keyword commit bc014b86e9498169b357943889cf0d929316d2ee Author: Avinash Lingaloo Date: Thu Apr 28 12:54:55 2022 +0400 PanGesture- fine tuning the animation PanGesture- wip commit 8f675566e7e687eeaded6d1fa1a7f1473a8e2a2c Author: Avinash Lingaloo Date: Thu Apr 28 12:09:35 2022 +0400 PanGesture- wip commit eb2a63c75fd0d3b6edc82772537048f4a28e48ea Author: Elias Nahum Date: Wed Apr 27 11:17:13 2022 -0400 snack positioning and touches commit 6db7f0e0e7f7229fe107c2a6480b7f3a8ec057da Author: Avinash Lingaloo Date: Wed Apr 27 16:43:47 2022 +0400 using EphemeralStore and listeners to discard overlays commit 99a9a527899442d1ca8e047f7e7230878c41057e Merge: 5237401f5 776f56efb Author: Avinash Lingaloo Date: Wed Apr 27 14:51:32 2022 +0400 Merge branch 'gekidou' into gekidou-snack-bars commit 5237401f524165b83410928a184872b69aaa7554 Author: Avinash Lingaloo Date: Wed Apr 27 13:16:47 2022 +0400 able to touch through on iOS commit 7dc5c5c39e801d75eaba1cfbb477b8b6ef39e713 Author: Avinash Lingaloo Date: Tue Apr 26 15:17:53 2022 +0400 adding PanGesture adding PanGesture- wip PanGesture- wip commit 772654f7e52ab00a7b2b28f316c6872e96e5c3f1 Author: Avinash Lingaloo Date: Thu Apr 21 13:57:42 2022 +0400 update message to text commit 53c7ca68ba1b934ddded40602cc9bf040d1ae7c1 Author: Avinash Lingaloo Date: Thu Apr 21 13:40:30 2022 +0400 adjust width commit 0c20bd7e737bdd9f67a83bc943a30c9db061d9b5 Author: Avinash Lingaloo Date: Wed Apr 20 18:05:44 2022 +0400 changed location to sourceScreen in post.tsx commit efbccbb7104ebfa7025a631b44eccb277583b9aa Author: Avinash Lingaloo Date: Wed Apr 20 18:04:19 2022 +0400 removed space commit cc400482bda201d1c1208698bdefe127888be6d5 Author: Avinash Lingaloo Date: Wed Apr 20 18:01:23 2022 +0400 corrections from reviews commit 4204b6c656078069eb33fbc67fd1c36c5f0753ff Author: Avinash Lingaloo Date: Wed Apr 20 14:47:52 2022 +0400 Update en.json commit 80f6d675f502c205d8b9fead6a47aa2b0f0d63ec Merge: c59a2cfc0 c1e71b09c Author: Avinash Lingaloo Date: Wed Apr 20 14:27:33 2022 +0400 Merge branch 'gekidou' into gekidou-snack-bars commit c59a2cfc0532277284deac1d347ba0228974a9da Author: Avinash Lingaloo Date: Wed Apr 20 13:58:22 2022 +0400 removed offSetY commit a65af7057be3caacbed1e9aa705bce73fc14e7b3 Author: Avinash Lingaloo Date: Wed Apr 20 12:24:02 2022 +0400 styling tablet wip tablet portrait commit 3ef280c80cf25120e6df6c3920abfa4a9559d2cb Author: Avinash Lingaloo Date: Tue Apr 19 16:10:37 2022 +0400 styling mobile wip * minor clean up * Squashed commit of the following: commit c7c00b83166b10c4554773661ce8f66bdd6f1b14 Author: Elias Nahum Date: Thu May 5 18:25:46 2022 -0400 Ensure posts are not covered by the post draft on channel switch commit 58719c82dc635064687ffcf0ef8b5a2276ba6943 Author: Elias Nahum Date: Thu May 5 14:09:30 2022 -0400 fix flip of post list (#6234) commit 9d3c7c9496adc67135cceaea889efb28bab56f41 Author: Joseph Baylon Date: Thu May 5 10:04:33 2022 -0700 Detox/E2E: Messaging e2e tests in Gekidou (#6228) commit 1760b75dbf29216f05e9d8733c4ab7640e56e879 Author: Anurag Shivarathri Date: Thu May 5 21:03:09 2022 +0530 [Gekidou] [MM-43973] Thread footer for recent mentions (#6225) * Displaying thread footer * Participants can be empty * Update thread.ts commit 83c2cfff974ce8db44c39fd80add1204de529291 Author: Avinash Lingaloo Date: Thu May 5 18:00:32 2022 +0400 MM-41532 Gekidou Snack Bars (#6181) * styling mobile wip * styling tablet wip tablet portrait * removed offSetY * Update en.json * corrections from reviews * removed space * changed location to sourceScreen in post.tsx * adjust width * update message to text * adding PanGesture adding PanGesture- wip PanGesture- wip * able to touch through on iOS * using EphemeralStore and listeners to discard overlays * snack positioning and touches * PanGesture- wip * PanGesture- fine tuning the animation PanGesture- wip * removed toast keyword * checks for ongoing animation * dismiss overlay on navigating away * dismiss overlay on navigating away * dismiss overlay on tabPress * dismiss overlay on tabPress * cancelled timers on panning start * add entering layoutAnimation * add exitingg layoutAnimation * fix layoutAnimation * fix styling * eslint fix * style fix * fix timer not stopping * revert changes made to the ephemeral store * bumping the toast vertically by 4px Co-authored-by: Elias Nahum commit 2deb2e01e03ed9dcb2ac3db7e957d28001428d94 Author: Anurag Shivarathri Date: Thu May 5 18:36:18 2022 +0530 [Gekidou][MM-43870, MM-43896, MM-43898, MM-43902, MM-43903] CRT related bug fixes (#6205) * Fixes * Updated snapshot * Excluding current user from getting updated * Doesn't handle users if it's empty Co-authored-by: Elias Nahum commit 251ef0992bbe7e839f7ca9e3f297683bb4f237c6 Author: Elias Nahum Date: Thu May 5 08:53:27 2022 -0400 Fix create direct message styles (#6224) commit 5620a50975869701400ff06fdf763cf5bced8cbe Author: Elias Nahum Date: Thu May 5 08:53:02 2022 -0400 Fix channel item with long name and badge (#6222) commit a0d2f33b2fb7193b5b62cb046304fff9a9805255 Author: Elias Nahum Date: Thu May 5 08:47:09 2022 -0400 Dismiss post options before executing action (#6227) commit c4e1b4ad3ed04cf82cafc959e9f8a8a38ab0eaa2 Author: Shaz MJ Date: Thu May 5 22:45:50 2022 +1000 Fixes grouped unread sorting (#6230) * Fixes grouped unread sorting * Type fix commit 362db9d98d05e84dc0dbccac61c73e30c978d104 Author: Shaz MJ Date: Thu May 5 11:17:33 2022 +1000 Moves collapse animation to FlatList, updates timings (#6220) * Moves collapse animation to FlatList, updates timings * dev review * filters unreads from other categories & removes duplicate Co-authored-by: Elias Nahum Co-authored-by: Mattermod commit 14abe4d2aceadb152fbfc8d3e46b05341d565ea9 Author: Elias Nahum Date: Wed May 4 17:26:32 2022 -0400 Remove jcenter (#6226) commit c8e46607b7264fc65a4063de5eaf143649067a72 Author: Elias Nahum Date: Wed May 4 13:13:23 2022 -0400 upgrade exoplayer commit 32fd8e3cdadeb20721fcf1fecf60ec183d29d5f5 Author: Elias Nahum Date: Wed May 4 12:15:13 2022 -0400 Add ellipsis to server displayName & url (#6223) commit abc5dc4bc3a091040c82938d4a132afded35984b Author: Elias Nahum Date: Wed May 4 09:55:51 2022 -0400 Fix GM display name (#6215) commit ecfbb934a8011509f7bdb1218e4434c1cc8ed84d Author: Elias Nahum Date: Wed May 4 09:51:14 2022 -0400 [Gekidou] Exclude muted channels from unread badges (#6208) * Exclude muted channels from unread badges * Gekidou unreads mention fix (#6221) * Removes muted channels without mentions from grouped unreads * show channel if unread and have no mentions when unread up top Co-authored-by: Elias Nahum Co-authored-by: Shaz MJ commit 588491f58209446cd5be1e4220b08f717170f15a Author: Elias Nahum Date: Wed May 4 09:32:43 2022 -0400 Fix alignment of custom status (#6211) commit 4fc077caefa689bbeaa80033ebbb392d66021be3 Author: Elias Nahum Date: Wed May 4 09:13:17 2022 -0400 Fetch missing custom emojis (#6216) commit 3aa0425fdd3f06d4e8c0a9edc953304691ae72ee Author: Elias Nahum Date: Wed May 4 09:12:37 2022 -0400 Preserve notifications when tapping or clearing notifications from a channel (#6209) commit bd50422167fe00ec3808bcdaab067100fed78c27 Author: Elias Nahum Date: Tue May 3 17:26:35 2022 -0400 Hide archive channels in channel list (#6214) commit 43c43e50d4dd7aaacc5469b0f0775f419020fd02 Author: Elias Nahum Date: Tue May 3 14:43:55 2022 -0400 Do not set new line message indicator on own posts (#6206) commit f973ac8016a83aa896f5e8f912267ad58159f97a Author: Elias Nahum Date: Tue May 3 14:29:37 2022 -0400 [Gekidou] Find channels (remote) (#6203) * Display local results * Fix queryPreferencesByCategoryAndName to observeWithColumns value * Find channels (remote) * ux feedback review * dev review * dev review 2 * Fetch deleted channels from other teams commit bb42339c42ef3cfc1ff17ea57613a52a3fa360d9 Author: Elias Nahum Date: Tue May 3 11:58:47 2022 -0400 Increase tap area of the + button on home screen (#6207) commit 02b42954642be57f75f44e255b1274ebb0269fde Author: Daniel Espino García Date: Tue May 3 17:22:21 2022 +0200 [Gekidou] [MM-39936] Add Select Team Screen (#6180) * Add Select Team Screen * Fixes for iPhone and iPad * Fix tests * Address feedback * Fix tests * Theme illustration * Address feedback and fixes * Remove database warnings by avoiding recalculations on repeated events. * Address feedback * Remove unneeded catch Co-authored-by: Daniel Espino commit 2376dc934cb755b00dadbe59b951e5020c8bc05e Author: Elias Nahum Date: Tue May 3 08:54:13 2022 -0400 Fix Back button position in Navigation Header (#6204) * snack bar with undo option * fix react error * implement onAction correctly * implemented pessimistic approach * fix ts issue * Move toggleMuteChannel to remote actions Co-authored-by: Elias Nahum --- app/actions/local/channel.ts | 5 ++- app/actions/remote/channel.ts | 64 ++++++++++++++++++++++++++++++++- app/constants/snack_bar.ts | 10 +----- app/screens/snack_bar/index.tsx | 39 +++++++++++--------- app/utils/channel/index.ts | 14 ++++++++ app/utils/snack_bar/index.ts | 9 ++++- types/api/channels.d.ts | 1 + 7 files changed, 114 insertions(+), 28 deletions(-) diff --git a/app/actions/local/channel.ts b/app/actions/local/channel.ts index ed7aee28be..34405c5ca4 100644 --- a/app/actions/local/channel.ts +++ b/app/actions/local/channel.ts @@ -11,7 +11,10 @@ import DatabaseManager from '@database/manager'; import {getTeammateNameDisplaySetting} from '@helpers/api/preference'; import {extractChannelDisplayName} from '@helpers/database'; import PushNotifications from '@init/push_notifications'; -import {prepareDeleteChannel, prepareMyChannelsForTeam, queryAllMyChannel, getMyChannel, getChannelById, queryUsersOnChannel, queryUserChannelsByTypes} from '@queries/servers/channel'; +import { + prepareDeleteChannel, prepareMyChannelsForTeam, queryAllMyChannel, + getMyChannel, getChannelById, queryUsersOnChannel, queryUserChannelsByTypes, +} from '@queries/servers/channel'; import {queryPreferencesByCategoryAndName} from '@queries/servers/preference'; import {prepareCommonSystemValues, PrepareCommonSystemValuesArgs, getCommonSystemValues, getCurrentTeamId, setCurrentChannelId, getCurrentUserId} from '@queries/servers/system'; import {addChannelToTeamHistory, addTeamToTeamHistory, getTeamById, queryMyTeams, removeChannelFromTeamHistory} from '@queries/servers/team'; diff --git a/app/actions/remote/channel.ts b/app/actions/remote/channel.ts index b8ad866923..b125df807f 100644 --- a/app/actions/remote/channel.ts +++ b/app/actions/remote/channel.ts @@ -13,13 +13,14 @@ import DatabaseManager from '@database/manager'; import {privateChannelJoinPrompt} from '@helpers/api/channel'; import {getTeammateNameDisplaySetting} from '@helpers/api/preference'; import NetworkManager from '@managers/network_manager'; -import {prepareMyChannelsForTeam, getChannelById, getChannelByName, getMyChannel, getChannelInfo} from '@queries/servers/channel'; +import {prepareMyChannelsForTeam, getChannelById, getChannelByName, getMyChannel, getChannelInfo, queryMyChannelSettingsByIds} from '@queries/servers/channel'; import {queryPreferencesByCategoryAndName} from '@queries/servers/preference'; import {getCommonSystemValues, getCurrentTeamId, getCurrentUserId} from '@queries/servers/system'; import {prepareMyTeams, getNthLastChannelFromTeam, getMyTeamById, getTeamById, getTeamByName, queryMyTeams} from '@queries/servers/team'; import {getCurrentUser} from '@queries/servers/user'; import EphemeralStore from '@store/ephemeral_store'; import {generateChannelNameFromDisplayName, getDirectChannelName, isDMorGM} from '@utils/channel'; +import {showMuteChannelSnackbar} from '@utils/snack_bar'; import {PERMALINK_GENERIC_TEAM_NAME_REDIRECT} from '@utils/url'; import {displayGroupMessageName, displayUsername} from '@utils/user'; @@ -1055,3 +1056,64 @@ export async function searchAllChannels(serverUrl: string, term: string, archive return {error}; } } + +export const updateChannelNotifyProps = async (serverUrl: string, channelId: string, props: Partial) => { + let client: Client; + try { + client = NetworkManager.getClient(serverUrl); + } catch (error) { + return {error}; + } + + const database = DatabaseManager.serverDatabases[serverUrl]?.database; + if (!database) { + return {error: `${serverUrl} database not found`}; + } + + try { + const userId = await getCurrentUserId(database); + const notifyProps = {...props, channel_id: channelId, user_id: userId} as ChannelNotifyProps & {channel_id: string; user_id: string}; + + await client.updateChannelNotifyProps(notifyProps); + + return { + notifyProps, + }; + } catch (error) { + forceLogoutIfNecessary(serverUrl, error as ClientErrorProps); + return {error}; + } +}; + +export const toggleMuteChannel = async (serverUrl: string, channelId: string, showSnackBar = false) => { + const database = DatabaseManager.serverDatabases[serverUrl]?.database; + if (!database) { + return {error: `${serverUrl} database not found`}; + } + + try { + const channelSettings = await queryMyChannelSettingsByIds(database, [channelId]).fetch(); + const myChannelSetting = channelSettings?.[0]; + const mark_unread = myChannelSetting.notifyProps?.mark_unread === 'mention' ? 'all' : 'mention'; + + const notifyProps: Partial = {...myChannelSetting.notifyProps, mark_unread}; + await updateChannelNotifyProps(serverUrl, channelId, notifyProps); + + await database.write(async () => { + await myChannelSetting.update((c) => { + c.notifyProps = notifyProps; + }); + }); + + if (showSnackBar) { + const onUndo = () => toggleMuteChannel(serverUrl, channelId, false); + showMuteChannelSnackbar(onUndo); + } + + return { + notifyProps, + }; + } catch (error) { + return {error}; + } +}; diff --git a/app/constants/snack_bar.ts b/app/constants/snack_bar.ts index 484c4162fc..3638f486ca 100644 --- a/app/constants/snack_bar.ts +++ b/app/constants/snack_bar.ts @@ -7,9 +7,7 @@ import keyMirror from '@utils/key_mirror'; export const SNACK_BAR_TYPE = keyMirror({ LINK_COPIED: null, MESSAGE_COPIED: null, - FOLLOW_THREAD: null, MUTE_CHANNEL: null, - FAILED_TO_SAVE_MESSAGE: null, }); type SnackBarConfig = { @@ -17,7 +15,7 @@ type SnackBarConfig = { defaultMessage: string; iconName: string; canUndo: boolean; -} +}; export const SNACK_BAR_CONFIG: Record = { LINK_COPIED: { id: t('snack.bar.link.copied'), @@ -31,12 +29,6 @@ export const SNACK_BAR_CONFIG: Record = { iconName: 'content-copy', canUndo: false, }, - FOLLOW_THREAD: { - id: t('snack.bar.follow.thread'), - defaultMessage: 'You\'re now following this thread', - iconName: 'message-check-outline', - canUndo: true, - }, MUTE_CHANNEL: { id: t('snack.bar.mute.channel'), defaultMessage: 'This channel was muted', diff --git a/app/screens/snack_bar/index.tsx b/app/screens/snack_bar/index.tsx index 3787414514..526a8727a9 100644 --- a/app/screens/snack_bar/index.tsx +++ b/app/screens/snack_bar/index.tsx @@ -1,7 +1,7 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {useCallback, useEffect, useMemo, useRef, useState} from 'react'; +import React, {useEffect, useMemo, useRef, useState} from 'react'; import {useIntl} from 'react-intl'; import {DeviceEventEmitter, Text, TouchableOpacity, useWindowDimensions, ViewStyle} from 'react-native'; import {Gesture, GestureDetector, GestureHandlerRootView} from 'react-native-gesture-handler'; @@ -71,12 +71,12 @@ const getStyleSheet = makeStyleSheetFromTheme((theme: Theme) => { type SnackBarProps = { componentId: string; - onUndoPress?: () => void; + onAction?: () => void; barType: keyof typeof SNACK_BAR_TYPE; sourceScreen: typeof Screens[keyof typeof Screens]; } -const SnackBar = ({barType, componentId, onUndoPress, sourceScreen}: SnackBarProps) => { +const SnackBar = ({barType, componentId, onAction, sourceScreen}: SnackBarProps) => { const [showSnackBar, setShowSnackBar] = useState(); const intl = useIntl(); const theme = useTheme(); @@ -85,15 +85,12 @@ const SnackBar = ({barType, componentId, onUndoPress, sourceScreen}: SnackBarPro const offset = useSharedValue(0); const isPanned = useSharedValue(false); const baseTimer = useRef(); + const mounted = useRef(false); + const userHasUndo = useRef(false); const config = SNACK_BAR_CONFIG[barType]; const styles = getStyleSheet(theme); - const onPressHandler = useCallback(() => { - dismissOverlay(componentId); - onUndoPress?.(); - }, [onUndoPress, componentId]); - const snackBarStyle = useMemo(() => { const diffWidth = windowWidth - TABLET_SIDEBAR_WIDTH; @@ -147,11 +144,13 @@ const SnackBar = ({barType, componentId, onUndoPress, sourceScreen}: SnackBarPro }, [offset.value, isPanned.value]); const hideSnackBar = () => { - setShowSnackBar(false); + if (mounted?.current) { + setShowSnackBar(false); + } }; const stopTimers = () => { - if (baseTimer.current) { + if (baseTimer?.current) { clearTimeout(baseTimer.current); } }; @@ -174,8 +173,14 @@ const SnackBar = ({barType, componentId, onUndoPress, sourceScreen}: SnackBarPro offset.value = withTiming(200, {duration}, () => runOnJS(hideSnackBar)()); }; + const onUndoPressHandler = () => { + userHasUndo.current = true; + animateHiding(false); + }; + // This effect hides the snack bar after 3 seconds useEffect(() => { + mounted.current = true; baseTimer.current = setTimeout(() => { if (!isPanned.value) { animateHiding(false); @@ -183,18 +188,20 @@ const SnackBar = ({barType, componentId, onUndoPress, sourceScreen}: SnackBarPro }, 3000); return () => { - if (baseTimer.current) { - clearTimeout(baseTimer.current); - } + stopTimers(); + mounted.current = false; }; }, [isPanned.value]); // This effect dismisses the Navigation Overlay after we have hidden the snack bar useEffect(() => { if (showSnackBar === false) { + if (userHasUndo?.current) { + onAction?.(); + } dismissOverlay(componentId); } - }, [showSnackBar]); + }, [showSnackBar, onAction]); // This effect checks if we are navigating away and if so, it dismisses the snack bar useEffect(() => { @@ -226,8 +233,8 @@ const SnackBar = ({barType, componentId, onUndoPress, sourceScreen}: SnackBarPro textStyle={styles.text} style={styles.toast} > - {config.canUndo && onUndoPress && ( - + {config.canUndo && onAction && ( + {intl.formatMessage({ id: 'snack.bar.undo', diff --git a/app/utils/channel/index.ts b/app/utils/channel/index.ts index e12ee36c73..06e8a4b141 100644 --- a/app/utils/channel/index.ts +++ b/app/utils/channel/index.ts @@ -118,3 +118,17 @@ export function generateChannelNameFromDisplayName(displayName: string) { } return name; } + +export function compareNotifyProps(propsA: Partial, propsB: Partial): boolean { + if ( + propsA.desktop !== propsB.desktop || + propsA.email !== propsB.email || + propsA.mark_unread !== propsB.mark_unread || + propsA.push !== propsB.push || + propsA.ignore_channel_mentions !== propsB.ignore_channel_mentions + ) { + return false; + } + + return true; +} diff --git a/app/utils/snack_bar/index.ts b/app/utils/snack_bar/index.ts index a99fdaed3b..0d80b4e350 100644 --- a/app/utils/snack_bar/index.ts +++ b/app/utils/snack_bar/index.ts @@ -6,7 +6,7 @@ import {showOverlay} from '@screens/navigation'; type ShowSnackBarArgs = { barType: keyof typeof SNACK_BAR_TYPE; - onPress?: () => void; + onAction?: () => void; sourceScreen?: typeof Screens[keyof typeof Screens]; }; @@ -14,3 +14,10 @@ export const showSnackBar = (passProps: ShowSnackBarArgs) => { const screen = Screens.SNACK_BAR; showOverlay(screen, passProps); }; + +export const showMuteChannelSnackbar = (onAction: () => void) => { + return showSnackBar({ + onAction, + barType: SNACK_BAR_TYPE.MUTE_CHANNEL, + }); +}; diff --git a/types/api/channels.d.ts b/types/api/channels.d.ts index 5122c512b4..0cd1e4f1e3 100644 --- a/types/api/channels.d.ts +++ b/types/api/channels.d.ts @@ -8,6 +8,7 @@ type ChannelStats = { guest_count: number; pinnedpost_count: number; }; + type ChannelNotifyProps = { desktop: 'default' | 'all' | 'mention' | 'none'; email: 'default' | 'all' | 'mention' | 'none';