-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Add modal for inviting users to a workspace #3463
Conversation
This is ready for review! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM and overall fine work! Really only had NAB comments.
translateLocal = (phrase, variables) => translate(preferredLocale, phrase, variables); | ||
} | ||
}, | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NAB but maybe a good follow up. I noticed that we are doing this in every file that needs to use translate()
. Perhaps we should just subscribe to the preferred locale in '../translate.js'
and then we could export the method that already knows what the locale is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That sounds like a good follow-up to me 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Created a follow-up PR here: #3716
src/libs/actions/Policy.js
Outdated
if (data.jsonCode === 200) { | ||
const policyDataToStore = _.reduce(data.policyList, (memo, policy) => ({ | ||
...memo, | ||
[`${ONYXKEYS.COLLECTION.POLICY}${policy.id}`]: getSimplifiedMemberList(policy), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NAB, I wonder if it would be more clear that this is doing a merge
on an object if we instead did this...
[`${ONYXKEYS.COLLECTION.POLICY}${policy.id}`]: {employeeList: getSimplifiedMemberList(policy)},
also seems like getSimplifiedMemberList()
would return a list.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I updated the name of the function to getSimplifiedEmployeeListObject
, let me know if that's more clear or if you think it'd still be better to return just the array from that function instead.
src/libs/actions/Policy.js
Outdated
const policy = _.clone(allPolicies[key]); | ||
policy.employeeList.push(login); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it's a shallow copy - you are pushing to the original allPolicies[key].employeeList
It' probably won't make a difference here, but mutating your source data is bad
See: #3463 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agree it doesn't really matter in this case, but should be avoided.
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
🚀 Deployed to staging in version: 1.0.69-1🚀
|
🚀 Deployed to production in version: 1.0.73-3🚀
|
cc @mountiny
Details
This PR adds the ability to invite a user to a workspace.
Fixed Issues
Fixes https://github.com/Expensify/Expensify/issues/166040
Tests
4A19DC10B34DC505
.People
and remove that way.{translationKey: 'common.invite', icon: Profile, action: () => { Navigation.navigate(ROUTES.getWorkspaceInviteRoute('4A19DC10B34DC505')); },},
Invite
(the one we added in step 2), and confirm that the modal opens with theInvite
button disabled. Confirm that the welcomeNote placeholder value contains the policy name.Application
tab of the Chrome inspector (web is the easiest way to test this) and type inpolicy_4A19DC10B34DC505
in the filter bar (replace4A19DC10B34DC505
with your policyID), confirm you see the policy object w/ the employeeListApplication
tab of the Chrome inspector, confirm that the new email is addedpersonalDetails
, confirm the invited user's personal details show upPolicy_Employees_Merge
command of the PHP api.then
handler ofPolicy_Employees_Merge
inPolicy.js
so that thedata.jsonCode === 200
check is nowdata.jsonCode !== 200
QA Steps
N/A, this will be more easily testable by QA in https://github.com/Expensify/Expensify/issues/166468
Tested On
Screenshots
Web
Mobile Web
Desktop
iOS
Android