mattermost-mobile/app/screens
Jason Frerich 97b5e75e5f
[Gekidou - MM-44930] Use File component for showing files in search. (#6425)
* 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>
2022-07-14 12:50:05 +02:00
..
about [Gekidou] Extract common observers to queries (#5984) 2022-03-23 09:19:29 -03:00
apps_form MM-45022 : Gekidou - Refactor code to use custom nav hooks (#6426) 2022-06-30 11:12:59 -04:00
bottom_sheet [Gekidou MM-45521] Remove show results button (#6465) 2022-07-12 20:05:35 +02:00
browse_channels [Gekidou MM-45521] Remove show results button (#6465) 2022-07-12 20:05:35 +02:00
channel Detox/E2E: Messaging (at-mentions, channel mentions, autocomplete etc) e2e tests in Gekidou (#6428) 2022-07-05 10:01:46 -07:00
channel_info Detox/E2E: Find channels, Edit channel, etc e2e tests in Gekidou 2022-07-06 11:15:45 -07:00
code [Gekidou] Code syntax highlight (#6156) 2022-04-12 08:59:50 -04:00
create_direct_message MM-45022 : Gekidou - Refactor code to use custom nav hooks (#6426) 2022-06-30 11:12:59 -04:00
create_or_edit_channel MM-45022 : Gekidou - Refactor code to use custom nav hooks (#6426) 2022-06-30 11:12:59 -04:00
custom_status Fix theming and navigation stack tracking (#6443) 2022-06-30 11:14:07 -04:00
custom_status_clear_after [Gekidou] cleanup fixes (#6376) 2022-06-13 08:07:24 -04:00
edit_post MM-45022 : Gekidou - Refactor code to use custom nav hooks (#6426) 2022-06-30 11:12:59 -04:00
edit_profile MM-45022 : Gekidou - Refactor code to use custom nav hooks (#6426) 2022-06-30 11:12:59 -04:00
edit_server Remove ts-expect-error regarding legacy refs (#6317) 2022-05-31 07:42:34 +02:00
emoji_picker MM-45022 : Gekidou - Refactor code to use custom nav hooks (#6426) 2022-06-30 11:12:59 -04:00
find_channels Detox/E2E: Find channels, Edit channel, etc e2e tests in Gekidou 2022-07-06 11:15:45 -07:00
forgot_password [Gekidou] pinned posts (#6336) 2022-06-03 09:27:45 -04:00
gallery [Gekidou - MM-44930] Use File component for showing files in search. (#6425) 2022-07-14 12:50:05 +02:00
global_threads [Gekidou] user profile (#6353) 2022-06-06 11:27:25 -04:00
home [Gekidou - MM-44930] Use File component for showing files in search. (#6425) 2022-07-14 12:50:05 +02:00
in_app_notification MM-39711 - Gekidou Settings Timezone (#6384) 2022-06-24 06:52:05 -04:00
interactive_dialog [Gekidou] user profile (#6353) 2022-06-06 11:27:25 -04:00
latex [Gekidou] Add Latex support (#6195) 2022-04-28 12:27:10 -04:00
login Ease the way the keyboard can be dismissed in the login screen (#6341) 2022-06-03 08:10:51 -04:00
mfa Substitute all console.x by an appropiate log util function (#6427) 2022-06-24 10:26:40 -04:00
permalink MM-45022 : Gekidou - Refactor code to use custom nav hooks (#6426) 2022-06-30 11:12:59 -04:00
pinned_messages MM-45022 : Gekidou - Refactor code to use custom nav hooks (#6426) 2022-06-30 11:12:59 -04:00
post_options Fix theming and navigation stack tracking (#6443) 2022-06-30 11:14:07 -04:00
reactions Detox/E2E: Messaging (at-mentions, channel mentions, autocomplete etc) e2e tests in Gekidou (#6428) 2022-07-05 10:01:46 -07:00
select_team Comment out create team options until we have a create team screen (#6310) 2022-05-26 14:39:02 +02:00
server Remove ts-expect-error regarding legacy refs (#6317) 2022-05-31 07:42:34 +02:00
settings MM-39711 - Gekidou Advanced Settings (#6412) 2022-07-08 14:39:41 +04:00
snack_bar [Gekidou] Add saved messages to bottom tab (#6367) 2022-06-09 15:19:24 -04:00
sso Substitute all console.x by an appropiate log util function (#6427) 2022-06-24 10:26:40 -04:00
table Render Tables in their own screen (#6356) 2022-06-07 09:50:55 -04:00
thread [Gekidou] Thread auto follow on receiving new post when user is in a NOT-FOLLOWING thread (#6448) 2022-06-30 20:34:28 +05:30
thread_options MM-45022 : Gekidou - Refactor code to use custom nav hooks (#6426) 2022-06-30 11:12:59 -04:00
user_profile Detox/E2E: Messaging (at-mentions, channel mentions, autocomplete etc) e2e tests in Gekidou (#6428) 2022-07-05 10:01:46 -07:00
background.tsx [Gekidou] MM-39736 Login Flow (#5799) 2021-11-18 22:07:41 +01:00
index.tsx MM-39711 - Gekidou Advanced Settings (#6412) 2022-07-08 14:39:41 +04:00
navigation.ts MM-45456 - Gekidou LoadingUnreads component keeps spinning (#6453) 2022-07-08 14:14:35 +04:00