From 1ab96eacfab730a908ad84cb3384984d7acfd34d Mon Sep 17 00:00:00 2001 From: Ben Francis Date: Mon, 15 Dec 2025 17:36:41 +0000 Subject: [PATCH] Fix Thing names in rules engine UI - closes #3183 --- static/js/rules/RuleUtils.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/static/js/rules/RuleUtils.js b/static/js/rules/RuleUtils.js index 8fbaf6785..6b2ba0998 100644 --- a/static/js/rules/RuleUtils.js +++ b/static/js/rules/RuleUtils.js @@ -30,9 +30,16 @@ const RuleUtils = { console.warn('byProperty property undefined', new Error().stack); return false; } - + const propHref = `/things/${encodeURIComponent(property.thing)}/properties/${encodeURIComponent( + property.id + )}`; const optProp = option.properties[property.id]; - return optProp && optProp.forms && optProp.forms.length; + return ( + optProp && + optProp.forms.filter((f) => { + return f.href === propHref; + }).length > 0 + ); }, // Helper function for selecting the thing corresponding to an href byThing: (thing) => (otherThing) => {