Skip to content
This repository has been archived by the owner on Jan 16, 2024. It is now read-only.

Lazy load for popup widgets #596

Merged
merged 3 commits into from
Feb 18, 2021
Merged

Lazy load for popup widgets #596

merged 3 commits into from
Feb 18, 2021

Conversation

Dergash
Copy link
Member

@Dergash Dergash commented Feb 11, 2021

This PR introduces lazy load for certain types of widgets (PopupWidgetTypes at the moment, but can be extended later), i.e. the data and row meta will not be fetched until those widgets are explicitly opened through showViewPopup dispatch.
If lazy widget shares business component with some non-lazy widget (either directly or through ancestors chaing), than it continues to be fetched.

  1. A lot of efforts are directed into refactoring bcFetchDataEpic which tends to be overbloated with various loosely connected functionality: hierarchies, pagination, cancellation, cursors change, data fetch, row meta fetch, children fetch... Unit tests and tsdoc coverage should document current behavior
  2. Efforts are made to make all five possible actions for this epic to work with widgetName instead of bcName prone to collisions. Work in progress.
  3. <PickListField /> and <MultivalueField /> no longer show spinners while row meta for their corresponding business components if fetched; it was an ad hoc protection to prevent fetching data on popup open when the initial data is still fetched. With lazy load there is no initial fetch => no race condition, though it is still possible in a case when multiple popup fields share the same business component. Probably there is still work to do here.
  4. WidgetMeta now has url field (it was always there, just missing from the interface)
  5. As we still did not update redux-observable to 1.*.* due to backward-compatibility support, tests for Observable.race are omitted and epic implementations return flows intended to check manually

@Dergash Dergash added enhancement New feature or request tests Unit tests and coverage labels Feb 11, 2021
@Dergash Dergash added this to the 1.28.0 milestone Feb 11, 2021
@Dergash Dergash self-assigned this Feb 11, 2021
@Dergash
Copy link
Member Author

Dergash commented Feb 11, 2021

/alpha

@coveralls
Copy link
Collaborator

coveralls commented Feb 11, 2021

Pull Request Test Coverage Report for Build 577916040

  • 87 of 98 (88.78%) changed or added relevant lines in 7 files are covered.
  • 2 unchanged lines in 2 files lost coverage.
  • Overall coverage increased (+0.4%) to 61.517%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/components/InlinePickList/InlinePickList.tsx 0 2 0.0%
src/components/PickListField/PickListField.tsx 1 3 33.33%
src/epics/data/bcFetchData.ts 70 77 90.91%
Files with Coverage Reduction New Missed Lines %
src/components/InlinePickList/InlinePickList.tsx 1 26.42%
src/components/PickListField/PickListField.tsx 1 63.64%
Totals Coverage Status
Change from base Build 577717076: 0.4%
Covered Lines: 3281
Relevant Lines: 4676

💛 - Coveralls

@Dergash Dergash force-pushed the feat/popup-lazy-load branch 2 times, most recently from 8266688 to ea47311 Compare February 11, 2021 23:45
@Dergash Dergash force-pushed the feat/popup-lazy-load branch from ea47311 to 6e2cd04 Compare February 18, 2021 11:11
@Dergash Dergash marked this pull request as ready for review February 18, 2021 11:12
@Dergash Dergash merged commit e84a77d into develop Feb 18, 2021
@Dergash Dergash deleted the feat/popup-lazy-load branch April 28, 2021 11:27
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request tests Unit tests and coverage
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants