Skip to content

Commit f64dddb

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

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

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

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

22+
const creating = (elementUuid, childrenMetadata) => {
23+
return (
24+
!childrenMetadata[elementUuid] ||
25+
(childrenMetadata[elementUuid].type === ElementType.STUDY &&
26+
!childrenMetadata[elementUuid].specificMetadata.caseFormat)
27+
);
28+
};
29+
2230
const getDisplayedElementName = (
2331
data: ElementAttributes,
2432
childrenMetadata: Record<UUID, ElementAttributes>,
@@ -29,7 +37,7 @@ const getDisplayedElementName = (
2937
if (uploading) {
3038
return elementName + '\n' + formatMessage({ id: 'uploading' });
3139
}
32-
if (!childrenMetadata[elementUuid]) {
40+
if (creating(elementUuid, childrenMetadata)) {
3341
return elementName + '\n' + formatMessage({ id: 'creationInProgress' });
3442
}
3543
return childrenMetadata[elementUuid].elementName;
@@ -72,11 +80,11 @@ export const NameCellRenderer = ({
7280
return (
7381
<Box sx={styles.tableCell}>
7482
{/* Icon */}
75-
{!childrenMetadata[data.elementUuid] &&
83+
{creating(data.elementUuid, childrenMetadata) &&
7684
isElementCaseOrStudy(data.type) && (
7785
<CircularProgress size={18} sx={styles.circularRoot} />
7886
)}
79-
{childrenMetadata[data.elementUuid] &&
87+
{!creating(data.elementUuid, childrenMetadata) &&
8088
getFileIcon(data.type, styles.icon)}
8189
{/* Name */}
8290
<OverflowableText

0 commit comments

Comments
 (0)