Skip to content

Commit

Permalink
fix(ui-hydro): disable stretch to fix display issue on some matrices
Browse files Browse the repository at this point in the history
  • Loading branch information
hdinia committed Feb 23, 2024
1 parent 29aa349 commit 6ca1d88
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ function HydroMatrix({ type }: Props) {
fetchFn={hydroMatrix.fetchFn}
disableEdit={hydroMatrix.disableEdit}
enablePercentDisplay={hydroMatrix.enablePercentDisplay}
stretch={hydroMatrix.stretch}
/>
</Root>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export interface HydroMatrixProps {
fetchFn?: fetchMatrixFn;
disableEdit?: boolean;
enablePercentDisplay?: boolean;
stretch?: boolean; // TODO: Remove this once the `EditableMatrix` component is refactored
}

type Matrices = Record<HydroMatrixType, HydroMatrixProps>;
Expand Down Expand Up @@ -120,6 +121,7 @@ export const MATRICES: Matrices = {
"Pumping Max Energy (Hours at Pmax)",
],
stats: MatrixStats.NOCOL,
stretch: false,
},
[HydroMatrixType.ReservoirLevels]: {
title: "Reservoir Levels",
Expand Down Expand Up @@ -175,6 +177,7 @@ export const MATRICES: Matrices = {
"December",
],
stats: MatrixStats.NOCOL,
stretch: false,
},
[HydroMatrixType.Allocation]: {
title: "Allocation",
Expand Down
3 changes: 3 additions & 0 deletions webapp/src/components/common/MatrixInput/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ interface Props {
fetchFn?: fetchMatrixFn;
disableEdit?: boolean;
enablePercentDisplay?: boolean;
stretch?: boolean;
}

function MatrixInput({
Expand All @@ -50,6 +51,7 @@ function MatrixInput({
fetchFn,
disableEdit,
enablePercentDisplay,
stretch,
}: Props) {
const { enqueueSnackbar } = useSnackbar();
const enqueueErrorSnackbar = useEnqueueErrorSnackbar();
Expand Down Expand Up @@ -211,6 +213,7 @@ function MatrixInput({
onUpdate={handleUpdate}
computStats={computStats}
isPercentDisplayEnabled={enablePercentDisplay}
stretch={stretch}
/>
) : (
!isLoading && (
Expand Down

0 comments on commit 6ca1d88

Please sign in to comment.