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