Skip to content

Commit

Permalink
Enhance Copilot Surveys component; update icon color for 'Used Copilo…
Browse files Browse the repository at this point in the history
…t' column, add MatCardModule to main component, and filter out pending surveys in Highcharts service
  • Loading branch information
austenstone committed Nov 21, 2024
1 parent 7ca9faa commit 0835bed
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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}` },
Expand Down
7 changes: 5 additions & 2 deletions frontend/src/app/main/main.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -26,7 +27,8 @@ import { SetupService } from '../services/setup.service';
MatListModule,
MatIconModule,
AsyncPipe,
AppModule
AppModule,
MatCardModule
]
})
export class MainComponent {
Expand Down Expand Up @@ -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 {
Expand Down
1 change: 1 addition & 0 deletions frontend/src/app/services/highcharts.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,7 @@ export class HighchartsService {
}

transformSurveysToScatter(surveys: Survey[]): Highcharts.Options {
surveys = surveys.filter(survey => survey.status !== 'pending');
return {
series: [{
name: 'Time Saved',
Expand Down

0 comments on commit 0835bed

Please sign in to comment.