Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions static/js/rules/RuleUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down