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

feat: [DHIS2-15483] assign an user when scheduling an enrollment event #3419

Merged
merged 7 commits into from
Nov 1, 2023

Conversation

simonadomnisoru
Copy link
Contributor

@simonadomnisoru simonadomnisoru commented Sep 26, 2023

DHIS2-15483

Tech summary

  • Assignee Section into the Sechdule enrollment event tab
  • Show the No results found message if a searched user does not exist in the system
  • store assignedUser properties in the enrollmentDomain in the redux store

@simonadomnisoru simonadomnisoru requested a review from a team as a code owner September 26, 2023 09:28
@github-actions
Copy link

github-actions bot commented Oct 11, 2023

Copy link
Contributor

@eirikhaugstulen eirikhaugstulen left a comment

Choose a reason for hiding this comment

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

Hey @simonadomnisoru,
Just a quick comment, but otherwise very nice!

<div className={classes.label}>{i18n.t('Assignee')}</div>
<div className={classes.field}>
{/* $FlowFixMe[cannot-spread-inexact] automated comment */}
<UserField inputPlaceholderText={i18n.t('Search for user')} value={assignee} {...passOnProps} />
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you think this field would benefit from having a No suggestions-state.
If a user types in a user that does not exist in the system, you should get a message that says something like Could not find... or No user found... etc. In the current functionality, it looks that it has not searched if you type quickly enough. Do you think this could be implemented?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hey @eirikhaugstulen
I agree that the users will benefit from a No suggestions-state (the design team also liked the idea). I added it in the last commits.
Regarding the second point, if the user types very fast, the search is prevented on purpose. Within the UserField.component, the DebounceField is used to introduce a delay between search requests. Input debouncing serves the purpose of limiting the frequency of API calls and enhancing overall performance.
Thanks!

Copy link
Member

@JoakimSM JoakimSM left a comment

Choose a reason for hiding this comment

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

When saving the event to the enrollmentDomain in the Redux store, let's make sure we also include displayName, username, firstName and surname like we do when we initially fetch the events. This way it will be easier when we are going to display the assigned user in stages and events later. I think we also use the enrollmentDomain event data directly in the assignee Widget.

@simonadomnisoru
Copy link
Contributor Author

When saving the event to the enrollmentDomain in the Redux store, let's make sure we also include displayName, username, firstName and surname like we do when we initially fetch the events. This way it will be easier when we are going to display the assigned user in stages and events later. I think we also use the enrollmentDomain event data directly in the assignee Widget.

Hey @JoakimSM,
Good catch! I added the rest of the assignedUsper proprieties into the enrollmentDomain. Let me know if you encounter any other issues.
Thanks for the review!

Copy link
Contributor

@eirikhaugstulen eirikhaugstulen left a comment

Choose a reason for hiding this comment

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

Looks good @simonadomnisoru 👍 Thanks for implementing the changes!

Copy link

@geethaalwan geethaalwan left a comment

Choose a reason for hiding this comment

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

Tested successfully on 2.41,2.40.2,2.39.4,2.38.6 versions

@simonadomnisoru simonadomnisoru merged commit 556884f into master Nov 1, 2023
37 of 38 checks passed
@simonadomnisoru simonadomnisoru deleted the DHIS2-15483 branch November 1, 2023 08:28
dhis2-bot added a commit that referenced this pull request Nov 1, 2023
# [100.44.0](v100.43.0...v100.44.0) (2023-11-01)

### Features

* [DHIS2-15483] assign an user when scheduling an enrollment event ([#3419](#3419)) ([556884f](556884f))
@dhis2-bot
Copy link
Contributor

🎉 This PR is included in version 100.44.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

simonadomnisoru pushed a commit that referenced this pull request Nov 8, 2023
# [100.44.0](v100.43.0...v100.44.0) (2023-11-01)

### Features

* [DHIS2-15483] assign an user when scheduling an enrollment event ([#3419](#3419)) ([556884f](556884f))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants