[x] This PR has a title that briefly describes the work done including the ticket number. If there is a ticket, make sure your PR title includes a conventional commit label. See existing PR titles for inspiration.
[ ] My work includes tests or is validated by existing tests.
Summary
SWR's preload API makes it possible to prefetch resources programmatically and store the results in the cache. I've leveraged this ability so that when the user hovers over a link to a schema in the forms dashboard table, a request gets fired off to the backend. This means that when the user does click on the link, the schema loads up immediately without showing a loading spinner.
An unrelated change I've made here involves cleaning up the ConfigurableLink implementation to leverage interpolation. Functionality is unchanged.
Requirements
Summary
SWR's preload API makes it possible to prefetch resources programmatically and store the results in the cache. I've leveraged this ability so that when the user hovers over a link to a schema in the forms dashboard table, a request gets fired off to the backend. This means that when the user does click on the link, the schema loads up immediately without showing a loading spinner.
An unrelated change I've made here involves cleaning up the ConfigurableLink implementation to leverage interpolation. Functionality is unchanged.
Screenshots
Before
https://github.com/openmrs/openmrs-esm-form-builder/assets/8509731/847bdf04-5bd9-41d8-85f8-a29244d7adda
After
https://github.com/openmrs/openmrs-esm-form-builder/assets/8509731/b5d6435f-07e1-40fc-bf43-5a435dc50ce9
Related Issue
Other