Skip to content

Commit

Permalink
Merge pull request #47595 from Expensify/revert-47373-fix/46340
Browse files Browse the repository at this point in the history
Revert "[QA failed: do not check this off] fix: Submit expense option is not disabled for users who are invited to expense report"
  • Loading branch information
pecanoro authored Aug 19, 2024
2 parents 20b0866 + 7fe2a76 commit 0ff1b98
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 15 deletions.
8 changes: 0 additions & 8 deletions src/libs/ReportUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1667,14 +1667,6 @@ function canAddOrDeleteTransactions(moneyRequestReport: OnyxEntry<Report>): bool
return false;
}

if (isIOUReport(moneyRequestReport) && currentUserAccountID !== moneyRequestReport?.managerID && currentUserAccountID !== moneyRequestReport?.ownerAccountID) {
return false;
}

if (isExpenseReport(moneyRequestReport) && currentUserAccountID !== moneyRequestReport?.managerID) {
return false;
}

const policy = getPolicy(moneyRequestReport?.policyID);
if (PolicyUtils.isInstantSubmitEnabled(policy) && PolicyUtils.isSubmitAndClose(policy) && hasOnlyNonReimbursableTransactions(moneyRequestReport?.reportID)) {
return false;
Expand Down
7 changes: 0 additions & 7 deletions tests/unit/ReportUtilsTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,6 @@ describe('ReportUtils', () => {
type: CONST.REPORT.TYPE.IOU,
stateNum: CONST.REPORT.STATE_NUM.SUBMITTED,
statusNum: CONST.REPORT.STATUS_NUM.SUBMITTED,
managerID: currentUserAccountID,
};
const moneyRequestOptions = ReportUtils.temporary_getMoneyRequestOptions(report, undefined, [currentUserAccountID, participantsAccountIDs[0]]);
expect(moneyRequestOptions.length).toBe(1);
Expand All @@ -574,7 +573,6 @@ describe('ReportUtils', () => {
type: CONST.REPORT.TYPE.IOU,
stateNum: CONST.REPORT.STATE_NUM.SUBMITTED,
statusNum: CONST.REPORT.STATUS_NUM.SUBMITTED,
managerID: currentUserAccountID,
};
const moneyRequestOptions = ReportUtils.temporary_getMoneyRequestOptions(report, undefined, [currentUserAccountID, participantsAccountIDs[0]]);
expect(moneyRequestOptions.length).toBe(1);
Expand All @@ -593,7 +591,6 @@ describe('ReportUtils', () => {
...LHNTestUtils.getFakeReport(),
parentReportID: '102',
type: CONST.REPORT.TYPE.EXPENSE,
managerID: currentUserAccountID,
};
const moneyRequestOptions = ReportUtils.temporary_getMoneyRequestOptions(report, undefined, [currentUserAccountID]);
expect(moneyRequestOptions.length).toBe(2);
Expand All @@ -614,7 +611,6 @@ describe('ReportUtils', () => {
stateNum: CONST.REPORT.STATE_NUM.OPEN,
statusNum: CONST.REPORT.STATUS_NUM.OPEN,
parentReportID: '103',
managerID: currentUserAccountID,
};
const paidPolicy = {
type: CONST.POLICY.TYPE.TEAM,
Expand All @@ -638,7 +634,6 @@ describe('ReportUtils', () => {
type: CONST.REPORT.TYPE.IOU,
stateNum: CONST.REPORT.STATE_NUM.SUBMITTED,
statusNum: CONST.REPORT.STATUS_NUM.SUBMITTED,
managerID: currentUserAccountID,
};
const moneyRequestOptions = ReportUtils.temporary_getMoneyRequestOptions(report, undefined, [currentUserAccountID, participantsAccountIDs[0]]);
expect(moneyRequestOptions.length).toBe(1);
Expand All @@ -651,7 +646,6 @@ describe('ReportUtils', () => {
type: CONST.REPORT.TYPE.IOU,
stateNum: CONST.REPORT.STATE_NUM.SUBMITTED,
statusNum: CONST.REPORT.STATUS_NUM.SUBMITTED,
managerID: currentUserAccountID,
};
const moneyRequestOptions = ReportUtils.temporary_getMoneyRequestOptions(report, undefined, [currentUserAccountID, participantsAccountIDs[0]]);
expect(moneyRequestOptions.length).toBe(1);
Expand Down Expand Up @@ -685,7 +679,6 @@ describe('ReportUtils', () => {
statusNum: CONST.REPORT.STATUS_NUM.SUBMITTED,
parentReportID: '101',
policyID: paidPolicy.id,
managerID: currentUserAccountID,
};
const moneyRequestOptions = ReportUtils.temporary_getMoneyRequestOptions(report, paidPolicy, [currentUserAccountID, participantsAccountIDs[0]]);
expect(moneyRequestOptions.length).toBe(2);
Expand Down

0 comments on commit 0ff1b98

Please sign in to comment.