-
Notifications
You must be signed in to change notification settings - Fork 46
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: Correct relationship display on workspace forms #291
Fix: Correct relationship display on workspace forms #291
Conversation
Thanks, @amosmachora. I defer to @donaldkibet and @makombe for their reviews. |
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 Left some suggestions Thanks @amosmachora 🤝
...ages/esm-patient-clinical-view-app/src/case-management/workspace/case-management.resource.ts
Outdated
Show resolved
Hide resolved
packages/esm-patient-clinical-view-app/src/family-partner-history/relationships.resource.tsx
Outdated
Show resolved
Hide resolved
packages/esm-patient-clinical-view-app/src/family-partner-history/relationships.resource.tsx
Outdated
Show resolved
Hide resolved
Co-authored-by: Donald Kibet <[email protected]>
|
||
data?.data.results.forEach((type) => { | ||
const aIsToB = { | ||
display: type.displayAIsToB ? type.displayAIsToB : type.displayBIsToA, |
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.
What is exactly do we want to achieve with this? Should we switch the displays if one is missing? It may not be a good approach
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.
That is how they have it implemented in the community. So I figured they probably had a good reason why.
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.
Do you think I should remove it ?
@donaldkibet are we good now. I refactored the hooks to avoid code duplication. |
Please share the latest screenshot/video |
Here is a video demonstrating the changes. Relationships-display-demo.mp4You can find the implementation code from the community here |
@ojwanganto here is the video you requested. Parent-child-relationship.mp4 |
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.
Thanks, @amosmachora
@@ -49,12 +51,30 @@ export const useCaseManagers = () => { | |||
return { data, error }; | |||
}; | |||
|
|||
export const useRelationshipType = () => { | |||
const customRepresentation = 'custom:(uuid,display)&q=Case manager'; | |||
export const useCaseManagerRelationshipType = () => { |
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 think we can use the useRelationships hook and just filter the case manager relationships. What do you think?
Thanks, @amosmachora. This looks good |
@donaldkibet please check this one more time so that we have it in |
Requirements
Summary
In this PR I have refactored the **family-relationship other-relationship & case-management workspaces ** to use the correct display property on the UI while maintaining the integrity of the relationships themselves. Previously the when creating a relationship for example a sibling we were using the display property which caused the UI to have something like SIBLING/SIBLING. This PR correctly identifies the relationship direction of the subjects and finds out the correct display value to use improving the UX of the app.
Also I correctly handled the cyclic dependency for the relationships. For example right now if you create a relationship of
Parent -> Child
That child now has a parent . I guess that functionality was there but now the UI shows the correct information.Screenshots
Before
After
Other Relationships Workspace (After)
Related Issue
None.
Other
None.