-
-
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
Update predictive modeling page layout and behavior #63
Conversation
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).
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.OpenSSF Scorecard
Scanned Files |
export class PredictiveModelingComponent implements OnInit { | ||
settingsForm: FormGroup; | ||
targetForm: FormGroup; | ||
calculatedFields: 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 structure of calculatedFields
. This will involve understanding the expected structure of calculatedFields
and defining an appropriate TypeScript interface or type alias for it. Once we have the correct type, we can update the type declaration for calculatedFields
.
-
Copy modified line R14
@@ -13,3 +13,3 @@ | ||
targetForm: FormGroup; | ||
calculatedFields: any; | ||
calculatedFields: { [key: string]: number }; | ||
|
|
||
constructor(private http: HttpClient) {} | ||
|
||
getSettings(): Observable<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 being handled. This involves defining TypeScript interfaces or types for the data structures 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 with the newly defined interfaces in the method signatures and HTTP requests.
-
Copy modified lines R5-R16 -
Copy modified lines R25-R26 -
Copy modified lines R29-R30 -
Copy modified lines R33-R34 -
Copy modified lines R37-R38
@@ -4,2 +4,14 @@ | ||
|
||
interface Settings { | ||
// Define the structure of the settings data | ||
} | ||
|
||
interface Target { | ||
// Define the structure of the target data | ||
} | ||
|
||
interface CalculatedField { | ||
// Define the structure of the calculated field data | ||
} | ||
|
||
@Injectable({ | ||
@@ -12,16 +24,16 @@ | ||
|
||
getSettings(): Observable<any> { | ||
return this.http.get<any>(`${this.apiUrl}/settings`); | ||
getSettings(): Observable<Settings> { | ||
return this.http.get<Settings>(`${this.apiUrl}/settings`); | ||
} | ||
|
||
getTargets(): Observable<any> { | ||
return this.http.get<any>(`${this.apiUrl}/targets`); | ||
getTargets(): Observable<Target[]> { | ||
return this.http.get<Target[]>(`${this.apiUrl}/targets`); | ||
} | ||
|
||
saveTargets(targets: any): Observable<any> { | ||
return this.http.post<any>(`${this.apiUrl}/targets`, targets); | ||
saveTargets(targets: Target[]): Observable<void> { | ||
return this.http.post<void>(`${this.apiUrl}/targets`, targets); | ||
} | ||
|
||
getCalculatedFields(): Observable<any> { | ||
return this.http.get<any>(`${this.apiUrl}/calculated-fields`); | ||
getCalculatedFields(): Observable<CalculatedField[]> { | ||
return this.http.get<CalculatedField[]>(`${this.apiUrl}/calculated-fields`); | ||
} |
constructor(private http: HttpClient) {} | ||
|
||
getSettings(): Observable<any> { | ||
return this.http.get<any>(`${this.apiUrl}/settings`); |
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 endpoints. This involves defining TypeScript interfaces or types that describe the structure of the data. We will then use these types in the method signatures instead of any
.
- Define interfaces for the expected data structures returned by the API endpoints.
- Update the method signatures to use these interfaces instead of
any
. - Ensure that the HTTP client methods use the correct types.
-
Copy modified lines R5-R16 -
Copy modified lines R25-R26 -
Copy modified lines R29-R30 -
Copy modified lines R33-R34 -
Copy modified lines R37-R38
@@ -4,2 +4,14 @@ | ||
|
||
interface Settings { | ||
// Define the structure of settings data | ||
} | ||
|
||
interface Target { | ||
// Define the structure of target data | ||
} | ||
|
||
interface CalculatedField { | ||
// Define the structure of calculated field data | ||
} | ||
|
||
@Injectable({ | ||
@@ -12,16 +24,16 @@ | ||
|
||
getSettings(): Observable<any> { | ||
return this.http.get<any>(`${this.apiUrl}/settings`); | ||
getSettings(): Observable<Settings> { | ||
return this.http.get<Settings>(`${this.apiUrl}/settings`); | ||
} | ||
|
||
getTargets(): Observable<any> { | ||
return this.http.get<any>(`${this.apiUrl}/targets`); | ||
getTargets(): Observable<Target[]> { | ||
return this.http.get<Target[]>(`${this.apiUrl}/targets`); | ||
} | ||
|
||
saveTargets(targets: any): Observable<any> { | ||
return this.http.post<any>(`${this.apiUrl}/targets`, targets); | ||
saveTargets(targets: Target[]): Observable<void> { | ||
return this.http.post<void>(`${this.apiUrl}/targets`, targets); | ||
} | ||
|
||
getCalculatedFields(): Observable<any> { | ||
return this.http.get<any>(`${this.apiUrl}/calculated-fields`); | ||
getCalculatedFields(): Observable<CalculatedField[]> { | ||
return this.http.get<CalculatedField[]>(`${this.apiUrl}/calculated-fields`); | ||
} |
return this.http.get<any>(`${this.apiUrl}/settings`); | ||
} | ||
|
||
getTargets(): Observable<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 being handled. This involves defining TypeScript interfaces or types that match the structure of the data returned by the API endpoints and using these types in the method signatures.
- Define interfaces for the data structures returned by the API endpoints.
- Replace the
any
type in the method signatures with the newly defined interfaces. - Ensure that the methods return the correct types and handle the data accordingly.
-
Copy modified lines R5-R16 -
Copy modified lines R25-R26 -
Copy modified lines R29-R30 -
Copy modified lines R33-R34 -
Copy modified lines R37-R38
@@ -4,2 +4,14 @@ | ||
|
||
interface Settings { | ||
// Define the structure of the settings data | ||
} | ||
|
||
interface Target { | ||
// Define the structure of the target data | ||
} | ||
|
||
interface CalculatedField { | ||
// Define the structure of the calculated field data | ||
} | ||
|
||
@Injectable({ | ||
@@ -12,16 +24,16 @@ | ||
|
||
getSettings(): Observable<any> { | ||
return this.http.get<any>(`${this.apiUrl}/settings`); | ||
getSettings(): Observable<Settings> { | ||
return this.http.get<Settings>(`${this.apiUrl}/settings`); | ||
} | ||
|
||
getTargets(): Observable<any> { | ||
return this.http.get<any>(`${this.apiUrl}/targets`); | ||
getTargets(): Observable<Target[]> { | ||
return this.http.get<Target[]>(`${this.apiUrl}/targets`); | ||
} | ||
|
||
saveTargets(targets: any): Observable<any> { | ||
return this.http.post<any>(`${this.apiUrl}/targets`, targets); | ||
saveTargets(targets: Target[]): Observable<void> { | ||
return this.http.post<void>(`${this.apiUrl}/targets`, targets); | ||
} | ||
|
||
getCalculatedFields(): Observable<any> { | ||
return this.http.get<any>(`${this.apiUrl}/calculated-fields`); | ||
getCalculatedFields(): Observable<CalculatedField[]> { | ||
return this.http.get<CalculatedField[]>(`${this.apiUrl}/calculated-fields`); | ||
} |
} | ||
|
||
getTargets(): Observable<any> { | ||
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 2 months 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 using these types in the method signatures.
- Define interfaces for the expected data structures returned by the API endpoints.
- Replace the
any
type in the method signatures with these newly defined interfaces. - Ensure that the
HttpClient
methods use the correct types for the API responses.
-
Copy modified lines R5-R16 -
Copy modified lines R25-R26 -
Copy modified lines R29-R30 -
Copy modified lines R33-R34 -
Copy modified lines R37-R38
@@ -4,2 +4,14 @@ | ||
|
||
interface Settings { | ||
// Define the structure of the settings data | ||
} | ||
|
||
interface Target { | ||
// Define the structure of the target data | ||
} | ||
|
||
interface CalculatedField { | ||
// Define the structure of the calculated field data | ||
} | ||
|
||
@Injectable({ | ||
@@ -12,16 +24,16 @@ | ||
|
||
getSettings(): Observable<any> { | ||
return this.http.get<any>(`${this.apiUrl}/settings`); | ||
getSettings(): Observable<Settings> { | ||
return this.http.get<Settings>(`${this.apiUrl}/settings`); | ||
} | ||
|
||
getTargets(): Observable<any> { | ||
return this.http.get<any>(`${this.apiUrl}/targets`); | ||
getTargets(): Observable<Target[]> { | ||
return this.http.get<Target[]>(`${this.apiUrl}/targets`); | ||
} | ||
|
||
saveTargets(targets: any): Observable<any> { | ||
return this.http.post<any>(`${this.apiUrl}/targets`, targets); | ||
saveTargets(targets: Target[]): Observable<void> { | ||
return this.http.post<void>(`${this.apiUrl}/targets`, targets); | ||
} | ||
|
||
getCalculatedFields(): Observable<any> { | ||
return this.http.get<any>(`${this.apiUrl}/calculated-fields`); | ||
getCalculatedFields(): Observable<CalculatedField[]> { | ||
return this.http.get<CalculatedField[]>(`${this.apiUrl}/calculated-fields`); | ||
} |
return this.http.get<any>(`${this.apiUrl}/targets`); | ||
} | ||
|
||
saveTargets(targets: any): Observable<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 being handled. This involves defining TypeScript interfaces or types for the expected data structures and updating the method signatures accordingly.
- Define interfaces for the expected data structures returned by the API endpoints and used in the
saveTargets
method. - Update the return types of the
getSettings
,getTargets
,getCalculatedFields
methods, and the parameter type of thesaveTargets
method to use the newly defined interfaces.
-
Copy modified lines R5-R16 -
Copy modified lines R25-R26 -
Copy modified lines R29-R30 -
Copy modified lines R33-R34 -
Copy modified lines R37-R38
@@ -4,2 +4,14 @@ | ||
|
||
interface Settings { | ||
// Define the structure of the settings object | ||
} | ||
|
||
interface Target { | ||
// Define the structure of a target object | ||
} | ||
|
||
interface CalculatedField { | ||
// Define the structure of a calculated field object | ||
} | ||
|
||
@Injectable({ | ||
@@ -12,16 +24,16 @@ | ||
|
||
getSettings(): Observable<any> { | ||
return this.http.get<any>(`${this.apiUrl}/settings`); | ||
getSettings(): Observable<Settings> { | ||
return this.http.get<Settings>(`${this.apiUrl}/settings`); | ||
} | ||
|
||
getTargets(): Observable<any> { | ||
return this.http.get<any>(`${this.apiUrl}/targets`); | ||
getTargets(): Observable<Target[]> { | ||
return this.http.get<Target[]>(`${this.apiUrl}/targets`); | ||
} | ||
|
||
saveTargets(targets: any): Observable<any> { | ||
return this.http.post<any>(`${this.apiUrl}/targets`, targets); | ||
saveTargets(targets: Target[]): Observable<void> { | ||
return this.http.post<void>(`${this.apiUrl}/targets`, targets); | ||
} | ||
|
||
getCalculatedFields(): Observable<any> { | ||
return this.http.get<any>(`${this.apiUrl}/calculated-fields`); | ||
getCalculatedFields(): Observable<CalculatedField[]> { | ||
return this.http.get<CalculatedField[]>(`${this.apiUrl}/calculated-fields`); | ||
} |
return this.http.get<any>(`${this.apiUrl}/targets`); | ||
} | ||
|
||
saveTargets(targets: any): Observable<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 being handled. This involves defining TypeScript interfaces or types for the expected data structures and using these types in the method signatures.
- Define interfaces for the expected data structures returned by the API endpoints and used in the
saveTargets
method. - Replace the
any
type with the newly defined interfaces in the method signatures.
-
Copy modified line R2 -
Copy modified lines R14-R15 -
Copy modified lines R18-R19 -
Copy modified lines R22-R23 -
Copy modified lines R26-R27
@@ -1,2 +1,3 @@ | ||
import { Injectable } from '@angular/core'; | ||
import { Settings, Target, CalculatedField } from '../models/predictive-modeling.models'; | ||
import { HttpClient } from '@angular/common/http'; | ||
@@ -12,16 +13,16 @@ | ||
|
||
getSettings(): Observable<any> { | ||
return this.http.get<any>(`${this.apiUrl}/settings`); | ||
getSettings(): Observable<Settings> { | ||
return this.http.get<Settings>(`${this.apiUrl}/settings`); | ||
} | ||
|
||
getTargets(): Observable<any> { | ||
return this.http.get<any>(`${this.apiUrl}/targets`); | ||
getTargets(): Observable<Target[]> { | ||
return this.http.get<Target[]>(`${this.apiUrl}/targets`); | ||
} | ||
|
||
saveTargets(targets: any): Observable<any> { | ||
return this.http.post<any>(`${this.apiUrl}/targets`, targets); | ||
saveTargets(targets: Target[]): Observable<void> { | ||
return this.http.post<void>(`${this.apiUrl}/targets`, targets); | ||
} | ||
|
||
getCalculatedFields(): Observable<any> { | ||
return this.http.get<any>(`${this.apiUrl}/calculated-fields`); | ||
getCalculatedFields(): Observable<CalculatedField[]> { | ||
return this.http.get<CalculatedField[]>(`${this.apiUrl}/calculated-fields`); | ||
} |
} | ||
|
||
saveTargets(targets: any): Observable<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 2 months 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 for the data structures returned by the API and used in the service methods. We will create interfaces for the settings, targets, and calculated fields, and use these interfaces in the method signatures.
-
Copy modified lines R5-R16 -
Copy modified lines R25-R26 -
Copy modified lines R29-R30 -
Copy modified lines R33-R34 -
Copy modified lines R37-R38
@@ -4,2 +4,14 @@ | ||
|
||
interface Settings { | ||
// Define the structure of settings data | ||
} | ||
|
||
interface Target { | ||
// Define the structure of target data | ||
} | ||
|
||
interface CalculatedField { | ||
// Define the structure of calculated field data | ||
} | ||
|
||
@Injectable({ | ||
@@ -12,16 +24,16 @@ | ||
|
||
getSettings(): Observable<any> { | ||
return this.http.get<any>(`${this.apiUrl}/settings`); | ||
getSettings(): Observable<Settings> { | ||
return this.http.get<Settings>(`${this.apiUrl}/settings`); | ||
} | ||
|
||
getTargets(): Observable<any> { | ||
return this.http.get<any>(`${this.apiUrl}/targets`); | ||
getTargets(): Observable<Target[]> { | ||
return this.http.get<Target[]>(`${this.apiUrl}/targets`); | ||
} | ||
|
||
saveTargets(targets: any): Observable<any> { | ||
return this.http.post<any>(`${this.apiUrl}/targets`, targets); | ||
saveTargets(targets: Target[]): Observable<void> { | ||
return this.http.post<void>(`${this.apiUrl}/targets`, targets); | ||
} | ||
|
||
getCalculatedFields(): Observable<any> { | ||
return this.http.get<any>(`${this.apiUrl}/calculated-fields`); | ||
getCalculatedFields(): Observable<CalculatedField[]> { | ||
return this.http.get<CalculatedField[]>(`${this.apiUrl}/calculated-fields`); | ||
} |
return this.http.post<any>(`${this.apiUrl}/targets`, targets); | ||
} | ||
|
||
getCalculatedFields(): Observable<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 more specific types that accurately represent the data being handled by the PredictiveModelingService
. This involves defining TypeScript interfaces or types for the expected data structures and using these types in the method signatures.
- Define interfaces for the data structures returned by the API endpoints and used in the methods.
- Replace the
any
type in the method signatures with the newly defined interfaces. - Ensure that the HttpClient methods use the correct types for the requests and responses.
-
Copy modified lines R5-R16 -
Copy modified lines R25-R26 -
Copy modified lines R29-R30 -
Copy modified lines R33-R34 -
Copy modified lines R37-R38
@@ -4,2 +4,14 @@ | ||
|
||
interface Settings { | ||
// Define the structure of the settings data | ||
} | ||
|
||
interface Target { | ||
// Define the structure of the target data | ||
} | ||
|
||
interface CalculatedField { | ||
// Define the structure of the calculated field data | ||
} | ||
|
||
@Injectable({ | ||
@@ -12,16 +24,16 @@ | ||
|
||
getSettings(): Observable<any> { | ||
return this.http.get<any>(`${this.apiUrl}/settings`); | ||
getSettings(): Observable<Settings> { | ||
return this.http.get<Settings>(`${this.apiUrl}/settings`); | ||
} | ||
|
||
getTargets(): Observable<any> { | ||
return this.http.get<any>(`${this.apiUrl}/targets`); | ||
getTargets(): Observable<Target[]> { | ||
return this.http.get<Target[]>(`${this.apiUrl}/targets`); | ||
} | ||
|
||
saveTargets(targets: any): Observable<any> { | ||
return this.http.post<any>(`${this.apiUrl}/targets`, targets); | ||
saveTargets(targets: Target[]): Observable<void> { | ||
return this.http.post<void>(`${this.apiUrl}/targets`, targets); | ||
} | ||
|
||
getCalculatedFields(): Observable<any> { | ||
return this.http.get<any>(`${this.apiUrl}/calculated-fields`); | ||
getCalculatedFields(): Observable<CalculatedField[]> { | ||
return this.http.get<CalculatedField[]>(`${this.apiUrl}/calculated-fields`); | ||
} |
} | ||
|
||
getCalculatedFields(): Observable<any> { | ||
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 2 months ago
To fix the problem, we need to replace the any
type with more specific types that accurately represent the data structures returned by the API endpoints. This involves defining TypeScript interfaces for the expected responses and using these interfaces in the method signatures.
- Define interfaces for the expected data structures returned by the API endpoints.
- Replace the
any
type in the method signatures with these interfaces. - Ensure that the HttpClient methods use the correct types.
-
Copy modified line R4 -
Copy modified lines R14-R15 -
Copy modified lines R18-R19 -
Copy modified lines R22-R23 -
Copy modified lines R26-R27 -
Copy modified lines R30-R42
@@ -3,2 +3,3 @@ | ||
import { Observable } from 'rxjs'; | ||
import { Settings, Target, CalculatedField } from '../models/predictive-modeling.models'; | ||
|
||
@@ -12,17 +13,30 @@ | ||
|
||
getSettings(): Observable<any> { | ||
return this.http.get<any>(`${this.apiUrl}/settings`); | ||
getSettings(): Observable<Settings> { | ||
return this.http.get<Settings>(`${this.apiUrl}/settings`); | ||
} | ||
|
||
getTargets(): Observable<any> { | ||
return this.http.get<any>(`${this.apiUrl}/targets`); | ||
getTargets(): Observable<Target[]> { | ||
return this.http.get<Target[]>(`${this.apiUrl}/targets`); | ||
} | ||
|
||
saveTargets(targets: any): Observable<any> { | ||
return this.http.post<any>(`${this.apiUrl}/targets`, targets); | ||
saveTargets(targets: Target[]): Observable<void> { | ||
return this.http.post<void>(`${this.apiUrl}/targets`, targets); | ||
} | ||
|
||
getCalculatedFields(): Observable<any> { | ||
return this.http.get<any>(`${this.apiUrl}/calculated-fields`); | ||
getCalculatedFields(): Observable<CalculatedField[]> { | ||
return this.http.get<CalculatedField[]>(`${this.apiUrl}/calculated-fields`); | ||
} | ||
} | ||
|
||
// Define the interfaces for the expected data structures | ||
export interface Settings { | ||
// Define the properties of the Settings object | ||
} | ||
|
||
export interface Target { | ||
// Define the properties of the Target object | ||
} | ||
|
||
export interface CalculatedField { | ||
// Define the properties of the CalculatedField object | ||
} |
Add PredictiveModelingComponent to load settings and target data, and save target values.
For more details, open the Copilot Workspace session.