Improve CVEs page loading and general page loading user experience #2108
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Essentially, this is an effort to improve the perceived performance of CVEs page. Before this change, the whole table was triggered loading and once the request to fetch cves for the table resolves, according to the advisor_availability info in the metadata, a new filter 'Advisor availability filter' was added. This would result in complete re-render of the table and the same API request to be triggered once more. Now, the advisory availability info is fetched on the very first page load with
limit:1
and provided across components using react context.Furthermore, there is another improvement for the general page loading user experience. Before, for example, while CVEs page was loading, the spinner would be displayed first in the center, then on top smaller, then on top bigger. This was not very pretty. Now, as one component is shared, the spinner is displayed only in the center. This improvement needs to be tested with this fix in the fec-components package: RedHatInsights/frontend-components#2010