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

MERGING develop into release/24.04 #101

Merged
merged 2 commits into from
Apr 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/components/UserForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ const setupState = (props) => ({
}
: props.user,
isSaved: false,
reset: 0,
});

class UserForm extends Component {
Expand Down Expand Up @@ -123,6 +124,7 @@ class UserForm extends Component {
// eslint-disable-next-line no-console
console.error(`[RELOAD_USER]: Fetching user details failed. ${error}`);
}
this.setState((state) => ({ ...state, reset: state.reset + 1 }));
return;
}

Expand All @@ -138,6 +140,7 @@ class UserForm extends Component {
// eslint-disable-next-line no-console
console.error(`[RELOAD_USER]: Fetching user details failed. ${error}`);
}
this.setState((state) => ({ ...state, reset: state.reset + 1 }));
return;
}

Expand Down Expand Up @@ -210,7 +213,7 @@ class UserForm extends Component {
obligatoryEoFields,
usernameLength,
} = this.props;
const { user, isSaved } = this.state;
const { user, isSaved, reset } = this.state;

if (!rights.includes(RIGHT_USERS)) return null;

Expand All @@ -236,6 +239,7 @@ class UserForm extends Component {
title={userId ? "admin.user.UserOverview.title" : "admin.user.UserOverview.newTitle"}
edited_id={userId}
edited={user}
reset={reset}
back={back}
add={add}
openDirty={save}
Expand Down
8 changes: 2 additions & 6 deletions src/components/UserMasterPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,11 +229,7 @@ const UserMasterPanel = (props) => {
district={edited.districts}
module="admin"
readOnly={readOnly}
required={
edited.userTypes.includes(
CLAIM_ADMIN_USER_TYPE,
) /* This field is also present in the claim administrator panel */
}
required={edited.userTypes.includes(CLAIM_ADMIN_USER_TYPE)}
onChange={(healthFacility) => onEditedChanged({ ...edited, healthFacility })}
/>
</Grid>
Expand Down Expand Up @@ -264,7 +260,7 @@ const UserMasterPanel = (props) => {
<PublishedComponent
pubRef="location.LocationPicker"
locationLevel={1}
value={edited.districts}
value={edited?.districts ?? []}
onChange={(districts) => onEditedChanged({ ...edited, districts })}
readOnly={readOnly}
required
Expand Down
Loading