Commit Graph

297 Commits

Author SHA1 Message Date
Elias Nahum
7e09e5dc05 PostList do not scroll to bottom after the first onEndReached (#6109) 2022-03-31 19:23:57 +02:00
Elias Nahum
8cb0131e95 npm audit (#6112) 2022-03-31 12:58:32 -03:00
Avinash Lingaloo
5a86c58ccb fix association (#6108) 2022-03-31 10:32:27 -03:00
Kyriakos Z
567141a60e [Gekidou DB]: Refactors thread and threads_in_team tables (#6100)
* Refactors thread and threads_in_team tables

The convention is that only threads being in the ThreadsInTeam will be shown in a thread list,
and that only threads marked as loaded_in_global_threads are being shown
in the All threads tab in the list.

So when a thread arrives through different means, whether it's a WS event,
or just fetching a (*new) thread by opening it in a channel, etc...
we'll need to check if it's newer than any of the existing threads in the all threads list.
If it is it will be added in the ThreadsInTeam and will be marked as loaded_in_global_threads: true.
If it's not newer but it is an unread thread it will still be added in the ThreadsInTeam
but marked as loaded_in_global_threads: false.

This commit refactors `loaded_in_global_threads` field from the Thread table
to the ThreadsInTeam table so that the above is possible.

* Update tests

* Addresses review comments
2022-03-31 09:18:35 -03:00
Daniel Espino García
e2e54b3bca [Gekidou MM-39733] Port Create Channel from V1 (#6067)
* copy directly from v1. will get working and then convert class to functional components

* screen showing up correctly.  Need to convert lifestyle methods

* create channel button working

* save before refactor in prep for bringing in edit_channel functionality

* change function naming

* clean up lint

* clean up for PR review

* clean up for PR review

* remove hoardcoded styles

* add edit_channel screen

* add handlePatchChannel

* add custom useFormInput hook. use edit screen for both create and edit screens. edit or create screen mode determined by channel prop passed in as a channel or null

* rename edit_channel to create_or_edit_channel

* displayname, header, and purpose are now an object with value and onChange props, created from the useFormInput hook. Now only need to pass this new FormInput Prop to the edit_channel_info component and deconstruct there to get the onChange and value

* fix some lint errors

* fix some lint errors

* remove empty line

* pass intl into utils validate functions because they are not Hooks.  add validation for displayName including translations.

* Move useFormInput hook to its own hooks file and import

* simplify

* remove editing prop.  Was used to determine if the right button was enabled. It was always true for edit_channel screen and always false for create channel screen.  The enableRightButton prop call back is was also used for the same reason.

* remove channeUrl editing references.  This was not implemented on v1

* pass editing prop back into component and add back logic. When editing one field must change.  when creating, just need to check that name is provided

* lint fixes

* fix typing issue for channel types

* scrolling ref should be fixed.  Linting should pass now

* Linting should pass now

* require id field in partial Channel. fixes tsc

* remove everything related to renaming the channel URL.  This has never been requred for mobile

* manage state with useReducer so that all actions/state in one location. This also removes the number of onXXX functions and reduces the number of functions in the component

* reorganize code. useEffects are at top.  Move type and interfaces outside of function component

* Fix lint

* nit: invert if statement checking a negative

* use cneterChannelColor. in figma this is center channel text, but I verified theme color by comparing to SSO login text color

* Simple snapshot tests as a start

* Add more tests

* update snapshot

* add snapshot tests. Add tests for button enabling and disabling

* simplify test with destructuring.

* PR feedback. formatting changes. get user and teamid from one call

* remove FormInput hook and use value/setvalue convention for controlled components

* no need to setChannelDisplayName after creating/updating channel

* Just pass the setXXX function.  Don't need to create as separate callback

* modify floatingTextInput component to allow placeholder text

* remove InteractionManager. PR nits

* mv EditChannelComponent into create_or_edit screen.  Rename component from EditChannelInfo to ChannelInfoForm

* correct import path

* add IntlShape Type to function input. Wrap screen with withServerDatabase, not withIntl

* remove state setting function calls from inside the reducer.  move close function outside of the component. remove setRightButton and rightButton and place rightbutton in initial appState

* move editing const after useX oneliners and before useCallback, useEffect, and useReducers

* rightButton
  - useMemo to memoize an object with dependencies
  - move out of the appState
emitCanSaveChannel
  - wrap with useCallback
onCreateChannel
  - wrap with useCallback
onUpdateChannel
  - wrap with useCallback
useEffect Navigation
  - use the callbacks as dependencies in stead of the depencies of those
    callbacks.

* wrap all formatted message with useMemo()
wrap all onXXXChangeText with useCallback and add deps
move all oneliner derived constants directly after useState useMemo

* remove useMemo from formatted text

* switchToCHannel is still not working.  failing at
  const channel: ChannelModel = await member.channel.fetch();

* use prepareMyChannelsForTeam to update db tables for new channel

* add placeholder text color

* Attach open edit channel screen to `Set Header` button in channel intro view
port SectionItem from V1 and us to add a Switch for setting private/public channel
hook up the plus icon in the channel list header to create a channel (temporary fix to allow debugging)
add new queryChannelsInfoById and queryCurrentChannelInfo query functions
update text for create screen text inputs

* Fix styles and fix actions

* Add autocomplete, fix patch, and address design feedback

* Address feedback

* Add margin between icon and label on Make Private

* Address feedback

* Address feedback

* Address feedback and fix channel list not updating when the channel gets created

* Address feedback and directly add the channel to the default category

* Render at-mentions as Members if no channelId is set

* Display autocomplete on iOS

Co-authored-by: Jason Frerich <jason.frerich@mattermost.com>
Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
2022-03-31 10:06:02 +02:00
Daniel Espino García
328f029a93 Performance improvements on Home to Channel (#6106) 2022-03-31 10:01:22 +02:00
Daniel Espino García
9069048aa7 [Gekidou] Address performance improvements on team switch action (#6101) 2022-03-30 08:05:31 -03:00
Elias Nahum
a058eddb21 [Gekidou] multi server fixes (#6102) 2022-03-30 08:04:58 -03:00
Avinash Lingaloo
29628a585f Gekidou - Fix to make all models implement their respective interface (#6099)
* make all models implement their respective interface

* make all models implement their respective interface
2022-03-29 17:41:46 -03:00
Avinash Lingaloo
7f8a55684d MM-42787 - Gekidou User DB field remote_id (#6094)
* added remote_id to user table schema

* update user model to accomodate for remote_id field

* transform - reaction - split into its own file

* update user transformer

* update isShared function

* Fix typescript

* make remote_id field optional

Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
2022-03-29 14:54:09 -03:00
Avinash Lingaloo
ec17aea41e Gekidou - Fix channel creator for private/public channel (#6086) 2022-03-29 04:40:13 -03:00
Elias Nahum
764c34eeb7 Merge pull request #6095 from mattermost/gekidou-deps
[Gekidou] update deps
2022-03-28 15:25:09 -03:00
Elias Nahum
4696f880ba use any instead of never in screens HOC 2022-03-28 15:10:50 -03:00
Elias Nahum
7d311f77b3 feedback review 2022-03-28 14:46:15 -03:00
Elias Nahum
ed96601839 update react-native-safe-area-context 2022-03-28 09:05:49 -03:00
Kyriakos Z
f2484297a8 [Gekidou DB]: Adds threads in team database table and handlers (#6090)
* Adds threads in team database table and handlers

DM/GM channels have no team ID. This makes it troublesome to paginate
threads in a team. The issue is that whenever a DM/GM thread is fetched
from pagination it will be added in all teams in that server,
potentially creating gaps in between threads for those teams.

This PR inserts a new table in the DB ThreadsInTeam which will hold
references of threads loaded in which server.
Thread lists then would have to rely on that table to show threads.


Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
Co-authored-by: Avinash Lingaloo <avinashlng1080@gmail.com>
2022-03-28 10:11:13 +03:00
Elias Nahum
3650cdfc6d fix Require cycle 2022-03-26 20:40:17 -03:00
Elias Nahum
8901afb0d8 Enable Flipper on iOS 2022-03-26 20:36:21 -03:00
Elias Nahum
527bd04170 Update dependencies 2022-03-26 20:33:13 -03:00
Elias Nahum
86ae1fc9cc Handle system ephemeral post 2022-03-24 19:24:54 -03:00
Elias Nahum
941aa9d0d0 Merge pull request #6085 from mattermost/gekidou-fixes
[Gekidou] UI fixes
2022-03-24 16:48:17 -03:00
Elias Nahum
b71396d559 commonmark-react-renderer integrity 2022-03-24 16:41:02 -03:00
Elias Nahum
b6f373df5c Merge branch 'gekidou' into gekidou-fixes 2022-03-24 16:36:09 -03:00
Elias Nahum
d10b6c3eab Merge pull request #6077 from mattermost/detox-server-list
Detox/E2E: Server List e2e tests in Gekidou
2022-03-24 15:37:34 -03:00
Elias Nahum
57e6deeb4b Merge pull request #6061 from larkox/CommandAutocomplete
[Gekidou] Add command autocomplete
2022-03-24 15:34:11 -03:00
Daniel Espino García
cc1c112028 Nit 2022-03-24 18:47:16 +01:00
Daniel Espino García
c1b8b0ee38 Merge branch 'gekidou' into CommandAutocomplete 2022-03-24 18:45:42 +01:00
Daniel Espino García
2393151ff0 Add integrations manager, use base-64 to handle svgs and minor improvement and fixes in the components 2022-03-24 18:40:38 +01:00
Elias Nahum
eb9e261ad4 Merge pull request #6083 from mattermost/gekidou-reactions
[Gekidou] reactions
2022-03-24 13:59:28 -03:00
Elias Nahum
ee2ef00a10 Merge pull request #6084 from mattermost/MM-42160-Mention-badge
Adds mention badges to channel list items
2022-03-24 13:49:58 -03:00
Elias Nahum
ce3ea47826 CategoryModel typing 2022-03-24 12:42:17 -03:00
Daniel Espino García
59959d041a Merge branch 'gekidou' into CommandAutocomplete 2022-03-24 16:39:25 +01:00
Anurag Shivarathri
aa4776a260 Replies count query (#6088) 2022-03-24 18:29:10 +05:30
Elias Nahum
9769ec41a7 Make sure record displayName for GM is set 2022-03-23 18:51:43 -03:00
Shaz MJ
c0b265132a Removes dupes 2022-03-24 08:29:35 +11:00
Shaz MJ
eea5e87940 Merge branch 'gekidou' into MM-42160-Mention-badge 2022-03-24 08:24:38 +11:00
Shaz MJ
ab45851e19 Uses existing badge 2022-03-24 08:19:43 +11:00
Elias Nahum
ccb29bbce6 Merge branch 'gekidou' into gekidou-fixes 2022-03-23 17:06:10 -03:00
Elias Nahum
f08ccb2d0c feedback review 2022-03-23 15:16:14 -03:00
Joseph Baylon
ef17c1d139 Added test for MM-T4691_6 2022-03-23 09:56:12 -07:00
Daniel Espino García
7fecf7e474 Merge branch 'gekidou' into CommandAutocomplete 2022-03-23 17:53:43 +01:00
Daniel Espino García
649681ef94 Remove bang image and use compass icon 2022-03-23 17:37:20 +01:00
Elias Nahum
2b974f8b46 Removed unused handlePostMetadata 2022-03-23 13:29:59 -03:00
Elias Nahum
ffc06bbaa3 Prevent more_messages to autoscroll more than once 2022-03-23 12:56:50 -03:00
Daniel Espino García
7382c1f4fc Address feedback 2022-03-23 16:11:58 +01:00
Elias Nahum
c9ca6cb90c channel can be null or undefined 2022-03-23 12:03:41 -03:00
Elias Nahum
296d088ca2 channel settings can be null or undefined 2022-03-23 12:00:34 -03:00
Elias Nahum
7f9cd287fe feedback review 2022-03-23 11:35:37 -03:00
Elias Nahum
292d72dc79 fix collapse categories dependencies and reset list on team change 2022-03-23 11:14:57 -03:00
Shaz MJ
80930477ff Handes visibility preference setting for dm/gm (#6078)
* Handes visibility preference setting for dm/gm

* Feedback

Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
2022-03-23 10:41:50 -03:00