Skip to content

Commit 7a41c66

Browse files
committed
WIP study infinite creation
1 parent 71bf166 commit 7a41c66

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/components/utils/renderers/name-cell-renderer.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ const isElementCaseOrStudy = (objectType: ElementType) => {
1919
return objectType === ElementType.STUDY || objectType === ElementType.CASE;
2020
};
2121

22+
const creating = (elementUuid, childrenMetadata) => {
23+
return !childrenMetadata[elementUuid] || (childrenMetadata[elementUuid].type == 'STUDY' && !childrenMetadata[elementUuid].specificMetadata.caseFormat)
24+
}
25+
2226
const getDisplayedElementName = (
2327
data: ElementAttributes,
2428
childrenMetadata: Record<UUID, ElementAttributes>,
@@ -29,7 +33,7 @@ const getDisplayedElementName = (
2933
if (uploading) {
3034
return elementName + '\n' + formatMessage({ id: 'uploading' });
3135
}
32-
if (!childrenMetadata[elementUuid]) {
36+
if (creating(elementUuid, childrenMetadata)) {
3337
return elementName + '\n' + formatMessage({ id: 'creationInProgress' });
3438
}
3539
return childrenMetadata[elementUuid].elementName;
@@ -72,11 +76,11 @@ export const NameCellRenderer = ({
7276
return (
7377
<Box sx={styles.tableCell}>
7478
{/* Icon */}
75-
{!childrenMetadata[data.elementUuid] &&
79+
{creating(data.elementUuid, childrenMetadata) &&
7680
isElementCaseOrStudy(data.type) && (
7781
<CircularProgress size={18} sx={styles.circularRoot} />
7882
)}
79-
{childrenMetadata[data.elementUuid] &&
83+
{!creating(data.elementUuid, childrenMetadata) &&
8084
getFileIcon(data.type, styles.icon)}
8185
{/* Name */}
8286
<OverflowableText

0 commit comments

Comments
 (0)