fix(modes): don't attempt to retrieve a stage index if HPs (#4552)

Co-authored-by: Ibrahim <93064150+IbrahimCSAE@users.noreply.github.com>
Co-authored-by: Ștefan Silviu-Alexandru <silviu.stefan@atta.systems>
This commit is contained in:
authored and GitHub committed 2024-12-03 09:14:41 -05:00
1 parent 71f06dcd3e
commit e5286d9fc2
12 files changed
+43 -48

No files matched your search

+1 -1
View File
@@ -107,7 +107,7 @@ Cypress.Commands.add('isPageLoaded', (url = '/basic-test') => {
Cypress.Commands.add('openStudyList', () => {
cy.initRouteAliases();
cy.visit('/', { timeout: 15000 });
cy.visit('/', { timeout: 30000 });
// For some reason cypress 12.x does not like to stub the network request
// so we just wait here for querying to be done.
+1 -1
View File
@@ -292,7 +292,7 @@ function ViewerViewportGrid(props: withAppTypes) {
>
<div
data-cy="viewport-pane"
className={classNames('flex h-full w-full flex-col', {
className={classNames('flex h-full w-full min-w-[5px] flex-col', {
'pointer-events-none':
!isActive && (appConfig?.activateViewportBeforeInteraction ?? true),
})}
+4 -4
View File
@@ -218,11 +218,11 @@ export default function ModeRoute({
: hangingProtocol;
// Determine the index of the stageId if the hangingProtocolIdToUse is defined
const stageIndex = hangingProtocolIdToUse
? hangingProtocolService.getStageIndex(hangingProtocolIdToUse, {
const stageIndex = Array.isArray(hangingProtocolIdToUse)
? -1
: hangingProtocolService.getStageIndex(hangingProtocolIdToUse, {
stageId: runTimeStageId || undefined,
})
: -1;
});
// Ensure that the stage index is never negative
// If stageIndex is negative (e.g., if stage wasn't found), use 0 as the default
const stageIndexToUse = Math.max(0, stageIndex);
@@ -78,25 +78,25 @@ Stack: ${error.stack}
>
<DialogContent className="border-input h-[50vh] w-[90vw] border-2 sm:max-w-[900px]">
<DialogHeader>
<DialogTitle className="text-xl">{title}</DialogTitle>
<DialogTitle className="text-muted-foreground flex justify-between text-xl">
<div className="flex items-center">{title}</div>
<button
onClick={() => {
copyErrorDetails();
setShowDetails(false);
}}
className="text-aqua-pale hover:text-aqua-pale/80 flex items-center gap-2 rounded bg-gray-800 px-4 py-2 font-light"
>
<Icons.Code className="h-4 w-4" />
{t('Copy Details')}
</button>
</DialogTitle>
<DialogDescription className="text-lg">{subtitle}</DialogDescription>
</DialogHeader>
<ScrollArea className="h-[calc(90vh-120px)]">
<ScrollArea className="h-[100%]">
<div className="space-y-4 pr-4 font-mono text-base">
<div className="flex justify-end">
<button
onClick={() => {
copyErrorDetails();
setShowDetails(false);
}}
className="text-aqua-pale hover:text-aqua-pale/80 flex items-center gap-2 rounded bg-gray-800 px-4 py-2"
>
<Icons.Code className="h-4 w-4" />
{t('Copy Details')}
</button>
</div>
<div className="space-y-4">
<p className="text-aqua-pale break-words text-lg">
{t('Context')}: {context}