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

[Debug Mode] Add transaction and violation data to debug mode #50745

Open
wants to merge 23 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
371c92a
feat(debug mode): add debug transaction page
pac-guerreiro Oct 14, 2024
09effbe
chore: create validateTransactionDraftProperty
pac-guerreiro Oct 15, 2024
415604c
Merge branch 'main' into pac-guerreiro/feature/50335-add-transaction-…
pac-guerreiro Oct 16, 2024
6922c05
chore(debug mode): finish DebugUtils.validateTransactionDraftData and…
pac-guerreiro Oct 16, 2024
86279f4
chore(debug mode): add debug transaction types
pac-guerreiro Oct 17, 2024
fd20c7b
feat(debug mode): add links for transaction and report
pac-guerreiro Oct 17, 2024
9db0e98
Merge branch 'main' into pac-guerreiro/feature/50335-add-transaction-…
pac-guerreiro Oct 17, 2024
d3af97f
Merge branch 'main' into pac-guerreiro/feature/50335-add-transaction-…
pac-guerreiro Oct 19, 2024
3202cd7
chore(debug mode): add transaction violation creation page
pac-guerreiro Oct 19, 2024
61c342a
Merge branch 'main' into pac-guerreiro/feature/50335-add-transaction-…
pac-guerreiro Oct 21, 2024
bc74450
chore(debug mode): add debug transaction violation page and finish de…
pac-guerreiro Oct 21, 2024
8ea1478
Merge branch 'main' into pac-guerreiro/feature/50335-add-transaction-…
pac-guerreiro Oct 21, 2024
8c6128b
chore(debug mode): add debug transaction violation draft form types
pac-guerreiro Oct 21, 2024
6af473b
Merge branch 'main' into pac-guerreiro/feature/50335-add-transaction-…
pac-guerreiro Oct 22, 2024
3f4dd04
chore(debug mode): fix mutating Onyx data causing set to fail and add…
pac-guerreiro Oct 23, 2024
4ac02f5
Merge branch 'main' into pac-guerreiro/feature/50335-add-transaction-…
pac-guerreiro Oct 23, 2024
bd4b641
refactor(debug mode): debug details constant fields
pac-guerreiro Oct 23, 2024
9d6b1ba
Merge branch 'main' into pac-guerreiro/feature/50335-add-transaction-…
pac-guerreiro Oct 23, 2024
754c5fa
refactor: make code more readable
pac-guerreiro Oct 24, 2024
41e12a3
fix: virtualized list error
pac-guerreiro Oct 24, 2024
4e50adb
Merge branch 'main' into pac-guerreiro/feature/50335-add-transaction-…
pac-guerreiro Oct 24, 2024
390a6a6
refactor: apply suggestions
pac-guerreiro Oct 24, 2024
cb91f47
Merge branch 'main' into pac-guerreiro/feature/50335-add-transaction-…
pac-guerreiro Oct 24, 2024
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
7 changes: 7 additions & 0 deletions src/CONST.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5955,10 +5955,17 @@ const CONST = {
},

DEBUG: {
FORMS: {
REPORT: 'report',
REPORT_ACTION: 'reportAction',
TRANSACTION: 'transaction',
TRANSACTION_VIOLATION: 'transactionViolation',
},
DETAILS: 'details',
JSON: 'json',
REPORT_ACTIONS: 'actions',
REPORT_ACTION_PREVIEW: 'preview',
TRANSACTION_VIOLATIONS: 'violations',
},

