Merge pull request #482 from rasika/release-2.0.x

Fixing IOTS-333: Devices listing page doesn't honor analyticsEnabled and groupingEnabled configs
4.x.x
Geeth 8 years ago committed by GitHub
commit 099fc99bce

@ -65,7 +65,9 @@ function onRequest(context) {
"type": data[i],
"category": deviceType.category,
"label": deviceType.label,
"thumb": utility.getDeviceThumb(data[i])
"thumb": utility.getDeviceThumb(data[i]),
"analyticsEnabled": deviceType.analyticsEnabled,
"groupingEnabled": deviceType.groupingEnabled
});
}
}

@ -66,7 +66,7 @@ $(document).ready(function () {
$.hasPermission = function (permission) {
return permissionSet[permission];
};
deviceListing = $("#device-listing");
currentUser = deviceListing.data("current-user");
@ -246,7 +246,7 @@ function loadDevices(searchType, searchParam) {
return true;
}
// In JS Boolean("false") returns TRUE => http://stackoverflow.com/a/264037/1560536
return (analyticsEnabled == "true");
return (groupingEnabled == "true");
}
}
return true;
@ -351,7 +351,7 @@ function loadDevices(searchType, searchParam) {
'<span class="hidden-xs hidden-on-grid-view">Analytics</span>';
}
if (!groupName || !groupId) {
if ((!groupName || !groupId) && groupingEnabled(row.deviceType)) {
html +=
'<a href="#" data-click-event="remove-form" class="btn padding-reduce-on-grid-view group-device-link" '
+

Loading…
Cancel
Save