Skip to content

Commit 5d20127

Browse files
committed
Fix Thing names in rules engine UI - closes #3183
1 parent f925694 commit 5d20127

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

static/js/rules/RuleUtils.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,16 @@ const RuleUtils = {
3030
console.warn('byProperty property undefined', new Error().stack);
3131
return false;
3232
}
33-
33+
const propHref = `/things/${encodeURIComponent(property.thing)}/properties/${encodeURIComponent(
34+
property.id
35+
)}`;
3436
const optProp = option.properties[property.id];
35-
return optProp && optProp.forms && optProp.forms.length;
37+
return (
38+
optProp &&
39+
optProp.forms.filter((f) => {
40+
return f.href === propHref;
41+
}).length > 0
42+
);
3643
},
3744
// Helper function for selecting the thing corresponding to an href
3845
byThing: (thing) => (otherThing) => {

0 commit comments

Comments
 (0)