-
Notifications
You must be signed in to change notification settings - Fork 97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: [IOCOM-824,IOCOM-825] Loading and loaded message list adapted to the new DS #5784
Conversation
Affected stories |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #5784 +/- ##
==========================================
+ Coverage 48.42% 49.88% +1.45%
==========================================
Files 1488 1637 +149
Lines 31617 32570 +953
Branches 7669 7938 +269
==========================================
+ Hits 15311 16246 +935
- Misses 16238 16262 +24
+ Partials 68 62 -6
... and 572 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Short description
This PR adds the message list loading and displaying, adapted to the new DS.
Empty list, Error handling, item selection, next page loading, refresh and so on will come later.
loading
loading
loaded
loaded
List of changes proposed in this pull request
MessageListItem
andMessageListItemSkeleton
components. These files and all the content inside theDS
folder will later be moved into the design system library. They are temporarily here in order to ease the development process and changes that will come in later PRs.CustomPressableListItem
will later be merged intoPressableListItem
.useListItemSpingAnimation
is just an exported hook from the design system, used insideCustomPressableListItem
, and will be later deleted.MessageList
component have been enhanced in order to implement the FlatList displaying the message listWrappedMessageListItem
to encapsulate all the business and rendering logic for theMessageListItem
messageListForCategorySelector
selector. Its output is used by the message FlatList and it is interpreted as follows:When
undefined
is returned,MessageList
provides a fixed list as an input to theFlatList
. Such list is computed in order to have as much elements as the screen height allows, to fill the view. Its type is different from the standard message list so that therenderItem
function can detect it and createMessageListItemSkeleton
components instead ofWrappedMessageListItem
ones.WrappedMessageListItem
uses a selector to get theservice
data which is used to compute the service's logo CDN urls. If service data is not available, aloadServiceDetails.request
action is dispatch to load them. Since such request uses atakeEvery
saga, we have to make sure not to dispatch multiple requests for the same service (since multiple messages may have the same service). This is done by checking if the service's pot is in its loading state inside theuseEffect
hook. This status is inside the redux state but we do not want a re-rendering to happen when the pot changes: that is why this latter data is retrieved using the store and not a selector.How to test
Using the io-dev-api-server, make sure that both DS and new home are enabled in app. Get to the messages home and switch between tabs (in order to see the loading list with the dev server, you can set a delay function on the related router, something like 3500 milliseconds).