Commit Graph

100 Commits

Author SHA1 Message Date
Daniel Espino García
a4674915c1 Better handle go to location (#6262)
* Better handle go to location

* Improve server check
2022-05-19 09:06:31 +02:00
Daniel Espino García
75d1c9d228 Try to remove as many as as possible (#6200)
* Try to remove as many ` as ` as possible

* Fix imports
2022-05-12 15:46:11 +02:00
Anurag Shivarathri
ba976dadc2 [Gekidou[ [MM-43969, MM-44037] global threads crash, mark as read (#6253)
* Preparing thread data as well with prepareDeletePost

* observing the post directly to prevent the crash until the data issue is found

* mark as read, delete threeds fix

* Update thread.ts

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-05-10 15:59:06 +05:30
Anurag Shivarathri
1760b75dbf [Gekidou] [MM-43973] Thread footer for recent mentions (#6225)
* Displaying thread footer

* Participants can be empty

* Update thread.ts
2022-05-05 21:03:09 +05:30
Anurag Shivarathri
2deb2e01e0 [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 <nahumhbl@gmail.com>
2022-05-05 09:06:18 -04:00
Elias Nahum
ecfbb934a8 [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 <nahumhbl@gmail.com>

Co-authored-by: Shaz MJ <shaz.amjad@mattermost.com>
2022-05-04 09:51:14 -04:00
Elias Nahum
a2fac160ef set badge count on cancel notifications (#6189) 2022-04-28 11:20:16 -04: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
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
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
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
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
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
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
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
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
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
9769ec41a7 Make sure record displayName for GM is set 2022-03-23 18:51:43 -03:00
Elias Nahum
2b974f8b46 Removed unused handlePostMetadata 2022-03-23 13:29:59 -03:00
Elias Nahum
088aa193ab [Gekidou] Use localPath when available (#6058)
* Use localPath when available

* Revert changes to replace space for dash in the filename

* Rename other action to external and always call onDownloadSuccess if defined

* add missing localization strings
2022-03-17 08:58:49 -03:00
Shaz MJ
eec536a61b Adds muted state to channel list in sidebar (#6042)
* Sorting categories body in the observable

* Adds muted state to channel list in sidebar

* update snapshots

Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
Co-authored-by: Shaz Amjad <shaz.amjad@me.com>
2022-03-11 10:13:05 -03:00
Shaz MJ
23ff6e8a09 Sorting categories body in the observable (#6041)
* Sorting categories body in the observable

* feedback review

* Fix category queries to return only channels that have been loaded

* Do not display archived channels unless is the active one

Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
2022-03-10 18:19:49 -03:00
Anurag Shivarathri
5b44676985 [MM-39708] Gekidou Thread Screen (#6015)
* Thread screen

* misc

* Added snapshot for ThreadOverview

* Updated snapshot

* Misc

* Updated snapshot and ts fixes

* Made thread as a modal, fixes post list not closing on tablet

* Removed unsued variables

* Putting back the empty space before the root post (inverse list footer)

* Changed input text

* Removed empty footer space

* Misc fixes

* Disables new messages line for thread

* Loading threads before opening modal & BottomSheet componentId fix

* Moved merge navigation options to switchToThread

* Moved LeftButton to switch to thread

* Removed Q.and

* Misc fixes

* Added task id for pagination

* Removed useMemo, Q.and

* move thread close button as a prop

* Remove title font styles to use default

* Misc changes

* Misc fix

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
2022-03-10 10:45:30 -03:00
Anurag Shivarathri
9dbdae22fd [Gekidou MM-39707] CRT DB (#5948)
* Database init

* Naming fix

* naming misc

* Fix test

* Added Thread Tab columns, Team Threads Count table and other changes

* Test case fix

* Test cases fix ...... AGAIN

* TS fix

* Removed loaded_in_all_threads_tab, loaded_in_unreads_tab

* Removed TeamThreadsCount table, mention & message root counts & added loadedInGlobalThreads flag

* Type changes, added delete thread with post

* Removed unused type

* Reverted relationshio of post with thread

* Calling thread destroyPermanently from post

* Removed unused table name variables

* added THREAD constant table in post model and fixed a few comments

* Misc typo fix and code clean up

* Added test case and related to participant in user model

* test cases fix

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
2022-03-03 22:47:29 +05:30
Elias Nahum
162bc6cc3f [Gekidou] various fixes (#6022)
* remove empty roles before fetching

* Fix prepare delete teams, channels and posts so they don't throw

* Fix reaction operator and moved some handlers to their correct file

* include delete categories when teams or channels are deleted

* Remove unused array in fetchRoles

* fix param comment for reactions handler

* don't sync preferences when getting the WS event
2022-03-03 12:11:47 -03:00
Elias Nahum
eaf4f3166e [Gekidou] update dependencies (#6019)
* Dependency updates

* npm audit fixes
2022-03-01 18:52:01 -03:00
Elias Nahum
5de54471b7 [Gekidou] Gallery (#6008)
* Gallery screen (ground work)

* Open the gallery from posts

* Open the gallery from post draft

* feedback review

* Feedback review 2

* do not remove dm channel names and localization fix

* update to the latest network-client

* do not override file width, height and imageThumbail if received file does not have it set

* bring back ScrollView wrapper for message component

* Remove Text wrapper for markdown paragraph

* Fix YouTube play icon placeholder

* Make video file play button container round

* Add gif image placeholder

* Save images & videos to camera roll

* Feedback review 3

* load video thumbnail when post is in viewport

* simplify prefix
2022-03-01 13:55:44 -03:00
Jason Frerich
efd2fd0c02 [Gekidou MM-39729] Websocket Events - Groups (#5930)
Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
2022-03-01 10:13:45 -06:00
Elias Nahum
a14dd4928f [Gekidou] Post removal (#5985)
* Fix post onPress handler to remove a deleted post

* Fix operator handlePost to remove fetched existing deleted posts and filter the ones that do not exist
2022-02-21 09:25:52 -03:00
Elias Nahum
5b9492356b Gekidou MultiServers second part (#5963)
* Edit Server display name

* Lock iPhone to portrait and iPad to landscape

* Create actions for app global to store device token and multi server tutorial

* Add MutliServer tutorial on first use

* WebSocket reconnection priority

* have isRecordGlobalEqualToRaw to not check for value

* Return early on edit server if error is found

* Prepopulate server screen with last logged out server address and name

* Add CompassIcon to circleCI asset generation
2022-02-17 10:42:06 -03:00
Elias Nahum
d35eac8bd3 Gekidou servers (#5960)
* Servers logout and websocket state

* addNewServer uility and rename file

* add LaunchType for add new server

* added time to LaunchProps type

* Remove unnecessary props for launchToHome

* Fix local action updateLastPostAt

* Batch fetchProfilesPerChannels requests in chunks of 50

* WS handleUserAddedToChannelEvent to return early if no channelId is set

* WS handleNewPostEvent to batch update last_post_at

* add common actions to sync other servers

* Entry actions to sync other servers data

* Do not attempt to fetch notification data if payload does not contain a channelId

* Set database as default at the end of the login flow

* Handle logout when other servers remain

* Handle Server options

* Show alert when logging out from the account screen

* Add workaround to have Lottie animate the loading component

* Fix badge position in ServerIcon component

* Server screen to support adding new server

* Fix login screen to display error when credentials do not match

* add localization strings

* fix DatabaseProvider to update on server switch

* Fix home icon and server icon subscriptions and badge display

* Add dependencies to onLogout callback

* feedback

* Only updateLastPostAt if needed
2022-02-14 16:39:29 -03:00
Shaz Amjad
9f5f73b264 Gekidou - Sidebar - Adds actions, queries, db models and rest client (#5953)
* Adds actions, queries, db models and rest client

* move fetching categories inside fetchMyChannelsForTeam

* code cleanup

* deconstruct categoriesWithOrder

* DMs fetching for changing teams

* Fix bad merge and address feedback

Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
2022-02-11 18:40:44 -03:00
Elias Nahum
1b62c10dcc [Gekidou] various fixes (#5951)
* Specify the screen to be dismissed from the bottom sheet on tablets

* reposition unread badge on server icon

* Skip setNavigatorStyles and set correct theme for login flow screens

* Fetch current user status with fetchMe and when the WS connects

* switchToChannel skip setting current channel if id is the same

* ChannelMention component to use switchToChannelById instead of switchToChannel

* loginEntry only set initialChannel if isTablet

* deferredAppEntryActions mark channel as read and fetch channel stats if initialChannel is set

* feedback review

* feedback review
2022-02-10 11:46:35 -03:00
Elias Nahum
16524314aa Sort servers list 2022-02-03 11:44:49 -03:00
Daniel Espino García
55324127e1 [Gekidou] Post input (#5844)
* Initial commit post input

* Fix message posting, add create direct channel and minor fixes

* Fix "is typing" and "react to last post" behaviour

* Some reordering, better handling of upload error, properly clear draft on send message, and fix minor progress bar misbehavior

* Add keyboard listener for shift-enter, add selection between video or photo while attaching, add alert when trying to attach more than you are allowed, add paste functionality, minor fixes and reordering

* Add library patch

* Fix lint

* Address feedback

* Address feedback

* Add missing negation

* Check for group name and fix typo on draft comparisons

* Address feedback

* Address feedback

* Address feedback

* Address feedback

* Fix several bugs

* Remove @app imports

* Address feedback

* fix post list & post draft layout on iOS

* Fix post draft cursor position

* Fix file upload route

* Allow to pick multiple images using the image picker

* accurately get the channel member count

* remove android cursor workaround

* Remove local const INPUT_LINE_HEIGHT

* move getPlaceHolder out of the component

* use substring instead of legacy substr for hardward keyboard

* Move onAppStateChange above the effects

* Fix camera action bottom sheet

* no need to memo SendButton

* properly use memberCount in sender handler

* Refactor how to get memberCount

* Fix queryRecentPostsInThread

* Remove unused isDirectChannelVisible && isGroupChannelVisible util functions

* rename errorBadUser to errorUnkownUser

* extract localized strings

* use ClientErrorProps instead of ClientError

* Minor improvements

Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
2022-02-03 08:59:15 -03:00
Jason Frerich
f815f6b3e5 [Gekidou MM-3972] Websocket Events - Reaction and emojis (#5920)
* Wip

* update name so it references changing the reaction on a post

* handleAddEmoji -> handleAddCustomEmoji

* add remove reaction logic

* sanitizeReactions
  * use skipSync to return early if not deleting any records that are
    not in the server db
  * return the filtered delete results and have the handler destroy the
    records

* fix lint

* use forEach instead of map.

* PR feedback

* PR feedback

* Update app/actions/websocket/reactions.ts

* remove console.log

Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
2022-02-03 11:14:08 +01:00
Shaz Amjad
fc29b4b974 [Gekidou] Sidebar Categories (Database only) (#5909) 2022-01-31 10:30:10 -03:00
Elias Nahum
d14ce66897 [Gekidou] Multi-Server support UI (#5912)
* Multi-Server support UI

* feedback review

* Apply suggestions from code review

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

Co-authored-by: Avinash Lingaloo <avinashlng1080@gmail.com>
2022-01-28 09:51:30 -03:00
Daniel Espino García
d5228633b2 [Gekidou] Manage user websocket events (#5862)
* Manage user websocket events

* Revert ChannelMembership -> MyChannelMembership

* Address feedback

* Update channel display name when the user changes

* Minor name and refactoring changes from feedback

* Address feedback

* Address feedback

* Add line breaks for readability
2022-01-24 12:12:06 +01:00
Elias Nahum
2013f39a61 V2 dependency updates (#5907)
* Update to RN 0.67 & dependencies

* Update server displayName if already exists

* Allow adding only one reaction

* update to rn 0.67.1
2022-01-21 08:49:04 -03:00
Elias Nahum
b8b51296c0 [Gekidou] post list (#5893) 2022-01-17 07:06:26 -03:00
Daniel Espino García
b49b4050ac [Gekidou] Add is_unread to MyChannel model (#5878)
* Make message_count become has_unreads

* Fix lint

* Re-add the message count

* rename has_unreads to is_unread and address feedback

* fix query with is_unread

Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
2021-12-22 14:37:14 +02:00