REPORT_IN_LHN_REASONS: {
Expand Down
8 changes: 1 addition & 7 deletions src/ONYXKEYS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -703,10 +703,6 @@ const ONYXKEYS = {
RULES_MAX_EXPENSE_AMOUNT_FORM_DRAFT: 'rulesMaxExpenseAmountFormDraft',
RULES_MAX_EXPENSE_AGE_FORM: 'rulesMaxExpenseAgeForm',
RULES_MAX_EXPENSE_AGE_FORM_DRAFT: 'rulesMaxExpenseAgeFormDraft',
DEBUG_REPORT_PAGE_FORM: 'debugReportPageForm',
DEBUG_REPORT_PAGE_FORM_DRAFT: 'debugReportPageFormDraft',
DEBUG_REPORT_ACTION_PAGE_FORM: 'debugReportActionPageForm',
DEBUG_REPORT_ACTION_PAGE_FORM_DRAFT: 'debugReportActionPageFormDraft',
DEBUG_DETAILS_FORM: 'debugDetailsForm',
DEBUG_DETAILS_FORM_DRAFT: 'debugDetailsFormDraft',
},
Expand Down Expand Up @@ -801,9 +797,7 @@ type OnyxFormValuesMapping = {
[ONYXKEYS.FORMS.RULES_MAX_EXPENSE_AMOUNT_FORM]: FormTypes.RulesMaxExpenseAmountForm;
[ONYXKEYS.FORMS.RULES_MAX_EXPENSE_AGE_FORM]: FormTypes.RulesMaxExpenseAgeForm;
[ONYXKEYS.FORMS.SEARCH_SAVED_SEARCH_RENAME_FORM]: FormTypes.SearchSavedSearchRenameForm;
[ONYXKEYS.FORMS.DEBUG_REPORT_PAGE_FORM]: FormTypes.DebugReportForm;
[ONYXKEYS.FORMS.DEBUG_REPORT_ACTION_PAGE_FORM]: FormTypes.DebugReportActionForm;
[ONYXKEYS.FORMS.DEBUG_DETAILS_FORM]: FormTypes.DebugReportForm | FormTypes.DebugReportActionForm;
[ONYXKEYS.FORMS.DEBUG_DETAILS_FORM]: FormTypes.DebugReportForm | FormTypes.DebugReportActionForm | FormTypes.DebugTransactionForm | FormTypes.DebugTransactionViolationForm;
};

type OnyxFormDraftValuesMapping = {
Expand Down
37 changes: 35 additions & 2 deletions src/ROUTES.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1730,13 +1730,46 @@ const ROUTES = {
getRoute: (reportID: string, reportActionID: string) => `debug/report/${reportID}/actions/${reportActionID}/preview` as const,
},
DETAILS_CONSTANT_PICKER_PAGE: {
route: 'debug/details/constant/:fieldName',
getRoute: (fieldName: string, fieldValue?: string, backTo?: string) => getUrlWithBackToParam(`debug/details/constant/${fieldName}?fieldValue=${fieldValue}`, backTo),
route: 'debug/:formType/details/constant/:fieldName',
getRoute: (formType: string, fieldName: string, fieldValue?: string, backTo?: string) =>
getUrlWithBackToParam(`debug/${formType}/details/constant/${fieldName}?fieldValue=${fieldValue}`, backTo),
},
DETAILS_DATE_TIME_PICKER_PAGE: {
route: 'debug/details/datetime/:fieldName',
getRoute: (fieldName: string, fieldValue?: string, backTo?: string) => getUrlWithBackToParam(`debug/details/datetime/${fieldName}?fieldValue=${fieldValue}`, backTo),
},
DEBUG_TRANSACTION: {
route: 'debug/transaction/:transactionID',
getRoute: (transactionID: string) => `debug/transaction/${transactionID}` as const,
},
DEBUG_TRANSACTION_TAB_DETAILS: {
route: 'debug/transaction/:transactionID/details',
getRoute: (transactionID: string) => `debug/transaction/${transactionID}/details` as const,
},
DEBUG_TRANSACTION_TAB_JSON: {
route: 'debug/transaction/:transactionID/json',
getRoute: (transactionID: string) => `debug/transaction/${transactionID}/json` as const,
},
DEBUG_TRANSACTION_TAB_VIOLATIONS: {
route: 'debug/transaction/:transactionID/violations',
getRoute: (transactionID: string) => `debug/transaction/${transactionID}/violations` as const,
},
DEBUG_TRANSACTION_VIOLATION_CREATE: {
route: 'debug/transaction/:transactionID/violations/create',
getRoute: (transactionID: string) => `debug/transaction/${transactionID}/violations/create` as const,
},
DEBUG_TRANSACTION_VIOLATION: {
route: 'debug/transaction/:transactionID/violations/:index',
getRoute: (transactionID: string, index: string) => `debug/transaction/${transactionID}/violations/${index}` as const,
},
DEBUG_TRANSACTION_VIOLATION_TAB_DETAILS: {
route: 'debug/transaction/:transactionID/violations/:index/details',
getRoute: (transactionID: string, index: string) => `debug/transaction/${transactionID}/violations/${index}/details` as const,
},
DEBUG_TRANSACTION_VIOLATION_TAB_JSON: {
route: 'debug/transaction/:transactionID/violations/:index/json',
getRoute: (transactionID: string, index: string) => `debug/transaction/${transactionID}/violations/${index}/json` as const,
},
} as const;

/**
Expand Down
3 changes: 3 additions & 0 deletions src/SCREENS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -611,6 +611,9 @@ const SCREENS = {
REPORT_ACTION_CREATE: 'Debug_Report_Action_Create',
DETAILS_CONSTANT_PICKER_PAGE: 'Debug_Details_Constant_Picker_Page',
DETAILS_DATE_TIME_PICKER_PAGE: 'Debug_Details_Date_Time_Picker_Page',
TRANSACTION: 'Debug_Transaction',
TRANSACTION_VIOLATION_CREATE: 'Debug_Transaction_Violation_Create',
TRANSACTION_VIOLATION: 'Debug_Transaction_Violation',
},
} as const;

Expand Down
2 changes: 2 additions & 0 deletions src/components/TabSelector/TabSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ function getIconAndTitle(route: string, translate: LocaleContextProps['translate
return {icon: Expensicons.Document, title: translate('debug.reportActions')};
case CONST.DEBUG.REPORT_ACTION_PREVIEW:
return {icon: Expensicons.Document, title: translate('debug.reportActionPreview')};
case CONST.DEBUG.TRANSACTION_VIOLATIONS:
return {icon: Expensicons.Exclamation, title: translate('debug.violations')};
case CONST.TAB_REQUEST.MANUAL:
return {icon: Expensicons.Pencil, title: translate('tabSelector.manual')};
case CONST.TAB_REQUEST.SCAN:
Expand Down
6 changes: 6 additions & 0 deletions src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5112,6 +5112,9 @@ const translations = {
createReportAction: 'Create Report Action',
reportAction: 'Report Action',
report: 'Report',
transaction: 'Transaction',
violations: 'Violations',
transactionViolation: 'Transaction Violation',
hint: "Data changes won't be sent to the backend",
textFields: 'Text fields',
numberFields: 'Number fields',
Expand All @@ -5126,6 +5129,9 @@ const translations = {
RBR: 'RBR',
true: 'true',
false: 'false',
viewReport: 'View report',
viewTransaction: 'View transaction',
createTransactionViolation: 'Create transaction violation',
reasonVisibleInLHN: {
hasDraftComment: 'Has draft comment',
hasGBR: 'Has GBR',
Expand Down
6 changes: 6 additions & 0 deletions src/languages/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5628,6 +5628,9 @@ const translations = {
createReportAction: 'Crear Report Action',
reportAction: 'Report Action',
report: 'Report',
transaction: 'Transacción',
violations: 'Violaciones',
transactionViolation: 'Violación de transacción',
hint: 'Los cambios de datos no se enviarán al backend',
textFields: 'Campos de texto',
numberFields: 'Campos numéricos',
Expand All @@ -5642,6 +5645,9 @@ const translations = {
RBR: 'RBR',
true: 'verdadero',
false: 'falso',
viewReport: 'Ver informe',
viewTransaction: 'Ver transacción',
createTransactionViolation: 'Crear infracción de transacción',
reasonVisibleInLHN: {
hasDraftComment: 'Tiene comentario en borrador',
hasGBR: 'Tiene GBR',
Expand Down
Loading
Loading