Fixed WIP errors. NEXT: Format selected pointGroup

pull/1463/head
Rick Carlino 2019-09-26 10:23:23 -05:00
parent 34c632cad3
commit ba0503ef00
3 changed files with 15 additions and 3 deletions

View File

@ -116,7 +116,8 @@ export const determineDropdown =
const toolSlot = findSlotByToolId(resources, tool_id);
return formatTool(findToolById(resources, tool_id), toolSlot);
case "point_group":
throw new Error("Not yet implemented");
const { resource_id } = data_value.args;
return { label: "--- WIP ---", value: "" + resource_id };
case "nothing" as unknown:
return NO_VALUE_SELECTED_DDI();
}

View File

@ -132,7 +132,18 @@ const newVariableCreator = (ddi: DropDownItem): VariableCreator => {
case "parameter": return newParameter; // Caller decides X/Y/Z
case "every_point": return everyPointVar(ddi.value);
case "Coordinate": return manualEntry(ddi.value);
case "PointGroup": throw new Error("TODO");
case "PointGroup":
const resource_id = parseInt("" + ddi.value, 10);
return (p): VariableWithAValue => ({
kind: "parameter_application",
args: {
label: p.label,
data_value: {
kind: "point_group",
args: { resource_id }
}
}
});
}
console.warn("WARNING: Don't know how to handle " + (ddi.headingId || "NA"));
return () => undefined;

View File

@ -64,7 +64,7 @@ const groups2Ddi = (groups: TaggedPointGroup[]): DropDownItem[] => {
return groups
.filter(x => x.body.id)
.map(x => {
return { label: x.body.name, value: x.uuid, headingId: "PointGroup" };
return { label: x.body.name, value: "" + x.body.id, headingId: "PointGroup" };
});
};