Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove isHidden property from report #52963

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/libs/DebugUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,6 @@ function validateReportDraftProperty(key: keyof Report, value: string) {
case 'isOptimisticReport':
case 'isWaitingOnBankAccount':
case 'isCancelledIOU':
case 'isHidden':
return validateBoolean(value);
case 'lastReadSequenceNumber':
case 'managerID':
Expand Down Expand Up @@ -621,7 +620,6 @@ function validateReportDraftProperty(key: keyof Report, value: string) {
iouReportID: CONST.RED_BRICK_ROAD_PENDING_ACTION,
preexistingReportID: CONST.RED_BRICK_ROAD_PENDING_ACTION,
nonReimbursableTotal: CONST.RED_BRICK_ROAD_PENDING_ACTION,
isHidden: CONST.RED_BRICK_ROAD_PENDING_ACTION,
pendingChatMembers: CONST.RED_BRICK_ROAD_PENDING_ACTION,
fieldList: CONST.RED_BRICK_ROAD_PENDING_ACTION,
permissions: CONST.RED_BRICK_ROAD_PENDING_ACTION,
Expand Down
4 changes: 0 additions & 4 deletions src/libs/ReportUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,6 @@ type OptimisticChatReport = Pick<
| 'writeCapability'
| 'avatarUrl'
| 'invoiceReceiver'
| 'isHidden'
> & {
isOptimisticReport: true;
};
Expand Down Expand Up @@ -6518,8 +6517,6 @@ function reasonForReportToBeInOptionList({
!report?.reportID ||
!report?.type ||
report?.reportName === undefined ||
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
report?.isHidden ||
(!report?.participants &&
// 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.
// So we allow showing rooms with no participants–in any other circumstances we should never have these reports with no participants in Onyx.
Expand Down Expand Up @@ -7400,7 +7397,6 @@ function getTaskAssigneeChatOnyxData(
pendingFields: {
createChat: CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD,
},
isHidden: false,
},
},
{
Expand Down
18 changes: 12 additions & 6 deletions src/libs/actions/Task.ts
Original file line number Diff line number Diff line change
Expand Up @@ -776,13 +776,19 @@ function setAssigneeChatReport(chatReport: OnyxTypes.Report) {
}

function setNewOptimisticAssignee(assigneeLogin: string, assigneeAccountID: number) {
const report: ReportUtils.OptimisticChatReport = ReportUtils.buildOptimisticChatReport([assigneeAccountID, currentUserAccountID]);
const report: ReportUtils.OptimisticChatReport = ReportUtils.buildOptimisticChatReport(
[assigneeAccountID, currentUserAccountID],
'',
undefined,
CONST.POLICY.OWNER_EMAIL_FAKE,
CONST.POLICY.OWNER_ACCOUNT_ID_FAKE,
false,
'',
undefined,
undefined,
CONST.REPORT.NOTIFICATION_PREFERENCE.HIDDEN,
);

// When assigning a task to a new user, by default we share the task in their DM
// However, the DM doesn't exist yet - and will be created optimistically once the task is created
// 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
// So here, we create it optimistically to share it with the assignee, but we have to hide it until the task is created
report.isHidden = true;
Onyx.set(`${ONYXKEYS.COLLECTION.REPORT}${report.reportID}`, report);

const optimisticPersonalDetailsListAction: OnyxTypes.PersonalDetails = {
Expand Down
3 changes: 0 additions & 3 deletions src/types/onyx/Report.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,9 +211,6 @@ type Report = OnyxCommon.OnyxValueWithOfflineFeedback<
/** If the report contains nonreimbursable expenses, send the nonreimbursable total */
nonReimbursableTotal?: number;

/** Whether the report is hidden from options list */
isHidden?: boolean;

/** Collection of participant private notes, indexed by their accountID */
privateNotes?: Record<number, Note>;

Expand Down
1 change: 0 additions & 1 deletion src/types/utils/whitelistedReportKeys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ type WhitelistedReport = OnyxCommon.OnyxValueWithOfflineFeedback<
iouReportID: unknown;
preexistingReportID: unknown;
nonReimbursableTotal: unknown;
isHidden: unknown;
privateNotes: unknown;
pendingChatMembers: unknown;
fieldList: unknown;
Expand Down
Loading