added the alerts to the bin details part of the bin page, also fixed bug in the new alert dialog

This commit is contained in:
csawatzky 2026-05-19 16:30:22 -06:00
parent f72aeb802f
commit 6ccc1ba263
6 changed files with 167 additions and 14 deletions

View file

@ -179,7 +179,6 @@ export default function NewObjectInteraction(props: Props){
setNewAlertComponentType(quack.ComponentType.COMPONENT_TYPE_INVALID);
setConditions([]);
setSelectedAlertComponents([]);
setValidComponents([])
setValStrings(["0", "0"]);
setNumConditions(0)
setNodeOptions([]);
@ -190,7 +189,6 @@ export default function NewObjectInteraction(props: Props){
setResultType(quack.InteractionResultType.INTERACTION_RESULT_TYPE_REPORT)
setSinkMotor(false)
setSelectedSink("")//the key of the component to be the sink
setSinkOptions([])
setResultMode(0)
setResultValue("")
setDutyCycleEnabled(false)
@ -215,12 +213,15 @@ export default function NewObjectInteraction(props: Props){
//display the components that match the type that was selected for the new alert
const listMatchingComponents = () => {
console.log("listing")
let matching: Component[] = [];
console.log(validComponents)
validComponents.forEach(comp => {
if (comp.type() === newAlertComponentType) {
matching.push(comp);
}
});
console.log(matching)
return (
<List>
{matching.map(comp => (
@ -1018,6 +1019,7 @@ export default function NewObjectInteraction(props: Props){
displayEmpty
value={newAlertComponentType}
onChange={e => {
console.log("type change")
setNewAlertComponentType(e.target.value as quack.ComponentType);
setSelectedAlertComponents([]);
setConditions(initialConditions(e.target.value as quack.ComponentType));