Skip to content

Commit 3f4e93e

Browse files
authored
Merge pull request #52963 from callstack-internal/chore/remove-isHidden-property-from-report
remove isHidden property from report
2 parents 2ce0764 + 6a9a769 commit 3f4e93e

File tree

5 files changed

+12
-16
lines changed

5 files changed

+12
-16
lines changed

src/libs/DebugUtils.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,6 @@ function validateReportDraftProperty(key: keyof Report, value: string) {
480480
case 'isOptimisticReport':
481481
case 'isWaitingOnBankAccount':
482482
case 'isCancelledIOU':
483-
case 'isHidden':
484483
return validateBoolean(value);
485484
case 'lastReadSequenceNumber':
486485
case 'managerID':
@@ -621,7 +620,6 @@ function validateReportDraftProperty(key: keyof Report, value: string) {
621620
iouReportID: CONST.RED_BRICK_ROAD_PENDING_ACTION,
622621
preexistingReportID: CONST.RED_BRICK_ROAD_PENDING_ACTION,
623622
nonReimbursableTotal: CONST.RED_BRICK_ROAD_PENDING_ACTION,
624-
isHidden: CONST.RED_BRICK_ROAD_PENDING_ACTION,
625623
pendingChatMembers: CONST.RED_BRICK_ROAD_PENDING_ACTION,
626624
fieldList: CONST.RED_BRICK_ROAD_PENDING_ACTION,
627625
permissions: CONST.RED_BRICK_ROAD_PENDING_ACTION,

src/libs/ReportUtils.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,6 @@ type OptimisticChatReport = Pick<
329329
| 'writeCapability'
330330
| 'avatarUrl'
331331
| 'invoiceReceiver'
332-
| 'isHidden'
333332
> & {
334333
isOptimisticReport: true;
335334
};
@@ -6518,8 +6517,6 @@ function reasonForReportToBeInOptionList({
65186517
!report?.reportID ||
65196518
!report?.type ||
65206519
report?.reportName === undefined ||
6521-
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
6522-
report?.isHidden ||
65236520
(!report?.participants &&
65246521
// We omit sending back participants for chat rooms when searching for reports since they aren't needed to display the results and can get very large.
65256522
// So we allow showing rooms with no participants–in any other circumstances we should never have these reports with no participants in Onyx.
@@ -7400,7 +7397,6 @@ function getTaskAssigneeChatOnyxData(
74007397
pendingFields: {
74017398
createChat: CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD,
74027399
},
7403-
isHidden: false,
74047400
},
74057401
},
74067402
{

src/libs/actions/Task.ts

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -776,13 +776,19 @@ function setAssigneeChatReport(chatReport: OnyxTypes.Report) {
776776
}
777777

778778
function setNewOptimisticAssignee(assigneeLogin: string, assigneeAccountID: number) {
779-
const report: ReportUtils.OptimisticChatReport = ReportUtils.buildOptimisticChatReport([assigneeAccountID, currentUserAccountID]);
779+
const report: ReportUtils.OptimisticChatReport = ReportUtils.buildOptimisticChatReport(
780+
[assigneeAccountID, currentUserAccountID],
781+
'',
782+
undefined,
783+
CONST.POLICY.OWNER_EMAIL_FAKE,
784+
CONST.POLICY.OWNER_ACCOUNT_ID_FAKE,
785+
false,
786+
'',
787+
undefined,
788+
undefined,
789+
CONST.REPORT.NOTIFICATION_PREFERENCE.HIDDEN,
790+
);
780791

781-
// When assigning a task to a new user, by default we share the task in their DM
782-
// However, the DM doesn't exist yet - and will be created optimistically once the task is created
783-
// We don't want to show the new DM yet, because if you select an assignee and then change the assignee, the previous DM will still be shown
784-
// So here, we create it optimistically to share it with the assignee, but we have to hide it until the task is created
785-
report.isHidden = true;
786792
Onyx.set(`${ONYXKEYS.COLLECTION.REPORT}${report.reportID}`, report);
787793

788794
const optimisticPersonalDetailsListAction: OnyxTypes.PersonalDetails = {

src/types/onyx/Report.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,9 +211,6 @@ type Report = OnyxCommon.OnyxValueWithOfflineFeedback<
211211
/** If the report contains nonreimbursable expenses, send the nonreimbursable total */
212212
nonReimbursableTotal?: number;
213213

214-
/** Whether the report is hidden from options list */
215-
isHidden?: boolean;
216-
217214
/** Collection of participant private notes, indexed by their accountID */
218215
privateNotes?: Record<number, Note>;
219216

src/types/utils/whitelistedReportKeys.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ type WhitelistedReport = OnyxCommon.OnyxValueWithOfflineFeedback<
5454
iouReportID: unknown;
5555
preexistingReportID: unknown;
5656
nonReimbursableTotal: unknown;
57-
isHidden: unknown;
5857
privateNotes: unknown;
5958
pendingChatMembers: unknown;
6059
fieldList: unknown;

0 commit comments

Comments
 (0)