-
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
[HOLD for payment 2024-11-29] [HOLD #49996][$250] Update Default / Custom Workspace Invite Behavior #51096
Comments
Triggered auto assignment to @anmurali ( |
|
Triggered auto assignment to Design team member for new feature review - @dannymcclain ( |
Job added to Upwork: https://www.upwork.com/jobs/~021847313199304724261 |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @aimane-chnaif ( |
Edited by proposal-police: This proposal was edited at 2024-10-18 17:29:52 UTC. ProposalPlease re-state the problem that we are trying to solve in this issue.we are not saving the welcome message as draft when user send the invitation, it saved every time user edit the message. What is the root cause of that problem?New feature What changes do you think we should make in order to solve the problem?I think the implemnetion is very straight forward
|
Edited by proposal-police: This proposal was edited at 2024-10-18 17:58:03 UTC. ProposalPlease re-state the problem that we are trying to solve in this issue.Update Default / Custom Workspace Invite Behavior What is the root cause of that problem?New feature What changes do you think we should make in order to solve the problem?We need to create a new key to persist the new workspace invite message for storing the invite message when sending invites to members. We use this message in case the member is sent—close the RHP and then reopen the RHP //.src/ONYXKEYS.ts#L470
+ WORKSPACE_INVITE_MESSAGE_PERSIST: 'workspaceInviteMessagePersist_', Create a function to set the invite message //.src/libs/actions/Policy/Policy.ts#L2153
+ function persistWorkspaceInviteMessage(policyID: string, message: string | null) {
+ Onyx.set(`${ONYXKEYS.COLLECTION.WORKSPACE_INVITE_MESSAGE_PERSIST}${policyID}`, message);
+ } Update the function to get the default welcome note and call persistMessage when sending the invitation. //.src/pages/workspace/WorkspaceInviteMessagePage.tsx#L68
const getDefaultWelcomeNote = useCallback(() => {
- return (
- ...
- );
- }, [workspaceInviteMessageDraft, policy, translate]);
+ let welcomeNote = '';
+ if (workspaceInviteMessageDraft) {
+ welcomeNote = workspaceInviteMessageDraft;
+ } else if (typeof workspaceInviteMessagePersist === 'string') {
+ welcomeNote = workspaceInviteMessagePersist;
+ } else if (policy?.description) {
+ welcomeNote = Parser.htmlToMarkdown(policy.description);
+ } else {
+ welcomeNote = translate('workspace.common.welcomeNote', {
+ workspaceName: policy?.name ?? '',
+ });
+ }
+ return welcomeNote;
+ }, [workspaceInviteMessageDraft, workspaceInviteMessagePersist, policy, translate]);
//.src/pages/workspace/WorkspaceInviteMessagePage.tsx#L89
useEffect(() => {
- if (isEmptyObject(invitedEmailsToAccountIDsDraft) || !welcomeNote) {
+ if ((typeof workspaceInviteMessagePersist !== 'string' && isEmptyObject(invitedEmailsToAccountIDsDraft)) || !welcomeNote) {
return;
}
setWelcomeNote(getDefaultWelcomeNote());
- }, [getDefaultWelcomeNote, invitedEmailsToAccountIDsDraft, welcomeNote]);
+ }, [getDefaultWelcomeNote, invitedEmailsToAccountIDsDraft, welcomeNote, workspaceInviteMessagePersist]);
//.src/pages/workspace/WorkspaceInviteMessagePage.tsx#L99
+ const debouncedPersistWorkspaceInviteMessage = lodashDebounce((newDraft: string) => {
+ Policy.persistWorkspaceInviteMessage(route.params.policyID, newDraft);
+ });
//.src/pages/workspace/WorkspaceInviteMessagePage.tsx#L111
const sendInvitation = () => {
...
+ debouncedPersistWorkspaceInviteMessage(welcomeNote ?? '');
...
}; We need to clear the message draft when closing the RHP because it won't be used next time. //.src/pages/workspace/WorkspaceInvitePage.tsx#L80
useEffect(() => {
return () => {
Member.setWorkspaceInviteMembersDraft(route.params.policyID, {});
+ Policy.setWorkspaceInviteMessageDraft(route.params.policyID, '');
};
// eslint-disable-next-line react-compiler/react-compiler, react-hooks/exhaustive-deps
}, [route.params.policyID]);
Screen.Recording.2024-10-19.at.01.01.36.mp4 |
@dangrous Don't we have to put this issue on hold until #49996 is done? |
ah yep forgot to hold it! |
📣 @rojiphil 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app! Offer link |
ProposalPlease re-state the problem that we are trying to solve in this issue.Update Default / Custom Workspace Invite Behavior What is the root cause of that problem?Behavior change on demand What changes do you think we should make in order to solve the problem?This is on simpler side..... Policy.setWorkspaceInviteMessageDraft(route.params.policyID,
Parser.htmlToMarkdown(policy?.description ?? '') ||
translate('workspace.common.welcomeNote', {
workspaceName: policy?.name ?? '',
})
); And boom.... What alternative solutions did you explore? (Optional)Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job. |
📣 @Krishna2323 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app! Offer link |
Apologies for the delay, reviewed the proposal and it makes sense to me, thanks for the bump! |
@rojiphil PR ready for review^ |
If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results. If a regression has occurred and you are the assigned CM follow the instructions here. If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future. |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.65-5 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue: If no regressions arise, payment will be issued on 2024-11-29. 🎊 For reference, here are some details about the assignees on this issue:
|
BugZero Checklist: The PR adding this new feature has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
|
@garrettmknight This issue is an improvement and not a bug. As such, I do not think a BZ checklist is needed here. But, adding the following test case to the database would be ideal to avoid any regressions: Precondition: No preexisting saved invite message draft should be set for the workspace.
|
@garrettmknight, @rojiphil, @dannymcclain, @jasperhuangg, @Krishna2323 Whoops! This issue is 2 days overdue. Let's get this updated quick! |
@rojiphil new offer out to you. |
@Krishna2323 you've been paid! |
@garrettmknight Accepted the offer. Thanks. |
Paid out, closing! |
If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!
cc @rojiphil coming from #49899
A pretty quick one here - we want to update the behavior for the Workspace Invite Message Page. Namely:
As long as the RHP stays open, keep the messages as edited (even if it is set to empty). And save the edited message as invite message draft only on an actual invite. Once the RHP closes without an actual invitation, discard the edited message. And when the RHP is shown again, show either the previously saved invite message draft or show the default message if no custom message is set.
Currently, we reset to the default value whenever the invite message page is shown and the message is empty. This is irrespective of whether the RHP stays open or closed.
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @garrettmknightThe text was updated successfully, but these errors were encountered: