Skip to content

Commit

Permalink
Merge branch 'master' into 1280-unhandled-keycloak-log-in-failure
Browse files Browse the repository at this point in the history
# Conflicts:
#	src/WrapperApp/components/Results/ResultsPanel.tsx
  • Loading branch information
Derstilon committed Oct 18, 2023
2 parents 5a12d7f + 5e81b0e commit d01e688
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 16 deletions.
8 changes: 4 additions & 4 deletions docs/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/JsRoot/GraphData.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ export function generateGraphs(
.map(({ page, graph, filter }, idx) => {
return (
<Grid
key={`graph_${name}${jobId ? '_' + jobId : ''}_${idx}`}
key={`graph_${name}${jobId ? '_' + jobId : ''}_${page.name ?? idx}`}
item
xs={12}>
<Card>
Expand Down
41 changes: 31 additions & 10 deletions src/WrapperApp/components/Results/ResultsPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { ChangeEvent, SyntheticEvent, useEffect, useState } from 'react';
import { Estimator, generateGraphs, isPage0d, Page, Page0D } from '../../../JsRoot/GraphData';
import { useDialog } from '../../../services/DialogService';
import { useStore } from '../../../services/StoreService';
import { InfoTooltip } from '../../../shared/components/tooltip/InfoTooltip';
import { titleToKebabCase } from '../../../ThreeEditor/components/Dialog/CustomDialog';
import { TabPanel } from '../Panels/TabPanel';
import TablePage0D from './ResultsTable';
Expand Down Expand Up @@ -60,6 +61,8 @@ function ResultsPanel() {
return estimatorResults;
};

const resultsGeneratedFromProjectFile = !!simulation?.input.inputJson;

return (
<Box
sx={{
Expand Down Expand Up @@ -93,17 +96,34 @@ function ResultsPanel() {
alignItems: 'center',
gap: '0.5rem'
}}>
<FormControlLabel
control={
<Switch
checked={groupQuantities}
onChange={(e: ChangeEvent<HTMLInputElement>) =>
setGroupQuantities(e.target.checked)
<Box
sx={{
display: 'flex',
alignItems: 'center',
marginRight: '0.5rem'
}}>
<FormControlLabel
sx={{ marginRight: '0' }}
control={
<Switch
checked={groupQuantities}
onChange={(e: ChangeEvent<HTMLInputElement>) =>
setGroupQuantities(e.target.checked)
}
disabled={!resultsGeneratedFromProjectFile}
/>
}
label='Group Quantities'
/>
{!resultsGeneratedFromProjectFile && (
<InfoTooltip
sx={{ marginLeft: '0.25rem' }}
title={
'Grouping quantities is only available when results are generated from a project file.'
}
/>
}
label='Group Quantities'
/>
)}
</Box>
<Button
color='info'
size='small'
Expand Down Expand Up @@ -204,7 +224,8 @@ function ResultsPanel() {
)}
{generateGraphs(
estimator,
groupQuantities,
resultsGeneratedFromProjectFile &&
groupQuantities,
simulation?.jobId
)}
</Box>
Expand Down
6 changes: 5 additions & 1 deletion src/shared/components/tooltip/InfoTooltip.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
import InfoOutlinedIcon from '@mui/icons-material/InfoOutlined';
import { SxProps, Theme } from '@mui/material/styles';
import Tooltip from '@mui/material/Tooltip';
import * as React from 'react';

interface InfoTooltipProps {
title: string;
sx?: SxProps<Theme> | undefined;
}

export const InfoTooltip = (props: InfoTooltipProps) => {
return (
<Tooltip title={props.title}>
<Tooltip
title={props.title}
sx={props.sx}>
<InfoOutlinedIcon />
</Tooltip>
);
Expand Down

0 comments on commit d01e688

Please sign in to comment.