Skip to content

Commit

Permalink
(fix) Fix the relationship display (#909)
Browse files Browse the repository at this point in the history
  • Loading branch information
icrc-loliveira committed Jan 8, 2024
1 parent 197628d commit 41ab54a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -168,12 +168,12 @@ export const RelationshipsSection = () => {
const tmp: RelationshipType[] = [];
relationshipTypes.results.forEach((type) => {
const aIsToB = {
display: type.displayAIsToB ? type.displayAIsToB : type.aIsToB,
display: type.displayAIsToB ? type.displayAIsToB : type.displayBIsToA,
uuid: type.uuid,
direction: 'aIsToB',
};
const bIsToA = {
display: type.displayBIsToA ? type.displayBIsToA : type.bIsToA,
display: type.displayBIsToA ? type.displayBIsToA : type.displayAIsToB,
uuid: type.uuid,
direction: 'bIsToA',
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,20 @@ describe('RelationshipsSection', () => {
it('renders relationships when relationshipTypes are available', () => {
const relationshipTypes = {
results: [
{ aIsToB: 'Mother', bIsToA: 'Child', uuid: '42ae5ce0-d64b-11ea-9064-5adc43bbdd34' },
{ aIsToB: 'Father', bIsToA: 'Child', uuid: '52ae5ce0-d64b-11ea-9064-5adc43bbdd24' },
{
displayAIsToB: 'Mother',
aIsToB: 'Mother',
bIsToA: 'Child',
displayBIsToA: 'Child',
uuid: '42ae5ce0-d64b-11ea-9064-5adc43bbdd34',
},
{
displayAIsToB: 'Father',
aIsToB: 'Father',
bIsToA: 'Child',
displayBIsToA: 'Child',
uuid: '52ae5ce0-d64b-11ea-9064-5adc43bbdd24',
},
],
};
mockResourcesContextValue = {
Expand Down

0 comments on commit 41ab54a

Please sign in to comment.