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: add email verification in user list [DHIS2-18613] #1520

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

tomzemp
Copy link
Member

@tomzemp tomzemp commented Jan 15, 2025

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

  • checking that logic of feature toggling works as expected
  • checking that filter dropdown appears and that the requests to api/users refetches with the appropriate filter logic
  • check that email verification status appears/does not appear in table based on feature toggling logic

}) => ({
fields: [
'id',
'displayName',
'access',
'email',
'emailVerified',
Copy link
Member Author

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

@dhis2-bot
Copy link
Contributor

dhis2-bot commented Jan 15, 2025

🚀 Deployed on https://pr-1520--dhis2-user.netlify.app

@dhis2-bot dhis2-bot temporarily deployed to netlify January 15, 2025 11:10 Inactive
@dhis2-bot dhis2-bot temporarily deployed to netlify January 15, 2025 11:47 Inactive
# 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
Copy link
Member Author

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

@tomzemp tomzemp marked this pull request as ready for review January 15, 2025 11:49
@tomzemp tomzemp requested a review from a team January 15, 2025 11:51
Copy link
Member

@Chisomchima Chisomchima 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 @tomzemp 👍🏾

Copy link
Member

@Chisomchima Chisomchima left a 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>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants