Skip to content

Commit 1dd01da

Browse files
authored
Merge pull request Expensify#88851 from Expensify/claude-unreportedStatusBadge
2 parents 16c4b53 + 9107a13 commit 1dd01da

5 files changed

Lines changed: 15 additions & 7 deletions

File tree

src/libs/ReportUtils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13195,7 +13195,7 @@ function getReportStatusTranslation({stateNum, statusNum, isDeleted, translate}:
1319513195
return translate('iou.deleted');
1319613196
}
1319713197
if (stateNum === undefined || statusNum === undefined) {
13198-
return '';
13198+
return translate('common.unreported');
1319913199
}
1320013200

1320113201
if (stateNum === CONST.REPORT.STATE_NUM.OPEN && statusNum === CONST.REPORT.STATUS_NUM.OPEN) {
@@ -13226,7 +13226,7 @@ function getReportStatusColorStyle(theme: ThemeColors, stateNum?: number, status
1322613226
return theme.reportStatusBadge.deleted;
1322713227
}
1322813228
if (stateNum === undefined || statusNum === undefined) {
13229-
return undefined;
13229+
return theme.reportStatusBadge.unreported;
1323013230
}
1323113231

1323213232
if (stateNum === CONST.REPORT.STATE_NUM.OPEN && statusNum === CONST.REPORT.STATUS_NUM.OPEN) {

src/styles/theme/themes/dark.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,10 @@ const darkTheme = {
197197
backgroundColor: colors.tangerine700,
198198
textColor: colors.productDark900,
199199
},
200+
unreported: {
201+
backgroundColor: colors.productDark400,
202+
textColor: colors.productDark900,
203+
},
200204
},
201205

202206
statusBarStyle: CONST.STATUS_BAR_STYLE.LIGHT_CONTENT,

src/styles/theme/themes/light.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,10 @@ const lightTheme = {
197197
backgroundColor: colors.tangerine500,
198198
textColor: colors.productLight100,
199199
},
200+
unreported: {
201+
backgroundColor: colors.productLight400,
202+
textColor: colors.productLight900,
203+
},
200204
},
201205

202206
statusBarStyle: CONST.STATUS_BAR_STYLE.DARK_CONTENT,

src/styles/theme/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ type ThemeColors = {
119119
trialTimer: Color;
120120

121121
reportStatusBadge: Record<
122-
'draft' | 'outstanding' | 'paid' | 'approved' | 'closed' | 'deleted',
122+
'draft' | 'outstanding' | 'paid' | 'approved' | 'closed' | 'deleted' | 'unreported',
123123
{
124124
backgroundColor: Color;
125125
textColor: Color;

tests/unit/ReportUtilsTest.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10638,10 +10638,10 @@ describe('ReportUtils', () => {
1063810638
expect(result).toBe(mockTranslate('iou.settledExpensify'));
1063910639
});
1064010640

10641-
it('should return an empty string when stateNum or statusNum is undefined', () => {
10642-
expect(getReportStatusTranslation({stateNum: undefined, statusNum: undefined, translate: mockTranslate})).toBe('');
10643-
expect(getReportStatusTranslation({stateNum: CONST.REPORT.STATE_NUM.OPEN, statusNum: undefined, translate: mockTranslate})).toBe('');
10644-
expect(getReportStatusTranslation({stateNum: undefined, statusNum: CONST.REPORT.STATUS_NUM.OPEN, translate: mockTranslate})).toBe('');
10641+
it('should return "Unreported" when stateNum or statusNum is undefined', () => {
10642+
expect(getReportStatusTranslation({stateNum: undefined, statusNum: undefined, translate: mockTranslate})).toBe(mockTranslate('common.unreported'));
10643+
expect(getReportStatusTranslation({stateNum: CONST.REPORT.STATE_NUM.OPEN, statusNum: undefined, translate: mockTranslate})).toBe(mockTranslate('common.unreported'));
10644+
expect(getReportStatusTranslation({stateNum: undefined, statusNum: CONST.REPORT.STATUS_NUM.OPEN, translate: mockTranslate})).toBe(mockTranslate('common.unreported'));
1064510645
});
1064610646

1064710647
it('should return "Deleted" when isDeleted is true', () => {

0 commit comments

Comments
 (0)