[Uptime] clear ping state when PingList component in unmounted#88321
Conversation
|
Pinging @elastic/uptime (Team:uptime) |
There was a problem hiding this comment.
Mocking useSelector was causing issues for me, since this component called on two different selectors, so I am only mocking dispatch. Mocking useSelector is less critical when using the default app state within a mock redux provider, as we are in the new rtl custom render.
There was a problem hiding this comment.
Could also be resetPings.
There was a problem hiding this comment.
I'm fine with clearPings.
There was a problem hiding this comment.
I'm not sure who determines what the appropriate content is in these cases. Please let me know if this default content is appropriate or need to be run past product.
There was a problem hiding this comment.
I think 'Loading pings' might accomplish the same thing. @andrewvc any thought on this copy?
There was a problem hiding this comment.
On the ticket Paul suggested the more generic Loading history.. could work well, since this is a history table.
There was a problem hiding this comment.
I see some actions use SNAKE_CASE and others just use spaces. Which should I be using, or does it matter?
There was a problem hiding this comment.
I think largely we are not super strict on the formatting of these since in practice no one sees them or needs to do anything with them.
45be5c8 to
861112b
Compare
861112b to
944704c
Compare
|
@elasticmachine merge upstream |
| failedSteps: { steps: [], checkGroup: '1-f-4d-4f' }, | ||
| }); | ||
| const { getByText } = render(<PingList />); | ||
| expect(getByText('Loading ping history')).toBeInTheDocument(); |
There was a problem hiding this comment.
👍
Been doing these all week, it's making the test suites so much nicer.
There was a problem hiding this comment.
I think 'Loading pings' might accomplish the same thing. @andrewvc any thought on this copy?
There was a problem hiding this comment.
I'm fine with clearPings.
There was a problem hiding this comment.
I think largely we are not super strict on the formatting of these since in practice no one sees them or needs to do anything with them.
| Object.keys(expandedRows).filter((e) => !pings.some(({ docId }) => docId === e)) | ||
| ); | ||
|
|
||
| useEffect(() => { |
There was a problem hiding this comment.
Nice simple strategy here, small footprint, runs once. I smoke tested this and it seemed to work great.
…/dominiqueclarke/kibana into fix/285-remove-cached-ping-state
💚 Build SucceededMetrics [docs]Async chunks
History
To update your PR or re-run it, just comment with: |
…ic#88321) * clear ping state when PingList component in unmounted * update ping list content Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
…ic#88321) * clear ping state when PingList component in unmounted * update ping list content Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* master: (33 commits) [Security Solution][Case] Fix patch cases integration test with alerts (elastic#88311) [Security Solutions][Detection Engine] Removes duplicate API calls (elastic#88420) Fix log msg (elastic#88370) [Test] Add tag cloud visualization to dashboard in functional test for reporting (elastic#87600) removing kibana-core-ui from codeowners (elastic#88111) [Alerting] Migrate Event Log plugin to TS project references (elastic#81557) [Maps] fix zooming while drawing shape filter logs errors in console (elastic#88413) Porting fixes 1 (elastic#88477) [APM] Explicitly set environment for cross-service links (elastic#87481) chore(NA): remove mocha junit ci integrations (elastic#88129) [APM] Only display relevant sections for rum agent in service overview (elastic#88410) [Enterprise Search] Automatically mock shared logic files (elastic#88494) [APM] Disable Create custom link button on Transaction details page for read-only users [Docs] clean-up vega map reference documenation (elastic#88487) [Security Solution] Fix Timeline event details layout (elastic#88377) Change DELETE to POST for _bulk_delete to avoid incompatibility issues (elastic#87914) [Monitoring] Change cloud messaging on no data page (elastic#88375) [Uptime] clear ping state when PingList component in unmounted (elastic#88321) [APM] Consistent terminology for latency and throughput (elastic#88452) fix copy (elastic#88481) ...
… (#88506) * clear ping state when PingList component in unmounted * update ping list content Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
… (#88504) * clear ping state when PingList component in unmounted * update ping list content Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Summary
Fixes elastic/uptime#285
Addresses elastic/uptime#286 for PingList
This PR removes cached ping list state. Previously, when switching between monitors, the previous ping list state would show for a brief moment before the
usePingListhook kicks in and switches the state to loading. This PR resolves that by cleaning ping list state when thePingListcomponent unmounts, ensuring that new ping list state is always fetched freshed for a different monitor.You can see the new behavior here
https://drive.google.com/file/d/1Zm__8vbPjo1TZ30IRMLXIxzFdWsgqFPQ/view?usp=sharing
Checklist
Delete any items that are not applicable to this PR.
For maintainers