Skip to content

Commit

Permalink
MBS-12643: Hide non-editable link orders in the relationship editor (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
mwiencek authored Oct 13, 2022
1 parent 3509bd5 commit 907d81a
Showing 1 changed file with 17 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -249,12 +252,20 @@ const RelationshipItem = (React.memo<PropsT>(({
</>
) : null}
<span className={getRelationshipStyling(relationship)}>
{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}
</span>
</div>
Expand Down

0 comments on commit 907d81a

Please sign in to comment.