Skip to content

Commit

Permalink
feat: add deploy contributions to about menu
Browse files Browse the repository at this point in the history
  • Loading branch information
jakerenzella committed Sep 28, 2021
1 parent f25140b commit 0fcd614
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ export class AboutDialogData {
return compare(a.apiContributions, b.apiContributions, isAsc);
case 'web-contributions':
return compare(a.webContributions, b.webContributions, isAsc);
case 'deploy-contributions':
return compare(a.deployContributions, b.deployContributions, isAsc);
case 'io-contributions':
return compare(a.ioContributions, b.ioContributions, isAsc);
default:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ <h2>Contributors</h2>
<th mat-header-cell *matHeaderCellDef mat-sort-header> Web </th>
<td mat-cell *matCellDef="let element"> {{element.webContributions}} </td>
</ng-container>
<!-- Deploy Contributions Column -->
<ng-container matColumnDef="deploy-contributions">
<th mat-header-cell *matHeaderCellDef mat-sort-header> Deploy </th>
<td mat-cell *matCellDef="let element"> {{element.deployContributions}} </td>
</ng-container>
<!-- Doubtfire.io Contributions Column -->
<ng-container matColumnDef="io-contributions">
<th mat-header-cell *matHeaderCellDef mat-sort-header> doubtfire.io </th>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export class AboutDoubtfireModalContent {
'contributions',
'api-contributions',
'web-contributions',
'deploy-contributions',
'io-contributions',
];

Expand Down Expand Up @@ -96,5 +97,6 @@ export class AboutDoubtfireModal {
this.aboutDoubtfireModalService.getAPIContributors(this.aboutDialogData);
this.aboutDoubtfireModalService.getWebContributors(this.aboutDialogData);
this.aboutDoubtfireModalService.getDoubtfireIOWebContributors(this.aboutDialogData);
this.aboutDoubtfireModalService.getDeployContributors(this.aboutDialogData);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,14 @@ export class AboutDoubtfireModalService {
);
}

public getDeployContributors(data: AboutDialogData) {
this.getContributors(
'https://api.github.com/repos/doubtfire-lms/doubtfire-deploy/contributors',
data,
'deployContributions'
);
}

public getWebContributors(data: AboutDialogData) {
this.getContributors(
'https://api.github.com/repos/doubtfire-lms/doubtfire-web/contributors',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,16 @@ export class ContributorData {
apiContributions: number;
webContributions: number;
ioContributions: number;
deployContributions: number;

constructor(login: string, htmlUrl: string, avatarUrl: string) {
this.login = login;
this.htmlUrl = htmlUrl;
this.avatarUrl = avatarUrl;
this.apiContributions = 0;
this.webContributions = 0;
this.ioContributions = 0;
this.deployContributions = 0;
}
totalContributions(): number {
return this.apiContributions + this.webContributions + this.ioContributions;
Expand Down

0 comments on commit 0fcd614

Please sign in to comment.