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

bugfix #37757: admin badge on members list not greyed out when added offline #37892

Merged
Merged
Changes from all commits
Commits
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
9 changes: 7 additions & 2 deletions src/libs/actions/Policy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -749,9 +749,9 @@ function updateWorkspaceMembersRole(policyID: string, accountIDs: number[], newR
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.POLICY_MEMBERS}${policyID}`,
value: {
...memberRoles.reduce((member: Record<number, {role: string}>, current) => {
...memberRoles.reduce((member: Record<number, {role: string; pendingAction: string | null}>, current) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
...memberRoles.reduce((member: Record<number, {role: string; pendingAction: string | null}>, current) => {
...memberRoles.reduce((member: Record<number, {role: string; pendingAction: PendingAction}>, current) => {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thanks for pointing this out - I'll fix it in one of the upcoming PR's

// eslint-disable-next-line no-param-reassign
member[current.accountID] = {role: current?.role};
member[current.accountID] = {role: current?.role, pendingAction: CONST.RED_BRICK_ROAD_PENDING_ACTION.UPDATE};
return member;
}, {}),
errors: null,
Expand All @@ -764,6 +764,11 @@ function updateWorkspaceMembersRole(policyID: string, accountIDs: number[], newR
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.POLICY_MEMBERS}${policyID}`,
value: {
...memberRoles.reduce((member: Record<number, {role: string; pendingAction: string | null}>, current) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
...memberRoles.reduce((member: Record<number, {role: string; pendingAction: string | null}>, current) => {
...memberRoles.reduce((member: Record<number, {role: string; pendingAction: PendingAction}>, current) => {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍

Copy link
Contributor

Choose a reason for hiding this comment

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

Nvm. This was already fixed by Carlos as follow-up

Copy link
Contributor

Choose a reason for hiding this comment

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

Yep, this is fixed!

// eslint-disable-next-line no-param-reassign
member[current.accountID] = {role: current?.role, pendingAction: null};
return member;
}, {}),
errors: null,
},
},
Expand Down
Loading