@@ -19,6 +19,10 @@ const isElementCaseOrStudy = (objectType: ElementType) => {
19
19
return objectType === ElementType . STUDY || objectType === ElementType . CASE ;
20
20
} ;
21
21
22
+ const creating = ( elementUuid , childrenMetadata ) => {
23
+ return ! childrenMetadata [ elementUuid ] || ( childrenMetadata [ elementUuid ] . type == 'STUDY' && ! childrenMetadata [ elementUuid ] . specificMetadata . caseFormat )
24
+ }
25
+
22
26
const getDisplayedElementName = (
23
27
data : ElementAttributes ,
24
28
childrenMetadata : Record < UUID , ElementAttributes > ,
@@ -29,7 +33,7 @@ const getDisplayedElementName = (
29
33
if ( uploading ) {
30
34
return elementName + '\n' + formatMessage ( { id : 'uploading' } ) ;
31
35
}
32
- if ( ! childrenMetadata [ elementUuid ] ) {
36
+ if ( creating ( elementUuid , childrenMetadata ) ) {
33
37
return elementName + '\n' + formatMessage ( { id : 'creationInProgress' } ) ;
34
38
}
35
39
return childrenMetadata [ elementUuid ] . elementName ;
@@ -72,11 +76,11 @@ export const NameCellRenderer = ({
72
76
return (
73
77
< Box sx = { styles . tableCell } >
74
78
{ /* Icon */ }
75
- { ! childrenMetadata [ data . elementUuid ] &&
79
+ { creating ( data . elementUuid , childrenMetadata ) &&
76
80
isElementCaseOrStudy ( data . type ) && (
77
81
< CircularProgress size = { 18 } sx = { styles . circularRoot } />
78
82
) }
79
- { childrenMetadata [ data . elementUuid ] &&
83
+ { ! creating ( data . elementUuid , childrenMetadata ) &&
80
84
getFileIcon ( data . type , styles . icon ) }
81
85
{ /* Name */ }
82
86
< OverflowableText
0 commit comments