-
-
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
Add Predictive Modeling page and update settings #61
Conversation
Add Predictive Modeling page and update navigation menu. * Add `PredictiveModelingComponent` and update routes in `frontend/src/app/app.routes.ts`. * Update navigation menu in `frontend/src/app/main/main.component.html` to include link to Predictive Modeling. * Rename and update `frontend/src/app/main/copilot/copilot-calculator/copilot-calculator.component.ts` to `frontend/src/app/main/copilot/predictive-modeling/predictive-modeling.component.ts`. * Rename and update `frontend/src/app/main/copilot/copilot-calculator/copilot-calculator.component.html` to `frontend/src/app/main/copilot/predictive-modeling/predictive-modeling.component.html`. * Rename and update `frontend/src/app/main/copilot/copilot-calculator/copilot-calculator.component.spec.ts` to `frontend/src/app/main/copilot/predictive-modeling/predictive-modeling.component.spec.ts`. * Add methods to get and update new variables in `frontend/src/app/services/settings.service.ts`. * Add methods to get and update new variables in `backend/src/services/settings.service.ts`. * Add methods to get and update new variables in `backend/src/controllers/settings.controller.ts`. * Create `TargetValues` model in `backend/src/models/target-values.model.ts`. * Create `TargetValuesController` in `backend/src/controllers/target-values.controller.ts`. * Create `TargetValuesService` in `backend/src/services/target-values.service.ts`. * Create routes for `TargetValues` in `backend/src/routes/target-values.routes.ts`. --- For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/austenstone/github-value?shareId=XXXX-XXXX-XXXX-XXXX).
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.OpenSSF Scorecard
Scanned Files |
frontend/src/app/main/copilot/predictive-modeling/predictive-modeling.component.ts
Fixed
Show fixed
Hide fixed
frontend/src/app/main/copilot/predictive-modeling/predictive-modeling.component.ts
Fixed
Show fixed
Hide fixed
frontend/src/app/main/copilot/predictive-modeling/predictive-modeling.component.ts
Fixed
Show fixed
Hide fixed
…enhance validation
…roller, model, and form for predictive modeling
Add PredictiveModelingComponent to load settings and target data, and save target values. * **frontend/src/app/main/copilot/predictive-modeling/predictive-modeling.component.ts** - Create PredictiveModelingComponent with settings and target forms. - Load settings and target data from PredictiveModelingService. - Add saveTargets method to save target values. * **frontend/src/app/main/copilot/predictive-modeling/predictive-modeling.component.html** - Create HTML template with left column for settings and target values. - Add right column for calculated fields. - Include "Save Targets" button. * **frontend/src/app/main/copilot/predictive-modeling/predictive-modeling.component.scss** - Add styles for predictive-modeling-container, left and right columns, and button. * **frontend/src/app/services/predictive-modeling.service.ts** - Create PredictiveModelingService to handle data fetching and saving. - Implement methods to get settings, targets, and calculated fields, and save targets. --- For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/austenstone/github-value?shareId=XXXX-XXXX-XXXX-XXXX).
constructor(private http: HttpClient) {} | ||
|
||
getTargets() { | ||
return this.http.get<any>(`${this.apiUrl}/targets`); |
Check failure
Code scanning / ESLint
Disallow the `any` type Error
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix AI about 1 month ago
To fix the problem, we need to replace the any
type with a more specific type that accurately represents the data being returned by the HTTP requests. This involves defining TypeScript interfaces or types that match the expected structure of the data. We will need to update the return types of the getTargets
, saveTargets
, and getCalculatedFields
methods accordingly.
- Define interfaces for the expected data structures.
- Replace the
any
type with the newly defined interfaces in the HTTP request methods.
-
Copy modified lines R5-R16 -
Copy modified line R26 -
Copy modified lines R29-R30 -
Copy modified line R34
@@ -4,2 +4,14 @@ | ||
|
||
interface Target { | ||
id: number; | ||
name: string; | ||
// Add other properties as needed | ||
} | ||
|
||
interface CalculatedField { | ||
id: number; | ||
formula: string; | ||
// Add other properties as needed | ||
} | ||
|
||
@Injectable({ | ||
@@ -13,7 +25,7 @@ | ||
getTargets() { | ||
return this.http.get<any>(`${this.apiUrl}/targets`); | ||
return this.http.get<Target[]>(`${this.apiUrl}/targets`); | ||
} | ||
|
||
saveTargets(targets: any) { | ||
return this.http.post<any>(`${this.apiUrl}/targets`, targets); | ||
saveTargets(targets: Target[]) { | ||
return this.http.post<Target[]>(`${this.apiUrl}/targets`, targets); | ||
} | ||
@@ -21,3 +33,3 @@ | ||
getCalculatedFields() { | ||
return this.http.get<any>(`${this.apiUrl}/calculated-fields`); | ||
return this.http.get<CalculatedField[]>(`${this.apiUrl}/calculated-fields`); | ||
} |
return this.http.get<any>(`${this.apiUrl}/targets`); | ||
} | ||
|
||
saveTargets(targets: any) { |
Check failure
Code scanning / ESLint
Disallow the `any` type Error
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix AI about 1 month ago
To fix the problem, we need to replace the any
type with a more specific type. This involves defining an appropriate interface or type for the targets
parameter and the return types of the HTTP requests. We will define a Target
interface to represent the structure of the targets
data and use it in place of any
.
-
Copy modified lines R5-R10 -
Copy modified line R20 -
Copy modified lines R23-R24 -
Copy modified line R28
@@ -4,2 +4,8 @@ | ||
|
||
interface Target { | ||
id: number; | ||
name: string; | ||
// Add other properties as needed | ||
} | ||
|
||
@Injectable({ | ||
@@ -13,7 +19,7 @@ | ||
getTargets() { | ||
return this.http.get<any>(`${this.apiUrl}/targets`); | ||
return this.http.get<Target[]>(`${this.apiUrl}/targets`); | ||
} | ||
|
||
saveTargets(targets: any) { | ||
return this.http.post<any>(`${this.apiUrl}/targets`, targets); | ||
saveTargets(targets: Target[]) { | ||
return this.http.post<void>(`${this.apiUrl}/targets`, targets); | ||
} | ||
@@ -21,3 +27,3 @@ | ||
getCalculatedFields() { | ||
return this.http.get<any>(`${this.apiUrl}/calculated-fields`); | ||
return this.http.get<any[]>(`${this.apiUrl}/calculated-fields`); | ||
} |
} | ||
|
||
saveTargets(targets: any) { | ||
return this.http.post<any>(`${this.apiUrl}/targets`, targets); |
Check failure
Code scanning / ESLint
Disallow the `any` type Error
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix AI about 1 month ago
To fix the problem, we need to replace the any
type with more specific types that accurately describe the data being handled. This involves defining TypeScript interfaces or types that match the structure of the data returned by the API endpoints and used in the methods.
- Define interfaces for the data structures returned by the API endpoints and used in the methods.
- Replace the
any
type in thegetTargets
,saveTargets
, andgetCalculatedFields
methods with the newly defined interfaces.
-
Copy modified line R4 -
Copy modified line R15 -
Copy modified lines R18-R19 -
Copy modified line R23 -
Copy modified lines R26-R37
@@ -3,2 +3,3 @@ | ||
import { serverUrl } from './server.service'; | ||
import { Target, CalculatedField } from '../models/predictive-modeling.models'; | ||
|
||
@@ -13,7 +14,7 @@ | ||
getTargets() { | ||
return this.http.get<any>(`${this.apiUrl}/targets`); | ||
return this.http.get<Target[]>(`${this.apiUrl}/targets`); | ||
} | ||
|
||
saveTargets(targets: any) { | ||
return this.http.post<any>(`${this.apiUrl}/targets`, targets); | ||
saveTargets(targets: Target[]) { | ||
return this.http.post<void>(`${this.apiUrl}/targets`, targets); | ||
} | ||
@@ -21,4 +22,16 @@ | ||
getCalculatedFields() { | ||
return this.http.get<any>(`${this.apiUrl}/calculated-fields`); | ||
return this.http.get<CalculatedField[]>(`${this.apiUrl}/calculated-fields`); | ||
} | ||
} | ||
|
||
export interface Target { | ||
id: number; | ||
name: string; | ||
// Add other properties as needed | ||
} | ||
|
||
export interface CalculatedField { | ||
id: number; | ||
formula: string; | ||
// Add other properties as needed | ||
} |
} | ||
|
||
getCalculatedFields() { | ||
return this.http.get<any>(`${this.apiUrl}/calculated-fields`); |
Check failure
Code scanning / ESLint
Disallow the `any` type Error
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix AI about 1 month ago
To fix the problem, we need to replace the any
type with a more specific type that accurately represents the data being returned by the HTTP requests. This involves defining TypeScript interfaces or types that match the expected structure of the data. We will need to update the return types of the getTargets
, saveTargets
, and getCalculatedFields
methods accordingly.
- Define interfaces for the expected data structures.
- Replace the
any
type with the newly defined interfaces in the HTTP request methods.
-
Copy modified line R4 -
Copy modified line R15 -
Copy modified lines R18-R19 -
Copy modified line R23 -
Copy modified lines R26-R37
@@ -3,2 +3,3 @@ | ||
import { serverUrl } from './server.service'; | ||
import { Target, CalculatedField } from './types'; | ||
|
||
@@ -13,7 +14,7 @@ | ||
getTargets() { | ||
return this.http.get<any>(`${this.apiUrl}/targets`); | ||
return this.http.get<Target[]>(`${this.apiUrl}/targets`); | ||
} | ||
|
||
saveTargets(targets: any) { | ||
return this.http.post<any>(`${this.apiUrl}/targets`, targets); | ||
saveTargets(targets: Target[]) { | ||
return this.http.post<void>(`${this.apiUrl}/targets`, targets); | ||
} | ||
@@ -21,4 +22,16 @@ | ||
getCalculatedFields() { | ||
return this.http.get<any>(`${this.apiUrl}/calculated-fields`); | ||
return this.http.get<CalculatedField[]>(`${this.apiUrl}/calculated-fields`); | ||
} | ||
} | ||
|
||
export interface Target { | ||
id: number; | ||
name: string; | ||
// Add other properties as needed | ||
} | ||
|
||
export interface CalculatedField { | ||
id: number; | ||
formula: string; | ||
// Add other properties as needed | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🚀
Add Predictive Modeling page and update navigation menu.
PredictiveModelingComponent
and update routes infrontend/src/app/app.routes.ts
.frontend/src/app/main/main.component.html
to include link to Predictive Modeling.frontend/src/app/main/copilot/copilot-calculator/copilot-calculator.component.ts
tofrontend/src/app/main/copilot/predictive-modeling/predictive-modeling.component.ts
.frontend/src/app/main/copilot/copilot-calculator/copilot-calculator.component.html
tofrontend/src/app/main/copilot/predictive-modeling/predictive-modeling.component.html
.frontend/src/app/main/copilot/copilot-calculator/copilot-calculator.component.spec.ts
tofrontend/src/app/main/copilot/predictive-modeling/predictive-modeling.component.spec.ts
.frontend/src/app/services/settings.service.ts
.backend/src/services/settings.service.ts
.backend/src/controllers/settings.controller.ts
.TargetValues
model inbackend/src/models/target-values.model.ts
.TargetValuesController
inbackend/src/controllers/target-values.controller.ts
.TargetValuesService
inbackend/src/services/target-values.service.ts
.TargetValues
inbackend/src/routes/target-values.routes.ts
.For more details, open the Copilot Workspace session.