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
RA-1855, update and delete relationships #101
Conversation
@cioan well done on this you could also add the ticket link on your pr description ,go on to claim the ticket too |
@HerbertYiga, The ticket link is Hyperlinked to RA-1855 and when you click or tap on it you will be directed to the issue worked on. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM cc @cioan @dkayiwa @mogoodrich
for (Relationship existingRelationship : existingRelationships) { | ||
personService.voidRelationship(existingRelationship, "deleted via the Registration widget"); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My apologies, as I'm stepping into something I haven't looked at in quite some time, but doesn't the relatioship widget allow you to customize the relationships you display to certain types? If so, we need to make sure to apply the same logic when deleting (ie, don't delete types that you can't enter/view via the widget)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think so, @mogoodrich , it shows all the patient relationships:
https://github.com/openmrs/openmrs-module-registrationapp/blob/master/omod/src/main/webapp/resources/scripts/field/personRelationship.js#L12
This is an old person relationships widget that PIH is not using.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good to me, thanks @cioan !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Thanks @mogoodrich ! |
Hi @jwamalwa , here is my attempt on fixing this bug with the relationships controller. The code probably needs a bit more cleanup, but I was able to delete and update existing relationships on my local environment.