Skip to content

Commit

Permalink
Merge pull request #52247 from callstack-internal/chore/remove-unused…
Browse files Browse the repository at this point in the history
…-report-properties

[No QA] chore: remove remaining unused Report properties
  • Loading branch information
puneetlath authored Nov 13, 2024
2 parents 2c9ce8c + ffd250c commit 1ad0d3f
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 23 deletions.
5 changes: 0 additions & 5 deletions src/libs/DebugUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,7 @@ const REPORT_BOOLEAN_PROPERTIES: Array<keyof Report> = [
'isWaitingOnBankAccount',
'isCancelledIOU',
'isHidden',
'isChatRoom',
'isLoadingPrivateNotes',
'selected',
] satisfies Array<keyof Report>;

const REPORT_DATE_PROPERTIES: Array<keyof Report> = ['lastVisibleActionCreated', 'lastReadTime', 'lastMentionedTime', 'lastVisibleActionLastModified'] satisfies Array<keyof Report>;
Expand Down Expand Up @@ -496,9 +494,6 @@ function validateReportDraftProperty(key: keyof Report, value: string) {
if (key === 'pendingFields') {
return validateObject(value, {});
}
if (key === 'participantAccountIDs') {
return validateArray(value, 'number');
}

validateString(value);
}
Expand Down
2 changes: 2 additions & 0 deletions src/libs/ReportUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,8 @@ type OptionData = {
isConciergeChat?: boolean;
isBold?: boolean;
lastIOUCreationDate?: string;
isChatRoom?: boolean;
participantsList?: PersonalDetails[];
icons?: Icon[];
iouReportAmount?: number;
} & Report;
Expand Down
2 changes: 0 additions & 2 deletions src/types/form/DebugReportForm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ const INPUT_IDS = {
NOTIFICATION_PREFERENCE: 'notificationPreference',
OLD_POLICY_NAME: 'oldPolicyName',
OWNER_ACCOUNT_ID: 'ownerAccountID',
PARTICIPANT_ACCOUNT_IDS: 'participantAccountIDs',
PARTICIPANTS: 'participants',
PERMISSIONS: 'permissions',
POLICY_AVATAR: 'policyAvatar',
Expand Down Expand Up @@ -78,7 +77,6 @@ type DebugReportForm = Form<
[INPUT_IDS.NOTIFICATION_PREFERENCE]: ValueOf<typeof CONST.REPORT.NOTIFICATION_PREFERENCE>;
[INPUT_IDS.OLD_POLICY_NAME]: string;
[INPUT_IDS.OWNER_ACCOUNT_ID]: string;
[INPUT_IDS.PARTICIPANT_ACCOUNT_IDS]: string;
[INPUT_IDS.PARTICIPANTS]: string;
[INPUT_IDS.PERMISSIONS]: string;
[INPUT_IDS.POLICY_AVATAR]: string;
Expand Down
16 changes: 0 additions & 16 deletions src/types/onyx/Report.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import type CONST from '@src/CONST';
import type ONYXKEYS from '@src/ONYXKEYS';
import type CollectionDataSet from '@src/types/utils/CollectionDataSet';
import type * as OnyxCommon from './OnyxCommon';
import type PersonalDetails from './PersonalDetails';
import type {PolicyReportField} from './Policy';

/** Preference that defines how regular the chat notifications are sent to the user */
Expand Down Expand Up @@ -233,24 +232,12 @@ type Report = OnyxCommon.OnyxValueWithOfflineFeedback<
/** Whether the report is hidden from options list */
isHidden?: boolean;

/** Whether the report is a chat room */
isChatRoom?: boolean;

/** Collection of participants personal details */
participantsList?: PersonalDetails[];

/** Text to be displayed in options list, which matches reportName by default */
text?: string;

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

/** Whether participants private notes are being currently loaded */
isLoadingPrivateNotes?: boolean;

/** Whether the report is currently selected in the options list */
selected?: boolean;

/** Pending members of the report */
pendingChatMembers?: PendingChatMember[];

Expand Down Expand Up @@ -278,9 +265,6 @@ type Report = OnyxCommon.OnyxValueWithOfflineFeedback<
/** Whether the report is archived */
// eslint-disable-next-line @typescript-eslint/naming-convention
private_isArchived?: string;

/** Participant account id's */
participantAccountIDs?: number[];
},
PolicyReportField['fieldID']
>;
Expand Down

0 comments on commit 1ad0d3f

Please sign in to comment.