Commit graph

141 commits

Author SHA1 Message Date
Elias Nahum
298067ab65
Update react-native-cookies & react-native-webview + always use defaultDataStore (#5452)
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-06-15 18:40:35 -04:00
Elias Nahum
9f238d5ef4
Post List & post components refactored (#5409)
* Update transform to make Android's post list scroll smooth

* set start since metric when appStarted is false

* Refactor Formatted components

* Downgrade RNN to 7.13.0 & patch XCDYouTube to allow video playback

* Refactor Post list and all related components

* review suggestion rename hour12 to isMilitaryTime

* feedback review use aliases

* feedback review deconstruct actions in markdown_link

* feedback review simplify if/else statement in combined_used_activity

* Simplify if statement for consecutive posts

* Specify npm version to build iOS on CI

* Refactor network_indicator

* render Icon in file gallery with transparent background

* Increase timeout to scroll to bottom when posting a new message

* fix: scroll when tapping on the new messages bar

* fix: dismiss all modals

* fix navigation tests

* Handle dismissAllModals for iOS to prevent blank screens

* Prevent modal from dismissing when showing the thread screen in the stack

* Update app/components/image_viewport.tsx

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

* Update app/utils/post.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>

* fix: rename selector and prop

* Fix XCDYouTube patch

* Fix posting from a thread in the right channel

* do not render reply bar on the thread screen

* close previous permalink before showing a new one

* move XCDYouTube patch to ios/patches folder

* closePermalink directly instead of using an onClose prop

Co-authored-by: Miguel Alatzar <migbot@users.noreply.github.com>
Co-authored-by: Miguel Alatzar <this.migbot@gmail.com>
2021-06-03 11:12:15 -07:00
Elias Nahum
13eab98143
Refactor rest client class to use mixin and a bit of cleanup (#5318) 2021-04-15 10:04:36 -04:00
Elias Nahum
f8a0f29237
Update dependencies (#5266)
* Update dependencies

* Fix lint, use npm@6

* Fix unit tests

* Dowgrade Fastlane

* Fix Fastlane script

* use android:api-29-node ci image

* Infer gradle json file from apk output folder

* Fastlane to Parse new version of gradle output-metadata.json
2021-04-06 11:12:31 -04:00
Miguel Alatzar
7702c050bf
Revert "[MM-29225] Define LSApplicationQueriesSchemes so Linking.canO… (#5067)
* Revert "[MM-29225] Define LSApplicationQueriesSchemes so Linking.canOpenURL can work (#5007)"

This reverts commit f3baaa6aa3.

* Create and use tryOpenURL

* Add missing onError functions

* Update app/components/markdown/markdown_link/markdown_link.js

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

Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
2021-01-06 09:11:27 -07:00
Miguel Alatzar
f3baaa6aa3
[MM-29225] Define LSApplicationQueriesSchemes so Linking.canOpenURL can work (#5007)
* Revert "[MM-29225] Linking fix (#4860)"

This reverts commit a5cb92876c.

* Define LSApplicationQueriesSchemes
2020-12-09 13:42:21 -07:00
Elias Nahum
dcaaaee44c
MM-30164 fix safe area insets (#4979)
* MM-30164 fix safe area insets

* Fix unit test setup mock for react-native-device-info

* Add insets for edit profile screen

* Fix about screen

* Fix theme screen

* Lock phone screen to portrait

* fix unit tests

* Fix autocomplete layout
2020-11-23 20:10:09 -03:00
Elias Nahum
b226d451f3
update dependencies (#4958)
* update dependencies

* revert keychain update

* Update dependencies & Fastlane

* set path agnostic for bash in scrips

* Fix open from push notification race

* patch react-native-localize
2020-11-18 19:45:07 -07:00
Elias Nahum
dbd7bc8a51
Gallery Improvements (#4837)
* Open/Close Gallery transitions

* Include postId in file info & disable opening the gallery in some cases

* Add progress bar component

* Transition to gallery based on platform

* Improve getting the filename for non attachments

* Patch RNFetchBlob TS definition

* Add gallery types

* fix unit tests for message and post attachment

* add getLocalPath method

* Add react-native-share dependency

* Re-style gallery footer

* Refactor Gallery screen

* Double tap zoom in/out and translate

* Make android activity "transparent"

* Do not animate to height on dismissing gallery

* Open gallery for file uploads

* Fix borderRadius for gallery action button

* Use progress bar for file uploads

* Replace progress bar for file attachment document

* Upgrade RNN to 7.1.0 to fix share elements transitions

* Fix Gallery unit tests

* translate down when popping screen on iOS

* Swipe, Pan & Tap fixes

* fix gallery footer avatar eslint

* Fix gallery snapshot tests

* Use CompassIcon in Gallery

* Feedback from UX review

* Fix gallery UI for other file types

* Set other file type gallery button to 48pt
2020-11-06 21:17:27 -03:00
Elias Nahum
e57bcfdaba
MM-30101 Match channel specific global notification preference (#4935)
* MM-30101 Match channel specific global notification preference

* Avoid crash if globalNotifyProps is undefined
2020-11-03 11:59:17 -07:00
Elias Nahum
30d4aa2a3e
Build Improvements (#4884)
* Use AppGroupId from Info.plists instead of hardcoded constant

* Update script, ci & Makefile

* Update Cocoapods to 1.9.3

* Split android builds using ABI filters

* Update Fastlane deps & build scripts

* Update CI to use latests scripts

* Display app version & build number in select server screen

* Make generate scripts compatible with node < 12

* Build scripts

* add build script to package.json

* Update to use bundler 2.1.4 and CI with Xcode 12

* Fix script name for build:ios-unsigned

* Fix RN iOS scripts

* Update CI pods-dependencies step

* Add pipefail to android executor

* Update Fastlane

* Fix type in postinstall script

* update android executor and set TERM

* Fix S3 bucket name variable

* Apply suggestions from code review

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

* Fix master unit tests

* use requireActual in jest setup

* Jest setup to use react instead of React

Co-authored-by: Miguel Alatzar <migbot@users.noreply.github.com>
2020-10-15 22:09:36 -03:00
Ashish Bhate
3988e64d22
MM-29039: unit and e2e tests for #4821 (#4879)
* MM-29039: unit and e2e tests for #4821

* add e2e test

* Apply suggestions from code review

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

* use suggested test libs

* move mock to test setup

* update snapshot for new mock

Co-authored-by: Joseph Baylon <joseph.baylon@mattermost.com>
2020-10-15 09:27:28 -07:00
Miguel Alatzar
a5cb92876c
[MM-29225] Linking fix (#4860)
* Catch openURL over checking canOpenURL

* Update en.json
2020-10-02 10:01:44 -07:00
Saturnino Abril
6e03ba8351
reintroduce @testing-library/react-native now with v7 (#4766) 2020-09-15 09:24:54 -07:00
Elias Nahum
48f1875cf1
MM-23090 MM-26078 && MM-26876 Refactor post draft component (#4621)
* Refactor post draft component
Re-styled ReadOnly channels
Remove filename from upload error

* Update canSubmit based on file attachment changes

* Fix error message for max file size

* Fix select autocomplete values on iOS

* Style readonly and refactor accessory view for iOS

* Make PostDraft scrollViewNativeID prop not required

* Update ReadOnly to have a background with 0.40 opacity

* Update max file size error message

* Fix shift+enter with HW keyboard
2020-08-06 19:39:25 -04:00
Elias Nahum
320ec7029c
MM-26722 check for switchKeyboardForCodeBlocks only on iOS 12+ (#4537) 2020-07-07 13:01:48 -04:00
Elias Nahum
30cd64b38b
Revert updated dependecies for SSO (#4499)
* Revert updated dependecies for SSO

* Fix test setup
2020-06-26 21:50:53 -04:00
Elias Nahum
023109e250
Fix SSO and clear cookies (#4422)
* Fix SSO and clear cookies

* Fix unit tests

* Removed unnecessary argument

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

Co-authored-by: Miguel Alatzar <migbot@users.noreply.github.com>
2020-06-15 14:00:13 -04:00
Elias Nahum
a9763c7480
Do not preload images with FastImage (#4314) 2020-05-20 15:47:06 -04:00
Elias Nahum
d3a6e166ad
MM-15758 Update dependencies including Fastlane (#4272)
* Update dependencies including Fastlane and disable Flipper on iOS

* Remove EventEmitter for previous doc-viewer

* Fix android crash when setting more channels buttons

* Downgrade fuse.js

* Upgrade deps to latest

* Update Podfile.lock

* Downgrade RNN to 6.4.0

* QA Review #2

* Upgrade fuse.js to 6.0.0
2020-05-18 11:24:47 -07:00
Elias Nahum
36e55c95a2
MM-23570 Migrate from Segment to Rudder (#4293)
* Replace Segment with Rudder (ios not working)

* Update @assets reference and fix tests
2020-05-13 16:54:07 -04:00
Elias Nahum
9af108026e
MM-24285 Use FastImage instead of Image (#4218)
* Enable ESLint no-unused-vars

* Use FastImage instead of Image

* Update fast-image patch to support multiple cookies

* Fix ESLint errors

* Have jest run timers for post_textbox tests

* Feedback review

* Update snapshots
2020-04-28 23:23:39 +08:00
Elias Nahum
fda4948c8c
MM-23848 consolidate store, upgrade mmkv and fix logout (#4145)
* MM-23848 consolidate store, upgrade mmkv and fix logout

* Feedback review

* Add store.ts to modulesPath
2020-04-16 09:02:47 -04:00
Miguel Alatzar
7afa9aed01
[MM-23698] [MM-19559] Remove redux-offline and updated redux-persist (#4120)
* Remove redux-offline and configure redux-persist

* Fix typo

* Fix configure store

* Upgrade to redux-persist 6.0.0

* Add migration from redux-persist v4 to v6

* Replace AsyncStorage with MMKVStorage to boost storage speed

* Mock RNFastStorage

* Fix reactions test

* Fix clearing the store on logout

* Remove the need for LOGOUT_SUCCESS

* No need to pass persistConfig to middlewares()

* Remove unused imports

* Export connection

Accidentally removed this export.

* Add batch action name

Co-Authored-By: Elias Nahum <nahumhbl@gmail.com>

* Add batch action name

Co-Authored-By: Elias Nahum <nahumhbl@gmail.com>

* Add batch action name

Co-Authored-By: Elias Nahum <nahumhbl@gmail.com>

* Add batch action name

Co-Authored-By: Elias Nahum <nahumhbl@gmail.com>

* Fix delete post

* Fix leave channel

Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
2020-04-08 13:44:54 -07:00
Miguel Alatzar
ee4b85edcf
[MM-23520] Port mattermost-redux (#4088)
* Remove mattermost-redux

* Move mm-redux files into app/redux

* Add @redux path to tsconfig.json

* Fix imports

* Install missing dependencies

* Fix tsc errors

* Fix i18n_utils test

* Fix more imports

* Remove redux websocket

* Fix tests

* Rename @redux

* Apply changes from mattermost-redux PR 1103

* Remove mattermost-redux mention in template

* Add missing imports

* Rename app/redux/ to app/mm-redux/

* Remove test file

* Fix fetching Sidebar GM profiles

Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
2020-03-31 11:09:26 -07:00
Elias Nahum
10d433cfab
Port WebSocket from mm-redux and batch actions (#4060)
* Port WebSocket from mm-redux and batch actions

* Update mm-redux and fix tests

* Change action name

* Naming batch actions

* Fix unit tests

* Dispatch connection change only if its different

* Remove comment

* Add Lint to TypeScript and fix linting errors

* Add WebSocket Unit Tests

* Revert from unwanted RN 0.62
2020-03-26 21:23:50 -03:00
Elias Nahum
334a07aabe
Performance improvements (#3911)
* Improve sidebar performance on first load

* Initial work for switch channel

* Revert android changes

* Split Sidebar per Platform

* Fix waitForHydration executing the callback more than once

* Fix custom emoji not showing on Android

* Finalize Channel Switch

* Enable Android Ram Bundles

* Select the right team for lastChannelForTeam

* Channel loading post indicator

* Fix main sidebar base intl provider

* Update mm-redux

* No need to request configAndLicense on launch

* Load channel member roles

* Rename closeChannelDrawer to closeMainSidebar

* do not throw errors when console is called while running tests

* constant for LOADING_POSTS_HEIGHT

* Remove show more if a long post is edited and no longer long

* Update mm-redux#batch-actions branch

* Code review

* Clear notifications if channel was switched

* Import Platform

Co-authored-by: Miguel Alatzar <migbot@users.noreply.github.com>
2020-02-17 21:18:09 -07:00
Miguel Alatzar
d25561bb83 [MM-21888] Don't use localPath when it's the share extension cache dir (#3845)
* Don't use localPath when it's the share extension cache dir

* Move android pasted images to cache image folder

* Use Files.move instead of FileInput / FileOutput stream

* Remove commented code and not needed imports
2020-01-27 13:58:30 -03:00
Elias Nahum
7c09334dc4
Deps update (#3806)
* Dependecy updates

* Update dependencies
2020-01-20 13:20:03 -03:00
Nick Brady
a0c5ad5c2b MM-18530 - Update Main Sidebar on iOS (#3622)
* initial working code

* minimum changes for main sidebar working

* add settings sidebar back in

* fix visual bug with sidebar showing underneath

* fix bug for android

* cleanups

* minor cleanups and update snapshot

* add basic test

* fix style errors

* review changes
2019-12-04 15:19:50 -03:00
Elias Nahum
59c8cbed55 MM-20780 MM-20782 Clear cookies on logout (#3645) 2019-12-03 08:33:09 +08:00
Miguel Alatzar
04210b8a14 [MM-19968] Ensure SELECT_CHANNEL_WITH_MEMBER is dispatched when app opened from a push notification (#3533)
* Dispatch SELECT_CHANNEL_WITH_MEMBER

* Call handleSelectChannel with true when from any push notification

* Always dispatch SELECT_CHANNEL_WITH_MEMBER with passed channelId

* Add missing comma

* Update unit tests

* Fix makrChannelViewedAndRead call
2019-11-12 17:45:11 -05:00
Miguel Alatzar
1efb01deda
[MM-16593] Upgrade to RN 0.61.2 (#3455)
* [MM-16593] [MM-17175] [MM-17164] [MM-17189] [MM-17181] Android - Upgrade to RN 0.60 (#3145)

* Upgrade to react-native 0.60

* Use @sentry/react-native

* Manually link @sentry/react-native

* Address review comments

* Jetify after install

* Call jetify from node_modules

* [MM-17785] iOS - Upgrade to RN 0.60 (#3153)

* Upgrade to react-native 0.60

* Use @sentry/react-native

* Manually link @sentry/react-native

* Address review comments

* Jetify after install

* Call jetify from node_modules

* Get app building for iOS

* Revert react-native-image-picker upgrade

* Minor version upgrade of react-native-image-picker

* [MM-17142] Convert all string refs to callbacks (#3217)

* Replace string refs

* Fix tests

* Don't use inline functions

* Fix mattermost-redux reversion from master merge

* [MM-18336] Upload Sentry debug symbols only when SENTRY_ENABLED is true (#3227)

* Upgrade @sentry/react-native

* Run Sentry gradle tasks only when enabled

* Upgrade @sentry/react-native and remove extra Sentry build phase

* [MM-17144] Use Hermes (#3226)

* Replace string refs

* Fix tests

* Don't use inline functions

* Fix mattermost-redux reversion from master merge

* Use Hermes

* bundleCommand ram-bundle no longer needed

* Require harmony-reflect only for Android

* Fix failing test

* Path react-native's splitLayoutProps (#3337)

* [MM-18867] [MM-17186] [MM-18866] [MM-19447] [MM-18967] Upgrade to RN 0.61.2 (#3423)

* Upgrade to RN 0.61.2

* Update rn-fetch-blob commit hash

* Update react-native-keyboard-tracking-view commit hash

* Use react-native-youtube with AVPlayer fix

* Fix jest mocks

* Use updated document picker API

* Remove unnecessary linking

* Revert "MM-17759 Add code highlighting (#3072)"

This reverts commit 26b999e885.

* Fix share extension

* Revert "Revert "MM-17759 Add code highlighting (#3072)""

This reverts commit 52aca776b12dee3abe8646d0c90480f8528e86c1.

* Address PR reviews

* Rename patch to match version

* Update react-native-youtube patch

* Update dependencies

* Fix RNDocViewer reference

* Update tests and revert to redux-persist 4.10.2

* Revert "Revert "Revert "MM-17759 Add code highlighting (#3072)"""

This reverts commit 5ef383be2619b1be6167c23f128ecb4b4ad25df9.

* Android fixes after dep upgrades

* Use fresco 2.0.0

* Use mattermost forks

* Use React-Core in Mattermost.scheme instead of react

* Remove packager (#3452)

* Remove Pods from source control

* Fix unit tests

* Add new line before entering the keystore in gradle.properties

* set ios as working directory for cocoapods

* Cache cocoapods on circleCI builds

* set ios as working dir

* fix cocoapods cache key

* Unify fastlane and npm dependencies command

* Use package-lock.json checksum for npm cache

* Fix package.json and use the checksum as the cache key

* Fix package.json and use the checksum as the cache key

* changes to circleci.yaml fastlane and removing pods from git

* Fix Mattermost.xcodeproj

* Update coocoapods to 1.7.5 and fix xcode header search paths

* Update package-lock.json

* Remove unused tooltip component

* Fix incorrect ref

* Disable Hermes (#3460)

* Revert "Remove packager (#3452)"

This reverts commit b2a79e184b3242124dfdb91ae095f6ce3f4eb986.

* Disable Hermes :'(

* Update preloaded modules

* Fix packages moduleNames and modulePaths, update snapshots and update mm-redux (ts version)

* remove document picker from modulePaths

* Fix package-lock.json

* Add eslint disable rules
2019-10-28 15:04:24 -07:00
Miguel Alatzar
459801d10b
[MM-17560] Await dismissAllModals and popToRoot prior to calling showSearchModal (#3298)
* Patch react-native-navigation

* Make navigation actions regular functions

* Fix unhandled promise rejection warning

* Missing semicolons

* Mock navigation actions

* Add unit tests for navigation actions

* Place all patches in patches directory

* Fix channel_info snapshot test
2019-09-25 15:23:45 -07:00
Miguel Alatzar
faf97f9945
Ensure onAppStateChange runs only after GlobalEventHandler is configured (#3268) 2019-09-18 09:59:52 -07:00
Ewe Tek Min
f6c9c950c5 MM-12879 Fix iOS photo/camera permission denied prompt (#2904)
* Update Github issues link

* Update GH issue to permalink

* Add missing comma

* Fix ios not prompting alert after denied photo or camera permission

* Rename permission var

* Update text

* Change to correct text

* Update text for attachement button

* Update text for image_preview

* Fix test

* Integrate react-native-android-open-settings for storage permission denied

* Move react-native-android-open-settings

* Change all default permission denied message

* Revert "Merge remote-tracking branch 'upstream/master'"

This reverts commit 65187f8f98de4943103bdab4b39bd7e1ebd5a220, reversing
changes made to daca425676503a57936a5539b5b5fa68a6c5427e.

* Revert "Revert "Merge remote-tracking branch 'upstream/master'""

This reverts commit c82fa628d5addc1262353539c32b76c6a1130e83.

* Add NSPhotoLibraryAddUsageDescription description

* Fix bad import

* Lazy load react-native-android-open-settings

* Fix indent
2019-09-11 01:18:53 -03:00
Elias Nahum
223bd64a43
[MM-18349] Post menu delay animation speed and haptic feedback (#3214)
* Animate backdrop opacity in slide up panel

* Set delayLongPress to 75ms for post

* Add haptic feedback on slide up of post options

* Ease in slide up animation

* Add haptic feedback to android

* reduce long press delay for post options menu

* helper function for haptic feedback

* Add haptic feedback when opening post options menu

* Patch haptic feedback RN module on Android

* Fix tests

* Move hapticFeedback call to SlideUpPanel

* Decrease long press time for reaction
2019-09-07 07:45:07 +09:00
Elias Nahum
1d37c81163 Fix tests (#3114) 2019-08-13 09:51:51 -07:00
Elias Nahum
e87858d7af Various fixes (#3078)
* MM-17588 Remove navigation component from stack

* MM-175986 Fix Clock Display Settings on iOS

* Fix markdown and team icon currentServerUrl

* Fix closing permalink logs out the user

* Fix file attachment document ref

* Fix applyTheme when changing a theme in the app

* Feedback review

* remove / when fetching the image on the markdown table on relative paths
2019-08-08 22:28:07 +08:00
Elias Nahum
76df42bbd1 MM-16752 Fix unhandled promise rejection TypeError state.websocket.lastConnectAt (#3039) 2019-08-02 13:04:50 -07:00
Miguel Alatzar
9a894641fc
[MM-14926] Include in-app notifications in iOS badge number (#3001)
* Include in-app notifications in iOS badge number

* Make foreground notifications key a const
2019-07-24 07:58:15 -07:00
Harrison Healey
fcd9e401f5 MM-15582 Don't show forgot password link without email/username login (#2811) 2019-05-22 11:55:27 -04:00
Elias Nahum
08df256c1d MM-14921 Fix iPad layout including safeAreaInsets (#2748)
* MM-14780 and MM-14921 Fix iPad layout including safeAreaInsets

* Fix unit tests
2019-05-03 17:42:32 -04:00
Miguel Alatzar
19c493ff6e
[MM-15401] Fix setting of extension when caching files (#2762)
* Get extension from Content-Disposition first

* User ImageCacheManager.cache over getCacheFile

* Add unit tests for ImageCacheManager.getCacheFile

* Add unit tests for ImageCacheManager.cache

* Use exports and require to be able to mock isDownloading

* Chain mockReturnValueOnce calls

* Fix getExtensionFromContentDisposition and its unit tests
2019-05-03 09:24:40 -07:00
Elias Nahum
88f5848850
Dependencies update (#2576)
* Dependencies update

* Fix WebView

* Update to RN 0.58.5 and include the WebSocket fix

* Update react-native-video

* Fix RNFetchBlob
2019-02-20 17:17:04 -03:00
Elias Nahum
2184696e65
post menu and file attachments (#2414)
* post menu and file attachments

* Fix post list selector test

* Use new Gesture handler to avoid gesture conflicts in post menu and reaction list

* Allow reaction list to scroll the header on Android

* Feedback review

* Add some comments

* Fix eslint
2018-12-05 14:59:41 -03:00
Elias Nahum
9a5122c19c
Slide up panel for reaction list (#2285)
* Slide up panel for reaction list

* Feedback review

* UI Feedback review

* Feedback review

* Improve slide speed and fix end position

* Scroll to top when changing reaction view

* dismiss modal without animation so backdrop does not scroll down

* Smooth animation to show/hide

* Change animation speed
2018-11-02 13:21:43 -03:00
Sudheer
1b54e1ebe3
Fix for LHS populating you next to current user (#2263)
* Fix for LHS populating you next to current user

* Add test cases
 * Refactor to use avaiable props conditions in component
   instead of passing flags from connector
2018-10-15 21:00:11 +05:30
Saturnino Abril
dd506d4c9f
fix issue that blocks adding test for thread screen (#2221) 2018-10-05 14:46:21 +08:00
Sudheer
5aac68e785 Change rn-fetch-blob to mock globally in jest (#2124) 2018-09-14 12:14:37 -03:00