-
-
Notifications
You must be signed in to change notification settings - Fork 1
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
Status #84
Status #84
Conversation
…and improve development scripts
…int, and improve data handling
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.OpenSSF Scorecard
Scanned Files |
@@ -1,6 +1,6 @@ | |||
import { Endpoints } from '@octokit/types'; | |||
import { Seat } from "../models/copilot.seats.model.js"; | |||
import { QueryTypes, Sequelize } from 'sequelize'; | |||
import { Op, QueryTypes, Sequelize } from 'sequelize'; |
Check failure
Code scanning / ESLint
Disallow unused variables Error
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix AI about 2 months ago
To fix the problem, we need to remove the unused QueryTypes
import from the file. This will resolve the ESLint error and clean up the code. The change should be made in the backend/src/services/copilot.seats.service.ts
file, specifically on line 3.
-
Copy modified line R3
@@ -2,3 +2,3 @@ | ||
import { Seat } from "../models/copilot.seats.model.js"; | ||
import { Op, QueryTypes, Sequelize } from 'sequelize'; | ||
import { Op, Sequelize } from 'sequelize'; | ||
import { components } from "@octokit/openapi-types"; |
import { MetricsService } from '../../../services/api/metrics.service'; | ||
import { CopilotMetrics } from '../../../services/api/metrics.service.interfaces'; | ||
import { ActivityResponse, Seat, SeatService } from '../../../services/api/seat.service'; | ||
import { MembersService } from '../../../services/api/members.service'; | ||
import { CopilotSurveyService, Survey } from '../../../services/api/copilot-survey.service'; | ||
import { forkJoin, takeUntil } from 'rxjs'; | ||
import { forkJoin, Subject, Subscription, takeUntil } from 'rxjs'; |
Check failure
Code scanning / ESLint
Disallow unused variables Error
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix AI about 2 months ago
To fix the problem, we need to remove the unused forkJoin
import from the file. This will resolve the ESLint error and clean up the code. The change should be made in the frontend/src/app/main/copilot/copilot-dashboard/dashboard.component.ts
file, specifically on line 9 where forkJoin
is imported.
-
Copy modified line R9
@@ -8,3 +8,3 @@ | ||
import { CopilotSurveyService, Survey } from '../../../services/api/copilot-survey.service'; | ||
import { forkJoin, Subject, Subscription, takeUntil } from 'rxjs'; | ||
import { Subject, Subscription, takeUntil } from 'rxjs'; | ||
import { AdoptionChartComponent } from '../copilot-value/adoption-chart/adoption-chart.component'; |
|
||
activityTotals?: Record<string, number>; | ||
status?: any; |
Check failure
Code scanning / ESLint
Disallow the `any` type Error
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix AI about 2 months ago
To fix the problem, we need to replace the any
type with a more specific type that accurately represents the data that the status
variable is expected to hold. This will improve type safety and make the code easier to understand and maintain.
In this case, we can infer from the context that status
might be an object with specific properties. We should define an appropriate interface or type alias for this object and use it instead of any
.
-
Copy modified line R77
@@ -76,3 +76,3 @@ | ||
activityTotals?: Record<string, number>; | ||
status?: any; | ||
status?: { [key: string]: string | number | boolean }; | ||
statuses = [] as { |
this.status = status; | ||
this.statuses[0] = { | ||
title: 'GitHub App', | ||
message: status.installations.reduce((acc: number, i: any) => acc += i.repos.length, 0) + ' repositories', |
Check failure
Code scanning / ESLint
Disallow the `any` type Error
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix AI about 2 months ago
To fix the problem, we need to replace the any
type with a more specific type that accurately represents the structure of the i
variable. This involves defining an interface that describes the expected properties of i
and then using this interface in place of any
. Specifically, we need to define an interface for the installation
object that includes a repos
property, which is an array. We will then use this interface in the reduce
function to ensure type safety.
-
Copy modified lines R16-R18 -
Copy modified line R132
@@ -15,2 +15,5 @@ | ||
import { StatusComponent } from './status/status.component'; | ||
interface Installation { | ||
repos: { length: number }[]; | ||
} | ||
|
||
@@ -128,3 +131,3 @@ | ||
title: 'GitHub App', | ||
message: status.installations.reduce((acc: number, i: any) => acc += i.repos.length, 0) + ' repositories', | ||
message: status.installations.reduce((acc: number, i: Installation) => acc += i.repos.length, 0) + ' repositories', | ||
status: status.installations.length > 0 ? 'success' : 'error' |
import { DateRangeSelectComponent } from "../../../shared/date-range-select/date-range-select.component"; | ||
import { MetricsService } from '../../../services/api/metrics.service'; | ||
import { CopilotMetrics } from '../../../services/api/metrics.service.interfaces'; | ||
import { CopilotMetricsPieChartComponent } from './copilot-metrics-pie-chart/copilot-metrics-pie-chart.component'; | ||
import { MatCardModule } from '@angular/material/card'; | ||
import { Installation, InstallationsService } from '../../../services/api/installations.service'; | ||
import { takeUntil } from 'rxjs'; | ||
import { forkJoin, Subject, Subscription, takeUntil } from 'rxjs'; |
Check failure
Code scanning / ESLint
Disallow unused variables Error
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix AI about 2 months ago
To fix the problem, we need to remove the unused forkJoin
import from the file. This will resolve the ESLint error and clean up the code. The change is straightforward and involves deleting the forkJoin
import from the import statement on line 8.
-
Copy modified line R8
@@ -7,3 +7,3 @@ | ||
import { Installation, InstallationsService } from '../../../services/api/installations.service'; | ||
import { forkJoin, Subject, Subscription, takeUntil } from 'rxjs'; | ||
import { Subject, Subscription, takeUntil } from 'rxjs'; | ||
import { DashboardCardBarsComponent } from '../copilot-dashboard/dashboard-card/dashboard-card-bars/dashboard-card-bars.component'; |
}); | ||
} | ||
|
||
dateRangeChange(event: {start: Date, end: Date}) { | ||
ngOnDestroy() { |
Check warning
Code scanning / ESLint
Ensures that classes implement lifecycle interfaces corresponding to the declared lifecycle methods. See more at https://angular.dev/style-guide#style-09-01 Warning
}); | ||
} | ||
|
||
ngOnDestroy() { |
Check warning
Code scanning / ESLint
Ensures that classes implement lifecycle interfaces corresponding to the declared lifecycle methods. See more at https://angular.dev/style-guide#style-09-01 Warning
@@ -1,4 +1,4 @@ | |||
import { Injectable, OnDestroy } from '@angular/core'; | |||
import { Injectable, OnDestroy, OnInit } from '@angular/core'; |
Check failure
Code scanning / ESLint
Disallow unused variables Error
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix AI about 2 months ago
To fix the problem, we need to remove the unused OnInit
import from the file. This will resolve the ESLint error and clean up the code by removing unnecessary imports.
- Locate the import statement on line 1 in the file
frontend/src/app/services/api/installations.service.ts
. - Remove the
OnInit
import from the import statement.
-
Copy modified line R1
@@ -1,2 +1,2 @@ | ||
import { Injectable, OnDestroy, OnInit } from '@angular/core'; | ||
import { Injectable, OnDestroy } from '@angular/core'; | ||
import { BehaviorSubject, of, Subject, tap } from 'rxjs'; |
@@ -72,5 +73,8 @@ | |||
localStorage.setItem('installation', id.toString()); | |||
} | |||
|
|||
getStatus2() { | |||
return this.http.get<any>(`${serverUrl}/api/status`); |
Check failure
Code scanning / ESLint
Disallow the `any` type Error
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix AI about 2 months ago
To fix the problem, we need to replace the any
type with a more specific type that accurately represents the data returned by the API endpoint. This involves defining a new interface or type that matches the structure of the response from the ${serverUrl}/api/status
endpoint. We will then use this new type in the getStatus2
method.
- Define a new interface
StatusResponse2
that matches the structure of the response from the${serverUrl}/api/status
endpoint. - Update the
getStatus2
method to use the newStatusResponse2
type instead ofany
.
-
Copy modified lines R20-R27 -
Copy modified line R84
@@ -19,2 +19,10 @@ | ||
|
||
export interface StatusResponse2 { | ||
// Define the structure of the response here | ||
// For example: | ||
isSetup: boolean; | ||
dbConnected: boolean; | ||
installations: InstallationStatus[]; | ||
} | ||
|
||
export type Installations = Endpoints["GET /app/installations"]["response"]["data"] | ||
@@ -75,3 +83,3 @@ | ||
getStatus2() { | ||
return this.http.get<any>(`${serverUrl}/api/status`); | ||
return this.http.get<StatusResponse2>(`${serverUrl}/api/status`); | ||
} |
…nd services for cleaner code
…ts for improved clarity and maintainability
…ormatting and commenting out unused scatter series code
…date styles in status.component.scss for better visibility; comment out GitHub repository link in settings.component.html for future reference.
No description provided.