Skip to content

Commit 22776a1

Browse files
authored
build(deps): update dependencies and sync color palette (#195)
* build(deps): update dependencies and sync color palette LFXV2-866 - Update @linuxfoundation/lfx-ui-core to 0.0.21 - Update @commitlint/cli to 20.1.0 and config-angular to 20.0.0 - Update prettier to 3.7.4, lint-staged to 16.2.7, chart.js to 4.5.1 - Sync color palette (gray, emerald, red, amber, violet) with lfx-ui-core - Fix chart.js TooltipItem types to use generic ChartType - Add null-safety operators for optional chart values - Simplify shadow classes to use Tailwind shadow-md - Update RSVP button styling from cyan to blue Signed-off-by: Asitha de Silva <[email protected]> * fix(dashboards): add nullish coalescing for chart tooltip values LFXV2-866 Add consistent ?? 0 fallback for context.parsed.y in chart tooltip callbacks across dashboard components to handle potential undefined/null values safely. Signed-off-by: Asitha de Silva <[email protected]> --------- Signed-off-by: Asitha de Silva <[email protected]>
1 parent 437be4e commit 22776a1

File tree

11 files changed

+284
-262
lines changed

11 files changed

+284
-262
lines changed

apps/lfx-one/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
"@fullcalendar/daygrid": "^6.1.19",
4040
"@fullcalendar/timegrid": "^6.1.19",
4141
"@lfx-one/shared": "workspace:*",
42-
"@linuxfoundation/lfx-ui-core": "^0.0.20",
42+
"@linuxfoundation/lfx-ui-core": "^0.0.21",
4343
"@openfeature/core": "^1.9.1",
4444
"@openfeature/launchdarkly-client-provider": "^0.3.3",
4545
"@openfeature/web-sdk": "^1.7.1",
@@ -83,7 +83,7 @@
8383
"playwright": "^1.54.2",
8484
"pm2": "^6.0.8",
8585
"postcss": "^8.5.6",
86-
"prettier": "^3.6.2",
86+
"prettier": "^3.7.4",
8787
"prettier-plugin-organize-imports": "^4.2.0",
8888
"prettier-plugin-tailwindcss": "^0.6.14",
8989
"tailwindcss": "^3.4.17",

apps/lfx-one/src/app/modules/committees/committee-manage/committee-manage.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ <h1 class="text-xl font-semibold text-gray-900">{{ isEditMode() ? 'Edit ' : 'Cre
1616
</div>
1717

1818
<!-- Form Card -->
19-
<div class="bg-white rounded-lg p-4 md:p-8 shadow-[0px_1px_2px_-1px_rgba(0,0,0,0.10),0px_1px_3px_0px_rgba(0,0,0,0.10)]">
19+
<div class="bg-white rounded-lg p-4 md:p-8 shadow-md">
2020
<lfx-committee-form
2121
[form]="form"
2222
[isEditMode]="isEditMode()"

apps/lfx-one/src/app/modules/committees/components/committee-table/committee-table.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!-- Copyright The Linux Foundation and each contributor to LFX. -->
22
<!-- SPDX-License-Identifier: MIT -->
33

4-
<lfx-card styleClass="border-0 shadow-[0px_1px_2px_-1px_rgba(0,0,0,0.10),0px_1px_3px_0px_rgba(0,0,0,0.10)]">
4+
<lfx-card styleClass="border-0 shadow-md">
55
<div class="overflow-x-auto">
66
<table class="min-w-full" data-testid="committee-dashboard-table">
77
<thead>

apps/lfx-one/src/app/modules/dashboards/components/foundation-health/foundation-health.component.ts

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import type {
2121
TopProjectDisplay,
2222
UniqueContributorsDailyResponse,
2323
} from '@lfx-one/shared/interfaces';
24-
import type { TooltipItem } from 'chart.js';
2524

2625
@Component({
2726
selector: 'lfx-foundation-health',
@@ -225,9 +224,9 @@ export class FoundationHealthComponent {
225224
tooltip: {
226225
...(this.sparklineOptions.plugins?.tooltip ?? {}),
227226
callbacks: {
228-
title: (context: TooltipItem<'line'>[]) => context[0].label,
229-
label: (context: TooltipItem<'line'>) => {
230-
const count = context.parsed.y;
227+
title: (context) => context[0]?.label ?? '',
228+
label: (context) => {
229+
const count = context.parsed.y ?? 0;
231230
return `Total projects: ${count}`;
232231
},
233232
},
@@ -266,9 +265,9 @@ export class FoundationHealthComponent {
266265
tooltip: {
267266
...(this.sparklineOptions.plugins?.tooltip ?? {}),
268267
callbacks: {
269-
title: (context: TooltipItem<'line'>[]) => context[0].label,
270-
label: (context: TooltipItem<'line'>) => {
271-
const count = context.parsed.y;
268+
title: (context) => context[0]?.label ?? '',
269+
label: (context) => {
270+
const count = context.parsed.y ?? 0;
272271
return `Total members: ${count}`;
273272
},
274273
},
@@ -346,9 +345,9 @@ export class FoundationHealthComponent {
346345
tooltip: {
347346
...(this.sparklineOptions.plugins?.tooltip ?? {}),
348347
callbacks: {
349-
title: (context: TooltipItem<'line'>[]) => context[0].label,
350-
label: (context: TooltipItem<'line'>) => {
351-
const count = context.parsed.y;
348+
title: (context) => context[0]?.label ?? '',
349+
label: (context) => {
350+
const count = context.parsed.y ?? 0;
352351
return `Active contributors: ${count.toLocaleString()}`;
353352
},
354353
},
@@ -387,9 +386,9 @@ export class FoundationHealthComponent {
387386
tooltip: {
388387
...(this.sparklineOptions.plugins?.tooltip ?? {}),
389388
callbacks: {
390-
title: (context: TooltipItem<'line'>[]) => context[0].label,
391-
label: (context: TooltipItem<'line'>) => {
392-
const count = context.parsed.y;
389+
title: (context) => context[0]?.label ?? '',
390+
label: (context) => {
391+
const count = context.parsed.y ?? 0;
393392
return `Active maintainers: ${count}`;
394393
},
395394
},
@@ -433,9 +432,9 @@ export class FoundationHealthComponent {
433432
tooltip: {
434433
...(this.barChartOptions.plugins?.tooltip ?? {}),
435434
callbacks: {
436-
title: (context: TooltipItem<'bar'>[]) => context[0].label,
437-
label: (context: TooltipItem<'bar'>) => {
438-
const count = context.parsed.y;
435+
title: (context) => context[0]?.label ?? '',
436+
label: (context) => {
437+
const count = context.parsed.y ?? 0;
439438
return `Events: ${count.toLocaleString()}`;
440439
},
441440
},

apps/lfx-one/src/app/modules/dashboards/components/organization-involvement/organization-involvement.component.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import type {
2424
OrganizationMaintainersResponse,
2525
TrainingEnrollmentsResponse,
2626
} from '@lfx-one/shared/interfaces';
27-
import type { ChartOptions, TooltipItem } from 'chart.js';
27+
import type { ChartOptions, ChartType } from 'chart.js';
2828

2929
@Component({
3030
selector: 'lfx-organization-involvement',
@@ -635,32 +635,32 @@ export class OrganizationInvolvementComponent {
635635
};
636636
}
637637

638-
private createBarChartOptions(label: string): ChartOptions<'bar'> {
638+
private createBarChartOptions(label: string): ChartOptions<ChartType> {
639639
return {
640640
...BASE_BAR_CHART_OPTIONS,
641641
plugins: {
642642
...BASE_BAR_CHART_OPTIONS.plugins,
643643
tooltip: {
644644
...(BASE_BAR_CHART_OPTIONS.plugins?.tooltip ?? {}),
645645
callbacks: {
646-
title: (context: TooltipItem<'bar'>[]) => context[0].label,
647-
label: (context: TooltipItem<'bar'>) => `${label}: ${context.parsed.y}`,
646+
title: (context) => context[0]?.label ?? '',
647+
label: (context) => `${label}: ${context.parsed.y ?? 0}`,
648648
},
649649
},
650650
},
651651
};
652652
}
653653

654-
private createLineChartOptions(label: string): ChartOptions<'line'> {
654+
private createLineChartOptions(label: string): ChartOptions<ChartType> {
655655
return {
656656
...BASE_LINE_CHART_OPTIONS,
657657
plugins: {
658658
...BASE_LINE_CHART_OPTIONS.plugins,
659659
tooltip: {
660660
...(BASE_LINE_CHART_OPTIONS.plugins?.tooltip ?? {}),
661661
callbacks: {
662-
title: (context: TooltipItem<'line'>[]) => context[0].label,
663-
label: (context: TooltipItem<'line'>) => `${label}: ${context.parsed.y}`,
662+
title: (context) => context[0]?.label ?? '',
663+
label: (context) => `${label}: ${context.parsed.y ?? 0}`,
664664
},
665665
},
666666
},

apps/lfx-one/src/app/modules/dashboards/components/recent-progress/recent-progress.component.ts

Lines changed: 27 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ import type {
3333
UserCodeCommitsResponse,
3434
UserPullRequestsResponse,
3535
} from '@lfx-one/shared/interfaces';
36-
import type { TooltipItem } from 'chart.js';
3736

3837
@Component({
3938
selector: 'lfx-recent-progress',
@@ -159,8 +158,8 @@ export class RecentProgressComponent {
159158
tooltip: {
160159
...(BASE_BAR_CHART_OPTIONS.plugins?.tooltip ?? {}),
161160
callbacks: {
162-
title: (context: TooltipItem<'bar'>[]) => context[0].label,
163-
label: (context: TooltipItem<'bar'>) => {
161+
title: (context) => context[0].label,
162+
label: (context) => {
164163
const isActive = context.parsed.y === 1;
165164
return isActive ? 'Active' : 'Inactive';
166165
},
@@ -198,13 +197,13 @@ export class RecentProgressComponent {
198197
tooltip: {
199198
...(BASE_LINE_CHART_OPTIONS.plugins?.tooltip ?? {}),
200199
callbacks: {
201-
title: (context: TooltipItem<'line'>[]) => {
200+
title: (context) => {
202201
const dateStr = context[0].label;
203202
const date = parseLocalDateString(dateStr);
204203
return date.toLocaleDateString('en-US', { month: 'short', day: 'numeric', year: 'numeric' });
205204
},
206-
label: (context: TooltipItem<'line'>) => {
207-
const count = context.parsed.y;
205+
label: (context) => {
206+
const count = context.parsed.y ?? 0;
208207
return `PRs Merged: ${count}`;
209208
},
210209
},
@@ -241,13 +240,13 @@ export class RecentProgressComponent {
241240
tooltip: {
242241
...(BASE_LINE_CHART_OPTIONS.plugins?.tooltip ?? {}),
243242
callbacks: {
244-
title: (context: TooltipItem<'line'>[]) => {
243+
title: (context) => {
245244
const dateStr = context[0].label;
246245
const date = parseLocalDateString(dateStr);
247246
return date.toLocaleDateString('en-US', { month: 'short', day: 'numeric', year: 'numeric' });
248247
},
249-
label: (context: TooltipItem<'line'>) => {
250-
const count = context.parsed.y;
248+
label: (context) => {
249+
const count = context.parsed.y ?? 0;
251250
return `Commits: ${count}`;
252251
},
253252
},
@@ -316,18 +315,18 @@ export class RecentProgressComponent {
316315
tooltip: {
317316
...(DUAL_LINE_CHART_OPTIONS.plugins?.tooltip ?? {}),
318317
callbacks: {
319-
title: (context: TooltipItem<'line'>[]) => {
318+
title: (context) => {
320319
const dateStr = context[0].label;
321320
const date = parseLocalDateString(dateStr);
322321
return date.toLocaleDateString('en-US', { month: 'short', day: 'numeric', year: 'numeric' });
323322
},
324-
label: (context: TooltipItem<'line'>) => {
323+
label: (context) => {
325324
const datasetLabel = context.dataset?.label || '';
326-
const count = context.parsed.y;
325+
const count = context.parsed.y ?? 0;
327326
return `${datasetLabel}: ${count.toLocaleString()}`;
328327
},
329328
labelPointStyle: () => ({
330-
pointStyle: 'circle',
329+
pointStyle: 'circle' as const,
331330
rotation: 0,
332331
}),
333332
},
@@ -382,7 +381,7 @@ export class RecentProgressComponent {
382381
tooltip: {
383382
...(BAR_CHART_WITH_FOOTER_OPTIONS.plugins?.tooltip ?? {}),
384383
callbacks: {
385-
title: (context: TooltipItem<'bar'>[]) => {
384+
title: (context) => {
386385
try {
387386
const dateStr = context[0]?.label || '';
388387
if (!dateStr) return '';
@@ -394,7 +393,7 @@ export class RecentProgressComponent {
394393
return context[0]?.label || '';
395394
}
396395
},
397-
label: (context: TooltipItem<'bar'>) => {
396+
label: (context) => {
398397
try {
399398
const dataIndex = context.dataIndex;
400399
const weekData = chartData[dataIndex];
@@ -404,7 +403,7 @@ export class RecentProgressComponent {
404403
return '';
405404
}
406405
},
407-
footer: (context: TooltipItem<'bar'>[]) => {
406+
footer: (context) => {
408407
try {
409408
const dataIndex = context[0]?.dataIndex;
410409
if (dataIndex === undefined) return '';
@@ -457,9 +456,9 @@ export class RecentProgressComponent {
457456
tooltip: {
458457
...(BASE_LINE_CHART_OPTIONS.plugins?.tooltip ?? {}),
459458
callbacks: {
460-
title: (context: TooltipItem<'line'>[]) => context[0].label,
461-
label: (context: TooltipItem<'line'>) => {
462-
const count = context.parsed.y;
459+
title: (context) => context[0].label,
460+
label: (context) => {
461+
const count = context.parsed.y ?? 0;
463462
return `Contributors mentored: ${count.toLocaleString()}`;
464463
},
465464
},
@@ -515,7 +514,7 @@ export class RecentProgressComponent {
515514
tooltip: {
516515
...(BAR_CHART_WITH_FOOTER_OPTIONS.plugins?.tooltip ?? {}),
517516
callbacks: {
518-
title: (context: TooltipItem<'bar'>[]) => {
517+
title: (context) => {
519518
try {
520519
const dateStr = context[0]?.label || '';
521520
if (!dateStr) return '';
@@ -527,7 +526,7 @@ export class RecentProgressComponent {
527526
return context[0]?.label || '';
528527
}
529528
},
530-
label: (context: TooltipItem<'bar'>) => {
529+
label: (context) => {
531530
try {
532531
const dataIndex = context.dataIndex;
533532
const weekData = chartData[dataIndex];
@@ -537,7 +536,7 @@ export class RecentProgressComponent {
537536
return '';
538537
}
539538
},
540-
footer: (context: TooltipItem<'bar'>[]) => {
539+
footer: (context) => {
541540
try {
542541
const dataIndex = context[0].dataIndex;
543542
const weekData = chartData[dataIndex];
@@ -593,13 +592,13 @@ export class RecentProgressComponent {
593592
tooltip: {
594593
...(BASE_LINE_CHART_OPTIONS.plugins?.tooltip ?? {}),
595594
callbacks: {
596-
title: (context: TooltipItem<'line'>[]) => {
595+
title: (context) => {
597596
const dateStr = context[0].label;
598597
const date = parseLocalDateString(dateStr);
599598
return date.toLocaleDateString('en-US', { month: 'short', day: 'numeric', year: 'numeric' });
600599
},
601-
label: (context: TooltipItem<'line'>) => {
602-
const score = Math.round(context.parsed.y);
600+
label: (context) => {
601+
const score = Math.round(context.parsed.y ?? 0);
603602
return `Avg Health Score: ${score}`;
604603
},
605604
},
@@ -641,14 +640,14 @@ export class RecentProgressComponent {
641640
tooltip: {
642641
...(BASE_LINE_CHART_OPTIONS.plugins?.tooltip ?? {}),
643642
callbacks: {
644-
title: (context: TooltipItem<'line'>[]) => {
643+
title: (context) => {
645644
const dateStr = context[0]?.label || '';
646645
if (!dateStr) return '';
647646
const date = parseLocalDateString(dateStr);
648647
return date.toLocaleDateString('en-US', { month: 'short', day: 'numeric', year: 'numeric' });
649648
},
650-
label: (context: TooltipItem<'line'>) => {
651-
const count = context.parsed.y;
649+
label: (context) => {
650+
const count = context.parsed.y ?? 0;
652651
return `Commits: ${count.toLocaleString()}`;
653652
},
654653
},

apps/lfx-one/src/app/modules/meetings/components/rsvp-button-group/rsvp-button-group.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44
<!-- RSVP Container -->
55
<div
66
[ngClass]="{
7-
'bg-cyan-50 border border-cyan-400': selectedResponse() === null && !disabled(),
7+
'bg-blue-50 border border-blue-300': selectedResponse() === null && !disabled(),
88
'bg-gray-200/50': selectedResponse() !== null || disabled(),
99
}"
1010
class="rounded-[6px] p-[12px] space-y-2 flex-1"
1111
[attr.data-testid]="'meeting-rsvp-container'">
1212
<!-- Header -->
1313
<div
1414
[ngClass]="{
15-
'text-cyan-600': selectedResponse() === null && !disabled(),
15+
'text-blue-600': selectedResponse() === null && !disabled(),
1616
'text-gray-500': selectedResponse() !== null || disabled(),
1717
}"
1818
class="flex items-center gap-[7px]"

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,18 @@
2929
"prepare": "husky"
3030
},
3131
"devDependencies": {
32-
"@commitlint/cli": "^19.8.1",
33-
"@commitlint/config-angular": "^19.8.1",
34-
"@linuxfoundation/lfx-ui-core": "^0.0.20",
32+
"@commitlint/cli": "^20.1.0",
33+
"@commitlint/config-angular": "^20.0.0",
34+
"@linuxfoundation/lfx-ui-core": "^0.0.21",
3535
"@types/node": "^24.2.1",
3636
"@typescript-eslint/eslint-plugin": "^8.39.1",
3737
"@typescript-eslint/parser": "^8.39.1",
3838
"@typescript-eslint/type-utils": "^8.39.1",
3939
"@typescript-eslint/types": "^8.39.1",
4040
"@typescript-eslint/utils": "^8.39.1",
4141
"husky": "^9.1.7",
42-
"lint-staged": "^16.1.5",
43-
"prettier": "^3.6.2",
42+
"lint-staged": "^16.2.7",
43+
"prettier": "^3.7.4",
4444
"tslib": "^2.8.1",
4545
"turbo": "^2.5.5",
4646
"typescript": "5.8.3"
@@ -63,6 +63,6 @@
6363
]
6464
},
6565
"dependencies": {
66-
"chart.js": "^4.5.0"
66+
"chart.js": "^4.5.1"
6767
}
6868
}

0 commit comments

Comments
 (0)