Fixing analyticsEnabled and groupingEnabled not working

revert-70aa11f8
Rasika Perera 8 years ago
parent 1bee155d9a
commit 9f615916d0

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

Loading…
Cancel
Save