* Only call app entry on websocket reconnect
* Handle notification on its own entry and run app entry on websocket initialization
* Fix notification entry issues
* Fix login entry and add retry on entry failure
* feedback review
* Put back handleEntryAfterLoadNavigation before the batching
---------
Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
* Remove watermelondb limitation on updating an already updated model
* Add logic to handle different prepare states and improve logging
* fix tests
---------
Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
* move user_list to component
* start the modal from create_direct_message
* initial commit
* Add managing options to user profile
* s/showManage/showManageMode/
* simplify
* use helper functions
* add dependency
* fix togglling manage/done button
* remove close button in navbar
* remove close button. The only exit from this screen is the back button
* utilize LeaveChannelLabel component actions
* nit
* nit
* slight refactor
* return earlier if not showManageMode
* use defineMessages
* don't modify leave channel component
* add manage_members_label component
* rename variables to imply manage actions
* remove user from channel on server and locally in channel membership
* prevent managing yourself. In V1, this is done by not allowing you to
select yourself for channel removal
* remove useReducer
* - fix typography
- fix icon size
- don't allow tapping on yourself in manage mode
* sort props
* sort props
* sort props
* - combine try blocks
- use getServerDatabaseAndOperator function to get the operator
* fetchChannelStats after removing users from a channel
* currently, the UI does not provide a need to remove multiple members
from a channel, only one member. modify the function to only accept and
remove one user
* no need to pass the entire channel object. only need the channelId which
is already passed into the screen
* do not pass the entire user model, only the userid and if user canManage
(is sysadmin or channel admin)
* move members constants to its own file and out of general.ts file
* pass channel displayName instead of the entire channel object
* not need to store the user as it is already in the store from the
fetchProfilesInChannel call
* implement device emitter to notify the parent to remove to the user from
the user list
* rename constant in reveal removing a member from a channel. Might need for another team removal later.
* add snackbar after user is removed
* remove unnessary filter
* remove paging. Server response is not paginated
deconstruct intl
* create EMPTY const
* simplify getProfiles function
* move constants to top of file
* add function to remove the user from the server
* clean up dependencies
* remove @app/ prefix from imports
* add comment describing reason for switch / case
* rename varaible to be more intention revealing
* calculate isDefaultChannel and pass in as prop so don't need to
query for each user
* if user cannot manage, do not show the manage nav button
* move options const into function that uses it
* have the caller of handeRemoveMemberFromChannel fetch channel stats, not
the action
* nit formatting
* s/canManage/canManageMembers/
* use existing observeCanManageChannelMembers function
function only requires channel id
* move userInfo and manage user options to their own components
* calculate bottom sheet snap points when in manage mode
* implement correct permissions for managing users. For now, only channel
admins can manage users (including deleting members)
* working on section creation
* use map instead of arrays
* - handle user profile sections differently when in members are provided (manage mode)
- emit event when user role is changed
- modify the channelMembers in manage members modal after changing
user role
* remove commented code
* deconstruct options
* sort dependencies and add loading dependency
* - when removing a user, remove them from channelMembers state also
- don't add empty sections to the user list results
* user profile coming from ManageChannelMembers is UserProfile joined with
their ChannelMembership. Can now check for scheme_admin to see if the
user is a channel admin
* deconstruct locale from intl and remove intl const
* Add SearchUserOptions type to provide type checking when creating options for searchProfile
action and searchUsers client api
* correct comment
* deconstruct MANAGE_OPTIONS
* Remove unused event constant
* nits
* Push header title in to the UserProfileTitle component
* Put constants back so Diff of file is smaller
* Combine switch statements
Remove isOptionItem. These are always action items
* Wrap onAction in a usecallback
* Add help comments
* Add i18n to section titles
* Create RenderItemType for renderItem callback
* update testID
update snapshots
* CanManageMembers is deterimined by observeCanManageChannelMembers
* Add members chanenl option
* Update after merge
* Sort in order of options shown
* nit refactor
* Modify client getProfilesInChannel allow passing more options than sort.
- sort the profiles by admin
- do not show deactivated users in the manage members modal
* Profiles are now sorted by admin. We can maintain the alphabetical sort
also by iterating over the profiles instead of members which are not alphabetical
* Type the get users Api object
* Add type.
Active option is a boolean, not a string
* only initialize if needed. Moved inside the check for members
* Create type for Manage Member Options
* Remove one liners and call directly in the switch block
* Keys to the map do not need to be translated. Only translate the title
Place the Admins section always on top
* Add removeFromChannel as a dependency
* Remove manageMode option from the title component
- add imageSize prop
- add headerText prop
* Do not show deactivated users in search
* When users are showing and not in manage mode, allow the user to tap and
open the profile for the user (in non-manage mode)
* Add fetchOnly to getMemberInChannel function
Add fetchOnly to updateChannelMembersSchemeRoles function
Remove getMemberInChannel from handleUserChangeRole in manage_channel_members because it is already called via updateChannelMembersSchemeRoles
* Remove todo from comment
* Don't use state for defining action text, icon, and isDestructive. just
set them based on the prop value manageOption
* Added correct permission check for can user manage member roles
* Add can manage member roles prop
* Calculate snap points based on manageMemberRoles prop
* Calculate snap point based on if user can remove other users
* Do not show options if you cannot remove or manage members
* Fix post merge issues
* No need to batch because only manipulating a single model
* Remove comment
* Rename variable
* Split and sort props into multiple lines for readability
* Nit
* Make dependency more specific
* Remove comment. Doing this requires writing a custom search function in
the app that would need to guarantee the same results as a server call
* Add logError to functions with catch
* Add ticket reference
* Remove await from functions that are updating the database. Components
that observe models these modify will get the update based from the
observable change.
* Keep track of which section is first so that the tutorial highlight
selects the first user profile of the first section
* Add a second user that creates a new section for testing tutorial
* Remove unused prop
* Update snapshot to include second user
* Use getServerDatabaseAndOperator
* remove testID change. Added a ticket to fix later
* Revert tests to only one user to test if previous tests worked
* Add new test that has 2 users
* Add ticket context as comment
* Add channelId as dependency
* Use useCallback for updateChannelMemberSchemeRole
* Remove async
* mounted.current should only be used in an effect that executes on the
first render
when user has permission to manage members changed, there is no need to
get the profiles again
* Add await for function
* Always reset loading to false after getting profiles
* use !text instead of const value using Boolean()
* add dependency
* Add manage members ids back
* When fetching users for the channel, always store them in the database.
Otherwise tapping a user might not be in the database and tapping on
them will cause a crash
* Fetch the user profile from the server when opening the user profile
* Checking management permissions should be based on the current user, not
the user of the profile being opened
---------
Co-authored-by: Avinash Lingaloo <avinashlng1080@gmail.com>
* Fetch & Save granular data retention policies through REST
* Init Data cleanup
* Run the clean up
* Deleting posts in patches and running across other servers
* fetch on graphql & refactor
* Feedback changes
* Added try catch for deletePosts function
* Feedback changes
* Changed to 'for of' loop
* Misc
* app/actions
* Date cutoff fox
* Prevent showing loading bar when request fails
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Co-authored-by: Mattermost Build <build@mattermost.com>
* Add terms of service
* Add i18n
* Fix test
* Address feedback
* Address ux feedback
* Update texts
* Avoid Review to show on top of ToS
Co-authored-by: Daniel Espino <danielespino@MacBook-Pro-de-Daniel.local>
* Ensure no unresolved types in the definition files
* Address feedback and general cleanup
* Move import from @constants/x to @constants where relevant
* Remove unneeded "import as"
* First approach
* Lint
* Fixes and adding monitoring console statements (to be removed later)
* Add pagination and apply graphQL also to login
* Get all entry points to use the same GQL call
* Unify gql handling
* Use graphQL on websocket reconnect
* Handle latest changes regarding categories
* Use graphQL to properly fetch channel members on other servers
* Remove logs and fetch unreads from other teams
* Minor fixes
* Final fixes
* Address feedback, minor refactoring, and fixes around the refactor
* Fix custom status duration types
* Add missing fields and some reordering
* Add timeout to fetch posts for unread channels
* add observables for search component
add loader screen
add file client searches for files
* hook up loader component for loading state
* search results with found posts now working
* get and store files when searching
* query file results from the database
display dummy file text for now
* add filter screen and icon to the results header
* needs some cleanup but functionally works
- applied filters reduce files to subset of selectd types
- no filters will show all files
* update number files in parenthesis to match the filtered number of files
(if filtered)
* added the missing file extensions found in webapp
added document_types which is a superset of other types
* remove clear all text from filter and from bottom_sheet component
* checkin before merge latest gekidou branch
- change filters to use latest figma design
- from multiselect to single select
- revert changes to bottom sheet content that allowed adding a RHS title button
- start of the file attachement cards show in file results
* Cleanup and fixes
* Remove nested scroll views
* Address feedback
* Address feedback
* extract the fileInfos from the results object, from an array
* add translations for filters
* add translations
* use Object values to determine if has file info results
* Combine fetch recent mentions and search for posts
* add search icon back to home screen
* remove unused function import
* fix formatting and add 3 dot onPress option
* don't show search button
* Add touchable opacity for pressing the card
Add function for opening gallery
Fix `...` so only clicking directly over it calls it's function. Everywhere else calls open gallery
* place compassIcon in a touchable and add hitslop
create individual objects for flex column and row
* use one-liner for text
move constant outside of the component
* truncate filename if over max filename lenght and append ...
fix style for filename
* remove all commented filetype code. This will not be added to the card
because of added length to second row. Feedback from UX discussion
* remove trimFileName function and MAX_FILENAME_LENGTH constant
make the textContainer grow in width. The other flex boxes are constant width
align main container center and remove vertical margins
* create TabTypes contant and TabType Type to replace all uses of 'messages' and
'files'
* make padding adjustments based on the selected tab and if there are
results.
When no results are shown, we want the 'Check the spelling or try
another search' text to not move or flicker when switching between files
and messages
* put the margin on the touchable container, not the compassicon so the
hitslop is relative to the compassicon.
* Add the channel name to the filecard.
each fileInfo from the server contain a channel_id. Add to the reponse type
* Move the channel name to a separate line
* implement changes from PR. Shrink channel name when it doesn't fit
* use a useMemo instead of useCallback
* initial commit
* working copy using the File component instead of creating a new FileCard
component
* add styhling for long channel name
* update styling for info text
* update styling
* disable lint check for console statement until function is hooked up
* fixt linting errors caused by api including channel_id. It needs to be
optional or the model will complain
* when a file is an image, show the image or video as an image instead of
the generic file icon
* make `asCard` File Prop optional
* shift the image icon over 4px
* tweaked styles
* tweaked styles for file info
* move files directory from inside the post_list/post/body/ folder to its
own component because is it referenced from other screens and components
including:
app/components/post_draft/uploads/upload_item/index.tsx
app/components/post_list/post/body/content/image_preview/image_preview.tsx
app/components/post_list/post/body/content/message_attachments/attachment_image/index.tsx
app/components/post_list/post/body/index.tsx
app/screens/gallery/document_renderer/document_renderer.tsx
app/screens/home/search/results/results.tsx
* create useImageAttachments hook and share with files component and
results
* rename all renderXXXFile useMemo options to xxxFile. These return the
actual component
* use explicit Boolean(onOptionsPress)
* isSingleInput does not need to be a function
* use find instead of filter().map()
* add dependencies and refactor to reduce some file dependency arrays
* order files by reverse create_at date
* remove console.log and leave as a comment for now
* update styling so that the view wrapper has the borderRadius. Now
android and ios get the correct borderRadius surrounding the channel
name
* use the results of the ordered useImageAttachements results as data for
File and Gallery
* remove extra empty line
* PR feedback
- rename capitalize const
- add several useCallbacks
- use typescript optional parareter instead of if statement
* - remove useMemos that only return a component
- fix bug - when channel name is not present, don't show the channel
component. This happened when looking at posts in a channel because
post comes from the model, which does not include the channelName.
This is because in the channel view all images are in a specific
channel and no need to store it
* remove useMemo import
* remove callback
* - remote unused operator
- nothing needed outside of try catch
* remove unused Client import
* s/xxxFile/renderXxxFile/ because theare are a function that returns a
component
* move constant above component
* default to 0 instead of forcing to be defined
* use observerConfigBoolean
* import as type because not useing to construct as models
* add links to Jira ticket and github PR
* add line breaks and sort alphabetically
* use ternary operator to reduce number of lines
* move up as far as possible
* remove unused style
* sort props and input vars alphabetically
* move higher in the component
* return ealier
* no need for useDerivedValue. useMemo instead
* use useCallback
* Minor tweaks and fixes
* Remove floats from style
Co-authored-by: Daniel Espino García <larkox@gmail.com>
Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
Co-authored-by: Matthew Birtch <mattbirtch@gmail.com>
* WIP
* Actions updated to fetch remote first, and local on error
* Groups fetch and save
* PR Feedback: prepare vs store and undefined fix
* Forgot to add file
* Groups Mention WIP
* Groups highlight!
* Merge, PR Feedback
* PR Feedback
* PR Feedback: Try/Catch blocks
* PR Feedback
* Rebased with PR feedback
* Exclusion fix, plus id order
* Tidies up iterations
* Loops updated
* Update app/database/operator/server_data_operator/handlers/group.ts
Co-authored-by: Avinash Lingaloo <avinashlng1080@gmail.com>
* PR Feedback: Remove unnecessary prepare/store methods
* Newline ESLint error
* Extracts out id generation for group-associations
* Batches if not fetchOnly
Co-authored-by: Avinash Lingaloo <avinashlng1080@gmail.com>
* Pinned messages
* Move isCRTEnabled query to be called earlier and only once
* Update Channel stats when post is (un)pinned
* Create svg module type definition
* Add missing localization strings
* feedback review
* Group autocomplete -
* Styling fixes
* Loading indicator
* Displays group name and display name
* PR Feedback
* Cleans up styling
* Adds constraints to group searches
* Channel Team before current team
* PR Feedback; displayName > name, model observable
* PR Feedback; rename fetch + model observable
* PR Feedback: return {error}, spelling fix
* PR Feedback: Add forceLogoutIfNecessary to fetch calls
* Remove doubled up logout
* Preparing thread data as well with prepareDeletePost
* observing the post directly to prevent the crash until the data issue is found
* mark as read, delete threeds fix
* Update thread.ts
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
* Add verification for push proxy and related interface
* Fix lint and extract i18n
* Be specific about undefined equalities.
* Fix test
* Address feedback
* Fix long server names styles
* Fix tests and typo
* Fixes
* Updated snapshot
* Excluding current user from getting updated
* Doesn't handle users if it's empty
Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
* Display local results
* Fix queryPreferencesByCategoryAndName to observeWithColumns value
* Find channels (remote)
* ux feedback review
* dev review
* dev review 2
* Fetch deleted channels from other teams
* Add AppsForm and Interactive Dialogs
* Add the missing plumbing for Interactive Dialogs and minor fixes
* Remove widgets subfolder
* Fix paths
* Address feedback
* Address feedback
* i18n extract
* Only set the dialog if we are in the same server
* MM-40093: adds remote action to sync threads
Syncing threads fetches all unread threads if there are no threads in
the DB.
If there are threads in the DB it fetches all threads newest than the
newest one we have stored.
Fetching happens in batches of 60 threads at a time.
* Fixes querying for all threads list
* Syncs threads on WS reconnection
* Addresses review comments
* Addresses review comments
* WS Events, Actions, Queries, Thread Follow, Post Query
* i18n changes
* Misc
* Only unread threads are marked as read
* Mark threads from WS even as visible in Global threads
* Merge fixes
* Update thread_post_list.tsx
* Merge fix
* Feedback fix
* Make teamId in handleThreads optional for unfollowed threads
* Removed unwated type and return
* Review changes
* Removing unused model
* Merge fix
* Misc fixes
* Following button query change
* copy directly from v1. will get working and then convert class to functional components
* screen showing up correctly. Need to convert lifestyle methods
* create channel button working
* save before refactor in prep for bringing in edit_channel functionality
* change function naming
* clean up lint
* clean up for PR review
* clean up for PR review
* remove hoardcoded styles
* add edit_channel screen
* add handlePatchChannel
* add custom useFormInput hook. use edit screen for both create and edit screens. edit or create screen mode determined by channel prop passed in as a channel or null
* rename edit_channel to create_or_edit_channel
* displayname, header, and purpose are now an object with value and onChange props, created from the useFormInput hook. Now only need to pass this new FormInput Prop to the edit_channel_info component and deconstruct there to get the onChange and value
* fix some lint errors
* fix some lint errors
* remove empty line
* pass intl into utils validate functions because they are not Hooks. add validation for displayName including translations.
* Move useFormInput hook to its own hooks file and import
* simplify
* remove editing prop. Was used to determine if the right button was enabled. It was always true for edit_channel screen and always false for create channel screen. The enableRightButton prop call back is was also used for the same reason.
* remove channeUrl editing references. This was not implemented on v1
* pass editing prop back into component and add back logic. When editing one field must change. when creating, just need to check that name is provided
* lint fixes
* fix typing issue for channel types
* scrolling ref should be fixed. Linting should pass now
* Linting should pass now
* require id field in partial Channel. fixes tsc
* remove everything related to renaming the channel URL. This has never been requred for mobile
* manage state with useReducer so that all actions/state in one location. This also removes the number of onXXX functions and reduces the number of functions in the component
* reorganize code. useEffects are at top. Move type and interfaces outside of function component
* Fix lint
* nit: invert if statement checking a negative
* use cneterChannelColor. in figma this is center channel text, but I verified theme color by comparing to SSO login text color
* Simple snapshot tests as a start
* Add more tests
* update snapshot
* add snapshot tests. Add tests for button enabling and disabling
* simplify test with destructuring.
* PR feedback. formatting changes. get user and teamid from one call
* remove FormInput hook and use value/setvalue convention for controlled components
* no need to setChannelDisplayName after creating/updating channel
* Just pass the setXXX function. Don't need to create as separate callback
* modify floatingTextInput component to allow placeholder text
* remove InteractionManager. PR nits
* mv EditChannelComponent into create_or_edit screen. Rename component from EditChannelInfo to ChannelInfoForm
* correct import path
* add IntlShape Type to function input. Wrap screen with withServerDatabase, not withIntl
* remove state setting function calls from inside the reducer. move close function outside of the component. remove setRightButton and rightButton and place rightbutton in initial appState
* move editing const after useX oneliners and before useCallback, useEffect, and useReducers
* rightButton
- useMemo to memoize an object with dependencies
- move out of the appState
emitCanSaveChannel
- wrap with useCallback
onCreateChannel
- wrap with useCallback
onUpdateChannel
- wrap with useCallback
useEffect Navigation
- use the callbacks as dependencies in stead of the depencies of those
callbacks.
* wrap all formatted message with useMemo()
wrap all onXXXChangeText with useCallback and add deps
move all oneliner derived constants directly after useState useMemo
* remove useMemo from formatted text
* switchToCHannel is still not working. failing at
const channel: ChannelModel = await member.channel.fetch();
* use prepareMyChannelsForTeam to update db tables for new channel
* add placeholder text color
* Attach open edit channel screen to `Set Header` button in channel intro view
port SectionItem from V1 and us to add a Switch for setting private/public channel
hook up the plus icon in the channel list header to create a channel (temporary fix to allow debugging)
add new queryChannelsInfoById and queryCurrentChannelInfo query functions
update text for create screen text inputs
* Fix styles and fix actions
* Add autocomplete, fix patch, and address design feedback
* Address feedback
* Add margin between icon and label on Make Private
* Address feedback
* Address feedback
* Address feedback and fix channel list not updating when the channel gets created
* Address feedback and directly add the channel to the default category
* Render at-mentions as Members if no channelId is set
* Display autocomplete on iOS
Co-authored-by: Jason Frerich <jason.frerich@mattermost.com>
Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
* Extract common observers to queries
* Separate also queries and more agressive refactoring
* Use query to avoid throws from findAndObserve
* Fix minor error
* Address feedback
* Address feedback
* Address feedback
* Fix model types
* Address feedback