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: [DHIS2-15685][DHIS2-18326] View an event without selecting org unit in Tracker Programs #3926

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

henrikmv
Copy link
Contributor

@henrikmv henrikmv commented Jan 3, 2025

DHIS2-15685 and DHIS2-18236:

  • The event's organization unit will be used if no organisation unit is selected in the context selector.
  • Code for the warning displayed when deselecting an organisation unit in the context selector while editing or adding an event has been removed.

Removing the code for the warning can now be done since the event's org unit is used if none is selected in the context selector when editing an event. In addition, the context selector's org unit should soon be locked on the edit and add event pages.

This issue is blocked by DHIS2-18325 and DHIS2-18664 due to the warning removal for Add Event.

@henrikmv henrikmv marked this pull request as ready for review January 3, 2025 15:52
@henrikmv henrikmv requested a review from a team as a code owner January 3, 2025 15:52
Copy link
Contributor

@simonadomnisoru simonadomnisoru left a comment

Choose a reason for hiding this comment

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

Hi @henrikmv,

After this bug fix, I have two suggestions to improve some existing related functionality.

Firstly, in event edit mode, make some changes to the form, and then when deselecting the org unit, the "Discard unsaved changes" dialog will be displayed. Is this dialog still relevant, as now the page should be visible without an org unit and the unsaved data is not discarded from the form?
Screenshot 2025-01-06 at 14 37 10

Secondly, in an event program, when deselecting the org unit, the user is redirected to the home page. Does it make sense to remove this redirect and keep the user on the same page while the event view/edit form is displayed?

Any thoughts on these suggestions? Thanks!

@JoakimSM JoakimSM changed the title fix: [DHIS2-15685] Possible to view an event without selecting org unit fix: [DHIS2-15685][DHIS2-18326] Possible to view an event without selecting org unit Jan 10, 2025
@henrikmv henrikmv changed the title fix: [DHIS2-15685][DHIS2-18326] Possible to view an event without selecting org unit fix: [DHIS2-15685][DHIS2-18326] Possible to view an event without selecting org unit in Tracker Programs Jan 12, 2025
@henrikmv
Copy link
Contributor Author

henrikmv commented Jan 12, 2025

After discussion with @JoakimSM, DHIS2-15685 now only affects Tracker programs. A new ticket will be created for Event programs.

Comment on lines -125 to -130
<DiscardDialog
onDestroy={this.handleAcceptOrgUnit}
open={this.state.openOrgUnitWarning}
onCancel={this.handleClose}
{...defaultDialogProps}
/>
Copy link
Contributor

@simonadomnisoru simonadomnisoru Jan 13, 2025

Choose a reason for hiding this comment

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

I don't think that removing the warning displayed when deselecting an orgUnit in the ScopeSelector is possible for all the pages across the app. One example that comes to mind is the /new page when enrolling a trackedEntity. How will this case be handled? Thanks!

@henrikmv henrikmv changed the title fix: [DHIS2-15685][DHIS2-18326] Possible to view an event without selecting org unit in Tracker Programs fix: [DHIS2-15685][DHIS2-18326] View an event without selecting org unit in Tracker Programs Jan 13, 2025
…viewingEventShouldBePossibleWithoutSelectingOrgUnit
@henrikmv henrikmv marked this pull request as draft January 15, 2025 13:46
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.

2 participants