From 907d81a388299b80f43bbc3b864caf2f73168d5e Mon Sep 17 00:00:00 2001 From: Michael Wiencek Date: Thu, 13 Oct 2022 15:53:56 -0500 Subject: [PATCH] MBS-12643: Hide non-editable link orders in the relationship editor (#2692) --- .../components/RelationshipItem.js | 23 ++++++++++++++----- 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/root/static/scripts/relationship-editor/components/RelationshipItem.js b/root/static/scripts/relationship-editor/components/RelationshipItem.js index 541e96c80f0..dbdff1e21a3 100644 --- a/root/static/scripts/relationship-editor/components/RelationshipItem.js +++ b/root/static/scripts/relationship-editor/components/RelationshipItem.js @@ -19,6 +19,9 @@ import { performReactUpdateAndMaintainFocus, } from '../../common/utility/focusManagement.js'; import isDatabaseRowId from '../../common/utility/isDatabaseRowId.js'; +import { + isLinkTypeOrderableByUser, +} from '../../common/utility/isLinkTypeDirectionOrderable.js'; import relationshipDateText from '../../common/utility/relationshipDateText.js'; import { @@ -249,12 +252,20 @@ const RelationshipItem = (React.memo(({ ) : null} - {relationship.linkOrder ? ( - exp.l('{num}. {relationship}', { - num: relationship.linkOrder, - relationship: targetDisplay, - }) - ) : targetDisplay} + {( + relationship.linkOrder && + isLinkTypeOrderableByUser( + relationship.linkTypeID, + source, + backward, + ) + ) ? ( + exp.l('{num}. {relationship}', { + num: relationship.linkOrder, + relationship: targetDisplay, + }) + ) + : targetDisplay} {datesAndAttributes}