detailpanel
This commit is contained in:
@@ -247,6 +247,7 @@ const DocumentSummarySection = ({
|
||||
onUpdateIssued,
|
||||
resolveFolderPath,
|
||||
onFolderNavigate,
|
||||
showFolderPath = true,
|
||||
}) => {
|
||||
const summary = useMemo(() => {
|
||||
if (!document) {
|
||||
@@ -283,7 +284,11 @@ const DocumentSummarySection = ({
|
||||
}, [correspondents, document?.correspondents]);
|
||||
|
||||
const folderPath = useMemo(() => {
|
||||
if (!document?.folder_id || typeof resolveFolderPath !== 'function') {
|
||||
if (
|
||||
!showFolderPath
|
||||
|| !document?.folder_id
|
||||
|| typeof resolveFolderPath !== 'function'
|
||||
) {
|
||||
return null;
|
||||
}
|
||||
const segments = resolveFolderPath(document.folder_id);
|
||||
@@ -294,7 +299,7 @@ const DocumentSummarySection = ({
|
||||
return null;
|
||||
}
|
||||
return filtered;
|
||||
}, [document?.folder_id, resolveFolderPath]);
|
||||
}, [document?.folder_id, resolveFolderPath, showFolderPath]);
|
||||
|
||||
const folderDisplayNode = useMemo(() => {
|
||||
if (!folderPath || !folderPath.length) {
|
||||
@@ -521,7 +526,7 @@ const DocumentSummarySection = ({
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
{folderDisplayNode ? (
|
||||
{showFolderPath && folderDisplayNode ? (
|
||||
<div className="doc-title-row__path" aria-label="Folder path">
|
||||
{folderDisplayNode}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user