diff --git a/packages/synapse-react-client/src/components/EntityAclEditor/EntityAclEditor.test.tsx b/packages/synapse-react-client/src/components/EntityAclEditor/EntityAclEditor.test.tsx index 9a1887a8ee6..dcddb79eabb 100644 --- a/packages/synapse-react-client/src/components/EntityAclEditor/EntityAclEditor.test.tsx +++ b/packages/synapse-react-client/src/components/EntityAclEditor/EntityAclEditor.test.tsx @@ -113,7 +113,7 @@ function verifyInheritsSharingSettingsFromBenefactorMessage() { function verifyInheritsSharingSettingsPostUploadMessage() { screen.getByText( - /Currently, the sharing settings are inherited from the project named/, + /Currently, the sharing settings are inherited from the \w+ named/, { exact: false }, ) } diff --git a/packages/synapse-react-client/src/components/EntityAclEditor/InheritanceMessage.tsx b/packages/synapse-react-client/src/components/EntityAclEditor/InheritanceMessage.tsx index 19987d1718b..23e7399d022 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/entity/useGetEntityHeaders' +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 ? ( <> {' '}