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 7 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
1 change: 1 addition & 0 deletions src/components/MoneyRequestConfirmationList.js
Original file line number Diff line number Diff line change
Expand Up @@ -755,6 +755,7 @@ function MoneyRequestConfirmationList(props) {
? translate('common.error.enterMerchant')
: ''
}
rightLabel={canUseViolations && PolicyUtils.isPaidGroupPolicy(props.policy) ? translate('common.required') : ''}
cdanwards marked this conversation as resolved.
Show resolved Hide resolved
cdanwards marked this conversation as resolved.
Show resolved Hide resolved
/>
)}
{shouldShowCategories && (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -729,6 +729,7 @@ function MoneyTemporaryForRefactorRequestConfirmationList({
interactive={!isReadOnly}
brickRoadIndicator={merchantError ? CONST.BRICK_ROAD_INDICATOR_STATUS.ERROR : ''}
error={merchantError ? translate('common.error.fieldRequired') : ''}
rightLabel={canUseViolations && PolicyUtils.isPaidGroupPolicy(policy) ? translate('common.required') : ''}
cdanwards marked this conversation as resolved.
Show resolved Hide resolved
/>
)}
{!shouldShowAllFields && (
Expand Down
12 changes: 6 additions & 6 deletions src/libs/actions/IOU.ts
Original file line number Diff line number Diff line change
Expand Up @@ -675,11 +675,11 @@ function buildOnyxDataForMoneyRequest(
];

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

const violationsOnyxData = ViolationsUtils.getViolationsOnyxData(transaction, [], !!policy.requiresTag, policyTags ?? {}, !!policy.requiresCategory, policyCategories ?? {});
const violationsOnyxData = ViolationsUtils.getViolationsOnyxData(transaction, [], !!policy?.requiresTag, policyTags ?? {}, !!policy?.requiresCategory, policyCategories ?? {});
cdanwards marked this conversation as resolved.
Show resolved Hide resolved

if (violationsOnyxData) {
optimisticData.push(violationsOnyxData);
Expand Down Expand Up @@ -1218,15 +1218,15 @@ function getUpdateMoneyRequestParams(
});
}

if (policy?.id && updatedTransaction) {
if (PolicyUtils.isPaidGroupPolicy(policy) && updatedTransaction) {
const currentTransactionViolations = allTransactionViolations[`${ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS}${transactionID}`] ?? [];
optimisticData.push(
ViolationsUtils.getViolationsOnyxData(
updatedTransaction,
currentTransactionViolations,
!!policy.requiresTag,
!!policy?.requiresTag,
cdanwards marked this conversation as resolved.
Show resolved Hide resolved
policyTags ?? {},
!!policy.requiresCategory,
!!policy?.requiresCategory,
policyCategories ?? {},
),
);
Expand Down Expand Up @@ -2650,7 +2650,7 @@ function editRegularMoneyRequest(
];

// Add transaction violations if there is a policy and updated transaaction
cdanwards marked this conversation as resolved.
Show resolved Hide resolved
if (policy?.id && updatedTransaction) {
if (PolicyUtils.isPaidGroupPolicy(policy) && updatedTransaction) {
cdanwards marked this conversation as resolved.
Show resolved Hide resolved
const currentTransactionViolations = allTransactionViolations[`${ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS}${transactionID}`] ?? [];
const updatedViolationsOnyxData = ViolationsUtils.getViolationsOnyxData(
updatedTransaction,
Expand Down
Loading