From 1ae71b194e0bd03e594eddf55b896806abb5c61d Mon Sep 17 00:00:00 2001 From: Nick Grosenbacher Date: Fri, 4 Oct 2024 10:25:41 -0400 Subject: [PATCH] Get entity type instead of using static 'project' text --- .../EntityAclEditor/InheritanceMessage.tsx | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/packages/synapse-react-client/src/components/EntityAclEditor/InheritanceMessage.tsx b/packages/synapse-react-client/src/components/EntityAclEditor/InheritanceMessage.tsx index 19987d1718..6e414edc78 100644 --- a/packages/synapse-react-client/src/components/EntityAclEditor/InheritanceMessage.tsx +++ b/packages/synapse-react-client/src/components/EntityAclEditor/InheritanceMessage.tsx @@ -1,4 +1,9 @@ import React from 'react' +import { useGetEntityHeader } from '../../synapse-queries/index' +import { + convertToEntityType, + entityTypeToFriendlyName, +} from '../../utils/functions/EntityTypeUtils' import { EntityLink } from '../EntityLink' import { Link, Typography } from '@mui/material' @@ -11,11 +16,25 @@ type InheritanceMessageProps = { export function InheritanceMessage(props: InheritanceMessageProps) { const { isProject, isInherited, isAfterUpload = false, benefactorId } = props + const { data: benefactorHeader } = useGetEntityHeader( + benefactorId, + undefined, + { + enabled: Boolean(benefactorId), + }, + ) + if (isAfterUpload) { return ( <> - Currently, the sharing settings are inherited from the project named + Currently, the sharing settings are inherited from the{' '} + {benefactorHeader + ? entityTypeToFriendlyName( + convertToEntityType(benefactorHeader.type), + ).toLowerCase() + : 'container'}{' '} + named {benefactorId ? ( <> {' '}