hypertrace / hypertrace-ui

UI for Hypertrace
Other
25 stars 12 forks source link

Feat: Provide external loading triggers #2533

Open aneeshsharma opened 10 months ago

aneeshsharma commented 10 months ago

Description

Any changes that were external to the table that would trigger a new data fetch, couldn't be accounted for when displaying the loading state in the table. Also, since the data source is external and a stream, it is not possible for the table to know when a new data fetch might have been triggered.

So, added loadingTrigger: Observable to the TableDataSource as an optional field, which can be provided by the user which should emit whenever a change happens that will trigger a new data fetch.

This will require the user to provide the trigger but I couldn't find any other way for the table to know by itself if a new data fetch is going to be triggered.

codecov[bot] commented 10 months ago

Codecov Report

Attention: 3 lines in your changes are missing coverage. Please review.

Comparison is base (e743904) 71.26% compared to head (9967e6f) 81.92%. Report is 8 commits behind head on main.

Files Patch % Lines
projects/components/src/table/table.component.ts 66.66% 3 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #2533 +/- ## =========================================== + Coverage 71.26% 81.92% +10.65% =========================================== Files 927 928 +1 Lines 20870 20908 +38 Branches 3313 3324 +11 =========================================== + Hits 14874 17129 +2255 + Misses 5749 3641 -2108 + Partials 247 138 -109 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

github-actions[bot] commented 10 months ago

Test Results

       4 files  ±0     316 suites  ±0   32m 9s :stopwatch: +12s 1 135 tests ±0  1 135 :heavy_check_mark: ±0  0 :zzz: ±0  0 :x: ±0  1 145 runs  ±0  1 145 :heavy_check_mark: ±0  0 :zzz: ±0  0 :x: ±0 

Results for commit 9967e6f8. ± Comparison against base commit e7439043.

:recycle: This comment has been updated with latest results.

aneeshsharma commented 10 months ago

Instead of passing the loadingTrigger$ as metadata to the data source, we can now pass the trigger as input to the table component itself.