mirror of
https://github.com/ANL-CEEESA/UnitCommitment.jl.git
synced 2025-12-06 00:08:52 -06:00
web: Fix failing tests
This commit is contained in:
@@ -36,7 +36,7 @@ test("generateTableColumns", () => {
|
||||
headerSort: false,
|
||||
headerWordWrap: true,
|
||||
hozAlign: "left",
|
||||
minWidth: 75,
|
||||
minWidth: 80,
|
||||
resizable: false,
|
||||
title: "1",
|
||||
});
|
||||
|
||||
@@ -12,7 +12,11 @@ import {
|
||||
} from "tabulator-tables";
|
||||
import { ValidationError } from "../../../core/Data/validate";
|
||||
import Papa from "papaparse";
|
||||
import { parseBool, parseNumber } from "../../../core/Operations/commonOps";
|
||||
import {
|
||||
parseBool,
|
||||
parseNullableNumber,
|
||||
parseNumber,
|
||||
} from "../../../core/Operations/commonOps";
|
||||
import { UnitCommitmentScenario } from "../../../core/Data/types";
|
||||
|
||||
export interface ColumnSpec {
|
||||
@@ -243,6 +247,12 @@ export const parseCsv = (
|
||||
data[name][spec.title] = val;
|
||||
break;
|
||||
}
|
||||
case "number?": {
|
||||
const [val, err] = parseNullableNumber(row[spec.title]);
|
||||
if (err) return [null, { message: err.message + rowRef }];
|
||||
data[name][spec.title] = val;
|
||||
break;
|
||||
}
|
||||
case "busRef":
|
||||
const busName = row[spec.title];
|
||||
if (!(busName in scenario.Buses)) {
|
||||
@@ -421,10 +431,10 @@ const DataTable = (props: DataTableProps) => {
|
||||
|
||||
// Restore active cell selection
|
||||
if (activeCell) {
|
||||
const cell = tableRef.current
|
||||
.getRowFromPosition(activeRowPosition!!)
|
||||
.getCell(activeField!!);
|
||||
cell.edit();
|
||||
tableRef.current
|
||||
?.getRowFromPosition(activeRowPosition!!)
|
||||
?.getCell(activeField!!)
|
||||
?.edit();
|
||||
}
|
||||
|
||||
// Update columns
|
||||
|
||||
Reference in New Issue
Block a user