Skip to content

Commit

Permalink
Fix case for repos without any milestones
Browse files Browse the repository at this point in the history
  • Loading branch information
Misra Aditya committed Apr 1, 2024
1 parent ba6530d commit 26b65fa
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/app/issues-viewer/card-view/card-view.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<div class="scrollable-container-wrapper">
<div class="scrollable-container">
<div class="issue-pr-cards" *ngFor="let issue of this.issues$ | async; index as i">
<app-issue-pr-card [issue]="issue" [filter]="issues.filter"></app-issue-pr-card>
<app-issue-pr-card [issue]="issue" [filter]="issues.filter" [milestoneService]="milestoneService"></app-issue-pr-card>
</div>
<mat-card class="loading-spinner" *ngIf="this.issues.isLoading$ | async">
<mat-progress-spinner color="primary" mode="indeterminate" diameter="50" strokeWidth="5"></mat-progress-spinner>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<span class="octicon-milestone" octicon="milestone" color="grey" size="8"> </span>
{{ milestone.title }}
</div>
<div *ngIf="!milestone.state" class="milestone">
<div *ngIf="!milestone.state && hasMilestones" class="milestone">
<span class="octicon-milestone" octicon="milestone" color="red" size="8"> </span>
<span style="color: red">???</span>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { Milestone } from '../../../core/models/milestone.model';
})
export class IssuePrCardMilestoneComponent {
@Input() milestone: Milestone;
@Input() hasMilestones: boolean;

constructor() {}
}
5 changes: 4 additions & 1 deletion src/app/shared/issue-pr-card/issue-pr-card.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
<span [matTooltip]="this.issue.updated_at">
<app-issue-pr-card-header [issue]="issue"></app-issue-pr-card-header>
<mat-card-content>
<app-issue-pr-card-milestone [milestone]="issue.milestone"></app-issue-pr-card-milestone>
<app-issue-pr-card-milestone
[milestone]="issue.milestone"
[hasMilestones]="!milestoneService.hasNoMilestones"
></app-issue-pr-card-milestone>
<app-issue-pr-card-labels [labels]="issue.githubLabels" [labelSet]="filter?.hiddenLabels"></app-issue-pr-card-labels>
</mat-card-content>
</span>
Expand Down
2 changes: 2 additions & 0 deletions src/app/shared/issue-pr-card/issue-pr-card.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { Filter } from '../../core/services/filters.service';
import { GithubService } from '../../core/services/github.service';
import { LabelService } from '../../core/services/label.service';
import { LoggingService } from '../../core/services/logging.service';
import { MilestoneService } from '../../core/services/milestone.service';

@Component({
selector: 'app-issue-pr-card',
Expand All @@ -13,6 +14,7 @@ import { LoggingService } from '../../core/services/logging.service';
export class IssuePrCardComponent {
@Input() issue: Issue;
@Input() filter?: Filter;
@Input() milestoneService: MilestoneService;

constructor(private logger: LoggingService, private githubService: GithubService, public labelService: LabelService) {}

Expand Down

0 comments on commit 26b65fa

Please sign in to comment.