Skip to content

Commit 2c5f6bb

Browse files
Jan Kaiserhonzikec
authored andcommitted
chore: cleanup and comments
1 parent fc9cbcd commit 2c5f6bb

9 files changed

Lines changed: 9 additions & 13 deletions

File tree

angular-ngrx-scss/src/app/issues/components/issues-list/issues-list.component.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { Component, Input } from '@angular/core';
2-
import { Issue } from 'src/app/repository/services/repository.interfaces';
32
import { RepoIssues } from 'src/app/state/repository';
43

54
@Component({

angular-ngrx-scss/src/app/issues/components/issues.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Component } from '@angular/core';
1+
import { Component, OnInit } from '@angular/core';
22
import { ActivatedRoute } from '@angular/router';
33
import { Store } from '@ngrx/store';
44
import {
@@ -15,7 +15,7 @@ import {
1515
templateUrl: './issues.component.html',
1616
styleUrls: ['./issues.component.scss'],
1717
})
18-
export class IssuesComponent {
18+
export class IssuesComponent implements OnInit {
1919
owner!: string;
2020
repoName!: string;
2121
openIssues$ = this.store.select(selectOpenIssues);

angular-ngrx-scss/src/app/repository/components/repo-header/repo-header.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Component, Input } from '@angular/core';
1+
import { Component } from '@angular/core';
22
import { Store } from '@ngrx/store';
33
import { selectedRepository } from 'src/app/state/repository';
44

angular-ngrx-scss/src/app/repository/services/repository.service.spec.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import {
1010
PullRequestAPIResponse,
1111
RepoApiResponse,
1212
RepoContentsApiResponse,
13-
RepoIssues,
1413
} from 'src/app/state/repository';
1514
import {
1615
IssueComments,

angular-ngrx-scss/src/app/repository/services/repository.service.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { HttpClient, HttpParams, HttpResponse } from '@angular/common/http';
1+
import { HttpClient, HttpParams } from '@angular/common/http';
22
import { Injectable } from '@angular/core';
33
import { Observable, forkJoin, map } from 'rxjs';
44
import {
@@ -16,7 +16,6 @@ import { environment } from 'src/environments/environment';
1616
import {
1717
Issue,
1818
IssueComments,
19-
Issues,
2019
PullRequest,
2120
PullRequests,
2221
RepositoryIssuesApiParams,
@@ -210,6 +209,11 @@ export class RepositoryService {
210209
const name = encodeURIComponent(repoName);
211210
const url = `${environment.githubUrl}/repos/${owner}/${name}/issues`;
212211

212+
// We need to make two calls to get the total count of issues and the issues themselves.
213+
// This workaround is needed because the GitHub REST API doesn't return the total count of issues in the response.
214+
// We can get the total count from the "Link" HTTP header,
215+
// but we need to make a call with per_page=1 to be able to calculate the total count.
216+
// See https://developer.github.com/v3/guides/traversing-with-pagination/#calculating-the-pagination-offset
213217
return forkJoin([
214218
this.http.get(url, {
215219
observe: 'response',

angular-ngrx-scss/src/app/shared/components/pagination/pagination.component.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ export class PaginationComponent {
1515

1616
@Input() set params(params: PaginationParams | null | undefined) {
1717
if (params) {
18-
console.log(params);
1918
this.paginationParams = params;
2019
}
2120
}

angular-ngrx-scss/src/app/state/repository/repository.effects.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ import {
2323
RepoPullRequests,
2424
RepositoryState,
2525
} from './repository.state';
26-
import { Issue } from 'src/app/repository/services/repository.interfaces';
2726

2827
@Injectable()
2928
export class RepositoryEffects {
@@ -66,7 +65,6 @@ export class RepositoryEffects {
6665
repoLabels$,
6766
).pipe(
6867
map(([info, prList, contents, readme, milestones, labels]) => {
69-
console.log(info);
7068
const allData: RepositoryState = {
7169
description: info.description,
7270
forkCount: info.forks_count,
@@ -160,7 +158,6 @@ export class RepositoryEffects {
160158
.getRepositoryIssues(owner, repoName, params)
161159
.pipe(
162160
map((issues) => {
163-
console.log(issues, params);
164161
return fetchIssuesSuccess({ issues, params });
165162
}),
166163
catchError((error) => of(fetchIssuesFailure({ error }))),

angular-ngrx-scss/src/app/state/repository/repository.state.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { Issue } from 'src/app/repository/services/repository.interfaces';
22
import { UserApiResponse } from '../user';
3-
import { number } from '@primer/octicons';
43

54
export interface RepositoryState {
65
description: string;

angular-ngrx-scss/tsconfig.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
"resolveJsonModule": true,
2121
"paths": {
2222
"@prism": [
23-
"dist/prism/prism",
2423
"dist/prism"
2524
]
2625
},

0 commit comments

Comments
 (0)