Skip to content

IA-4691: refactor assignments page#2719

Merged
beygorghor merged 22 commits intodevelopfrom
feat/IA-4691-assignments-page
Feb 9, 2026
Merged

IA-4691: refactor assignments page#2719
beygorghor merged 22 commits intodevelopfrom
feat/IA-4691-assignments-page

Conversation

@beygorghor
Copy link
Copy Markdown
Collaborator

@beygorghor beygorghor commented Feb 4, 2026

What problem is this PR solving?

Actual page is not using sampling results or the target org unit type at all

Logic is totally different as previous.
We need to remove old code and start from scratch a new page/

We will implement features one by one, for now this PR should a llow a user to see the org units resulting from a sampling or not and assign user or team to an org unit.

Related JIRA tickets

IA-4691

Changes

  • move sampling to planning domain to be more consistent with the ui
  • remove old assignment index and components
  • new index, new map, new team table to assign user or team to an org unit

How to test

  • you need two plannings, published (with start and end date)
  • One should use a team of team , a target geography (province or district), assignments level with shapes (Area, Zone) and no pipeline
  • the other one a team of users, same target , assignments level with points (Centre de santé, hospital), LQAS Org Unit Selection Pipeline selected , at least a sampling with results and selected.
  • Open assignment page for both, you should be able to see shapes or points and assign teams or user to org units. Also you can edit team or user color directly

Print screen / video

Screen.Recording.2026-02-04.at.12.55.27.mov

Notes

Doc

docs/pages/dev/how_to/openhexa-integration/openhexa-integration.en.md

@beygorghor beygorghor added the release Should be released in production at next deploy label Feb 5, 2026
Copy link
Copy Markdown
Member

@quang-le quang-le left a comment

Choose a reason for hiding this comment

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

Great job! This interface finally makes some sense
Most comments are just nitpicks
2 are blocking:

  • N+1 in the backend
  • if--> else if in handleSave

Also, I some testing on the backend changes would be nice 😄

rootTeam?: Team,
) => {
const theme = useTheme();
return (orgUnitId: number) => {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

useCallback?

Comment thread iaso/api/microplanning/serializers.py Outdated

def get_geo_json(self, org_unit: OrgUnit):
if not hasattr(org_unit, "geo_json"):
if not hasattr(org_unit, "geo_json") or org_unit.geo_json is None:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

You should update the test if it exists

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

also, nitpick you could replace this with

if not self.get_has_geo_json(org_unit):


def get_iaso_profile_id(self, obj):
profile = getattr(obj, "iaso_profile", None)
return getattr(profile, "id", None) if profile else None
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This will cause an N+1

Comment thread hat/assets/js/apps/Iaso/utils/map/mapUtils.ts Outdated
onColorChange: (color: string) => void;
};

export const TeamRow: FunctionComponent<Props> = ({
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nitpick: I would name this one AssigneeRow or TeamTableRow, since it doesn't always display a team

} = useGetAssignments({ planning: planningId });
const { mutateAsync: saveAssignment, isLoading: isSaving } =
useSaveAssignment();
const handleSaveAssignment = useCallback(
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

You could probably group this with useSaveAssignments in a single custom hook.
Not blocking

Comment on lines +19 to +20
delete safeParams.planningId;
delete safeParams.mode;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

You could probably type params a bit more specifically, so we know that planningId and mode keys are always present

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This one is a bit tricky i'd say

'planningsList',
'planningDetails',
'planningOrgUnits',
'planningSamplingResults',
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Don't we also need planningRootOrgUnit and planningChildrenOrgUnits?

zoom={defaultViewport.zoom}
scrollWheelZoom={false}
zoomControl={false}
contextmenu
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm getting a TS error here

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I would split the different Panes into components for easier reading. Not blocking

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

this map will move a lot i think, but yes, after

beygorghor and others added 3 commits February 6, 2026 14:08
Co-authored-by: Quang Son Le <38907762+quang-le@users.noreply.github.com>
@beygorghor beygorghor requested a review from quang-le February 6, 2026 13:23
@beygorghor beygorghor merged commit a926597 into develop Feb 9, 2026
7 checks passed
@beygorghor beygorghor deleted the feat/IA-4691-assignments-page branch February 9, 2026 07:59
@beygorghor beygorghor added the user tested Has already been tested on staging label Feb 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release Should be released in production at next deploy Released user tested Has already been tested on staging

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants