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

Fix two created action generated on assign task from QAB casusing UX glitch #47138

Merged
merged 5 commits into from
Aug 19, 2024
Merged
Show file tree
Hide file tree
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
3 changes: 3 additions & 0 deletions src/libs/actions/Policy/Policy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1685,6 +1685,7 @@ function buildPolicyData(policyOwnerEmail = '', makeMeAdmin = false, policyName
addWorkspaceRoom: null,
},
pendingAction: null,
isOptimisticReport: false,
},
},
{
Expand All @@ -1705,6 +1706,7 @@ function buildPolicyData(policyOwnerEmail = '', makeMeAdmin = false, policyName
},
pendingAction: null,
pendingChatMembers: [],
isOptimisticReport: false,
},
},
{
Expand All @@ -1724,6 +1726,7 @@ function buildPolicyData(policyOwnerEmail = '', makeMeAdmin = false, policyName
addWorkspaceRoom: null,
},
pendingAction: null,
isOptimisticReport: false,
},
},
{
Expand Down
12 changes: 12 additions & 0 deletions src/libs/actions/Task.ts
Original file line number Diff line number Diff line change
Expand Up @@ -832,6 +832,17 @@ function clearOutTaskInfoAndNavigate(reportID?: string, chatReport?: OnyxEntry<O
Navigation.navigate(ROUTES.NEW_TASK_DETAILS);
}

/**
* Start out create task action quick action step
*/
function startOutCreateTaskQuickAction(reportID: string, targetAccountID: number) {
// The second parameter of clearOutTaskInfoAndNavigate is the chat report or DM report
// between the user and the person to whom the task is assigned.
// Since chatReportID isn't stored in NVP_QUICK_ACTION_GLOBAL_CREATE, we set
// it to undefined. This will make setAssigneeValue to search for the correct report.
clearOutTaskInfoAndNavigate(reportID, undefined, targetAccountID, true);
}

/**
* Get the assignee data
*/
Expand Down Expand Up @@ -1149,6 +1160,7 @@ export {
reopenTask,
completeTask,
clearOutTaskInfoAndNavigate,
startOutCreateTaskQuickAction,
getAssignee,
getShareDestination,
deleteTask,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -268,10 +268,7 @@ function FloatingActionButtonAndPopover(
selectOption(() => IOU.startMoneyRequest(CONST.IOU.TYPE.PAY, quickActionReportID, CONST.IOU.REQUEST_TYPE.MANUAL, true), false);
return;
case CONST.QUICK_ACTIONS.ASSIGN_TASK:
selectOption(
() => Task.clearOutTaskInfoAndNavigate(isValidReport ? quickActionReportID : '', isValidReport ? quickActionReport : undefined, quickAction.targetAccountID ?? -1, true),
false,
);
selectOption(() => Task.startOutCreateTaskQuickAction(isValidReport ? quickActionReportID : '', quickAction.targetAccountID ?? -1), false);
break;
case CONST.QUICK_ACTIONS.TRACK_MANUAL:
selectOption(() => IOU.startMoneyRequest(CONST.IOU.TYPE.TRACK, quickActionReportID, CONST.IOU.REQUEST_TYPE.MANUAL, true), false);
Expand Down
Loading