Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ExpressionChangedAfterItHasBeenCheckedError found in hidden-groups.component.html #406

Open
Eclipse-Dominator opened this issue Feb 15, 2025 · 0 comments · May be fixed by #407
Open

ExpressionChangedAfterItHasBeenCheckedError found in hidden-groups.component.html #406

Eclipse-Dominator opened this issue Feb 15, 2025 · 0 comments · May be fixed by #407
Assignees
Labels
category.Bug p.Low low value, can be delayed indefinitely

Comments

@Eclipse-Dominator
Copy link
Contributor

Describe the bug

To Reproduce
Steps to reproduce the behavior:

  1. Run npm ng:serve:web on current main branch.
  2. Go to any repo and set the filter to ensure that there is at least 1 hidden user in the GUI
  3. Now try to switch to an invalid repo
  4. See error

Expected behavior
No such error should appear.

Screenshots

image

Additional context
Investigation suggests this bug arises from hidden-groups.component.html

...
  <div class="scrollable-container">
    <div *ngFor="let group of groups">
      <ng-container [ngTemplateOutlet]="getCardTemplate()" [ngTemplateOutletContext]="{ $implicit: group }"></ng-container>
    </div>
...

<!-- Templates -->
<ng-template #defaultCard let-group>
...
</ng-template>

<ng-template #assigneeCard let-assignee>
...
</ng-template>

<ng-template #milestoneCard let-milestone>
...
</ng-template>
  @ViewChild('defaultCard') defaultCardTemplate: TemplateRef<any>;
  @ViewChild('assigneeCard') assigneeCardTemplate: TemplateRef<any>;
  @ViewChild('milestoneCard') milestoneCardTemplate: TemplateRef<any>;
// ...
  getCardTemplate(): TemplateRef<any> {
    switch (this.groupingContextService.currGroupBy) {
      case GroupBy.Assignee:
        return this.assigneeCardTemplate;
      case GroupBy.Milestone:
        return this.milestoneCardTemplate;
      default:
        return this.defaultCardTemplate;
    }
  }

How this appeared is the templates are undefined since the UI have not loaded. This causes getCardTemplate() to be undefined when angular is creating the UI. This becomes defined later on, which is uncaught by Angular's internal check during development leading to this issue.

@Eclipse-Dominator Eclipse-Dominator added category.Bug p.Low low value, can be delayed indefinitely labels Feb 15, 2025
@wx-03 wx-03 self-assigned this Feb 15, 2025
@wx-03 wx-03 linked a pull request Feb 15, 2025 that will close this issue
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category.Bug p.Low low value, can be delayed indefinitely
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants