Skip to content

Commit 594044e

Browse files
authored
feat(dashboards): add maintainer persona with dashboard restructuring (#127)
- Add Maintainer as new persona option - Migrate dashboard to new dashboards module structure - Rename existing dashboard to Core Developer dashboard - Create Maintainer dashboard with persona-specific metrics - Implement persona-aware pending actions with computed signals - Implement persona-aware progress metrics with line and bar charts - Move shared dashboard components to centralized location - Update routing to use new dashboard component structure LFXV2-649 Signed-off-by: Asitha de Silva <asithade@gmail.com>
1 parent 608eefc commit 594044e

30 files changed

+638
-262
lines changed

apps/lfx-one/src/app/app.routes.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export const routes: Routes = [
1313
children: [
1414
{
1515
path: '',
16-
loadComponent: () => import('./modules/pages/dashboard/dashboard.component').then((m) => m.DashboardComponent),
16+
loadComponent: () => import('./modules/dashboards/dashboard.component').then((m) => m.DashboardComponent),
1717
},
1818
{
1919
path: 'projects',
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ <h2 class="font-display font-semibold text-gray-900">Pending Actions</h2>
1919
<!-- Scrollable Content -->
2020
<div class="flex flex-col flex-1">
2121
<div class="flex flex-col gap-3" data-testid="dashboard-pending-actions-list">
22-
@for (item of pendingActions; track item.text) {
22+
@for (item of pendingActions(); track item.text) {
2323
<div
2424
class="p-4 border rounded-lg"
2525
[ngClass]="{
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
// Copyright The Linux Foundation and each contributor to LFX.
2+
// SPDX-License-Identifier: MIT
3+
4+
import { CommonModule } from '@angular/common';
5+
import { Component, computed, inject, output } from '@angular/core';
6+
import { PersonaService } from '@app/shared/services/persona.service';
7+
import { ButtonComponent } from '@components/button/button.component';
8+
import { CORE_DEVELOPER_ACTION_ITEMS, MAINTAINER_ACTION_ITEMS } from '@lfx-one/shared/constants';
9+
10+
import type { PendingActionItem } from '@lfx-one/shared/interfaces';
11+
12+
@Component({
13+
selector: 'lfx-pending-actions',
14+
standalone: true,
15+
imports: [CommonModule, ButtonComponent],
16+
templateUrl: './pending-actions.component.html',
17+
styleUrl: './pending-actions.component.scss',
18+
})
19+
export class PendingActionsComponent {
20+
private readonly personaService = inject(PersonaService);
21+
22+
public readonly actionClick = output<PendingActionItem>();
23+
public readonly viewAll = output<void>();
24+
25+
/**
26+
* Computed signal that returns action items based on the current persona
27+
*/
28+
protected readonly pendingActions = computed<PendingActionItem[]>(() => {
29+
const persona = this.personaService.currentPersona();
30+
31+
switch (persona) {
32+
case 'maintainer':
33+
return MAINTAINER_ACTION_ITEMS;
34+
case 'core-developer':
35+
default:
36+
return CORE_DEVELOPER_ACTION_ITEMS;
37+
}
38+
});
39+
40+
public handleViewAll(): void {
41+
this.viewAll.emit();
42+
}
43+
44+
protected handleActionClick(item: PendingActionItem): void {
45+
this.actionClick.emit(item);
46+
}
47+
}

0 commit comments

Comments
 (0)