Skip to content

Commit

Permalink
Add Value Modeling component, update & routing change
Browse files Browse the repository at this point in the history
  • Loading branch information
MattG57 committed Dec 5, 2024
1 parent 5cbd8cd commit dfdc06e
Show file tree
Hide file tree
Showing 7 changed files with 444 additions and 2 deletions.
44 changes: 44 additions & 0 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,12 @@
"@angular/router": "^18.2.12",
"@octokit/types": "^13.6.1",
"canvas-confetti": "^1.9.3",
"chart.js": "^4.4.7",
"cronstrue": "^2.51.0",
"dayjs": "^1.11.13",
"highcharts": "^11.4.8",
"highcharts-angular": "^4.0.1",
"ng2-charts": "^7.0.0",
"rxjs": "~7.8.0"
},
"devDependencies": {
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/app/app.routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { CopilotSurveyComponent } from './main/copilot/copilot-surveys/copilot-s
import { CopilotSeatComponent } from './main/copilot/copilot-seats/copilot-seat/copilot-seat.component';
import { PredictiveModelingComponent } from './main/copilot/predictive-modeling/predictive-modeling.component';
import { DatabaseComponent } from './database/database.component';
import { ValueModelingComponent } from './main/copilot/value-modeling/value-modeling.component';

export const routes: Routes = [
{ path: 'setup', component: InstallComponent },
Expand All @@ -34,7 +35,7 @@ export const routes: Routes = [
{ path: 'copilot/surveys/new', component: NewCopilotSurveyComponent, title: 'New Survey' },
{ path: 'copilot/surveys/new/:id', component: NewCopilotSurveyComponent, title: 'New Survey' },
{ path: 'copilot/surveys/:id', component: CopilotSurveyComponent, title: 'Survey' },
{ path: 'copilot/predictive-modeling', component: PredictiveModelingComponent, title: 'Predictive Modeling' },
{ path: 'copilot/value-modeling', component: ValueModelingComponent, title: 'Value Modeling' },
{ path: 'settings', component: SettingsComponent, title: 'Settings' },
{ path: '', redirectTo: 'copilot', pathMatch: 'full' }
]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
<div class="page-container">
<div class="page-header">
<h1>Value Modeling and Targeting</h1>
</div>

<!-- Charts Section -->
<div class="charts-grid">
<mat-card *ngFor="let options of chartOptions">
<mat-card-content>
<div class="chart-container">
<highcharts-chart
[Highcharts]="Highcharts"
[options]="options"
style="width: 100%; height: 100%; display: block;">
</highcharts-chart>
</div>
</mat-card-content>
</mat-card>
</div>

<!-- Metrics Grid -->
<form [formGroup]="form" class="metrics-grid">
<!-- Headers -->
<div class="grid-header metrics-label"></div>
<div class="grid-header">Current Level</div>
<div class="grid-header">Target Level</div>
<div class="grid-header">Max Level</div>

<!-- Adoption -->
<div class="metrics-label">Adopted Users</div>
<mat-form-field *ngFor="let level of ['current', 'target', 'max']" [formGroupName]="level">
<input matInput
type="text"
formControlName="adoption"
(input)="onInputChange($event, 'adoption', level)"
[readonly]="level === 'max'"
class="example-right-align">
<span matTextSuffix>%</span>
</mat-form-field>

<!-- Usage & Time Savings -->
<div class="metrics-label">Activity Per Daily User</div>
<div *ngFor="let level of ['current', 'target', 'max']" [formGroupName]="level" class="usage-inputs">
<mat-form-field>
<mat-label>Activity</mat-label>
<input matInput
type="text"
formControlName="activityLevel"
(input)="onInputChange($event, 'activityLevel', level)"
[readonly]="level === 'max'"
class="example-right-align">
<span matTextSuffix>%</span>
</mat-form-field>
<mat-form-field>
<mat-label>Time Savings</mat-label>
<input matInput
type="text"
formControlName="timeSavings"
(input)="onInputChange($event, 'timeSavings', level)"
[readonly]="level === 'max'"
class="example-right-align">
<span matTextSuffix>%</span>
</mat-form-field>
</div>

<!-- Time Saved As Dollars -->
<div class="metrics-label">Total Time Saved</div>
<mat-form-field *ngFor="let level of ['current', 'target', 'max']" [formGroupName]="level">
<input matInput
type="text"
formControlName="timeSavedDollars"
(input)="onInputChange($event, 'timeSavedDollars', level)"
[readonly]="level === 'max'"
class="example-right-align">
<span matTextPrefix>$&nbsp;</span>
</mat-form-field>

<!-- Downstream Productivity -->
<div class="metrics-label">Time Saved as Dollars</div>
<mat-form-field *ngFor="let level of ['current', 'target', 'max']" [formGroupName]="level">
<input matInput
type="text"
formControlName="downstreamProductivity"
(input)="onInputChange($event, 'downstreamProductivity', level)"
[readonly]="level === 'max'"
class="example-right-align">
<span matTextSuffix>%</span>
</mat-form-field>
</form>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
.page-container {
padding: 24px;
max-width: 1200px;
margin: 0 auto;
}

.page-header {
margin-bottom: 24px;
h1 {
margin: 0;
font-size: 24px;
font-weight: 500;
}
}

.charts-grid {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 24px;
margin-bottom: 24px;

mat-card {
height: 300px;

.chart-container {
height: 250px;
}
}
}

.metrics-grid {
display: grid;
grid-template-columns: 200px repeat(3, 1fr);
gap: 16px;
align-items: center;

.grid-header {
font-weight: 500;
padding: 8px;
text-align: center;
}

.metrics-label {
font-weight: 500;
}

mat-form-field {
width: 100%;
}

.usage-inputs {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 8px;
}
}

.example-right-align {
text-align: right;
}

@media (max-width: 768px) {
.charts-grid {
grid-template-columns: 1fr;
}

.metrics-grid {
grid-template-columns: 1fr;

.grid-header {
display: none;
}

.usage-inputs {
grid-template-columns: 1fr;
}
}
}
Loading

0 comments on commit dfdc06e

Please sign in to comment.