From 0835bed206108776f300a08dbda7484468ae9a44 Mon Sep 17 00:00:00 2001 From: Austen Stone Date: Wed, 20 Nov 2024 20:47:44 -0500 Subject: [PATCH] Enhance Copilot Surveys component; update icon color for 'Used Copilot' column, add MatCardModule to main component, and filter out pending surveys in Highcharts service --- .../copilot/copilot-surveys/copilot-surveys.component.ts | 2 +- frontend/src/app/main/main.component.ts | 7 +++++-- frontend/src/app/services/highcharts.service.ts | 1 + 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/frontend/src/app/main/copilot/copilot-surveys/copilot-surveys.component.ts b/frontend/src/app/main/copilot/copilot-surveys/copilot-surveys.component.ts index cc900f0..4ed6c8d 100644 --- a/frontend/src/app/main/copilot/copilot-surveys/copilot-surveys.component.ts +++ b/frontend/src/app/main/copilot/copilot-surveys/copilot-surveys.component.ts @@ -20,7 +20,7 @@ export class CopilotSurveysComponent implements OnInit { surveysColumns: ColumnOptions[] = [ { columnDef: 'id', header: 'ID', cell: (element: Survey) => `${element.id}` }, { columnDef: 'userId', header: 'Author', cell: (element: Survey) => `${element.userId}`, link: (element: Survey) => `https://github.com/${element.userId}` }, - { columnDef: 'usedCopilot', header: 'Used Copilot', cell: (element: Survey) => element.usedCopilot ? 'svg:github-copilot' : 'close', isIcon: true, iconColor: (element: Survey) => element.usedCopilot ? '' : 'var(--sys-outline)' }, + { columnDef: 'usedCopilot', header: 'Used Copilot', cell: (element: Survey) => element.usedCopilot ? 'svg:github-copilot' : 'close', isIcon: true, iconColor: (element: Survey) => 'var(--sys-on-surface)' }, { columnDef: 'percentTimeSaved', header: 'Time Saved', cell: (element: Survey) => element.percentTimeSaved < 0 ? '-' : `${element.percentTimeSaved}%` }, { columnDef: 'timeUsedFor', header: 'Time Used For', cell: (element: Survey) => this.formatTimeUsedFor(element.timeUsedFor) }, { columnDef: 'prNumber', header: 'PR', cell: (element: Survey) => `${element.repo}#${element.prNumber}`, link: (element: Survey) => `https://github.com/${element.owner}/${element.repo}/pull/${element.prNumber}` }, diff --git a/frontend/src/app/main/main.component.ts b/frontend/src/app/main/main.component.ts index edf7c84..847992d 100644 --- a/frontend/src/app/main/main.component.ts +++ b/frontend/src/app/main/main.component.ts @@ -13,6 +13,7 @@ import { ThemeService } from '../services/theme.service'; import { NavigationEnd, Router } from '@angular/router'; import { Endpoints } from '@octokit/types'; import { SetupService } from '../services/setup.service'; +import { MatCardModule } from '@angular/material/card'; @Component({ selector: 'app-main', @@ -26,7 +27,8 @@ import { SetupService } from '../services/setup.service'; MatListModule, MatIconModule, AsyncPipe, - AppModule + AppModule, + MatCardModule ] }) export class MainComponent { @@ -56,7 +58,8 @@ export class MainComponent { this.closeSidenav(); }); - this.installation = this.setupService.installation; + this.installation = this.setupService.installation; + console.log('MainComponent constructor', this.installation); } toggleNavText(): void { diff --git a/frontend/src/app/services/highcharts.service.ts b/frontend/src/app/services/highcharts.service.ts index 273962c..ce7b6b0 100644 --- a/frontend/src/app/services/highcharts.service.ts +++ b/frontend/src/app/services/highcharts.service.ts @@ -473,6 +473,7 @@ export class HighchartsService { } transformSurveysToScatter(surveys: Survey[]): Highcharts.Options { + surveys = surveys.filter(survey => survey.status !== 'pending'); return { series: [{ name: 'Time Saved',