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

Align default IDs in Report.ts file #54306

Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
0612e06
fix: undo default values to comply with eslint rules
pac-guerreiro Dec 18, 2024
f927a37
doc: fix typo in comment
pac-guerreiro Dec 18, 2024
8d1cf91
Merge branch 'main' into pac-guerreiro/fix/50360-undo-default-values-…
pac-guerreiro Dec 19, 2024
7f97310
chore: apply suggestions and follow guidelines
pac-guerreiro Dec 19, 2024
430a195
Merge branch 'main' into pac-guerreiro/fix/50360-undo-default-values-…
pac-guerreiro Dec 19, 2024
2e07d76
Merge branch 'main' into pac-guerreiro/fix/50360-undo-default-values-…
pac-guerreiro Dec 20, 2024
4be070e
chore: resolve eslint issues
pac-guerreiro Dec 20, 2024
34de8a5
Merge branch 'main' into pac-guerreiro/fix/50360-undo-default-values-…
pac-guerreiro Jan 2, 2025
8d6f43c
Merge branch 'main' into pac-guerreiro/fix/50360-undo-default-values-…
pac-guerreiro Jan 3, 2025
b589b0f
Merge branch 'main' into pac-guerreiro/fix/50360-undo-default-values-…
pac-guerreiro Jan 7, 2025
b7e916d
Merge branch 'main' into pac-guerreiro/fix/50360-undo-default-values-…
pac-guerreiro Jan 8, 2025
3d6e6a3
refactor: make optimistic task.parentReportID required
pac-guerreiro Jan 8, 2025
95e6510
Merge branch 'main' into pac-guerreiro/fix/50360-undo-default-values-…
pac-guerreiro Jan 8, 2025
0d5a338
refactor: apply suggestions
pac-guerreiro Jan 8, 2025
f0fb184
Merge branch 'main' into pac-guerreiro/fix/50360-undo-default-values-…
pac-guerreiro Jan 14, 2025
7a4971c
Merge branch 'main' into pac-guerreiro/fix/50360-undo-default-values-…
pac-guerreiro Jan 14, 2025
805a33b
refactor: apply suggestions
pac-guerreiro Jan 15, 2025
026a422
Merge branch 'main' into pac-guerreiro/fix/50360-undo-default-values-…
pac-guerreiro Jan 16, 2025
b47b57c
refactor: apply suggestions
pac-guerreiro Jan 16, 2025
9e3b8b7
Merge branch 'main' into pac-guerreiro/fix/50360-undo-default-values-…
pac-guerreiro Jan 20, 2025
20c7866
refactor: apply suggestions
pac-guerreiro Jan 20, 2025
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
8 changes: 1 addition & 7 deletions .eslintrc.changed.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,7 @@ module.exports = {
},
overrides: [
{
files: [
'src/libs/actions/IOU.ts',
'src/libs/actions/Report.ts',
'src/pages/workspace/WorkspaceInitialPage.tsx',
'src/pages/home/report/PureReportActionItem.tsx',
'src/libs/SidebarUtils.ts',
],
files: ['src/libs/actions/IOU.ts', 'src/pages/workspace/WorkspaceInitialPage.tsx', 'src/pages/home/report/PureReportActionItem.tsx', 'src/libs/SidebarUtils.ts'],
rules: {
'rulesdir/no-default-id-values': 'off',
},
Expand Down
33 changes: 28 additions & 5 deletions src/ROUTES.ts
Original file line number Diff line number Diff line change
Expand Up @@ -745,7 +745,12 @@ const ROUTES = {
WORKSPACE_NEW_ROOM: 'workspace/new-room',
WORKSPACE_INITIAL: {
route: 'settings/workspaces/:policyID',
getRoute: (policyID: string, backTo?: string) => `${getUrlWithBackToParam(`settings/workspaces/${policyID}`, backTo)}` as const,
getRoute: (policyID: string | undefined, backTo?: string) => {
if (!policyID) {
Log.warn('Invalid policyID while building route WORKSPACE_INITIAL');
}
return `${getUrlWithBackToParam(`settings/workspaces/${policyID}`, backTo)}` as const;
},
},
WORKSPACE_INVITE: {
route: 'settings/workspaces/:policyID/invite',
Expand Down Expand Up @@ -979,7 +984,12 @@ const ROUTES = {
},
WORKSPACE_MEMBERS: {
route: 'settings/workspaces/:policyID/members',
getRoute: (policyID: string) => `settings/workspaces/${policyID}/members` as const,
getRoute: (policyID: string | undefined) => {
if (!policyID) {
Log.warn('Invalid policyID while building route WORKSPACE_MEMBERS');
}
return `settings/workspaces/${policyID}/members` as const;
},
},
WORKSPACE_MEMBERS_IMPORT: {
route: 'settings/workspaces/:policyID/members/import',
Expand All @@ -991,7 +1001,10 @@ const ROUTES = {
},
POLICY_ACCOUNTING: {
route: 'settings/workspaces/:policyID/accounting',
getRoute: (policyID: string, newConnectionName?: ConnectionName, integrationToDisconnect?: ConnectionName, shouldDisconnectIntegrationBeforeConnecting?: boolean) => {
getRoute: (policyID: string | undefined, newConnectionName?: ConnectionName, integrationToDisconnect?: ConnectionName, shouldDisconnectIntegrationBeforeConnecting?: boolean) => {
if (!policyID) {
Log.warn('Invalid policyID while building route POLICY_ACCOUNTING');
}
let queryParams = '';
if (newConnectionName) {
queryParams += `?newConnectionName=${newConnectionName}`;
Expand Down Expand Up @@ -1029,7 +1042,12 @@ const ROUTES = {
},
WORKSPACE_CATEGORIES: {
route: 'settings/workspaces/:policyID/categories',
getRoute: (policyID: string) => `settings/workspaces/${policyID}/categories` as const,
getRoute: (policyID: string | undefined) => {
if (!policyID) {
Log.warn('Invalid policyID while building route WORKSPACE_CATEGORIES');
}
return `settings/workspaces/${policyID}/categories` as const;
},
},
WORKSPACE_CATEGORY_SETTINGS: {
route: 'settings/workspaces/:policyID/category/:categoryName',
Expand Down Expand Up @@ -1094,7 +1112,12 @@ const ROUTES = {
},
WORKSPACE_MORE_FEATURES: {
route: 'settings/workspaces/:policyID/more-features',
getRoute: (policyID: string) => `settings/workspaces/${policyID}/more-features` as const,
getRoute: (policyID: string | undefined) => {
if (!policyID) {
Log.warn('Invalid policyID while building route WORKSPACE_MORE_FEATURES');
}
return `settings/workspaces/${policyID}/more-features` as const;
},
},
WORKSPACE_TAGS: {
route: 'settings/workspaces/:policyID/tags',
Expand Down
2 changes: 1 addition & 1 deletion src/libs/API/parameters/AddCommentOrAttachementParams.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type {FileObject} from '@components/AttachmentModal';

type AddCommentOrAttachementParams = {
reportID: string;
reportID?: string;
pac-guerreiro marked this conversation as resolved.
Show resolved Hide resolved
reportActionID?: string;
commentReportActionID?: string | null;
reportComment?: string;
Expand Down
2 changes: 1 addition & 1 deletion src/libs/API/parameters/SearchForRoomsToMentionParams.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
type SearchForRoomsToMentionParams = {
query: string;
policyID: string;
policyID?: string;
};

export default SearchForRoomsToMentionParams;
39 changes: 21 additions & 18 deletions src/libs/ReportUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import type {OnyxCollection, OnyxEntry, OnyxUpdate} from 'react-native-onyx';
import Onyx from 'react-native-onyx';
import type {SvgProps} from 'react-native-svg';
import type {OriginalMessageIOU, OriginalMessageModifiedExpense} from 'src/types/onyx/OriginalMessage';
import type {TupleToUnion, ValueOf} from 'type-fest';
import type {SetRequired, TupleToUnion, ValueOf} from 'type-fest';
import type {FileObject} from '@components/AttachmentModal';
import {FallbackAvatar, IntacctSquare, NetSuiteSquare, QBOSquare, XeroSquare} from '@components/Icon/Expensicons';
import * as defaultGroupAvatars from '@components/Icon/GroupDefaultAvatars';
Expand Down Expand Up @@ -512,22 +512,25 @@ type OptimisticModifiedExpenseReportAction = Pick<
| 'delegateAccountID'
> & {reportID?: string};

type OptimisticTaskReport = Pick<
Report,
| 'reportID'
| 'reportName'
| 'description'
| 'ownerAccountID'
| 'participants'
| 'managerID'
| 'type'
| 'parentReportID'
| 'policyID'
| 'stateNum'
| 'statusNum'
| 'parentReportActionID'
| 'lastVisibleActionCreated'
| 'hasParentAccess'
type OptimisticTaskReport = SetRequired<
Pick<
Report,
| 'reportID'
| 'reportName'
| 'description'
| 'ownerAccountID'
| 'participants'
| 'managerID'
| 'type'
| 'parentReportID'
| 'policyID'
| 'stateNum'
| 'statusNum'
| 'parentReportActionID'
| 'lastVisibleActionCreated'
| 'hasParentAccess'
>,
'parentReportID'
>;

type TransactionDetails = {
Expand Down Expand Up @@ -6336,8 +6339,8 @@ function buildOptimisticWorkspaceChats(policyID: string, policyName: string, exp

function buildOptimisticTaskReport(
ownerAccountID: number,
parentReportID: string,
assigneeAccountID = 0,
parentReportID?: string,
title?: string,
description?: string,
policyID: string = CONST.POLICY.OWNER_EMAIL_FAKE,
Expand Down
Loading
Loading