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

Adds 'Required' label for merchant on workspaces & updates P2P requirements for worskpaces #36252

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
0eca9e9
Update MoneyRequestConfirmationList component
cdanwards Feb 8, 2024
014dd14
Merge branch 'lindboe/violations/money-request-updates' of github.com…
cdanwards Feb 8, 2024
b49e86e
Refactor MoneyRequestConfirmationList and MoneyTemporaryForRefactorRe…
cdanwards Feb 9, 2024
9927c0a
Merge branch 'lindboe/violations/money-request-updates' of github.com…
cdanwards Feb 9, 2024
7491f67
Merge branch 'main' of github.com:Expensify/App into violations/cdanw…
cdanwards Feb 9, 2024
28be879
Refactor rightLabel in MoneyTemporaryForRefactorRequestConfirmationLi…
cdanwards Feb 12, 2024
5c00980
Merge branch 'main' of github.com:Expensify/App into violations/cdanw…
cdanwards Feb 12, 2024
49a9f14
Fix condition in buildOnyxDataForMoneyRequest function
cdanwards Feb 12, 2024
9f833cd
Refactor code to use translated label for required field and other up…
cdanwards Feb 12, 2024
d1011f3
Update src/libs/actions/IOU.ts
cdanwards Feb 13, 2024
7c54b7f
Update src/libs/actions/IOU.ts
cdanwards Feb 13, 2024
c6277c6
Merge branch 'main' of github.com:Expensify/App into violations/cdanw…
cdanwards Feb 13, 2024
bc887e3
Merge branch 'main' of github.com:Expensify/App into violations/cdanw…
cdanwards Feb 14, 2024
ed3d556
Add right label for paid group policy
cdanwards Feb 14, 2024
b6ac532
Update src/components/MoneyTemporaryForRefactorRequestConfirmationLis…
cdanwards Feb 14, 2024
e97594a
Refactor rightLabel in MoneyTemporaryForRefactorRequestConfirmationLi…
cdanwards Feb 14, 2024
c62c0f6
Merge branch 'main' of github.com:Expensify/App into violations/cdanw…
cdanwards Feb 14, 2024
f3dedad
Fix policy check in getUpdateMoneyRequestParams function
cdanwards Feb 14, 2024
0b2971e
Fix conditional statement in editRegularMoneyRequest function
cdanwards Feb 14, 2024
107939a
Removed prop from MoneyRequestConfirmationList
cdanwards Feb 15, 2024
fda1f51
Merge branch 'main' of github.com:Expensify/App into violations/cdanw…
cdanwards Feb 15, 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
Original file line number Diff line number Diff line change
Expand Up @@ -718,6 +718,7 @@ function MoneyTemporaryForRefactorRequestConfirmationList({
interactive={!isReadOnly}
brickRoadIndicator={merchantError ? CONST.BRICK_ROAD_INDICATOR_STATUS.ERROR : ''}
error={merchantError ? translate('common.error.fieldRequired') : ''}
rightLabel={isMerchantRequired ? translate('common.required') : ''}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't make sense to show "Required" when merchant is already filled so this can be updated to
isMerchantEmpty && isMerchantRequired ? translate('common.required') : ''

But this is already existing logic in category, tag so out of scope

Copy link
Contributor Author

@cdanwards cdanwards Feb 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, this is just following the design precedent set by the other required items.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There was a bug created to remove the Required label from the category and tag fields if they have a values set. I can include the merchant field in the scope of that bug

/>
),
shouldShow: shouldShowMerchant,
Expand Down
10 changes: 5 additions & 5 deletions src/libs/actions/IOU.ts
Original file line number Diff line number Diff line change
Expand Up @@ -673,8 +673,8 @@ function buildOnyxDataForMoneyRequest(
},
];

// Policy won't be set for P2P cases for which we don't need to compute violations
if (!policy?.id) {
// We don't need to compute violations unless we're on a paid policy
if (!policy || !PolicyUtils.isPaidGroupPolicy(policy)) {
cdanwards marked this conversation as resolved.
Show resolved Hide resolved
return [optimisticData, successData, failureData];
}

Expand Down Expand Up @@ -1225,7 +1225,7 @@ function getUpdateMoneyRequestParams(
});
}

if (policy?.id && updatedTransaction) {
if (policy && PolicyUtils.isPaidGroupPolicy(policy) && updatedTransaction) {
const currentTransactionViolations = allTransactionViolations[`${ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS}${transactionID}`] ?? [];
optimisticData.push(
ViolationsUtils.getViolationsOnyxData(
Expand Down Expand Up @@ -2671,8 +2671,8 @@ function editRegularMoneyRequest(
},
];

// Add transaction violations if there is a policy and updated transaaction
if (policy?.id && updatedTransaction) {
// Add transaction violations if we have a paid policy and an updated transaction
if (policy && PolicyUtils.isPaidGroupPolicy(policy) && updatedTransaction) {
const currentTransactionViolations = allTransactionViolations[`${ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS}${transactionID}`] ?? [];
const updatedViolationsOnyxData = ViolationsUtils.getViolationsOnyxData(
updatedTransaction,
Expand Down
Loading