Skip to content

armgit / core

Public Imported from GitHub
0

100% open-source IoT Platform - Integrate your devices, add intelligence, build custom apps

UI updates: Bug fix for rules notification with linked users target

Rich Turnerd08dc8cdc3a7
diff --git a/ui/component/or-rules/src/json-viewer/or-rule-action-notification.ts b/ui/component/or-rules/src/json-viewer/or-rule-action-notification.ts
index 7b548a80b..17d54a601 100644
--- a/ui/component/or-rules/src/json-viewer/or-rule-action-notification.ts
+++ b/ui/component/or-rules/src/json-viewer/or-rule-action-notification.ts
@@ -127,21 +127,26 @@ export class OrRuleActionNotification extends LitElement {
);
label = i18next.t("user_plural");
- const userQuery = action.target!.users!;
-
- if ((userQuery.ids && userQuery.ids.length > 1)
- || userQuery.usernames
- || userQuery.assetPredicate
- || userQuery.limit
- || userQuery.pathPredicate
- || userQuery.tenantPredicate) {
- console.warn("Rule action user target query is unsupported: " + JSON.stringify(userQuery, null, 2));
- return;
- }
+ if (action.target!.users) {
+ const userQuery = action.target!.users!;
+
+ if ((userQuery.ids && userQuery.ids.length > 1)
+ || userQuery.usernames
+ || userQuery.assetPredicate
+ || userQuery.limit
+ || userQuery.pathPredicate
+ || userQuery.tenantPredicate) {
+ console.warn("Rule action user target query is unsupported: " + JSON.stringify(userQuery, null, 2));
+ return;
+ }
- if (userQuery.ids && userQuery.ids.length === 1) {
- value = userQuery.ids[0];
+ if (userQuery.ids && userQuery.ids.length === 1) {
+ value = userQuery.ids[0];
+ }
+ } else if (action.target!.linkedUsers) {
+ value = "linkedUsers";
}
+
} else {
const assetQuery = baseAssetQuery ? {...baseAssetQuery} : {};
assetQuery.orderBy = {