feat(dashboard): 결재 역할 뱃지와 문서 정합성 반영

- doc/frontend_backend_alignment_report.md에 roles 필터 적용 배경과 UI 반영 사항을 기록

- lib/features/dashboard/data/dashboard_summary_dto.dart에서 roles 파싱과 enum 매핑 로직, 문자열 리스트 util 추가

- lib/features/dashboard/domain/entities/dashboard_pending_approval.dart에 역할 enum과 도메인 필드 추가

- lib/features/dashboard/presentation/pages/dashboard_page.dart에서 결재 카드 헤더/설명 수정 및 역할 뱃지 렌더링 지원

- test/features/dashboard/data/dashboard_summary_dto_test.dart 신규 작성해 DTO→도메인 매핑과 무시 케이스를 검증

- test/features/masters/user/presentation/pages/user_page_test.dart에서 사용되지 않는 PermissionManager import 제거
This commit is contained in:
JiWoong Sul
2025-11-13 17:30:27 +09:00
parent 753f76e952
commit 80f3df770d
6 changed files with 154 additions and 5 deletions

View File

@@ -392,9 +392,9 @@ class _PendingApprovalCard extends StatelessWidget {
final theme = ShadTheme.of(context);
if (approvals.isEmpty) {
return ShadCard(
title: Text('결재 대기', style: theme.textTheme.h3),
title: Text('결재 현황', style: theme.textTheme.h3),
description: Text(
'최종 승인 대기 전표는 기본 목록에 노출되지 않습니다.',
'배정됨/상신자/기결재자 역할만 표시하며 최종 상태 건은 자동 제외됩니다.',
style: theme.textTheme.muted,
),
child: const SuperportEmptyState(
@@ -408,9 +408,9 @@ class _PendingApprovalCard extends StatelessWidget {
final dateFormat = intl.DateFormat('yyyy-MM-dd HH:mm');
return ShadCard(
title: Text('결재 대기', style: theme.textTheme.h3),
title: Text('결재 현황', style: theme.textTheme.h3),
description: Text(
'최종 승인 대기 전표를 한곳에서 확인하고 처리할 수 있습니다.',
'내 역할(배정됨/상신자/기결재자)에 해당하는 전표만 모아 보여주고 최종 상태는 제외됩니다.',
style: theme.textTheme.muted,
),
child: Column(
@@ -537,6 +537,12 @@ class _PendingApprovalListTile extends StatelessWidget {
? null
: _formatElapsedKorean(now.difference(requestedAt));
final chips = <Widget>[ShadBadge(child: Text(approval.approvalNo))];
final roleBadges = approval.roles
.map(_buildRoleBadge)
.toList(growable: false);
if (roleBadges.isNotEmpty) {
chips.addAll(roleBadges);
}
if (summary.stage != null && summary.stage!.isNotEmpty) {
chips.add(ShadBadge.outline(child: Text(summary.stage!)));
}
@@ -603,6 +609,17 @@ class _PendingApprovalListTile extends StatelessWidget {
),
);
}
Widget _buildRoleBadge(DashboardApprovalRole role) {
switch (role) {
case DashboardApprovalRole.assigned:
return ShadBadge(child: Text(role.label));
case DashboardApprovalRole.requester:
return ShadBadge.outline(child: Text(role.label));
case DashboardApprovalRole.completed:
return ShadBadge.outline(child: Text(role.label));
}
}
}
class _PendingApprovalSummary {