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,
|
headerSort: false,
|
||||||
headerWordWrap: true,
|
headerWordWrap: true,
|
||||||
hozAlign: "left",
|
hozAlign: "left",
|
||||||
minWidth: 75,
|
minWidth: 80,
|
||||||
resizable: false,
|
resizable: false,
|
||||||
title: "1",
|
title: "1",
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -12,7 +12,11 @@ import {
|
|||||||
} from "tabulator-tables";
|
} from "tabulator-tables";
|
||||||
import { ValidationError } from "../../../core/Data/validate";
|
import { ValidationError } from "../../../core/Data/validate";
|
||||||
import Papa from "papaparse";
|
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";
|
import { UnitCommitmentScenario } from "../../../core/Data/types";
|
||||||
|
|
||||||
export interface ColumnSpec {
|
export interface ColumnSpec {
|
||||||
@@ -243,6 +247,12 @@ export const parseCsv = (
|
|||||||
data[name][spec.title] = val;
|
data[name][spec.title] = val;
|
||||||
break;
|
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":
|
case "busRef":
|
||||||
const busName = row[spec.title];
|
const busName = row[spec.title];
|
||||||
if (!(busName in scenario.Buses)) {
|
if (!(busName in scenario.Buses)) {
|
||||||
@@ -421,10 +431,10 @@ const DataTable = (props: DataTableProps) => {
|
|||||||
|
|
||||||
// Restore active cell selection
|
// Restore active cell selection
|
||||||
if (activeCell) {
|
if (activeCell) {
|
||||||
const cell = tableRef.current
|
tableRef.current
|
||||||
.getRowFromPosition(activeRowPosition!!)
|
?.getRowFromPosition(activeRowPosition!!)
|
||||||
.getCell(activeField!!);
|
?.getCell(activeField!!)
|
||||||
cell.edit();
|
?.edit();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update columns
|
// Update columns
|
||||||
|
|||||||
Reference in New Issue
Block a user