-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement GroupBy feature to allow users to group the issues/prs based on different criteria such as milestone, status and etc. Let's integrate the grouping service in the components.
- Loading branch information
1 parent
1fa6138
commit 3420a73
Showing
15 changed files
with
184 additions
and
113 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...r/hidden-users/hidden-users.component.css → ...hidden-groups/hidden-groups.component.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
.hidden-users { | ||
.hidden-groups { | ||
margin: 8px; | ||
min-width: 150px; | ||
max-width: 300px; | ||
|
33 changes: 33 additions & 0 deletions
33
src/app/issues-viewer/hidden-groups/hidden-groups.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<div *ngIf="groups.length > 0" class="hidden-groups"> | ||
<mat-card matTooltip="Users that have no Issues/PRs pertaining to the current filter" matTooltipShowDelay="0" matTooltipHideDelay="0"> | ||
<mat-card-title>Hidden {{ this.groupingContextService.currGroupBy }}s</mat-card-title> | ||
<div class="row-count">{{ groups.length }}</div> | ||
</mat-card> | ||
<div class="scrollable-container"> | ||
<div *ngFor="let group of groups"> | ||
<ng-container [ngTemplateOutlet]="getCardTemplate()" [ngTemplateOutletContext]="{ $implicit: group }"></ng-container> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<!-- Templates --> | ||
<ng-template #defaultCard let-group> | ||
<mat-card class="loading-spinner"> | ||
<mat-progress-spinner color="primary" mode="indeterminate" diameter="50" strokeWidth="5"></mat-progress-spinner> | ||
</mat-card> | ||
</ng-template> | ||
|
||
<ng-template #assigneeCard let-assignee> | ||
<mat-card> | ||
<mar-card-header class="mat-card-header"> | ||
<div | ||
mat-card-avatar | ||
[ngStyle]="{ | ||
background: 'url(' + assignee.avatar_url + ')', | ||
'background-size': '30px' | ||
}" | ||
></div> | ||
<mat-card-title>{{ assignee.login }}</mat-card-title> | ||
</mar-card-header> | ||
</mat-card> | ||
</ng-template> |
26 changes: 26 additions & 0 deletions
26
src/app/issues-viewer/hidden-groups/hidden-groups.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { Component, Input, TemplateRef, ViewChild } from '@angular/core'; | ||
import { Group } from '../../core/models/github/group.interface'; | ||
import { GroupBy, GroupingContextService } from '../../core/services/grouping/grouping-context.service'; | ||
|
||
@Component({ | ||
selector: 'app-hidden-groups', | ||
templateUrl: './hidden-groups.component.html', | ||
styleUrls: ['./hidden-groups.component.css'] | ||
}) | ||
export class HiddenGroupsComponent { | ||
@Input() groups: Group[] = []; | ||
|
||
@ViewChild('defaultCard') defaultCardTemplate: TemplateRef<any>; | ||
@ViewChild('assigneeCard') assigneeCardTemplate: TemplateRef<any>; | ||
|
||
constructor(public groupingContextService: GroupingContextService) {} | ||
|
||
getCardTemplate(): TemplateRef<any> { | ||
switch (this.groupingContextService.currGroupBy) { | ||
case GroupBy.Assignee: | ||
return this.assigneeCardTemplate; | ||
default: | ||
return this.defaultCardTemplate; | ||
} | ||
} | ||
} |
22 changes: 0 additions & 22 deletions
22
src/app/issues-viewer/hidden-users/hidden-users.component.html
This file was deleted.
Oops, something went wrong.
11 changes: 0 additions & 11 deletions
11
src/app/issues-viewer/hidden-users/hidden-users.component.ts
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.