Add validation when deleting a value from group tab of Individuals page
Describe the bug In Groups tab of Individual page, when deleting the link of individual to a group while the individual is the head of that group, the individual will remain as head of the farmer group from Groups page despite being removed already from individuals page.
To Reproduce
- In QA Farmer registry, go to >registry> individuals
- Select an Individual which is currently a HEAD of a farmer group then click
- In Groups tab, click on Delete icon beside the group
- Go to Registry> Groups and select the group the individual previously belongs to
- Notice in farmer details tab, the individual's details is still present
- Notice in Members tab, the head of farmer group is already removed.
Expected behavior
In Groups tab of Individual page, a validation error message should appear when attempting to delete a group if the individual is currently the HEAD of that Farmer group.
Screenshots
Additional context
🔔 Note: This ticket should address common considerations without including country-specific content. Please ensure all references are generic and applicable across various contexts.
Estimate Dev Time
Optimistic: 4 hours Pessimistic: 8 hours
Verified and working as expected.
Test Steps:
- Install farmer registry demo module
- Go to Registry -> Farm and create a farm
- Go to Individual and enter the individual record
- Go to Groups tab
- Make sure that the individual is the head of the farmer
- Delete the record in the groups tab then save.
- Check if there is an error.
-
Group tab and then delete group via the delete icon:
-
After group deletion:
-
Error message when trying to exit the individuals tab without a HH head: