Skip to content

Commit 2a8ad71

Browse files
Merge branch 'Expensify:main' into knip-audit-export-1
2 parents 5ec9d04 + 705830c commit 2a8ad71

5 files changed

Lines changed: 40 additions & 6 deletions

File tree

contributingGuides/SETUP_ANDROID.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@ If you haven't done any intentional edits outside of `src/` (like adding new dep
7373
- Changes applied to Javascript will be applied automatically, any changes to native code will require a recompile
7474

7575
### Expensify Employees
76-
If you are an Expensify employee and want to point the emulator to your local VM, follow [this](https://stackoverflow.com/c/expensify/questions/7699)
76+
- To point the **Development Emulator** at your local VM, follow [these steps](https://stackoverflow.com/c/expensify/questions/7699).
77+
- You must configure the local dev email account; follow [these instructions](https://stackoverflowteams.com/c/expensify/questions/23537/23538#23538).
7778

7879
## Enabling Prebuilt React Native Artifacts
7980

contributingGuides/SETUP_IOS.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@ For an M1 Mac, read this [Stack Overflow post](https://stackoverflow.com/questio
8080
If you want to run the app on an actual physical iOS device, please follow the instructions [here](https://github.com/Expensify/App/blob/main/contributingGuides/HOW_TO_BUILD_APP_ON_PHYSICAL_IOS_DEVICE.md).
8181

8282
### Expensify Employees
83-
If you are an Expensify employee and want to point the emulator to your local VM, follow [this](https://stackoverflow.com/c/expensify/questions/7699)
83+
- To point the **Development Simulator** at your local VM, follow [these steps](https://stackoverflow.com/c/expensify/questions/7699).
84+
- You must configure the local dev email account; follow [these instructions](https://stackoverflowteams.com/c/expensify/questions/23537/23538#23538).
8485

8586
## Push Notifications Setup
8687

src/libs/actions/Policy/Member.ts

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -638,8 +638,17 @@ function buildUpdateWorkspaceMembersRoleOnyxData(policy: OnyxEntry<Policy>, sele
638638
onyxMethod: Onyx.METHOD.MERGE,
639639
key: `${ONYXKEYS.COLLECTION.POLICY}${policyID}`,
640640
value: {
641-
employeeList: previousEmployeeList,
642-
errors: ErrorUtils.getMicroSecondOnyxErrorWithTranslationKey('workspace.editor.genericFailureMessage'),
641+
employeeList: {
642+
...memberRoles.reduce((member: Record<string, PolicyEmployee>, current) => {
643+
// eslint-disable-next-line no-param-reassign
644+
member[current.email] = {
645+
...(previousEmployeeList[current.email] ?? {}),
646+
pendingAction: CONST.RED_BRICK_ROAD_PENDING_ACTION.UPDATE,
647+
errors: ErrorUtils.getMicroSecondOnyxErrorWithTranslationKey('workspace.editor.genericFailureMessage'),
648+
};
649+
return member;
650+
}, {}),
651+
},
643652
},
644653
},
645654
];
@@ -1145,6 +1154,20 @@ function clearAddMemberError(policyID: string, login: string, accountID: number)
11451154
});
11461155
}
11471156

1157+
/**
1158+
* Removes an error after trying to update a member role
1159+
*/
1160+
function clearUpdateMemberRoleError(policyID: string, login: string) {
1161+
Onyx.merge(`${ONYXKEYS.COLLECTION.POLICY}${policyID}`, {
1162+
employeeList: {
1163+
[login]: {
1164+
pendingAction: null,
1165+
errors: null,
1166+
},
1167+
},
1168+
});
1169+
}
1170+
11481171
function openWorkspaceMembersPage(policyID: string, clientMemberEmails: string[]) {
11491172
if (!policyID || !clientMemberEmails) {
11501173
Log.warn('openWorkspaceMembersPage invalid params', {policyID, clientMemberEmails});
@@ -1356,6 +1379,7 @@ export {
13561379
addMembersToWorkspace,
13571380
clearDeleteMemberError,
13581381
clearAddMemberError,
1382+
clearUpdateMemberRoleError,
13591383
openWorkspaceMembersPage,
13601384
setWorkspaceInviteMembersDraft,
13611385
inviteMemberToWorkspace,

src/pages/workspace/WorkspaceMembersPage.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ import {
3636
clearAddMemberError,
3737
clearDeleteMemberError,
3838
clearInviteDraft,
39+
clearUpdateMemberRoleError,
3940
clearWorkspaceOwnerChangeFlow,
4041
downloadMembersCSV,
4142
openWorkspaceMembersPage,
@@ -373,9 +374,15 @@ function WorkspaceMembersPage({personalDetails, route, policy}: WorkspaceMembers
373374
(item: MemberOption) => {
374375
if (item.pendingAction === CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE) {
375376
clearDeleteMemberError(route.params.policyID, item.login);
376-
} else {
377-
clearAddMemberError(route.params.policyID, item.login, item.accountID);
377+
return;
378+
}
379+
380+
if (item.pendingAction === CONST.RED_BRICK_ROAD_PENDING_ACTION.UPDATE) {
381+
clearUpdateMemberRoleError(route.params.policyID, item.login);
382+
return;
378383
}
384+
385+
clearAddMemberError(route.params.policyID, item.login, item.accountID);
379386
},
380387
[route.params.policyID],
381388
);

tests/unit/TransactionTest.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -864,6 +864,7 @@ describe('Transaction', () => {
864864
newReport: destinationExpenseReport,
865865
policy: undefined,
866866
allTransactions,
867+
policyTagList: undefined,
867868
});
868869

869870
await waitForBatchedUpdates();

0 commit comments

Comments
 (0)