@@ -43,11 +43,16 @@ const WAITING_MESSAGES = [
43
43
"So, how's your day? (Still looking for matching workspaces...)" ,
44
44
'Are you staying hydrated? (Still looking for matching workspaces...)' ,
45
45
"Hold your horses, we're still not done yet..." ,
46
+ "A Go developer walks into a bar and tries to defer their bill, but they can't start a tab. (Sorry.)" ,
46
47
]
47
48
48
49
/* The time to wait until we display the next waiting message, in seconds. */
49
50
const WAITING_MESSAGE_INTERVAL = 10
50
51
52
+ /** The minimum number of resolved workspaces at which we'll show a warning
53
+ * about Batch Changes performance. */
54
+ const WORKSPACE_WARNING_MIN_TOTAL_COUNT = 2000
55
+
51
56
interface WorkspacesPreviewProps {
52
57
isReadOnly ?: boolean
53
58
}
@@ -288,6 +293,11 @@ const MemoizedWorkspacesPreview: React.FunctionComponent<
288
293
{ ctaButton }
289
294
</ div >
290
295
) }
296
+ { totalCount !== null && totalCount >= WORKSPACE_WARNING_MIN_TOTAL_COUNT && (
297
+ < div className = "d-flex flex-column align-items-center w-100 mb-3" >
298
+ < CTASizeWarning totalCount = { totalCount } />
299
+ </ div >
300
+ ) }
291
301
{ ( hasPreviewed || isReadOnly ) && (
292
302
< WorkspacePreviewFilterRow onFiltersChange = { setFilters } disabled = { isWorkspacesPreviewInProgress } />
293
303
) }
@@ -334,3 +344,17 @@ const CTAInstruction: React.FunctionComponent<React.PropsWithChildren<{ active:
334
344
</ animated . div >
335
345
)
336
346
}
347
+
348
+ const CTASizeWarning : React . FunctionComponent < React . PropsWithChildren < { totalCount : number } > > = ( { totalCount } ) => (
349
+ < Alert variant = "warning" >
350
+ < div className = "mb-2" >
351
+ < strong >
352
+ It's over < s > 9000</ s > { WORKSPACE_WARNING_MIN_TOTAL_COUNT } !
353
+ </ strong >
354
+ </ div >
355
+ Batch changes with more than { WORKSPACE_WARNING_MIN_TOTAL_COUNT } workspaces may be unwieldy to manage. We're
356
+ working on providing more filtering options, and you can continue with this batch change if you want, but you
357
+ may want to break it into { Math . ceil ( totalCount / WORKSPACE_WARNING_MIN_TOTAL_COUNT ) } or more batch changes if
358
+ you can.
359
+ </ Alert >
360
+ )
0 commit comments