Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ASSETS-88922 : Review the Deliverable page load time (#130)
* Improve page load time by parallelizing API calls and adding debug logs - Updated `decorate` function to fetch program details and deliverables in parallel using `Promise.all`. - Added console logs before and after API calls to help with debugging. - Maintained existing functionality while optimizing performance by reducing sequential API calls. * Remove logging messages * feat: Improve performance of gmo-program-details.js - Implement parallel GraphQL queries to reduce load times. - Lazy load images using the `loading="lazy"` attribute to improve initial load performance. - Batch DOM updates using `document.createDocumentFragment()` to minimize reflows and repaints. - Debounce event listeners to prevent performance issues caused by rapid firing of events. These optimizations should enhance the overall performance and responsiveness of the page. * Optimize header rendering and asynchronous data fetching - Initiate parallel fetching of program details and deliverables. - Render a placeholder header immediately to improve perceived load time. - Update header with actual data once program details are fetched. - Ensure images are loaded asynchronously without blocking header rendering. * feat: Inject additional HTML content into main-body-wrapper after header update - Added HTML content including tab-wrapper, overview, and deliverables sections to the main-body-wrapper div after the header. - Updated the main-body-wrapper div to include newly provided HTML content for improved user interface and navigation. - Ensured the content injection occurs after the header update to maintain correct rendering order. * Added back displaying the back button with arrow icon and program name not available message and no data available message when program * Updated logic to display the total asset count for an image * Reverted back to const programData = await executeQuery(programQueryString); const deliverables = await executeQuery(deliverableQueryString); * Restored constant variables for Marketing Goal, KPIs, Target Market, Audiences const p0TargetMarketArea = program.p0TargetMarketArea; const p1TargetMarketArea = program.p1TargetMarketArea; const kpis = buildKPIList(program).outerHTML; const targetMarketAreas = buildTargetMarketAreaList(p0TargetMarketArea,p1TargetMarketArea).outerHTML; const audiences = buildAudienceList(program).outerHTML; const artifactLinks = buildArtifactLinks(program).outerHTML; To make the code more readable, they were removed when the structure of the code was refactored to incrementally build the block.innerHTML, to make the page appear to load faster.
- Loading branch information