Skip to content

Commit

Permalink
Merge pull request #616 from pkpdapp-team/feedback-changes-and-fixes
Browse files Browse the repository at this point in the history
Fix vertical scroll on horizontal layout
  • Loading branch information
wniestroj authored Dec 5, 2024
2 parents 579a09c + f008753 commit 755f850
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 13 deletions.
5 changes: 1 addition & 4 deletions frontend-v2/src/features/model/MapVariablesTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -358,10 +358,7 @@ const MapVariablesTab: FC<Props> = ({
</Table>
</TableContainer>
<Box sx={{ marginTop: ".5rem" }}>
<TableHeader
variant="h5"
label="Map RO, PD and secondary parameters"
/>
<TableHeader variant="h5" label="Map RO, PD and secondary parameters" />
</Box>
<TableContainer
sx={{
Expand Down
3 changes: 3 additions & 0 deletions frontend-v2/src/features/model/ParameterRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ const ParameterRow: FC<Props> = ({ project, variable, units }) => {
</TableCell>
<TableCell size="small" sx={{ width: "10rem" }}>
<FloatField
sx={{ minWidth: "5rem" }}
size="small"
name="lower_bound"
control={control}
Expand All @@ -98,6 +99,7 @@ const ParameterRow: FC<Props> = ({ project, variable, units }) => {
</TableCell>
<TableCell size="small" sx={{ width: "10rem" }}>
<FloatField
sx={{ minWidth: "5rem" }}
size="small"
name="default_value"
control={control}
Expand All @@ -109,6 +111,7 @@ const ParameterRow: FC<Props> = ({ project, variable, units }) => {
</TableCell>
<TableCell size="small" sx={{ width: "10rem" }}>
<FloatField
sx={{ minWidth: "5rem" }}
size="small"
name="upper_bound"
control={control}
Expand Down
2 changes: 2 additions & 0 deletions frontend-v2/src/features/model/secondary/ThresholdsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ function VariableRow({
</TableCell>
<TableCell sx={{ width: "20rem" }}>
<TextField
sx={{ minWidth: "5rem" }}
type="number"
defaultValue={variable.lower_threshold || 0}
onChange={onChangeLowerThreshold}
Expand All @@ -161,6 +162,7 @@ function VariableRow({
</TableCell>
<TableCell sx={{ width: "20rem" }}>
<TextField
sx={{ minWidth: "5rem" }}
type="number"
defaultValue={variable.upper_threshold || Infinity}
onChange={onChangeUpperThreshold}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@ import {
} from "../../../app/backendApi";
import { RootState } from "../../../app/store";
import { useModelTimeIntervals } from "../../../hooks/useModelTimeIntervals";
import {
getTableHeight,
} from "../../../shared/calculateTableHeights";
import { getTableHeight } from "../../../shared/calculateTableHeights";

const TABLE_BREAKPOINTS = [
{
Expand Down Expand Up @@ -148,6 +146,7 @@ function IntervalRow({
<TableRow>
<TableCell sx={{ width: "20rem" }}>
<TextField
sx={{ minWidth: "5rem" }}
size="small"
type="number"
value={start}
Expand All @@ -158,6 +157,7 @@ function IntervalRow({
</TableCell>
<TableCell sx={{ width: "20rem" }}>
<TextField
sx={{ minWidth: "5rem" }}
size="small"
type="number"
value={end}
Expand Down
12 changes: 6 additions & 6 deletions frontend-v2/src/features/simulation/SimulationPlotView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -480,34 +480,34 @@ const SimulationPlotView: FC<SimulationPlotProps> = ({
if (isVertical && !isHorizontal) {
return dimensions.width > layoutBreakpoint
? {
height: dimensions.height / 2 ,
height: dimensions.height / 2 - buffor,
width: dimensions.width - buffor,
}
: {
height: dimensions.height / 1.5,
height: dimensions.height / 1.5 - buffor,
width: dimensions.width - buffor,
};
}

if (!isVertical && isHorizontal) {
return dimensions.width > layoutBreakpoint
? {
height: dimensions.height,
height: dimensions.height - buffor,
width: dimensions.width / columnCount - buffor,
}
: {
height: dimensions.height,
height: dimensions.height - buffor,
width: dimensions.width / 1.5 - buffor,
};
}

return dimensions.width > layoutBreakpoint
? {
height: dimensions.height / 2,
height: dimensions.height / 2 - buffor,
width: dimensions.width / columnCount - buffor,
}
: {
height: dimensions.height / 2,
height: dimensions.height / 2 - buffor,
width: dimensions.width / columnCount - buffor,
};
};
Expand Down

0 comments on commit 755f850

Please sign in to comment.