Commit Graph

331 Commits

Author SHA1 Message Date
Shaz MJ
9feb3446a8 Unreads On Top (#6098)
* Unreads on top

* Feedback addressed

* update sorted channels if locale changes

* Extract localized strings

Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
2022-04-12 12:00:43 -04:00
Elias Nahum
a0ff404d39 [Gekidou] Update bottom sheet style for title and button (#6166)
* Update bottom sheet style for title and button

* title margin bottom

* Fix more teams list
2022-04-12 09:42:24 -04:00
Anurag Shivarathri
deb222a01d Gekidou CRT - User avatar stack (#6139)
* User avatar stack

* Fixed fetchPostThread & added observer

* Reusing the user component

* Refactor fix

* fix lint

Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
2022-04-12 09:36:13 -04:00
Avinash Lingaloo
b4b5c80629 removed useless getConfig call (#6167) 2022-04-12 09:25:17 -04:00
Elias Nahum
9d88099ac5 [Gekidou] new UI for no results found (#6165)
* new UI for no results found

* feedback review
2022-04-12 09:24:46 -04:00
Elias Nahum
57e3334507 [Gekidou] Fix initial Channel list width on iPad (#6164)
* Fix initial Channel list width on iPad

* feedback review
2022-04-12 09:07:55 -04:00
Elias Nahum
2b3d84ee61 Fix create DM when searching profile (#6162) 2022-04-12 15:03:43 +02:00
Elias Nahum
11d81d0b1d [Gekidou] Fix bottom sheet initial animation (#6161)
* Fix bottom sheet initial animation

* include bottom sheet backdrop opacity animation
2022-04-12 09:00:14 -04:00
Elias Nahum
692795a9a1 [Gekidou] Code syntax highlight (#6156)
* Code syntax highlight

* fix code syntax imports for jest

* feedback review
2022-04-12 08:59:50 -04:00
Kyriakos Z
477c7cf1bf MM-40093 [Gekidou]: adds remote action to sync threads (#6135)
* MM-40093: adds remote action to sync threads

Syncing threads fetches all unread threads if there are no threads in
the DB.
If there are threads in the DB it fetches all threads newest than the
newest one we have stored.

Fetching happens in batches of 60 threads at a time.

* Fixes querying for all threads list

* Syncs threads on WS reconnection

* Addresses review comments

* Addresses review comments
2022-04-12 15:03:05 +03:00
Kyriakos Z
df3ef72a0a [Gekidou CRT] thread mention counts (#6126)
* Sets values on my_channel according to CRT

* Team counts with regard to CRT

* Fixes myChannel.is_unread with regard to CRT

* Include DM/GMs for thread counts on demand

* Incorporate thread mention counts in server/channel

* Channel updates in regard to CRT
2022-04-12 13:27:40 +03:00
Elias Nahum
e741d47fc2 Fix float input label initial position (#6151)
* Fix float input label initial position

* fix focused label when field is empty
2022-04-11 12:15:44 -04:00
Elias Nahum
d9109691fd Fix update lastPostAt (#6154) 2022-04-11 09:10:20 +02:00
Elias Nahum
4746ae4996 Set background color to black when video goes fullscreen 2022-04-09 13:27:47 -04:00
Daniel Espino García
26b3fbf87f Fix add DM screen and some other database related issues (#6144)
* Fix add DM screen and some other database related issues

* Minor style fixes

* Handle create DM/GM websocket by using the teammate ids

* Address feedback
2022-04-08 23:10:08 -04:00
Elias Nahum
ee1f8ddab6 fix commonmark dependency hash 2022-04-08 21:21:23 -04:00
Elias Nahum
b530dbeb09 [Gekidou] upgrade to RN 68 (old arch) (#6138)
* upgrade to RN 68 (old arch)

* remove test setup unused & commented mock

* Android target set to 30

* Fix theme when opening app from push notification

* upgrade common mark
2022-04-08 12:40:44 -04:00
Avinash Lingaloo
9a72837f04 Gekidou - Updated Server Database Diagrams/Schema/Models (#6119)
* started with the diagrams

* removed redundant tables

next step:
1. reconstruct id ( local id vs server id )
2. annotate fields with examples
3. recreate relationship

* work in progress

* work in progress

* fix association

* update postsInChannel

* removed SlashCommands from the Server database schema

* added missing associations in the models and updated docs/database

* exported server database

* update test

* code corrections following review

* update relationship

* update docs

* removed cyclic relationship

* Revert "removed cyclic relationship"

This reverts commit 4d784efb81.

* removed isOptional from Draft

* linked myChannelSettings to myChannel instead of Channel

* update diagrams

* store null instead of empty string

* update thread association

Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
2022-04-07 10:14:28 -04:00
Elias Nahum
ae3c9e2ef2 [Gekidou] bug fixes found with e2e tests (#6130)
* Fix Search users in Create Direct Message

* Fix UserListRow style for onPress

* Prevent create direct message & browse channels from being dismissed with a swipe

* Only display Edit header option when tapping in the channel intro

* Fix localization for ThreadFollowButton

* Prevent New channel screen from being dismiss with a swipe
2022-04-07 09:57:43 -04:00
Avinash Lingaloo
b5c53d769f Gekidou - Updated App Database Diagrams/Schema/Models (#6133)
* app database - schema md file

* exported docs

* proper refactor of file name
2022-04-07 09:56:40 -04:00
Elias Nahum
0950dbd21b [Gekidou] operator handlers improvements (#6136)
* Allow database operator handlers to deal with empty or undefined input values

* Prevent known handler warnings

* Update app/database/operator/server_data_operator/handlers/post.ts

Co-authored-by: Avinash Lingaloo <avinashlng1080@gmail.com>

* feedback review

* remove unnecessary !

Co-authored-by: Avinash Lingaloo <avinashlng1080@gmail.com>
2022-04-07 09:17:57 -04:00
Kyriakos Z
3326f34933 [Gekidou HOTFIX] fixes saving threads in the DB (#6132)
* [Gekidou HOTFIX] fixes saving threads in the DB

`loadedInGlobalThreads` cannot be a property of the thread, the DB will
fail with unknown column upon saving.

This commit makes it an argument of handleThreads and
handleThreadInTeam.

Fixes wrong foreignKey in THREAD table associations.

* Fixes errors

* Fixes error
2022-04-06 17:37:17 +03:00
Joseph Baylon
c85914f4ba Detox/E2E: Channel List, Browse Channels, Create Direct Message e2e tests in Gekidou (#6114)
* Detox/E2E: Channel List, Browse Channels, Create Direct Message e2e tests in Gekidou

* Fix create_direct_message

* Fix channel_list snapshot test

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-04-05 13:12:57 -07:00
Elias Nahum
31ed25cd61 Access create channel from browse channel (#6128) 2022-04-05 11:38:49 -04:00
Elias Nahum
28b86e9c24 Use delta for mark as unread (#6127) 2022-04-05 09:00:45 -04:00
Elias Nahum
73d23ea515 [Gekidou] ci updates (#6123)
* use Flipper 0.125.0

* update fastlane

* update ci images & use node 16.14.2

* remove npm-install argument

* Remove DFB_SONARKIT_ENABLED flag in iOS Release mode
2022-04-04 18:37:56 -04:00
Elias Nahum
2621d921d6 [Gekidou] Performance & UI fixes (#6122)
* Fix search bar style

* MM-42983 Align mention badge on channel list item

* MM-42985 polish channel intro UI

* MM-42984 update fonts on 'Show' bottom sheet

* MM-42982 Increase tap area of back button on channel view

* Set StatusBar style based on theme sidebarBg

* Reconnect other WS after 20 seconds insted of 5

* Only fetch missing profiles for DM/GMs

* Database prepare records optimization

* Do not use fallbackUsername for storing GM/DM in the database

* fix filter for fetching missing dm/gm

* remove use of indexOf inside another loop

* remove use of includes inside another loop

* remove use of find inside another loop

* Add missing translations

* disable Flipper on iOS

* Remove Flipper code from AppDelegate

* feedback review

* trim DM display name to make sure is not empty

* fixing missing direct channels display name

* UI/UX feedback

* fix WS channel viewed and mark as unread

* Remove duplicate emojis from reaction bar
2022-04-04 17:09:26 -04:00
Jason Frerich
137ba9d191 [Gekidou MM-39728] - Websocket Events - Channels (#6038)
* wip checkin

* wip checkin because my system is messed up again

* correct the add user and remove user from channel functions. THe user and channel ids sometimes come from the broudcast field, not the data object

* remove old comments

* remove old comments

* remove old comments

* add back in unarchive handler. handleChannelUpdateEvent will also update the deleteAt value for a channel, but does not get called when unarchive from the channel view, only through the system console.

* nit remove empty line

* wip

* wip

* remove handleChannelConvertedEvent

* remove handleChannelDirectAddedEvent

* wip

* wip

* wip

* Fix websockets events

* Address feedback

* Ensure categories and some refactoring

* Self review fixes

* Fix category creation bug

* Address feedback and minor improvements

* Address feedback

* Fix lint

Co-authored-by: Daniel Espino García <larkox@gmail.com>
2022-04-04 14:25:42 -04:00
Joseph Baylon
b13a4abc27 Apply patch for minSdkVersion (#6121) 2022-04-05 00:01:43 +08:00
Anurag Shivarathri
8d6fc41dd5 [Gekidou MM-41093] CRT - WS Events, Actions, Queries, Thread Follow, Post Query (#6075)
* WS Events, Actions, Queries, Thread Follow, Post Query

* i18n changes

* Misc

* Only unread threads are marked as read

* Mark threads from WS even as visible in Global threads

* Merge fixes

* Update thread_post_list.tsx

* Merge fix

* Feedback fix

* Make teamId in handleThreads optional for unfollowed threads

* Removed unwated type and return

* Review changes

* Removing unused model

* Merge fix

* Misc fixes

* Following button query change
2022-04-04 19:55:13 +05:30
Daniel Espino García
d1322e84ce [Gekidou] Add performance and code improvements around post_list (#6113)
* Add performance and code improvements around post_list

* Fix test

* Move observers from utils to queries

* remove Flipper on iOS to fix CI build

* Fix observePermissionForChannel for DM/GM

Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
2022-04-04 08:14:55 -04:00
Avinash Lingaloo
c9d73d4512 removed TOS from Server DB schema (#6117)
Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
2022-04-01 12:35:24 -03:00
Avinash Lingaloo
764e08e25d removed SlashCommands from the Server database schema (#6116) 2022-04-01 12:23:57 -03:00
Saturnino Abril
b7d04afa21 fix detox report (#6115) 2022-04-01 20:16:44 +08:00
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