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

MPDX-8304 Next Action autoselected #1149

Merged
merged 7 commits into from
Oct 24, 2024
Merged

MPDX-8304 Next Action autoselected #1149

merged 7 commits into from
Oct 24, 2024

Conversation

caleballdrin
Copy link
Contributor

Description

https://jira.cru.org/secure/RapidBoard.jspa?rapidView=3&view=detail&selectedIssue=MPDX-8304&sprint=1282#

  • When the result of a task is changed, set the next action to the same action of the task that was completed (if it is an option)
  • Set result and nextAction default values to null to avoid a controlled/uncontrolled state error

Checklist:

  • I have given my PR a title with the format "MPDX-(JIRA#) (summary sentence max 80 chars)"
  • I have applied the appropriate labels. (Add the label "On Staging" to get the branch automatically merged into staging.)
  • I have requested a review from another person on the project

@caleballdrin caleballdrin self-assigned this Oct 23, 2024
@caleballdrin caleballdrin added the Preview Environment Add this label to create an Amplify Preview label Oct 23, 2024
@caleballdrin caleballdrin requested a review from canac October 23, 2024 00:55
Copy link
Contributor

Preview branch generated at https://MPDX-8304-next-action.d3dytjb8adxkk5.amplifyapp.com

Copy link
Contributor

github-actions bot commented Oct 23, 2024

Bundle sizes [mpdx-react]

Compared against 4f9c22b

No significant changes found

@canac
Copy link
Contributor

canac commented Oct 23, 2024

Great catch with the uncontrolled inputs! Here's another one that should probably change in TaskModalCompleteForm.tsx. Sorry I can't comment on the line because it wasn't changed.

<ActivityTypeAutocomplete
  options={nextActions}
  value={nextAction || undefined} // <------
  label={t('Next Action')}
  onChange={(nextAction) =>
    setFieldValue('nextAction', nextAction)
  }
  activityTypes={activityTypes}
/>

Copy link
Contributor

@canac canac left a comment

Choose a reason for hiding this comment

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

Looks great! I'm excited to have this feature back!

src/components/Task/Modal/Form/TaskModalHelper.ts Outdated Show resolved Hide resolved
src/components/Task/Modal/Form/TaskModalHelper.ts Outdated Show resolved Hide resolved
@canac
Copy link
Contributor

canac commented Oct 24, 2024

@caleballdrin Besides my suggestions for fixing the lint error, this looks good! I wasn't even seeing the uncontrolled input warning either (unless I was doing something wrong). EDIT: I do see it now when logging a task.

@caleballdrin caleballdrin merged commit c85d40e into main Oct 24, 2024
18 checks passed
@caleballdrin caleballdrin deleted the MPDX-8304-next-action branch October 24, 2024 18:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Preview Environment Add this label to create an Amplify Preview
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants