Commit Graph

46 Commits

Author SHA1 Message Date
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
Elias Nahum
7e6248dfb3 [Gekidou] - Channel Intro (#5846)
* Channel Intro

* Move avatar margins to post component per feedback review

* Channel intro redesign

* Fix preferences unit test

* Change group intro sizes

* Add Bot tag to DM Intro if they have it

* fix channel isTablet layout on split screen

* update snapshot
2021-12-21 17:44:00 +02:00
Kyriakos Z
675d8495b3 [Gekidou]: MM-39757 - Recent mentions (#5823)
* [Gekidou]: MM-39757 - Recent mentions

* Refactor channel_info to a separate component

* Fixes schema tests

* Fixes channel_info theme color

* Removes RECEIVED_MENTIONS table and model

Removes RECEIVED_MENTIONS table and model and saves recent_mentions in
the SYSTEM table under the recentMentions ID.

* Cleanup recent_mentions handler

* Adds i18n in recent_mentions screen

* Observe changes on the post messages

* Addresses review comments

* Batches records

* Addresses review comments

* Addresses review comments

* Addresses review comments

* Addresses review comments

* Fetches channels and users needed for mentions

Fetching mentions from all teams might result in missing info like user
profiles, and channels missing from the DB.
This commit fetches all missing users and channels.

* Adds empty state for recent mentions

* Prepares all missing models for channels

* Addresses review comments

* Fixes mention keys for recent mentions

User mention keys when asking for mentions should not include general
purpose ones, like @channel, @all, @here.

Fixes ActivityIndicator color in recent mentions screen.

* Removes top margin of mention message

* Addresses review comments

* Fixes group.name undefined
2021-12-16 12:26:43 +02:00
Jason Frerich
a5254992d3 Draft - Add Server Screen Gekidou Updates (#5663)
* initial checkin

* all text is added

* add fonts

* wip

* get fonts from differnt site suggestion from matt

* use actual apostrophe

* add react-native-paper dependency

* wip

* add project info for metropolis fonts

* correct the display name help text alignment with stretch
use paper theme to color and make the the placeholder opaque
remove placeholder prop because spec wants the box to be empty on focus

* fix Metropolis font reference

* Add more styling.  Clean up code later

* input box text theme color

* separate padding for two textinput boxes
share the input theme

* Use ActivityIndicator from react-native-paper

* wrap formatText components in a view so they scroll up inline with the
text inputs and button

* clean up styles section. no empty lines and no comments

* Use Colors library instead of harcoding #FFFFFF

* Move error message into helper directly under the server url input box

* need to handle the error so it can be presented in the modal

* set state for button is disabled or not
reset errors before every connect attempt

* when url is not valid show the error message and disable the connect
button until some text in display or the url input changes

* s/generic/default/

* group formatted messages together

* Add icon to the error message
fix clipped helper messages

* when urlError is not '', make the input border red
after connecting creates an error, typing in the input boxes will
   * enable the connect button
   * reset the error messages
   * change outline from red to blue

* After connecting and the server url has an error, allow the user to
click the display input and keep the url border red.  The only time the
red border and error reset is when the user types in that field again

* remove duplicate button component. only get the prop values and
construct after all values defined

* use correct icon and add spacing between icon and text

* fix styling for Android
New styling from figma

* initial add of background svg.  RHS is off a bit

* sync with gekidou changes

* sync with gekidou

* sync with gekidou

* sync with gekidou

* sync with gekidou

* use new FloatingTextInput component

* Added widgets/text_settings

* wip

* wip

* Update index.tsx

* work in progress

* fix text settings component

* fix text settings component

* crash fix

* code clean up

* Update index.tsx

* Fix testSettings

* Wrap with View so the text moves with the text inputs when keyboard
appears

* update styling
when user starts typing in server url after a failed connect, dismiss
the error

* use utils/buttonStyles

* leave as it was to minimize irrelevant PR diffs

* nit

* Align all components
Add vertical margin to styles
Add subcontainer and container props to text_setting component
Use FormattedText for choosing a display name text instead of
text_setting helper text

* revert midnight change

* reset the connecing error when a user starts modifying the server url

* formatting
remove svg
repalce <Text> with <FormattedText>

* fix lint

* remove svg file

* Listening for appearance to set the theme for non connected screens

* Pass the theme as a prop for TextSettings

* Fix Server screen layout and pass the displayName for DB creation

* Tablet layout

* Persist keyboard on tap

* Change position & opacity for app version

* added background SVG

* Fix non theme control screens status bar color

* Split Server screen into smaller components

* fixed svg background layout for tablet

* Bring back form & header and remove some extra background color and styles

* Remove duplicate font reference in Info.plist

* Final UI tweaks

* Fix error display on url field

* margin bottom to app version

* Add ClientError utility to extract error

* update snapshot

Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
Co-authored-by: Avinash Lingaloo <avinashlng1080@gmail.com>
Co-authored-by: Matthew Birtch <mattbirtch@gmail.com>
2021-10-29 19:14:55 -03:00
Elias Nahum
790b1beb22 [Gekidou] push notifications (#5779)
* Push notifications entry point

* Process android notification natively only if RN is not initialized

* Database changes to store local channel viewed_at

* EphemeralStore wait until screen removed

* Move schedule session notification to utility

* Fix channel remote & local actions + added actions for markChannelAsViewed & fetchMyChannel

* Add fetchMyTeam remote action

* Add dismissAllModalsAndPopToScreen to navigation

* Improve post list component & add app state to re-trigger queries

* Improve WS implementation

* Handle push notification events

* Fix postsInChannel since handler

* Handle in-app notifications

* Post list to listen to column changes

* Track selected bottom tab in ephemeral store

* add useIsTablet hook

* in-app notifications on tablets
2021-10-27 17:53:11 -03:00
Daniel Espino García
d1e0c99c3d Gekidou websockets (#5671)
* Adapt websocket client

* Add Websocket Manager

* Address feedback

* Start websockets on init and login, and invalidate on logout

* Add temporal logging and bug fixing

* Working WS

* Add reconnect actions and periodic updates

* Address feedback

* Add missing change

* Several improvements on websocket reconnect and channel handling

* fix gekidou package-lock.json

* update Podfile.lock

* Address feedback

* Address feedback

* Address feedback

* Fix update channel delete at

* Catch errors on batchRecords

* Update app/queries/servers/channel.ts

Co-authored-by: Elias Nahum <nahumhbl@gmail.com>

Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
2021-10-19 19:16:10 +02:00
Elias Nahum
ecd80fcd4f Add channel model property for shared channels (#5749) 2021-10-13 14:28:09 -03:00
Avinash Lingaloo
7f91a6a78a Gekidou - Account Screen (#5708)
* Added DrawerItem component

* WIP Account Screen

* Added react-native-paper

* Added StatusLabel Component

* Extracted i18n

* TS fix DrawerItem component

* WIP Account Screen

* Added server name label under log out

* Updated translation

* WIP

* Fixes the Offline text style

* Added Metropolis fonts

* WIP

* Typo clean up

* WIP

* WIP

* WIP

* Added server display name

* Writing OpenSans properly

* WIP

* WIP

* Added OptionsModal

* Opening OptionsModal

* Added translation keys

* Writes status to local db

* Fix missing translation

* Fix OptionModal not dismissing

* Pushing status to server

* Refactored

* Added CustomStatusExpiry component

* Added sub components

* Added CustomLabel

* CustomStatus WIP

* Added Custom Status screen WIP

* WIP - unsetCustomStatus and CustomStatus constant

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* Retrieving RecentCustomStatuses from Preferences table

* WIP

* WIP

* WIP

* Added Clear After Modal

* WIP - Transations

* WIP

* Done with showing modal cst

* wip

* Clear After Modal - DONE

* fix

* Added missing API calls

* wip

* Causing screen refresh

* wip

* WIP

* WIP

* WIP

* Code clean up

* Added OOO alert box

* Refactored Options-Item

* Refactored OptionsModalList component

* Opening 'status' in BottomSheet instead of OptionsModal

* AddReaction screen - WIP

* Add Reaction screen - WIP

* Added EmojiPickerRow

* Added @components/emoji_picker - WIP

* Emoji Picker - WIP

* WIP

* WIP

* WIP

* SectionList - WIP

* Installed react-native-section_list_get_item_layout

* Adding API calls - WIP

* WIP

* Search Bar component - WIP

* WIP

* WIP

* WIP

* Rendering Emoticons now - have to tackle some fixmes

* Code clean up

* Code clean up - WIP

* Code clean up

* WIP

* Major clean up

* wip

* WIP

* Fix rendering issue with SectionIcons and SearchBar

* Tackled the CustomEmojiPage

* Code clean up

* WIP

* Done with loading User Profiles for Custom Emoji

* Code clean up

* Code Clean up

* Fix screen Account

* Added missing sql file for IOS Pod

* Updated Podfile.lock

* Using queryConfig instead of queryCommonSystemValues

* Fix - Custom status

* Fix - Custom Status - Error

* Fix - Clear Pass Status - WIP

* Fix - Custom Status Clear

* Need to fix CST clear

* WIP

* Status clear - working

* Using catchError operator

* remove unnecessary prop

* Status  BottomSheet now has colored indicators

* Added KeyboardTrackingView from 'react-native-keyboard-tracking-view'

* Code clean up

* WIP

* code clean up

* Added a safety check

* Fix - Display suggestions

* Code clean up based on PR Review

* Code clean up

* Code clean up

* Code clean up

* Corrections

* Fix tsc

* TS fix

* Removed unnecessary prop

* Fix SearchBar Ts

* Updated tests

* Delete search_bar.test.js.snap

* Merge branch 'gekidou' into gekidou_account_screen

* Revert "Merge branch 'gekidou' into gekidou_account_screen"

This reverts commit 5defc31321.

* Fix fonts

* Refactor home account screen

* fix theme provider

* refactor bottom sheet

* remove paper provider

* update drawer item snapshots

* Remove options modal screen

* remove react-native-ui-lib dependency

* Refactor & fix custom status & navigation (including tablet)

* Refactor emoji picker

Co-authored-by: Avinash Lingaloo <>
Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
2021-10-12 19:24:24 +04:00
Elias Nahum
2f8160d360 Remove team unreads and rely on channel member instead (#5710) 2021-10-01 16:07:57 -03:00
Daniel Espino García
1c26f14fdb Add import order lint rules (#5672)
* Add import order lint rules

* Address feedback

* Revert change
2021-09-13 10:18:03 +02:00
Elias Nahum
5700ce7c86 [Gekidou] post component tree and partial postList (#5637) 2021-09-06 08:22:55 -03:00
Elias Nahum
65c3e05fd8 [Gekidou] groups (#5593)
* Rename groups in channel/team to group channel/team

* Redefine groups schema

* Groups action and operator

* Add group at mentions

* fix uni test

* Update types/database/models/servers/group.d.ts

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

Co-authored-by: Avinash Lingaloo <avinashlng1080@gmail.com>
2021-08-05 19:03:46 +04:00
Elias Nahum
7c5b3a1574 [Gekidou] Allow multiple posts in thread and posts in channel for a specific root or channel (#5594)
* Allow multiple posts in thread and posts in channel for a specific root or channel

* Apply suggestions from code review

Co-authored-by: Miguel Alatzar <migbot@users.noreply.github.com>

Co-authored-by: Miguel Alatzar <migbot@users.noreply.github.com>
2021-08-04 15:43:25 -04:00
Elias Nahum
85bef9eefc Fix database models type definition (#5588) 2021-08-03 08:26:15 +04:00
Avinash Lingaloo
e8ce78f39d MM-36721 - [GEKIDOU] Porting Markdown components (#5586)
* Started with Channel Post List

* Added markdown hashtag

* Added TouchableWithFeedback component

* Added utils/bottom_sheet

* Removed BottomSheet in favor of future SlideUpPanel

* Added markdown_block_quote

* Added markdown_list_item

* Added markdown_list

* Added MarkDownTableCell component

* Markdown_table - in progress - need to verify TS

* Added markdown_table

* Update Podfile.lock

* Added deep_linking constant

* Added utils/draft

* Update config to include ExperimentalNormalizeMarkdownLinks

* Added markdown_link

* Added markdown_table_row

* Added ProgressiveImage and RetriableImage components and images utils

* Converted Retriable component to functional component

* Added type definition for commonmark

* Continuing with markdown TS

* Markdown - Typing props [ in progress ]

* Fix boolean flag with mardown block quote

* Adding observable config to markdown_link

* TS Fixes [ in progress ]

* TS fixes

* TS fixes - TextStyles

* Update markdown.tsx

* TS fixes on markdown

* TS Fixes - AtMention component

* AtMention [ IN PROGRESS ]

* Add markdown support

* Fix emoji and jumboEmoji on iOS

* Fix handleMyTeam operator

* Fix navigation style based on theme

* Fix iOS MattermostManaged deleteDatabse return error type

* wrap setNavigationStackStyles under a requestAnimationFrame

* Add preventDoubleTap to channel mention

* Increase double tap to 750ms

* Fix handleReceivedPostsInChannel chunk query

* Set initial navigation theme

* Swizzle FastImage on iOS

* fix preventDoubleTap test

Co-authored-by: Avinash Lingaloo <>
Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
2021-08-02 20:30:17 +04:00
Elias Nahum
c452ef8038 [Gekidou] Login entry point (#5568)
* Login entry point

* feedback review

* sort imports

* Fix model relations

* Handle when no current team or current channel has been selected

* Fix MFA unit test

* update prepareCommonSystemValues arguments
2021-07-26 12:03:43 +04:00
Elias Nahum
324dbbd054 [Gekidou] fix database schema and models (#5553)
* fix database schema and models

* fix types
2021-07-20 23:24:42 +04:00
Elias Nahum
8cd127a223 [Gekidou] Typings & PostMetadata structure (#5542)
* Typings & PostMetadata structure

* comment out unused code

* Remove duplicate interface

* Fix getPreferenceAsBool defaultValue
2021-07-15 11:49:02 -04:00
Elias Nahum
c64277bdbf Gekidou Update deps (#5530) 2021-07-11 07:52:44 -04:00
Avinash Lingaloo
7ff119fdc1 MM_36721 : Restructure Entities - Global & System (#5504) 2021-07-02 05:08:12 -04:00
Elias Nahum
10bfc9d604 [Gekidou] update dependencies & use node 16 with npm 7 (#5475)
* [Gekidou] update dependencies & use node 16 with npm 7

* add npm7 circleCI changes

* use react-intl 5.17.7

* fix migration error type
2021-06-22 18:52:58 -04:00
Elias Nahum
17e832e689 [Gekidou] Refactor storage layer (#5471)
* Refactored storage layer - in progress

* Refactored DatabaseManager & Operators

* Renamed isRecordAppEqualToRaw to isRecordInfoEqualToRaw

* Review feedback

* Update app/database/models/app/info.ts

Co-authored-by: Miguel Alatzar <migbot@users.noreply.github.com>

* Update app/database/models/server/my_team.ts

Co-authored-by: Miguel Alatzar <migbot@users.noreply.github.com>

Co-authored-by: Avinash Lingaloo <>
Co-authored-by: Miguel Alatzar <migbot@users.noreply.github.com>
2021-06-21 17:06:18 -04:00
Elias Nahum
6f6d88f4d7 [Gekidou] Database HOC component to set the active server database in WDB Provider (#5449)
* Database HOC component to set the active server database in WDB Provider

* Adding is_secured and last_active_at to database schema + test + models

* Update baseHandler and `general` prepareRecords for isSecured and lastActiveAt

* Update withServer component for it to use the dbInstance.

Co-authored-by: Avinash Lingaloo <>
2021-06-18 10:27:24 -04:00
Avinash Lingaloo
3ee6e673c8 MM-35115 [Gekidou] Login flow - Email and Password (#5402)
* MM_35115: ADDED select_server screen

* MM_35115: ADDED select_server screen

* MM_35115: ADDED files on which select_server is dependent

* MM_35115: ADDED react-native-button

* MM_35115: Fixing TS issues [IN PROGRESS]

* MM_35115: Started withObservables [IN PROGRESS]

* MM_35115: Started withObservables [IN PROGRESS]

* MM_35115: withObservables - defaulting when no connection is available [IN PROGRESS]

* MM_35115: withObservables - some code clean up [IN PROGRESS]

* MM_35115: withObservables - some code clean up [IN PROGRESS]

* MM_35115: withObservables - some code clean up [IN PROGRESS]

* MM_35115: Substituting mapDispatchToProps [IN PROGRESS]

* MM_35115: Substituting mapDispatchToProps [IN PROGRESS]

* MM_35115: Substituting mapDispatchToProps [IN PROGRESS]

* MM_35115: Removed resetPing action [IN PROGRESS]

* MM_35115: ADDED app/client

* MM_35115: Preparing scheduleExpiredNotification

* MM_35115: Adding some todos

* Server & LoginOptions

* Use default server if available and autoconnect if configured

* Fix login header & manual server url

* MM_35115: Login Options[IN PROGRESS]

* MM_35115: Login screen - email [IN PROGRESS]

* MM_35115: Login screen - email [IN PROGRESS]

* MM_35115: Login screen - email - login api call [IN PROGRESS]

* MM_35115: Login screen - email - login api call [IN PROGRESS]

* MM_35115: Login screen - email - saving to server db [IN PROGRESS]

* MM_35115: Login screen - email - saving to System, Preferences to db [IN PROGRESS]

* MM_35115: Login screen - enforcing unique check on System entity [IN PROGRESS]

* MM_35115: Login screen - writing TeamMembership [IN PROGRESS]

* MM_35115: Login screen - writing Teams [IN PROGRESS]

* MM_35115: Login screen [IN PROGRESS]

* MM_35115: Login screen- Refactored DataOperator handlers [IN PROGRESS]

* MM_35115: Login screen - Proper clean up [IN PROGRESS]

* MM_35115: Login screen - completeLogin  [IN PROGRESS]

* MM_35115: Improving DataOperator

* MM_35115: Improving DataOperator

* MM_35115: 80% DONE - login with email and password - some todos

* MM_35115: 80% DONE - login with email and password - some todos

* MM_35115: 80% DONE - login with email and password - some todos

* MM_35115: Removing unused app/queries folder

* MM_35115: Clean up

* MM_35115: Clean up

* MM_35115: Clean up

* MM_35115: Clean up

* MM_35115: Clean up

* MM_35115: Adding roles for MYTEAM

* MM_35115: Code clean up

* MM_35115: Code clean up

* MM_35115: Code clean up

* MM_35115: Adding rn-fetch-blob for Android

* MM_35115: Code clean up

* MM_35115: Code clean up

* MM_35115: Added test setup

* MM_35115: Fix database utils

* MM_35115: ADDED loadRolesIfNeeded

* MM_35115: Fix TS issue

* MM_35115: ADDED Tests setup

* MM_35115: Fix TS issues

* MM_35115: Fix TS issues

* MM_35115: Fix TS issues

* MM_35115: Added alternative to site name

* MM_35115: Added alternative to site name

* MM_35115: Removed hardcoded values

* MM_35115: Clean up

* MM_35115 - Fixed Android platform check instead of hermes

* MM_35115  - Replaced emptyErrorHandlingFunction with emptyFunction

* MM_35115 : Implemented TS fixes

* Update index.ts

* MM-35115 - Fix react-test-renderer issue

* MM_35115 - Optimizing DatabaseManager

* MM_35115 : Implemented getDatabaseConnection

* MM_35115 : Refactoring set/getActiveDatabase to use flag record

* MM_35115 : Refactored active database to use flag in Global entity

* MM_35115 : Updated manual database manager test

* MM_35115 : Fix operator/utils/test

* MM_35115 : Fix for base_handler

* MM_35115 : Fix test issues with Handlers

* MM_35115 : Fix test issues with prepareRecords

* MM_35115 : Fix wrapper test issue

* MM_35115 : Updated getMostRecentServerConnection to return the serverUrl as well as the connection

* MM_35115 : Refactored the way we call DataOperator

* MM_35115 : Updated database manager mock

* Add getMostRecentServerUrl function (#5440)

* fix: add getMostRecentServerUrl func

* fix: add ts and tsx to editorconfig

* fix: rename functions

* fix: return type

* Fix unit test setup

* fix login screen unit tests

* MM-36205 [GEKIDOU] Login Flow SSO (#5454)

* MM_35115: Starting LoginOptions SSO

* MM_36205: SSO [IN PROGRESS]

* MM_36205 : SSO [ IN PROGRESS ]

* Update sso_with_redirect_url.tsx

* MM_36205 : SSO Tests [ IN PROGRESS ]

* MM_36205 : Passing serverUrl to SSO screen

* Update sso.test.tsx

* Fix ViewTypes imports and keyMirror method

* MM_36205 : Code clean up

* Fix : Clean up imports

* Update: Aligning with PR 5452

* Fix: AndroidManifest file to include redirection ofr scheme mmauthbeta

* refactor: SSO Login method via Gitlab now navigates to Channel screen

* refactor: SSO Login without redirectURL is also working

* feat: SSO - main test completed

* feat: ADDED test for sso_with_redirect_url

* fix : eslint correction

* fix: Updated Loading component name

* fix : code clean up from reviews

* fix: reviews check

* fix: Added mmauthbeta into info.plist

* Revert "fix: Added mmauthbeta into info.plist"

This reverts commit d87cc23f5b.

* Update Info.plist

* Update AppDelegate.m

* feat: ADDED Forgot Password - Test [ IN PROGRESS ]

* feat: Forgot Password - Completed & Tested

* fix: Including MFA screen [ IN PROGRESS ]

* MFA - Properly tested

* Properly testing forgot_password screen

* Fix login.test.tsx

* Fix SSO method calls chain

* Update index.tsx

* Sort imports for sceen/navigation

* fix: Reviews

* Update signing + act in test

* Removed todo comment on MFA

* feedback review

* fix login tests

Co-authored-by: Avinash Lingaloo <>
Co-authored-by: Elias Nahum <nahumhbl@gmail.com>

* App initialization refactor (#5430)

* fix: initial init refactor

* fix: await isServerPresent

* fix: more refactor

* fix: move out launch functions

* fix: remove comment

* fix: update credential functions

* fix: refactor launch functions

* fix: deep link parsing

* fix: lint change

* fix: update deeplink and notification handlers

* fix: indentation

* fix: add relaunchApp

* fix eslint

* refactor launchProps and autoconnect server for deeplink

* fix: use undefined

* fix: define OptionalLaunchProps

* fix: Android - handle server URL in push notification

* fix: rename func

* fix: use boolean launchError instead

* fix: use DatabaseModule

* fix: use DatabaseHelper instead

* fix: remove unnecessary null check

* fix: iOS - support for serverUrl

* fix: iOS - extract serverUrl in reply action

* fix: iOS - expose objc specific func

* fix: remove unnecessary deviceToken param

* fix: return if device is untrusted

Co-authored-by: Elias Nahum <nahumhbl@gmail.com>

* fix: bye bye modulePaths

* fix: ios build

* chore: remove unused aliases from babel.config

* chore: fix dependency format in package-lock.json

* chore: remove transparent window background color for android AppTheme

* chore: remove mattermost.js and use index.ts as app entry

* fix: login flow screens theme

* fix: Launch types

* chore: remove OptionalLaunchProps type

* fix: url utils unit tests

* chore: update en.json

Co-authored-by: Elias Nahum <nahumhbl@gmail.com>

Co-authored-by: Avinash Lingaloo <>
Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
Co-authored-by: Miguel Alatzar <migbot@users.noreply.github.com>
2021-06-18 00:57:40 -04:00
Avinash Lingaloo
78b76352c8 MM-30482 [Gekidou] Data Operator (#5346)
* MM_30482: Imported database and types /database folder

* MM_30482: Imported database and types /database folder

* MM_30482 : All tests are passing

* MM_30482 : Updating patch package for watermelon db

* MM_30482 : Fixing CI issue

* MM_30482 : Updating TS  complaint

* Update index.ts

* MM_30482 : Code clean up

Co-authored-by: Avinash Lingaloo <>
2021-04-22 19:16:00 +04:00
Elias Nahum
9a4a93a1a5 Update v2 dependencies (#5312) 2021-04-14 10:55:29 -04:00
Avinash Lingaloo
661904fbaf MM-33224 [v2] Data Operator Team section (#5272)
* MM_33224 : Team [IN PROGRESS]

* MM_33224 : Updating test for Team schema after addition of update_at column

* MM_33224 : Team Entity - Completed

* MM_33224 - TeamChannelHistory - Completed

* MM_33224 : Removing duplicates RawValues before processing them

* MM-33224 : TeamSearchHistory - Completed

* MM-33224 : Slash Command - Completed

* MM-33224 : My Team - Completed

* MM-33227 [v2] Data Operator Channel section (#5277)

* MM_33227 : Channel[IN PROGRESS]

* MM_33227 : Channel - Completed

* MM-33227 : MyChannelSettings - Completed

* MM-33227 : ChannelInfo - Completed

* MM-33227 :  MyChannel - Completed

* MM-33227 : Added expected results in handlers' test

* MM_33227 : Renamed RawApp and RawServers fields

* MM_33227 : Cleaning up Role

* MM_33227 : Cleaning TOS

* MM-33227 : Cleaning up Group comparator

* MM-33227 : Updated JSDoc

* MM-33227 : Fixed 'comparators' to comparator in JSDoc

Co-authored-by: Avinash Lingaloo <>

Co-authored-by: Avinash Lingaloo <>
2021-04-09 10:08:32 +04:00
Avinash Lingaloo
3279cf808b MM_33225 [v2] DataOperator Group section (#5258)
* MM_30475 : ADDED default schema

* MM_30475 : ADDED todo for field 'value' of default/Global entity

* MM_30476 : Created schema for SERVER DB

* MM_30476 : Server model [ IN PROGRESS ]

* MM_30476 : Including types for group, groups_in_channel and role

* MM_30476 : ADDED models for Group

- @typings absolute path has been added to the tsconfig.json

* MM_30476 : ADDED typings to current models

* MM_30476 : ADDED typings to current models

* MM_30476 : ADDED models related to TEAM section of the ERD

* MM_30476 : ADDED models for User section of the ERD

* MM_30476 : ADDED models for POST section of the ERD

* MM_30476 : ADDED models for Channel section of the ERD

* MM_30475 : Updated typings and references to MM_TABLES

* MM_30476 : Verified all field names

* MM_30476 : Verified every table associations

* MM_30476 : Verified all relation fields

* MM_30476 : Updated primary id of the main models

We will override the wdb id at component level when we create a new records.  This involves the models : channel, group, post, team and user.

* MM_30476 : Including 1:1 relationship amongs some entities

* MM_30476 : ADDED Schema Managers

* The migration array will hold all the migration steps.

*  The initial app release (e.g. v2 )will have an empty array and subsequent releases  (e.g.  v2.1 ) will have the steps listed in that array.

* On initialization, the database will perform the migration to accomodate for new columns/tables creation and while it will conserve the mobile phone's data, it will also make it conform to this new schema.

* If a migration fails, the migration process will rollback any changes.  This migration will be thoroughly tested in development before pushing it live.

* Revert "MM_30476 : ADDED Schema Managers"

This reverts commit a505bd5e11.

* MM_30478 : Converted schema_manager into a function

* MM_30478 : Updated schema manager and included patch for wdb

* MM_30478:  Updated watermelondb patch package

* MM_30478 : Update function create_schema_manager to createSqliteAdaptorOptions

* MM_30476 : Update constant name to reflect directory name

* MM_30476 : Updated msgCount from my_channel model to message_count in server schema

* MM_30482 : Added tests for schema_manager

* MM_30482 : Database Manager [ IN PROGRESS ]

* MM_30478 : Returning an sqliteAdapter instead of an object

* MM_30476 : Apply suggestions from code review

Co-authored-by: Elias Nahum <nahumhbl@gmail.com>

* MM_30476 : Updated all imports as per instruction.

* MM_30476 : Shortening object chains by destructuring

* MM_30476 : Updated schema file structure

* MM_30476 : Prettifying @typings folder

* MM_30476 : Removing useless ids

* MM_30476 : Prettify imports for decorators

* MM_30476 : ADDED documentations and lazy queries to Channel and Channel_Info

* MM_30476 : ADDED documentations for default schema

* MM_30476 : Documentation [ IN PROGRESS ]

- Following JSDoc syntax for single line comment
- Removed redundant fields in the 'membership' tables and left only the @relation records.

* MM_30476 : Documentations [ IN PROGRESS ]

* MM_30476 : Documentations [ IN PROGRESS ]

* MM_30476 : Documentations [ IN PROGRESS ]

* MM_30476 : Documentations [ IN PROGRESS]

Updated
1)  my_team and team,
2) my_channel and  channel,

to each have 1:1 relationship  with one another

* MM_30476 : Updated all Typescript definitions

* MM_30476 :Updated @relation to @immutableRelation

* MM_30476 : Updated description for previous_post_id

* MM_30478 : Updated patch package for wdb module

* MM_30478: DB Manager [IN PROGRESS ]

* MM_30478: DB Manager [IN PROGRESS]

* MM_30478: DB Manager [IN PROGRESS]

* MM_30478 : DB Manager [IN PROGRESS]

* MM_30478 : Deleting .db file on iOS

* MM_30478: Successfully deleting .db files and directory on iOS side

* MM_30478 : Update definition for default/global

* MM_30478 : Updated all models

* MM_30478 : Doing a bit of house cleaning

* MM_30478: Record of new server connection  added to default/servers db

* TS Definitely Typed Assignment issue is now FIXED

* MM_30478 : TS Definitely Typed Assignment \n  Removed all the constructors but error still in editor tabs.  But this time the app is not crashing

* MM_30478 : Attempt 1 [SUCCESSFUL]

* MM_30478 : Removing useDefineForClassFields

* MM_30478 : Retrieving the servers in a list + Improved the DB Manager and Babel config

* MM_30478 : Updated babel.config.js

* MM_30478 : Minor UI correction

* MM_30478 : Jest and Typescript configuration

* MM_30478 : A bit of housekeeping

* MM_30478 : Installed WDB on Android

* MM_30478 : Deletes new server record from default DB

* MM_30478 : Returns subset of server db instances

* MM_30478 : Code clean up

* MM_30478 :  Code clean up on db manager

* MM_30478 : House keeping + Patch for WDB

* MM_30478 : Android - Saving & Deleting in FilesDir [COMPLETED]

* MM_30478 : Code clean up

* MM_30478 : Code clean up

* MM_30478 : Code clean up

* MM_30478 : Test successful on Android device

* MM_30478 : Rolling back change to jest.config.js

* MM_30478 : Updated test to test_integration

* MM_30478 : Fix imports

* MM_30478 : Refactored the manual testscript

* MM_30478 : Renamed database manager test file

* MM_30478 : Code clean up

* MM_30478 : Updated manual test file with a note.

* MM_30482 : DataOperator [ IN PROGRESS ]

* MM_30482 : DataOperator - setting up the factory [ IN PROGRESS ]

* MM_30482: Code refactoring

* MM_30482 : DataOperator - setting up the factory [ IN PROGRESS ]

* MM_30482 : DataOperator - code clean up [ IN PROGRESS ]

* MM_30482 : Minor code clean up

* MM_30478 : Fixed JEST issue with TS

* MM_30478 : Fixed JEST issue with TS

* MM_30478 : Fixed JEST issue with TS

* MM_30478 : Implementing JEST test cases

* MM_30478 : Implementing JEST last  test cases

* MM_30478 : Jest fixing ts errors

* MM_30478 : Database Manager Jest testing [ IN PROGRESS ]

* MM_30482 - Fixing DataOperator [ IN PROGRESS ]

* MM_30482 : Code clean up

* MM_30482 - Creates multiple records [ IN PROGRESS ]

* MM_30482 - Creates multiple records [ IN PROGRESS ]

* MM_30482 : Update operation [ COMPLETED ]

* MM_30482 : Code clean up

* MM_30482 : Updated TS for Data Operator

* Update mobile v2 detox deps

* MM_30482 : Added factories for all isolated tables

* MM_30482 : Refactored TS

* MM_30482 : Refactored base factory

* MM_30482 : Updated JSDoc for operateBaseRecord - Delete CASE

* MM_30482 : Implementing test for Data Operator

* MM_30482 : Completed tests for all isolated tables

* MM_30482 : Renamed entity_factory into operators

* MM_30482 : Fix all imports

* MM_30482 : Update multiple records

* MM_30482 : Edge case for existing records ( update instead of create )

* MM_30482 : Edge case  - create instead of update

* MM_30482 : Code clean up

* MM_30482 : Code clean up

* MM_30482 : Code clean up

* MM_30482 : Code clean up

* Update app/database/admin/data_operator/operators.ts

Co-authored-by: Joseph Baylon <joseph.baylon@mattermost.com>

* Update app/database/admin/data_operator/operators.ts

Co-authored-by: Joseph Baylon <joseph.baylon@mattermost.com>

* Update app/database/admin/data_operator/operators.ts

Co-authored-by: Joseph Baylon <joseph.baylon@mattermost.com>

* MM_30482 : Imposing usage of correct table name for isolated entities

* MM_30482 : Code improvement as per Joseph reviews

* MM_30482 : Updated tests to validate choice of operator service wrt tableName

* MM_30482 : Updated PR as per suggestions

* MM_30482 : Updated comments to follow jsdoc conventions

* MM_33223 : Renamed DBInstance to DatabaseInstance

* MM_33223 : ADDED Prettier

* MM_33223 - Prettier formatting

* MM_33223 : Prettier formatting

* MM_33223 - Post section [ in progress ]

* MM_33223 : PostsInThread [99% completed ]

* MM_33223: Reaction entity completed

* MM_33223: Added Reaction to the Post

* MM_33223 : Refactored reactions utils

* MM_33223 : Added previous post id to all posts

* MM_33223 : Added File Metadata

* MM_33223 : Code clean up

* MM_33223 : Added PostMetadata

* MM_33223 : Added Draft

* MM_33223 - Removed Prettier

* MM_33223 - Undo files changes due to Prettier

* MM_33223 : Making use of MM eslint plugins

* MM_33223 : PostsInChannel [ IN PROGRESS ]

* MM_33223 : Including update_at in Post schema

* MM_33223: Code clean up

* MM_33223: Code clean up

* MM_33223 : Code clean up

* MM_33223: Testing Reaction [IN PROGRESS]

* MM_33223 : Updated typings for RawCustomEmoji in Reactions

* MM_33223 : Refactored DataOperator test

* MM_33223 : Jest - handleReactions - Completed

* MM_33223 : Jest - HandleDraft - Completed

* MM_33223 : Jest - HandleFiles - Completed

* MM_33223 : Refactored DataOperator-PostMetadata

* MM_33223 : Jest - HandlePostMetadata - Completed

* MM_33223 : Refactored posts into ordered and unordered

* MM_33223 : Refactoring + Jest Utils [ IN PROGRESS ]

* MM_33223 - Jest Utils - Completed

* MM_33223 : Jest - Remaining operators - Completed

* MM_33223 : Jest - Handler PostsInThread - Completed

* MM_33223 : Jest - HandlePostsInChannel - Completed

* MM_33223 : Refactored DataOperator class

* MM_33223 : DataOperator test clean up

* MM_33223 : DataOperator code clean up

* MM_33223 : Jest - HandlePosts - Completed

* MM_33223: JSDoc - Operators - Completed

* MM_33223 : Refactoring file types.ts

* MM_33223 : Refactored import statements

* MM_33223 : Added @database alias

* MM_33223 : Added missing JSDoc

* MM_33223 : Minor code clean up

* MM_33223 : Lint fixed

* MM_33223 : Disable eslint rules for Notification

* MM_33223 : Disable eslint rule for screens

* Update app/database/admin/data_operator/index.ts

Co-authored-by: Miguel Alatzar <migbot@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Miguel Alatzar <migbot@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Miguel Alatzar <migbot@users.noreply.github.com>

* MM_33223 : Update data_operatator as per suggestion

* MM_33226: Removed optType

* MM_33226 : ADDED User Handler+Operator+Jest, Included update_at field for User

* MM_33226 :  Preference entity - Completed

* MM_33226 : Team Membership entity - Completed

* MM_33226 : Team Membership - Jest - Completed

* MM_33226 : Removing duplicates for TeamMembership and Preferences

* MM_33226 : Refactored Custom Emojis to remove duplicates

* MM_33226 : Group Membership - Completed

* MM_33226 :  ChannelMembership - Completed

* MM_33226 : Refactored some handlers whose response have no Ids

* MM_33226 : Refactoring - in progress

* MM_33226 : Refactoring - in progress

* MM_33226 : Refactoring - in progress

* MM_33226 : Code clean up

* MM_33226 : Polishing Operator tests

* MM_33226 : Removing redundant test cases

* MM_33226 : Polishing Operators

* MM_33226 : Testing for duplicate post id in Raw  values

* MM_33226 : Including some error-throwing in the Database Manager

* MM_33226 : Merged in DataOperator/Post-section

* MM_33226 : Fixing the merging issues

* MM_33226 : fixing merge issues

* MM_33226 : Code polishing

* MM_33226 : Enabling user notify props comment

* MM_33226 : Correcting type casting

* MM_33226 : Correcting data operators

* MM_33225 : Group - Completed

* MM_33225 : GroupsInTeam - Completed

* MM_33225 : GroupsInChannel - Completed

* MM_33226 : Corrections

* MM_33225: Adding a todo comment

* MM_33225 : Added a todo for the Group section operator

* MM_33226 : Code clean up

* MM_33226 : Rename oneOfField to fieldName

* MM_33226 : Renaming comparators to Boolean name and oneOfField to fieldName

* MM_33226 : Putting back custom emoji into handleIsolatedEntity

* MM_33226 : Comparing simple arrays

* MM_33226 : Renaming DiscardDuplicates to ProcessInputs

* MM_33226 : Sort imports

* MM_33225 : Renamed some Group comparators

* MM_33226 : Types clean up

* MM_33225 : Types clean up

* MM_33225 : Further clean up

Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
Co-authored-by: Avinash Lingaloo <>
Co-authored-by: Joseph Baylon <joseph.baylon@mattermost.com>
Co-authored-by: Miguel Alatzar <migbot@users.noreply.github.com>
2021-04-02 00:55:33 +04:00
Avinash Lingaloo
e3f7c178bb MM_33226 [v2] DataOperator - User section (#5255)
* MM_30475 : ADDED default schema

* MM_30475 : ADDED todo for field 'value' of default/Global entity

* MM_30476 : Created schema for SERVER DB

* MM_30476 : Server model [ IN PROGRESS ]

* MM_30476 : Including types for group, groups_in_channel and role

* MM_30476 : ADDED models for Group

- @typings absolute path has been added to the tsconfig.json

* MM_30476 : ADDED typings to current models

* MM_30476 : ADDED typings to current models

* MM_30476 : ADDED models related to TEAM section of the ERD

* MM_30476 : ADDED models for User section of the ERD

* MM_30476 : ADDED models for POST section of the ERD

* MM_30476 : ADDED models for Channel section of the ERD

* MM_30475 : Updated typings and references to MM_TABLES

* MM_30476 : Verified all field names

* MM_30476 : Verified every table associations

* MM_30476 : Verified all relation fields

* MM_30476 : Updated primary id of the main models

We will override the wdb id at component level when we create a new records.  This involves the models : channel, group, post, team and user.

* MM_30476 : Including 1:1 relationship amongs some entities

* MM_30476 : ADDED Schema Managers

* The migration array will hold all the migration steps.

*  The initial app release (e.g. v2 )will have an empty array and subsequent releases  (e.g.  v2.1 ) will have the steps listed in that array.

* On initialization, the database will perform the migration to accomodate for new columns/tables creation and while it will conserve the mobile phone's data, it will also make it conform to this new schema.

* If a migration fails, the migration process will rollback any changes.  This migration will be thoroughly tested in development before pushing it live.

* Revert "MM_30476 : ADDED Schema Managers"

This reverts commit a505bd5e11.

* MM_30478 : Converted schema_manager into a function

* MM_30478 : Updated schema manager and included patch for wdb

* MM_30478:  Updated watermelondb patch package

* MM_30478 : Update function create_schema_manager to createSqliteAdaptorOptions

* MM_30476 : Update constant name to reflect directory name

* MM_30476 : Updated msgCount from my_channel model to message_count in server schema

* MM_30482 : Added tests for schema_manager

* MM_30482 : Database Manager [ IN PROGRESS ]

* MM_30478 : Returning an sqliteAdapter instead of an object

* MM_30476 : Apply suggestions from code review

Co-authored-by: Elias Nahum <nahumhbl@gmail.com>

* MM_30476 : Updated all imports as per instruction.

* MM_30476 : Shortening object chains by destructuring

* MM_30476 : Updated schema file structure

* MM_30476 : Prettifying @typings folder

* MM_30476 : Removing useless ids

* MM_30476 : Prettify imports for decorators

* MM_30476 : ADDED documentations and lazy queries to Channel and Channel_Info

* MM_30476 : ADDED documentations for default schema

* MM_30476 : Documentation [ IN PROGRESS ]

- Following JSDoc syntax for single line comment
- Removed redundant fields in the 'membership' tables and left only the @relation records.

* MM_30476 : Documentations [ IN PROGRESS ]

* MM_30476 : Documentations [ IN PROGRESS ]

* MM_30476 : Documentations [ IN PROGRESS ]

* MM_30476 : Documentations [ IN PROGRESS]

Updated
1)  my_team and team,
2) my_channel and  channel,

to each have 1:1 relationship  with one another

* MM_30476 : Updated all Typescript definitions

* MM_30476 :Updated @relation to @immutableRelation

* MM_30476 : Updated description for previous_post_id

* MM_30478 : Updated patch package for wdb module

* MM_30478: DB Manager [IN PROGRESS ]

* MM_30478: DB Manager [IN PROGRESS]

* MM_30478: DB Manager [IN PROGRESS]

* MM_30478 : DB Manager [IN PROGRESS]

* MM_30478 : Deleting .db file on iOS

* MM_30478: Successfully deleting .db files and directory on iOS side

* MM_30478 : Update definition for default/global

* MM_30478 : Updated all models

* MM_30478 : Doing a bit of house cleaning

* MM_30478: Record of new server connection  added to default/servers db

* TS Definitely Typed Assignment issue is now FIXED

* MM_30478 : TS Definitely Typed Assignment \n  Removed all the constructors but error still in editor tabs.  But this time the app is not crashing

* MM_30478 : Attempt 1 [SUCCESSFUL]

* MM_30478 : Removing useDefineForClassFields

* MM_30478 : Retrieving the servers in a list + Improved the DB Manager and Babel config

* MM_30478 : Updated babel.config.js

* MM_30478 : Minor UI correction

* MM_30478 : Jest and Typescript configuration

* MM_30478 : A bit of housekeeping

* MM_30478 : Installed WDB on Android

* MM_30478 : Deletes new server record from default DB

* MM_30478 : Returns subset of server db instances

* MM_30478 : Code clean up

* MM_30478 :  Code clean up on db manager

* MM_30478 : House keeping + Patch for WDB

* MM_30478 : Android - Saving & Deleting in FilesDir [COMPLETED]

* MM_30478 : Code clean up

* MM_30478 : Code clean up

* MM_30478 : Code clean up

* MM_30478 : Test successful on Android device

* MM_30478 : Rolling back change to jest.config.js

* MM_30478 : Updated test to test_integration

* MM_30478 : Fix imports

* MM_30478 : Refactored the manual testscript

* MM_30478 : Renamed database manager test file

* MM_30478 : Code clean up

* MM_30478 : Updated manual test file with a note.

* MM_30482 : DataOperator [ IN PROGRESS ]

* MM_30482 : DataOperator - setting up the factory [ IN PROGRESS ]

* MM_30482: Code refactoring

* MM_30482 : DataOperator - setting up the factory [ IN PROGRESS ]

* MM_30482 : DataOperator - code clean up [ IN PROGRESS ]

* MM_30482 : Minor code clean up

* MM_30478 : Fixed JEST issue with TS

* MM_30478 : Fixed JEST issue with TS

* MM_30478 : Fixed JEST issue with TS

* MM_30478 : Implementing JEST test cases

* MM_30478 : Implementing JEST last  test cases

* MM_30478 : Jest fixing ts errors

* MM_30478 : Database Manager Jest testing [ IN PROGRESS ]

* MM_30482 - Fixing DataOperator [ IN PROGRESS ]

* MM_30482 : Code clean up

* MM_30482 - Creates multiple records [ IN PROGRESS ]

* MM_30482 - Creates multiple records [ IN PROGRESS ]

* MM_30482 : Update operation [ COMPLETED ]

* MM_30482 : Code clean up

* MM_30482 : Updated TS for Data Operator

* Update mobile v2 detox deps

* MM_30482 : Added factories for all isolated tables

* MM_30482 : Refactored TS

* MM_30482 : Refactored base factory

* MM_30482 : Updated JSDoc for operateBaseRecord - Delete CASE

* MM_30482 : Implementing test for Data Operator

* MM_30482 : Completed tests for all isolated tables

* MM_30482 : Renamed entity_factory into operators

* MM_30482 : Fix all imports

* MM_30482 : Update multiple records

* MM_30482 : Edge case for existing records ( update instead of create )

* MM_30482 : Edge case  - create instead of update

* MM_30482 : Code clean up

* MM_30482 : Code clean up

* MM_30482 : Code clean up

* MM_30482 : Code clean up

* Update app/database/admin/data_operator/operators.ts

Co-authored-by: Joseph Baylon <joseph.baylon@mattermost.com>

* Update app/database/admin/data_operator/operators.ts

Co-authored-by: Joseph Baylon <joseph.baylon@mattermost.com>

* Update app/database/admin/data_operator/operators.ts

Co-authored-by: Joseph Baylon <joseph.baylon@mattermost.com>

* MM_30482 : Imposing usage of correct table name for isolated entities

* MM_30482 : Code improvement as per Joseph reviews

* MM_30482 : Updated tests to validate choice of operator service wrt tableName

* MM_30482 : Updated PR as per suggestions

* MM_30482 : Updated comments to follow jsdoc conventions

* MM_33223 : Renamed DBInstance to DatabaseInstance

* MM_33223 : ADDED Prettier

* MM_33223 - Prettier formatting

* MM_33223 : Prettier formatting

* MM_33223 - Post section [ in progress ]

* MM_33223 : PostsInThread [99% completed ]

* MM_33223: Reaction entity completed

* MM_33223: Added Reaction to the Post

* MM_33223 : Refactored reactions utils

* MM_33223 : Added previous post id to all posts

* MM_33223 : Added File Metadata

* MM_33223 : Code clean up

* MM_33223 : Added PostMetadata

* MM_33223 : Added Draft

* MM_33223 - Removed Prettier

* MM_33223 - Undo files changes due to Prettier

* MM_33223 : Making use of MM eslint plugins

* MM_33223 : PostsInChannel [ IN PROGRESS ]

* MM_33223 : Including update_at in Post schema

* MM_33223: Code clean up

* MM_33223: Code clean up

* MM_33223 : Code clean up

* MM_33223: Testing Reaction [IN PROGRESS]

* MM_33223 : Updated typings for RawCustomEmoji in Reactions

* MM_33223 : Refactored DataOperator test

* MM_33223 : Jest - handleReactions - Completed

* MM_33223 : Jest - HandleDraft - Completed

* MM_33223 : Jest - HandleFiles - Completed

* MM_33223 : Refactored DataOperator-PostMetadata

* MM_33223 : Jest - HandlePostMetadata - Completed

* MM_33223 : Refactored posts into ordered and unordered

* MM_33223 : Refactoring + Jest Utils [ IN PROGRESS ]

* MM_33223 - Jest Utils - Completed

* MM_33223 : Jest - Remaining operators - Completed

* MM_33223 : Jest - Handler PostsInThread - Completed

* MM_33223 : Jest - HandlePostsInChannel - Completed

* MM_33223 : Refactored DataOperator class

* MM_33223 : DataOperator test clean up

* MM_33223 : DataOperator code clean up

* MM_33223 : Jest - HandlePosts - Completed

* MM_33223: JSDoc - Operators - Completed

* MM_33223 : Refactoring file types.ts

* MM_33223 : Refactored import statements

* MM_33223 : Added @database alias

* MM_33223 : Added missing JSDoc

* MM_33223 : Minor code clean up

* MM_33223 : Lint fixed

* MM_33223 : Disable eslint rules for Notification

* MM_33223 : Disable eslint rule for screens

* Update app/database/admin/data_operator/index.ts

Co-authored-by: Miguel Alatzar <migbot@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Miguel Alatzar <migbot@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Miguel Alatzar <migbot@users.noreply.github.com>

* MM_33223 : Update data_operatator as per suggestion

* MM_33226: Removed optType

* MM_33226 : ADDED User Handler+Operator+Jest, Included update_at field for User

* MM_33226 :  Preference entity - Completed

* MM_33226 : Team Membership entity - Completed

* MM_33226 : Team Membership - Jest - Completed

* MM_33226 : Removing duplicates for TeamMembership and Preferences

* MM_33226 : Refactored Custom Emojis to remove duplicates

* MM_33226 : Group Membership - Completed

* MM_33226 :  ChannelMembership - Completed

* MM_33226 : Refactored some handlers whose response have no Ids

* MM_33226 : Refactoring - in progress

* MM_33226 : Refactoring - in progress

* MM_33226 : Refactoring - in progress

* MM_33226 : Code clean up

* MM_33226 : Polishing Operator tests

* MM_33226 : Removing redundant test cases

* MM_33226 : Polishing Operators

* MM_33226 : Testing for duplicate post id in Raw  values

* MM_33226 : Including some error-throwing in the Database Manager

* MM_33226 : Merged in DataOperator/Post-section

* MM_33226 : Fixing the merging issues

* MM_33226 : fixing merge issues

* MM_33226 : Code polishing

* MM_33226 : Enabling user notify props comment

* MM_33226 : Correcting type casting

* MM_33226 : Correcting data operators

* MM_33226 : Corrections

* MM_33226 : Code clean up

* MM_33226 : Rename oneOfField to fieldName

* MM_33226 : Renaming comparators to Boolean name and oneOfField to fieldName

* MM_33226 : Putting back custom emoji into handleIsolatedEntity

* MM_33226 : Comparing simple arrays

* MM_33226 : Renaming DiscardDuplicates to ProcessInputs

* MM_33226 : Sort imports

* MM_33226 : Types clean up

Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
Co-authored-by: Avinash Lingaloo <>
Co-authored-by: Joseph Baylon <joseph.baylon@mattermost.com>
Co-authored-by: Miguel Alatzar <migbot@users.noreply.github.com>
2021-04-02 00:26:05 +04:00
Avinash Lingaloo
040bf22264 MM_33223 [v2] Database Operator - Post section (#5227)
* MM_30475 : ADDED default schema

* MM_30475 : ADDED todo for field 'value' of default/Global entity

* MM_30476 : Created schema for SERVER DB

* MM_30476 : Server model [ IN PROGRESS ]

* MM_30476 : Including types for group, groups_in_channel and role

* MM_30476 : ADDED models for Group

- @typings absolute path has been added to the tsconfig.json

* MM_30476 : ADDED typings to current models

* MM_30476 : ADDED typings to current models

* MM_30476 : ADDED models related to TEAM section of the ERD

* MM_30476 : ADDED models for User section of the ERD

* MM_30476 : ADDED models for POST section of the ERD

* MM_30476 : ADDED models for Channel section of the ERD

* MM_30475 : Updated typings and references to MM_TABLES

* MM_30476 : Verified all field names

* MM_30476 : Verified every table associations

* MM_30476 : Verified all relation fields

* MM_30476 : Updated primary id of the main models

We will override the wdb id at component level when we create a new records.  This involves the models : channel, group, post, team and user.

* MM_30476 : Including 1:1 relationship amongs some entities

* MM_30476 : ADDED Schema Managers

* The migration array will hold all the migration steps.

*  The initial app release (e.g. v2 )will have an empty array and subsequent releases  (e.g.  v2.1 ) will have the steps listed in that array.

* On initialization, the database will perform the migration to accomodate for new columns/tables creation and while it will conserve the mobile phone's data, it will also make it conform to this new schema.

* If a migration fails, the migration process will rollback any changes.  This migration will be thoroughly tested in development before pushing it live.

* Revert "MM_30476 : ADDED Schema Managers"

This reverts commit a505bd5e11.

* MM_30478 : Converted schema_manager into a function

* MM_30478 : Updated schema manager and included patch for wdb

* MM_30478:  Updated watermelondb patch package

* MM_30478 : Update function create_schema_manager to createSqliteAdaptorOptions

* MM_30476 : Update constant name to reflect directory name

* MM_30476 : Updated msgCount from my_channel model to message_count in server schema

* MM_30482 : Added tests for schema_manager

* MM_30482 : Database Manager [ IN PROGRESS ]

* MM_30478 : Returning an sqliteAdapter instead of an object

* MM_30476 : Apply suggestions from code review

Co-authored-by: Elias Nahum <nahumhbl@gmail.com>

* MM_30476 : Updated all imports as per instruction.

* MM_30476 : Shortening object chains by destructuring

* MM_30476 : Updated schema file structure

* MM_30476 : Prettifying @typings folder

* MM_30476 : Removing useless ids

* MM_30476 : Prettify imports for decorators

* MM_30476 : ADDED documentations and lazy queries to Channel and Channel_Info

* MM_30476 : ADDED documentations for default schema

* MM_30476 : Documentation [ IN PROGRESS ]

- Following JSDoc syntax for single line comment
- Removed redundant fields in the 'membership' tables and left only the @relation records.

* MM_30476 : Documentations [ IN PROGRESS ]

* MM_30476 : Documentations [ IN PROGRESS ]

* MM_30476 : Documentations [ IN PROGRESS ]

* MM_30476 : Documentations [ IN PROGRESS]

Updated
1)  my_team and team,
2) my_channel and  channel,

to each have 1:1 relationship  with one another

* MM_30476 : Updated all Typescript definitions

* MM_30476 :Updated @relation to @immutableRelation

* MM_30476 : Updated description for previous_post_id

* MM_30478 : Updated patch package for wdb module

* MM_30478: DB Manager [IN PROGRESS ]

* MM_30478: DB Manager [IN PROGRESS]

* MM_30478: DB Manager [IN PROGRESS]

* MM_30478 : DB Manager [IN PROGRESS]

* MM_30478 : Deleting .db file on iOS

* MM_30478: Successfully deleting .db files and directory on iOS side

* MM_30478 : Update definition for default/global

* MM_30478 : Updated all models

* MM_30478 : Doing a bit of house cleaning

* MM_30478: Record of new server connection  added to default/servers db

* TS Definitely Typed Assignment issue is now FIXED

* MM_30478 : TS Definitely Typed Assignment \n  Removed all the constructors but error still in editor tabs.  But this time the app is not crashing

* MM_30478 : Attempt 1 [SUCCESSFUL]

* MM_30478 : Removing useDefineForClassFields

* MM_30478 : Retrieving the servers in a list + Improved the DB Manager and Babel config

* MM_30478 : Updated babel.config.js

* MM_30478 : Minor UI correction

* MM_30478 : Jest and Typescript configuration

* MM_30478 : A bit of housekeeping

* MM_30478 : Installed WDB on Android

* MM_30478 : Deletes new server record from default DB

* MM_30478 : Returns subset of server db instances

* MM_30478 : Code clean up

* MM_30478 :  Code clean up on db manager

* MM_30478 : House keeping + Patch for WDB

* MM_30478 : Android - Saving & Deleting in FilesDir [COMPLETED]

* MM_30478 : Code clean up

* MM_30478 : Code clean up

* MM_30478 : Code clean up

* MM_30478 : Test successful on Android device

* MM_30478 : Rolling back change to jest.config.js

* MM_30478 : Updated test to test_integration

* MM_30478 : Fix imports

* MM_30478 : Refactored the manual testscript

* MM_30478 : Renamed database manager test file

* MM_30478 : Code clean up

* MM_30478 : Updated manual test file with a note.

* MM_30482 : DataOperator [ IN PROGRESS ]

* MM_30482 : DataOperator - setting up the factory [ IN PROGRESS ]

* MM_30482: Code refactoring

* MM_30482 : DataOperator - setting up the factory [ IN PROGRESS ]

* MM_30482 : DataOperator - code clean up [ IN PROGRESS ]

* MM_30482 : Minor code clean up

* MM_30478 : Fixed JEST issue with TS

* MM_30478 : Fixed JEST issue with TS

* MM_30478 : Fixed JEST issue with TS

* MM_30478 : Implementing JEST test cases

* MM_30478 : Implementing JEST last  test cases

* MM_30478 : Jest fixing ts errors

* MM_30478 : Database Manager Jest testing [ IN PROGRESS ]

* MM_30482 - Fixing DataOperator [ IN PROGRESS ]

* MM_30482 : Code clean up

* MM_30482 - Creates multiple records [ IN PROGRESS ]

* MM_30482 - Creates multiple records [ IN PROGRESS ]

* MM_30482 : Update operation [ COMPLETED ]

* MM_30482 : Code clean up

* MM_30482 : Updated TS for Data Operator

* Update mobile v2 detox deps

* MM_30482 : Added factories for all isolated tables

* MM_30482 : Refactored TS

* MM_30482 : Refactored base factory

* MM_30482 : Updated JSDoc for operateBaseRecord - Delete CASE

* MM_30482 : Implementing test for Data Operator

* MM_30482 : Completed tests for all isolated tables

* MM_30482 : Renamed entity_factory into operators

* MM_30482 : Fix all imports

* MM_30482 : Update multiple records

* MM_30482 : Edge case for existing records ( update instead of create )

* MM_30482 : Edge case  - create instead of update

* MM_30482 : Code clean up

* MM_30482 : Code clean up

* MM_30482 : Code clean up

* MM_30482 : Code clean up

* Update app/database/admin/data_operator/operators.ts

Co-authored-by: Joseph Baylon <joseph.baylon@mattermost.com>

* Update app/database/admin/data_operator/operators.ts

Co-authored-by: Joseph Baylon <joseph.baylon@mattermost.com>

* Update app/database/admin/data_operator/operators.ts

Co-authored-by: Joseph Baylon <joseph.baylon@mattermost.com>

* MM_30482 : Imposing usage of correct table name for isolated entities

* MM_30482 : Code improvement as per Joseph reviews

* MM_30482 : Updated tests to validate choice of operator service wrt tableName

* MM_30482 : Updated PR as per suggestions

* MM_30482 : Updated comments to follow jsdoc conventions

* MM_33223 : Renamed DBInstance to DatabaseInstance

* MM_33223 : ADDED Prettier

* MM_33223 - Prettier formatting

* MM_33223 : Prettier formatting

* MM_33223 - Post section [ in progress ]

* MM_33223 : PostsInThread [99% completed ]

* MM_33223: Reaction entity completed

* MM_33223: Added Reaction to the Post

* MM_33223 : Refactored reactions utils

* MM_33223 : Added previous post id to all posts

* MM_33223 : Added File Metadata

* MM_33223 : Code clean up

* MM_33223 : Added PostMetadata

* MM_33223 : Added Draft

* MM_33223 - Removed Prettier

* MM_33223 - Undo files changes due to Prettier

* MM_33223 : Making use of MM eslint plugins

* MM_33223 : PostsInChannel [ IN PROGRESS ]

* MM_33223 : Including update_at in Post schema

* MM_33223: Code clean up

* MM_33223: Code clean up

* MM_33223 : Code clean up

* MM_33223: Testing Reaction [IN PROGRESS]

* MM_33223 : Updated typings for RawCustomEmoji in Reactions

* MM_33223 : Refactored DataOperator test

* MM_33223 : Jest - handleReactions - Completed

* MM_33223 : Jest - HandleDraft - Completed

* MM_33223 : Jest - HandleFiles - Completed

* MM_33223 : Refactored DataOperator-PostMetadata

* MM_33223 : Jest - HandlePostMetadata - Completed

* MM_33223 : Refactored posts into ordered and unordered

* MM_33223 : Refactoring + Jest Utils [ IN PROGRESS ]

* MM_33223 - Jest Utils - Completed

* MM_33223 : Jest - Remaining operators - Completed

* MM_33223 : Jest - Handler PostsInThread - Completed

* MM_33223 : Jest - HandlePostsInChannel - Completed

* MM_33223 : Refactored DataOperator class

* MM_33223 : DataOperator test clean up

* MM_33223 : DataOperator code clean up

* MM_33223 : Jest - HandlePosts - Completed

* MM_33223: JSDoc - Operators - Completed

* MM_33223 : Refactoring file types.ts

* MM_33223 : Refactored import statements

* MM_33223 : Added @database alias

* MM_33223 : Added missing JSDoc

* MM_33223 : Minor code clean up

* MM_33223 : Lint fixed

* MM_33223 : Disable eslint rules for Notification

* MM_33223 : Disable eslint rule for screens

* Update app/database/admin/data_operator/index.ts

Co-authored-by: Miguel Alatzar <migbot@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Miguel Alatzar <migbot@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Miguel Alatzar <migbot@users.noreply.github.com>

* MM_33223 : Update data_operatator as per suggestion

* Update app/database/admin/data_operator/index.ts

* MM_33223 : Removed OptType as the operator can do without it.

* MM_33223 : Code correction after review

* MM_33223 : Refactored Data Operator following reviews

* MM_33223 : Including a wrapper to DataOperator

* MM_33223 : Completing tests for wrapper

Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
Co-authored-by: Avinash Lingaloo <>
Co-authored-by: Joseph Baylon <joseph.baylon@mattermost.com>
Co-authored-by: Miguel Alatzar <migbot@users.noreply.github.com>
2021-03-26 19:23:32 +04:00
Avinash Lingaloo
d6a3504c08 MM_30482 [v2] DataOperator for all the isolated tables (#5182)
* MM_30475 : ADDED default schema

* MM_30475 : ADDED todo for field 'value' of default/Global entity

* MM_30476 : Created schema for SERVER DB

* MM_30476 : Server model [ IN PROGRESS ]

* MM_30476 : Including types for group, groups_in_channel and role

* MM_30476 : ADDED models for Group

- @typings absolute path has been added to the tsconfig.json

* MM_30476 : ADDED typings to current models

* MM_30476 : ADDED typings to current models

* MM_30476 : ADDED models related to TEAM section of the ERD

* MM_30476 : ADDED models for User section of the ERD

* MM_30476 : ADDED models for POST section of the ERD

* MM_30476 : ADDED models for Channel section of the ERD

* MM_30475 : Updated typings and references to MM_TABLES

* MM_30476 : Verified all field names

* MM_30476 : Verified every table associations

* MM_30476 : Verified all relation fields

* MM_30476 : Updated primary id of the main models

We will override the wdb id at component level when we create a new records.  This involves the models : channel, group, post, team and user.

* MM_30476 : Including 1:1 relationship amongs some entities

* MM_30476 : ADDED Schema Managers

* The migration array will hold all the migration steps.

*  The initial app release (e.g. v2 )will have an empty array and subsequent releases  (e.g.  v2.1 ) will have the steps listed in that array.

* On initialization, the database will perform the migration to accomodate for new columns/tables creation and while it will conserve the mobile phone's data, it will also make it conform to this new schema.

* If a migration fails, the migration process will rollback any changes.  This migration will be thoroughly tested in development before pushing it live.

* Revert "MM_30476 : ADDED Schema Managers"

This reverts commit a505bd5e11.

* MM_30478 : Converted schema_manager into a function

* MM_30478 : Updated schema manager and included patch for wdb

* MM_30478:  Updated watermelondb patch package

* MM_30478 : Update function create_schema_manager to createSqliteAdaptorOptions

* MM_30476 : Update constant name to reflect directory name

* MM_30476 : Updated msgCount from my_channel model to message_count in server schema

* MM_30482 : Added tests for schema_manager

* MM_30482 : Database Manager [ IN PROGRESS ]

* MM_30478 : Returning an sqliteAdapter instead of an object

* MM_30476 : Apply suggestions from code review

Co-authored-by: Elias Nahum <nahumhbl@gmail.com>

* MM_30476 : Updated all imports as per instruction.

* MM_30476 : Shortening object chains by destructuring

* MM_30476 : Updated schema file structure

* MM_30476 : Prettifying @typings folder

* MM_30476 : Removing useless ids

* MM_30476 : Prettify imports for decorators

* MM_30476 : ADDED documentations and lazy queries to Channel and Channel_Info

* MM_30476 : ADDED documentations for default schema

* MM_30476 : Documentation [ IN PROGRESS ]

- Following JSDoc syntax for single line comment
- Removed redundant fields in the 'membership' tables and left only the @relation records.

* MM_30476 : Documentations [ IN PROGRESS ]

* MM_30476 : Documentations [ IN PROGRESS ]

* MM_30476 : Documentations [ IN PROGRESS ]

* MM_30476 : Documentations [ IN PROGRESS]

Updated
1)  my_team and team,
2) my_channel and  channel,

to each have 1:1 relationship  with one another

* MM_30476 : Updated all Typescript definitions

* MM_30476 :Updated @relation to @immutableRelation

* MM_30476 : Updated description for previous_post_id

* MM_30478 : Updated patch package for wdb module

* MM_30478: DB Manager [IN PROGRESS ]

* MM_30478: DB Manager [IN PROGRESS]

* MM_30478: DB Manager [IN PROGRESS]

* MM_30478 : DB Manager [IN PROGRESS]

* MM_30478 : Deleting .db file on iOS

* MM_30478: Successfully deleting .db files and directory on iOS side

* MM_30478 : Update definition for default/global

* MM_30478 : Updated all models

* MM_30478 : Doing a bit of house cleaning

* MM_30478: Record of new server connection  added to default/servers db

* TS Definitely Typed Assignment issue is now FIXED

* MM_30478 : TS Definitely Typed Assignment \n  Removed all the constructors but error still in editor tabs.  But this time the app is not crashing

* MM_30478 : Attempt 1 [SUCCESSFUL]

* MM_30478 : Removing useDefineForClassFields

* MM_30478 : Retrieving the servers in a list + Improved the DB Manager and Babel config

* MM_30478 : Updated babel.config.js

* MM_30478 : Minor UI correction

* MM_30478 : Jest and Typescript configuration

* MM_30478 : A bit of housekeeping

* MM_30478 : Installed WDB on Android

* MM_30478 : Deletes new server record from default DB

* MM_30478 : Returns subset of server db instances

* MM_30478 : Code clean up

* MM_30478 :  Code clean up on db manager

* MM_30478 : House keeping + Patch for WDB

* MM_30478 : Android - Saving & Deleting in FilesDir [COMPLETED]

* MM_30478 : Code clean up

* MM_30478 : Code clean up

* MM_30478 : Code clean up

* MM_30478 : Test successful on Android device

* MM_30478 : Rolling back change to jest.config.js

* MM_30478 : Updated test to test_integration

* MM_30478 : Fix imports

* MM_30478 : Refactored the manual testscript

* MM_30478 : Renamed database manager test file

* MM_30478 : Code clean up

* MM_30478 : Updated manual test file with a note.

* MM_30482 : DataOperator [ IN PROGRESS ]

* MM_30482 : DataOperator - setting up the factory [ IN PROGRESS ]

* MM_30482: Code refactoring

* MM_30482 : DataOperator - setting up the factory [ IN PROGRESS ]

* MM_30482 : DataOperator - code clean up [ IN PROGRESS ]

* MM_30482 : Minor code clean up

* MM_30478 : Fixed JEST issue with TS

* MM_30478 : Fixed JEST issue with TS

* MM_30478 : Fixed JEST issue with TS

* MM_30478 : Implementing JEST test cases

* MM_30478 : Implementing JEST last  test cases

* MM_30478 : Jest fixing ts errors

* MM_30478 : Database Manager Jest testing [ IN PROGRESS ]

* MM_30482 - Fixing DataOperator [ IN PROGRESS ]

* MM_30482 : Code clean up

* MM_30482 - Creates multiple records [ IN PROGRESS ]

* MM_30482 - Creates multiple records [ IN PROGRESS ]

* MM_30482 : Update operation [ COMPLETED ]

* MM_30482 : Code clean up

* MM_30482 : Updated TS for Data Operator

* Update mobile v2 detox deps

* MM_30482 : Added factories for all isolated tables

* MM_30482 : Refactored TS

* MM_30482 : Refactored base factory

* MM_30482 : Updated JSDoc for operateBaseRecord - Delete CASE

* MM_30482 : Implementing test for Data Operator

* MM_30482 : Completed tests for all isolated tables

* MM_30482 : Renamed entity_factory into operators

* MM_30482 : Fix all imports

* MM_30482 : Update multiple records

* MM_30482 : Edge case for existing records ( update instead of create )

* MM_30482 : Edge case  - create instead of update

* MM_30482 : Code clean up

* MM_30482 : Code clean up

* MM_30482 : Code clean up

* MM_30482 : Code clean up

* Update app/database/admin/data_operator/operators.ts

Co-authored-by: Joseph Baylon <joseph.baylon@mattermost.com>

* Update app/database/admin/data_operator/operators.ts

Co-authored-by: Joseph Baylon <joseph.baylon@mattermost.com>

* Update app/database/admin/data_operator/operators.ts

Co-authored-by: Joseph Baylon <joseph.baylon@mattermost.com>

* MM_30482 : Imposing usage of correct table name for isolated entities

* MM_30482 : Code improvement as per Joseph reviews

* MM_30482 : Updated tests to validate choice of operator service wrt tableName

* MM_30482 : Updated PR as per suggestions

* MM_30482 : Updated comments to follow jsdoc conventions

Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
Co-authored-by: Avinash Lingaloo <>
Co-authored-by: Joseph Baylon <joseph.baylon@mattermost.com>
2021-02-26 08:24:53 +04:00
Avinash Lingaloo
d88b0f30b3 MM_30478 [v2] Database Manager (#5130)
* MM_30475 : ADDED default schema

* MM_30475 : ADDED todo for field 'value' of default/Global entity

* MM_30476 : Created schema for SERVER DB

* MM_30476 : Server model [ IN PROGRESS ]

* MM_30476 : Including types for group, groups_in_channel and role

* MM_30476 : ADDED models for Group

- @typings absolute path has been added to the tsconfig.json

* MM_30476 : ADDED typings to current models

* MM_30476 : ADDED typings to current models

* MM_30476 : ADDED models related to TEAM section of the ERD

* MM_30476 : ADDED models for User section of the ERD

* MM_30476 : ADDED models for POST section of the ERD

* MM_30476 : ADDED models for Channel section of the ERD

* MM_30475 : Updated typings and references to MM_TABLES

* MM_30476 : Verified all field names

* MM_30476 : Verified every table associations

* MM_30476 : Verified all relation fields

* MM_30476 : Updated primary id of the main models

We will override the wdb id at component level when we create a new records.  This involves the models : channel, group, post, team and user.

* MM_30476 : Including 1:1 relationship amongs some entities

* MM_30476 : ADDED Schema Managers

* The migration array will hold all the migration steps.

*  The initial app release (e.g. v2 )will have an empty array and subsequent releases  (e.g.  v2.1 ) will have the steps listed in that array.

* On initialization, the database will perform the migration to accomodate for new columns/tables creation and while it will conserve the mobile phone's data, it will also make it conform to this new schema.

* If a migration fails, the migration process will rollback any changes.  This migration will be thoroughly tested in development before pushing it live.

* Revert "MM_30476 : ADDED Schema Managers"

This reverts commit a505bd5e11.

* MM_30478 : Converted schema_manager into a function

* MM_30478 : Updated schema manager and included patch for wdb

* MM_30478:  Updated watermelondb patch package

* MM_30478 : Update function create_schema_manager to createSqliteAdaptorOptions

* MM_30476 : Update constant name to reflect directory name

* MM_30476 : Updated msgCount from my_channel model to message_count in server schema

* MM_30482 : Added tests for schema_manager

* MM_30482 : Database Manager [ IN PROGRESS ]

* MM_30478 : Returning an sqliteAdapter instead of an object

* MM_30476 : Apply suggestions from code review

Co-authored-by: Elias Nahum <nahumhbl@gmail.com>

* MM_30476 : Updated all imports as per instruction.

* MM_30476 : Shortening object chains by destructuring

* MM_30476 : Updated schema file structure

* MM_30476 : Prettifying @typings folder

* MM_30476 : Removing useless ids

* MM_30476 : Prettify imports for decorators

* MM_30476 : ADDED documentations and lazy queries to Channel and Channel_Info

* MM_30476 : ADDED documentations for default schema

* MM_30476 : Documentation [ IN PROGRESS ]

- Following JSDoc syntax for single line comment
- Removed redundant fields in the 'membership' tables and left only the @relation records.

* MM_30476 : Documentations [ IN PROGRESS ]

* MM_30476 : Documentations [ IN PROGRESS ]

* MM_30476 : Documentations [ IN PROGRESS ]

* MM_30476 : Documentations [ IN PROGRESS]

Updated
1)  my_team and team,
2) my_channel and  channel,

to each have 1:1 relationship  with one another

* MM_30476 : Updated all Typescript definitions

* MM_30476 :Updated @relation to @immutableRelation

* MM_30476 : Updated description for previous_post_id

* MM_30478 : Updated patch package for wdb module

* MM_30478: DB Manager [IN PROGRESS ]

* MM_30478: DB Manager [IN PROGRESS]

* MM_30478: DB Manager [IN PROGRESS]

* MM_30478 : DB Manager [IN PROGRESS]

* MM_30478 : Deleting .db file on iOS

* MM_30478: Successfully deleting .db files and directory on iOS side

* MM_30478 : Update definition for default/global

* MM_30478 : Updated all models

* MM_30478 : Doing a bit of house cleaning

* MM_30478: Record of new server connection  added to default/servers db

* TS Definitely Typed Assignment issue is now FIXED

* MM_30478 : TS Definitely Typed Assignment \n  Removed all the constructors but error still in editor tabs.  But this time the app is not crashing

* MM_30478 : Attempt 1 [SUCCESSFUL]

* MM_30478 : Removing useDefineForClassFields

* MM_30478 : Retrieving the servers in a list + Improved the DB Manager and Babel config

* MM_30478 : Updated babel.config.js

* MM_30478 : Minor UI correction

* MM_30478 : Jest and Typescript configuration

* MM_30478 : A bit of housekeeping

* MM_30478 : Installed WDB on Android

* MM_30478 : Deletes new server record from default DB

* MM_30478 : Returns subset of server db instances

* MM_30478 : Code clean up

* MM_30478 :  Code clean up on db manager

* MM_30478 : House keeping + Patch for WDB

* MM_30478 : Android - Saving & Deleting in FilesDir [COMPLETED]

* MM_30478 : Code clean up

* MM_30478 : Code clean up

* MM_30478 : Code clean up

* MM_30478 : Test successful on Android device

* MM_30478 : Rolling back change to jest.config.js

* MM_30478 : Updated test to test_integration

* MM_30478 : Fix imports

* MM_30478 : Refactored the manual testscript

* MM_30478 : Renamed database manager test file

* MM_30478 : Code clean up

* MM_30478 : Updated manual test file with a note.

* MM_30478 : Fixed JEST issue with TS

* MM_30478 : Fixed JEST issue with TS

* MM_30478 : Fixed JEST issue with TS

* MM_30478 : Implementing JEST test cases

* MM_30478 : Implementing JEST last  test cases

* MM_30478 : Jest fixing ts errors

* MM_30478 : Database Manager Jest testing [ IN PROGRESS ]

* Update mobile v2 detox deps

* MM_30478 : Add uniqueness check for duplicates server creation

* MM_30478 : Corrections from Joseph reviews

Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
Co-authored-by: Avinash Lingaloo <>
Co-authored-by: Joseph Baylon <joseph.baylon@mattermost.com>
2021-02-12 00:52:23 +04:00
Avinash Lingaloo
619503eedb MM_30476 [v2] Section 'Channel' of the server schema (#5078)
* MM_30476 : Added all isolated tables from the server schema

* MM_30476 : Updated 'test' script in package.json

* MM_30476 : Rename table schemas to avoid name collision

* MM_30476 : Added 'Channel' section of the server schema

* MM_30476 : Apply suggestions from code review

Co-authored-by: Miguel Alatzar <migbot@users.noreply.github.com>

* MM_30476 : Converted @relation to @immutableRelation

* MM_30476 : Apply suggestions from code review

* MM_30476 : Apply suggestions from code review

Co-authored-by: Miguel Alatzar <migbot@users.noreply.github.com>

* MM_30476 : Minor updates to the comments

* MM_30476 : Minor update to the comments

* MM_30476 : Updated table schema exports

* MM_30476 : Updated comments

* MM_30476 : Apply suggestions from code review

Co-authored-by: Elias Nahum <nahumhbl@gmail.com>

* MM_30476 : Update as per suggestions

* MM_30476 : Updated comments

* MM_30476 : Team and MyTeam share 1:1 relationship

* MM_30476 : Updated team comments

* MM_30476 : Updated myteam and team comments

Co-authored-by: Miguel Alatzar <migbot@users.noreply.github.com>
Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
2021-01-15 18:41:59 +04:00
Avinash Lingaloo
98c89797a5 MM_30476 [v2] Section 'Post' of the server schema (#5077)
* MM_30476 : Added all isolated tables from the server schema

* MM_30476 : Updated 'test' script in package.json

* MM_30476 : ADDED team section of the server schema

* MM_30476 : ADDED section for Group from the server schema

* MM_30476 : One PR for one section only

* MM_30476 : One PR for one section only

* MM_30476 : Rename table schemas to avoid name collision

* MM_30476 : ADDED section 'Post' of the server schema

* MM_30476 : Updated Post section of the server schema

* MM_30476 : Apply suggestions from code review

Co-authored-by: Miguel Alatzar <migbot@users.noreply.github.com>

* MM_30476 : Corrected draft wrt to suggestions

* MM_30476 : Apply suggestions from code review

Co-authored-by: Elias Nahum <nahumhbl@gmail.com>

* MM_30476 : ADDED lazy queries to group_membership model

* MM_30476 : Update model to match definition - GroupsInChannel

* MM_30476 : Removed groups_in_team definition from Post section of this PR

* MM_30476 : Updated all comments to match their variable/field name

* MM_30476 : Updated test

* MM_30476 : Updated imports and groups_in_team definition

* MM_30476 : Updated FileInfo

* MM_30476 : Updated Posts and PostMetadata ts types

Co-authored-by: Miguel Alatzar <migbot@users.noreply.github.com>
Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
2021-01-14 16:41:53 -03:00
Avinash Lingaloo
237a6e7932 MM_30476 [v2] Section 'Group' of the server schema (#5072)
* MM_30476 : Added all isolated tables from the server schema

* MM_30476 : Updated 'test' script in package.json

* MM_30476 : ADDED team section of the server schema

* MM_30476 : ADDED section for Group from the server schema

* MM_30476 : One PR for one section only

* MM_30476 : One PR for one section only

* MM_30476 : Apply suggestions from code review

Co-authored-by: Elias Nahum <nahumhbl@gmail.com>

* MM_30476 : ADDED lazy queries to group_membership model

* MM_30476 : Update model to match definition - GroupsInChannel

* MM_30476 : Updated all comments to match their variable/field name

Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
2021-01-14 00:26:55 +04:00
Avinash Lingaloo
e471efa48f MM_30476 [v2] Section 'User' of the server schema (#5073)
* MM_30476 : Added all isolated tables from the server schema

* MM_30476 : Updated 'test' script in package.json

* MM_30476 : Added USER section of the server schema

* MM_30476 : Added the models index back

* MM_30476 : Updated User entity as per previous comments

* MM_30476 : Added lazy query to channel membership

* MM_30476 : Adjusted PR as per suggestions

* MM_30476 : Update nick_name in user model

Co-authored-by: Elias Nahum <nahumhbl@gmail.com>

* MM_30476 : Adjusted extra padding

* MM_30476 : Corrected ChannelMemberShipSchema to ChannelMembershipSchema

* MM_30476 : Updated types/database/index.ts to types/database/index.d.ts

Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
2021-01-13 13:17:38 -03:00
Avinash Lingaloo
89d4cf235f MM_30476 [v2] Section 'Team' of the Server schema (#5071)
* MM_30476 : Added all isolated tables from the server schema

* MM_30476 : Updated 'test' script in package.json

* MM_30476 : ADDED team section of the server schema

* MM_30476 : Apply suggestions from code review

Co-authored-by: Miguel Alatzar <migbot@users.noreply.github.com>

* MM_30476 : Apply suggestions from code review

Co-authored-by: Elias Nahum <nahumhbl@gmail.com>

* MM_30476 : Updates to field name and description

Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
Co-authored-by: Hossein <hahmadia@users.noreply.github.com>

* MM_30476 : Updated my_team and team_search_history description

* MM_30476 : Prefixing boolean fields with 'is'

* MM_30476 : Updated channel.d.ts

Co-authored-by: Hossein <hahmadia@users.noreply.github.com>
Co-authored-by: Elias Nahum <nahumhbl@gmail.com>

* MM_30476 : ADDED lazy queries to TeamMembership

Two methods that will retrieve all users in a team and all the teams that a user is part of

* MM_30476 : Updated descriptions for the associations

* MM_30476 : Updated tests as server schema was updated

* MM_30476 : Updated Team to have a 1:1 relationship with TeamChannelHistory

* MM_30476 : Updated team_membership and user

Co-authored-by: Miguel Alatzar <migbot@users.noreply.github.com>
Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
Co-authored-by: Hossein <hahmadia@users.noreply.github.com>
2021-01-11 21:54:33 +04:00
Avinash Lingaloo
3e8c275486 MM_30476 [v2] Added all isolated tables from the server schema (#5070)
* MM_30476 : Added all isolated tables from the server schema

* MM_30476 : Updated 'test' script in package.json

* MM_30476 : Rename table schemas to avoid name collision

* MM_30476 : ADDED @babel/plugin-tranform-flow-strip-types

* MM_30476 : ADDED test for default schema

* MM_30476 : ADDED tests to server schema

* MM_30476 : ADDED tests for models and schema

* MM_30476 : ADDED tests for models and schema

* MM_30476 : Removed the tests on the models.
2021-01-07 13:48:23 +04:00
Avinash Lingaloo
cc02c9b8cb MM_30476 : Updated all models and typings for the default server (#5069) 2020-12-29 23:01:54 +04:00
Avinash Lingaloo
2dfb3433c9 MM-30475 [v2] watermelondb default schema (#4977)
* MM_30475 : ADDED default schema

* MM_30475 : Updated typings and references to MM_TABLES

* MM_30475 : Removed the app_id (The id field will be overwritten at the time of creation.)

* MM_30475 : Updated PR as per comments
2020-11-24 13:58:20 +04:00