-
Notifications
You must be signed in to change notification settings - Fork 9
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: add email verification in user list [DHIS2-18613] #1520
base: master
Are you sure you want to change the base?
Conversation
}) => ({ | ||
fields: [ | ||
'id', | ||
'displayName', | ||
'access', | ||
'email', | ||
'emailVerified', |
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.
this is now added to the request regardless, but will not be returned if it does not exist / will not be displayed if the conditions for this feature are not met.
I didn't think it was worth it to change the query definition based on the feature logic
🚀 Deployed on https://pr-1520--dhis2-user.netlify.app |
# And the user-manager navigated to the user list view | ||
# When the user-manager searches the list by entering a name | ||
# Then only the users whose username or display name contains the search term should be displayed | ||
Scenario: The user list gets filtered by name |
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.
unrelated, but turning these back on because the issue with them is now resolved on the backend
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.
looks good @tomzemp 👍🏾
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 think we can set the default selected value of the SingleSelectField
to "all"
, ensuring that when the component is first loaded, the "All" option is selected by default.
<SingleSelectField
prefix={i18n.t('Email verification')}
selected={emailVerificationStatus ? emailVerificationStatus : 'all'} // Default to 'all' if no status is provided
onChange={({ selected }) =>
onEmailVerificationStatusChange(selected)
}
className={styles.input}
dense
>
<SingleSelectOption label={i18n.t('All')} value="all" /> // Default option
<SingleSelectOption label={i18n.t('Email verified')} value="true" />
<SingleSelectOption label={i18n.t('Email not verified')} value="false" />
</SingleSelectField>
Background
See https://dhis2.atlassian.net/browse/DHIS2-18613
If system is v42+ and system has email configured, then the user list will display information about email verification status as well as a filter for this status.
(note when looking at this PR, you can simply put fake values in the email hostname, username as the system assume email is configured if these values are present)
Testing
Manually tested against v41 and v42 (with v42 with and without email configured)
added automated tests (jest) for