Skip to content

fix(*): applying fixes around window load for a few sample - #1264

Open
ChronosSF wants to merge 2 commits into
vnextfrom
sstoychev/sample-fixes
Open

ChronosSF wants to merge 2 commits into
vnextfrom
sstoychev/sample-fixes

Conversation

@ChronosSF

Copy link
Copy Markdown
Member

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Resolve the critical initialization error and the moderate navigation-path issue.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Fixes sample initialization when window.load has already fired and updates hierarchical-grid state-persistence navigation.

Changes:

  • Adds load-aware state restoration and column readiness handling.
  • Makes remote paging initialization load-safe.
  • Updates back-navigation paths.
File summaries
File Summary and findings
samples/grids/hierarchical-grid/state-persistence-main/src/index.ts Adds column readiness and load handling. Critical (2 votes): strict-mode fields lack initialization or definite-assignment assertions, causing TS2564 at lines 23 and 44.
samples/grids/hierarchical-grid/state-persistence-about/src/index.ts Updates navigation. Moderate (2 votes): companion links still use an incorrect nested path; they should use ./state-persistence-about.
samples/grids/hierarchical-grid/remote-paging-sample/src/index.ts Handles initial data loading when the page is already complete.
Review details

Suppressed comments (1)

samples/grids/hierarchical-grid/state-persistence-main/src/index.ts:44

  • Promise's resolve callback accepts a value argument, so assigning it directly to the zero-argument resolveColumnsLoaded function is not type-compatible under this sample's strict TypeScript settings. Store a zero-argument wrapper around resolve (and explicitly use Promise<void>) so the sample passes type checking.
        this.columnsLoaded = new Promise((resolve) => this.resolveColumnsLoaded = resolve);
  • Files reviewed: 3/3 changed files
  • Comments generated: 2
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

private grid: IgcHierarchicalGridComponent;
private gridState: IgcGridStateComponent;
private columnsLoaded: Promise<void>;
private resolveColumnsLoaded: () => void;

this._bind = () => {
backBtn.addEventListener("click", () => { window.location.replace("./grids/hierarchical-grid/state-persistence-main");});
backBtn.addEventListener("click", () => { window.location.replace("./state-persistence-main");});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants