From 41f367abfac3ec00ff9b7dad745f15b7e5c7dd39 Mon Sep 17 00:00:00 2001 From: sameera910409 Date: Tue, 25 Oct 2016 17:48:16 +0530 Subject: [PATCH 1/3] add group listing and group device listing fixes --- .../service/api/DeviceManagementService.java | 6 + .../impl/DeviceManagementServiceImpl.java | 4 + .../app/modules/business-controllers/group.js | 8 +- .../app/pages/cdmf.page.devices/devices.js | 5 +- .../cdmf.page.devices/public/js/listing.js | 14 +- .../public/js/group-add.js | 7 +- .../app/pages/cdmf.page.groups/groups.hbs | 2 +- .../cdmf.page.groups/public/js/listing.js | 175 +++++++++++------- 8 files changed, 132 insertions(+), 89 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceManagementService.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceManagementService.java index 3838155c1e0..a89117c8e3c 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceManagementService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceManagementService.java @@ -128,6 +128,12 @@ public interface DeviceManagementService { @QueryParam("status") @Size(max = 45) String status, + @ApiParam( + name = "groupId", + value = "The group name of the device included", + required = false) + @QueryParam("groupId") + int groupId, @ApiParam( name = "since", value = "Checks if the requested variant was created since the specified date-time.\n" + diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceManagementServiceImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceManagementServiceImpl.java index e88805bfe86..ad6c9bc68ce 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceManagementServiceImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceManagementServiceImpl.java @@ -71,6 +71,7 @@ public class DeviceManagementServiceImpl implements DeviceManagementService { @QueryParam("user") String user, @QueryParam("ownership") String ownership, @QueryParam("status") String status, + @QueryParam("groupId") int groupId, @QueryParam("since") String since, @HeaderParam("If-Modified-Since") String ifModifiedSince, @QueryParam("offset") int offset, @@ -107,6 +108,9 @@ public class DeviceManagementServiceImpl implements DeviceManagementService { RequestValidationUtil.validateStatus(status); request.setStatus(status); } + if (groupId != 0 ) { + request.setGroupId(groupId); + } // this is the user who initiates the request String authorizedUser = CarbonContext.getThreadLocalCarbonContext().getUsername(); diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/business-controllers/group.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/business-controllers/group.js index d4569b68046..0b1a0a1d63a 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/business-controllers/group.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/business-controllers/group.js @@ -53,11 +53,11 @@ var groupModule = {}; ); }; - groupModule.getGroupDeviceCount = function (groupName, owner) { - endPoint = deviceServiceEndpoint + "/owner/" + owner + "/name/" + groupName + "/devices/count"; + groupModule.getGroupDeviceCount = function (groupId, owner) { + endPoint = deviceServiceEndpoint + "/groups/id/" + groupId + "/devices/count"; return serviceInvokers.XMLHttp.get( endPoint, function (responsePayload) { - return responsePayload; + return responsePayload["responseText"]; }, function (responsePayload) { log.error(responsePayload); @@ -67,7 +67,7 @@ var groupModule = {}; }; groupModule.getGroupDevices = function (groupName, owner) { - endPoint = deviceServiceEndpoint + "/owner/" + owner + "/name/" + groupName + "/devices"; + endPoint = deviceServiceEndpoint + "/groups/owner/" + owner + "/name/" + groupName + "/devices"; return serviceInvokers.XMLHttp.get( endPoint, function (responsePayload) { return responsePayload; diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devices/devices.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devices/devices.js index ae506f4b074..6a833308953 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devices/devices.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devices/devices.js @@ -23,6 +23,7 @@ function onRequest(context) { var groupName = request.getParameter("groupName"); var groupOwner = request.getParameter("groupOwner"); + var groupId = request.getParameter("groupId"); var viewModel = {}; var title = "Devices"; @@ -41,9 +42,9 @@ function onRequest(context) { } viewModel.currentUser = currentUser; var deviceCount = 0; - if (groupName && groupOwner) { + if (groupId && groupOwner) { var groupModule = require("/app/modules/business-controllers/group.js")["groupModule"]; - deviceCount = groupModule.getGroupDeviceCount(groupName, groupOwner); + deviceCount = groupModule.getGroupDeviceCount(groupId, groupOwner); } else { deviceCount = deviceModule.getDevicesCount(); } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devices/public/js/listing.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devices/public/js/listing.js index 0e384c7016c..171b77346e5 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devices/public/js/listing.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devices/public/js/listing.js @@ -554,7 +554,7 @@ function attachDeviceEvents() { var serviceURL; if ($.hasPermission("LIST_ALL_GROUPS")) { - serviceURL = "/api/device-mgt/v1.0/groups/all"; + serviceURL = "/api/device-mgt/v1.0/groups"; } else if ($.hasPermission("LIST_GROUPS")) { //Get authenticated users groups serviceURL = "/api/device-mgt/v1.0/groups/user/" + currentUser + "/all"; @@ -563,18 +563,18 @@ function attachDeviceEvents() { invokerUtil.get(serviceURL, function (data) { var groups = JSON.parse(data); var str = '
'; $('#user-groups').html(str); $("a#group-device-yes-link").show(); $("a#group-device-yes-link").click(function () { var selectedGroup = $('#assign-group-selector').val(); - serviceURL = "/api/device-mgt/v1.0/groups/owner/" + selectedGroup + "/devices"; - var device = {"id": deviceId, "type": deviceType}; - invokerUtil.post(serviceURL, device, function (data) { + serviceURL = "/api/device-mgt/v1.0/groups/id/" + selectedGroup + "/devices"; + var deviceIdentifiers = [{"id":deviceId,"type":deviceType}]; + invokerUtil.post(serviceURL, deviceIdentifiers, function (data) { $(modalPopupContent).html($('#group-associate-device-200-content').html()); setTimeout(function () { hidePopup(); diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.group.create/public/js/group-add.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.group.create/public/js/group-add.js index ae6870abd34..a259a6e3612 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.group.create/public/js/group-add.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.group.create/public/js/group-add.js @@ -45,9 +45,8 @@ $(function () { } else { var group = {"name": name, "description": description}; - var successCallback = function (jqXHR) { - var data = JSON.parse(jqXHR); - if (data.status == 201) { + var successCallback = function (jqXHR, status, resp) { + if (resp.status == 201) { $('.wr-validation-summary strong').text("Group created. You will be redirected to groups"); $('.wr-validation-summary').removeClass("hidden"); $('.wr-validation-summary strong').removeClass("label-danger"); @@ -56,7 +55,7 @@ $(function () { window.location = "../groups"; }, 1500); } else { - displayErrors(data.status); + displayErrors(resp.status); } }; diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.groups/groups.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.groups/groups.hbs index 7ad04791e10..5ffc014f056 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.groups/groups.hbs +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.groups/groups.hbs @@ -18,7 +18,7 @@ {{unit "cdmf.unit.ui.title" pageTitle="Group Management"}} {{unit "cdmf.unit.ui.content.title" pageHeader="Groups"}} -{{unit "cdmf.unit.lib.data-table"}} +{{unit "cdmf.unit.data-tables-extended"}} {{#zone "breadcrumbs"}}
  • diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.groups/public/js/listing.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.groups/public/js/listing.js index bec491c0178..a9ab2d5216c 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.groups/public/js/listing.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.groups/public/js/listing.js @@ -22,6 +22,12 @@ var groupCheckbox = "#ast-container .ctrl-wr-asset .itm-select input[type='checkbox']"; var assetContainer = "#ast-container"; +function InitiateViewOption() { + if ($(".select-enable-btn").text() == "Select") { + $(location).attr('href', $(this).data("url")); + } +} + /* * On Select All Groups button click function. * @@ -100,10 +106,10 @@ function loadGroups() { var currentUser = groupListing.data("currentUser"); var serviceURL; if ($.hasPermission("LIST_ALL_GROUPS")) { - serviceURL = "/devicemgt_admin/groups"; + serviceURL = "/api/device-mgt/v1.0/groups"; } else if ($.hasPermission("LIST_GROUPS")) { //Get authenticated users groups - serviceURL = "/devicemgt_admin/groups/user/" + currentUser; + serviceURL = "/api/device-mgt/v1.0/groups/user/" + currentUser; } else { $("#loading-content").remove(); $('#device-table').addClass('hidden'); @@ -112,78 +118,105 @@ function loadGroups() { return; } - $('#group-grid').datatables_extended ({ - serverSide: true, - processing: false, - searching: true, - ordering: false, - filter: false, - pageLength : 16, - ajax: { url : '/devicemgt/api/groups', data : {url : serviceURL}, - dataSrc: function ( json ) { - $('#group-grid').removeClass('hidden'); - var $list = $("#group-listing :input[type='search']"); - $list.each(function(){ - $(this).addClass("hidden"); - }); - return json.data; - } - }, - columnDefs: [ - { targets: 0, data: 'id', className: 'remove-padding icon-only content-fill' , render: function ( data, type, row, meta ) { - return '
    '; - }}, - {targets: 1, data: 'name', className: 'fade-edge'}, - { targets: 2, data: 'owner', className: 'fade-edge remove-padding-top'}, - { targets: 3, data: 'id', className: 'text-right content-fill text-left-on-grid-view no-wrap' , - render: function ( id, type, row, meta ) { - var html; - html = '' + - '' + - ''; - - html += '' + - '' + - ''; - - html += ''; - - html += '' + - ''; - - html += '' + - ''; - - return html; - }} - ], - "createdRow": function( row, data, dataIndex ) { - $(row).attr('data-type', 'selectable'); - $(row).attr('data-groupid', data.id); - $.each($('td', row), function (colIndex) { - switch(colIndex) { - case 1: - $(this).attr('data-grid-label', "Name"); - $(this).attr('data-search', data.name); - $(this).attr('data-display', data.name); - break; - case 2: - $(this).attr('data-grid-label', "Owner"); - $(this).attr('data-search', data.owner); - $(this).attr('data-display', data.owner); - break; - } - }); + var dataFilter = function (data) { + data = JSON.parse(data); + var objects = []; + $(data.deviceGroups).each(function (index) { + objects.push({ + groupId: data.deviceGroups[index].id, + name: data.deviceGroups[index].name, + description: data.deviceGroups[index].description, + owner: data.deviceGroups[index].owner, + dateOfCreation: data.deviceGroups[index].dateOfCreation + }) + }); + var json = { + "recordsTotal": data.count, + "data": objects + } + + return JSON.stringify(json); + }; + + var columns = [{ + targets: 0, + data: 'id', + class: 'remove-padding icon-only content-fill', + render: function (data, type, row, meta) { + return '
    '; + } + }, + { + targets: 1, + data: 'name', + class: 'fade-edge' }, - "fnDrawCallback": function( oSettings ) { + { + targets: 3, + data: 'id', + class: 'text-right content-fill text-left-on-grid-view no-wrap', + render: function (id, type, row, meta) { + var html; + html = '' + + '' + + ''; + + html += '' + + '' + + ''; + + html += ''; + + html += '' + + ''; + + html += '' + + ''; + + return html; + } + } + + ]; + + var fnCreatedRow = function (row, data) { + $(row).attr('data-type', 'selectable'); + $(row).attr('data-groupid', data.id); + $.each($('td', row), function (colIndex) { + switch (colIndex) { + case 1: + $(this).attr('data-grid-label', "Name"); + $(this).attr('data-search', data.name); + $(this).attr('data-display', data.name); + break; + case 2: + $(this).attr('data-grid-label', "Owner"); + $(this).attr('data-search', data.owner); + $(this).attr('data-display', data.owner); + break; + } + }); + }; + + + $('#group-grid').datatables_extended_serverside_paging( + null, + serviceURL, + dataFilter, + columns, + fnCreatedRow, + function (oSettings) { $(".icon .text").res_text(0.2); attachEvents(); - } - }); + }, + { + "placeholder": "Search By Group Name", + "searchKey": "name" + }); $(groupCheckbox).click(function () { addGroupSelectedClass(this); }); From fef7c07cb2fc53a7e40260b1487c9f603341b943 Mon Sep 17 00:00:00 2001 From: sameera910409 Date: Wed, 26 Oct 2016 10:08:48 +0530 Subject: [PATCH 2/3] add device group deleting and updating fixes --- .../cdmf.page.group.create/public/js/group-add.js | 2 +- .../pages/cdmf.page.groups/public/js/listing.js | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.group.create/public/js/group-add.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.group.create/public/js/group-add.js index a259a6e3612..2dc32ce70f1 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.group.create/public/js/group-add.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.group.create/public/js/group-add.js @@ -59,7 +59,7 @@ $(function () { } }; - invokerUtil.post("/devicemgt_admin/groups", group, + invokerUtil.post("/api/device-mgt/v1.0/groups", group, successCallback, function (message) { displayErrors(message); }); diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.groups/public/js/listing.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.groups/public/js/listing.js index a9ab2d5216c..140ba335594 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.groups/public/js/listing.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.groups/public/js/listing.js @@ -170,10 +170,10 @@ function loadGroups() { ''; html += '' + + 'data-group-owner="' + row.owner + '" data-group-description="' + row.description + '" data-group-id="'+row.groupId+'">' + ''; - html += '' + ''; @@ -351,7 +351,7 @@ function attachEvents() { * on Group Management page in WSO2 IoT Server Console. */ $("a.remove-group-link").click(function () { - var groupName = $(this).data("group-name"); + var groupId = $(this).data("group-id"); var groupOwner = $(this).data("group-owner"); $(modalPopupContent).html($('#remove-group-modal-content').html()); @@ -359,7 +359,6 @@ function attachEvents() { $("a#remove-group-yes-link").click(function () { var successCallback = function (data, textStatus, xhr) { - data = JSON.parse(data); if (xhr.status == 200) { $(modalPopupContent).html($('#remove-group-200-content').html()); setTimeout(function () { @@ -371,7 +370,7 @@ function attachEvents() { } }; - invokerUtil.delete("/devicemgt_admin/groups/owner/" + groupOwner + "/name/" + groupName, + invokerUtil.delete("/api/device-mgt/v1.0/groups/id/" + groupId, successCallback, function (message) { displayErrors(message); }); @@ -389,6 +388,7 @@ function attachEvents() { * on Device Management page in WSO2 MDM Console. */ $("a.edit-group-link").click(function () { + var groupId = $(this).data("group-id"); var groupName = $(this).data("group-name"); var groupOwner = $(this).data("group-owner"); var groupDescription = $(this).data("group-description"); @@ -404,8 +404,8 @@ function attachEvents() { var group = {"name": newGroupName, "description": newGroupDescription, "owner": groupOwner}; var successCallback = function (data, textStatus, xhr) { - data = JSON.parse(data); if (xhr.status == 200) { + $(modalPopupContent).html($('#edit-group-200-content').html()); setTimeout(function () { hidePopup(); location.reload(false); @@ -415,7 +415,7 @@ function attachEvents() { } }; - invokerUtil.put("/devicemgt_admin/groups/owner/" + groupOwner + "/name/" + groupName, group, + invokerUtil.put("/api/device-mgt/v1.0/groups/id/" + groupId, group, successCallback, function (message) { displayErrors(message); }); From 204a0ed94393b7d8cefd555b300dcd9904cbd9a2 Mon Sep 17 00:00:00 2001 From: sameera910409 Date: Wed, 26 Oct 2016 15:14:53 +0530 Subject: [PATCH 3/3] fixes for the comments of the PR#404 --- .../mgt/jaxrs/service/api/DeviceManagementService.java | 2 +- .../devicemgt/app/modules/business-controllers/group.js | 2 +- .../devicemgt/app/pages/cdmf.page.devices/devices.js | 5 ++--- .../app/pages/cdmf.page.groups/public/js/listing.js | 1 - 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceManagementService.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceManagementService.java index a89117c8e3c..62036c2778c 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceManagementService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceManagementService.java @@ -130,7 +130,7 @@ public interface DeviceManagementService { String status, @ApiParam( name = "groupId", - value = "The group name of the device included", + value = "Id of the group which device belongs", required = false) @QueryParam("groupId") int groupId, diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/business-controllers/group.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/business-controllers/group.js index 0b1a0a1d63a..1bc1d80e179 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/business-controllers/group.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/business-controllers/group.js @@ -53,7 +53,7 @@ var groupModule = {}; ); }; - groupModule.getGroupDeviceCount = function (groupId, owner) { + groupModule.getGroupDeviceCount = function (groupId) { endPoint = deviceServiceEndpoint + "/groups/id/" + groupId + "/devices/count"; return serviceInvokers.XMLHttp.get( endPoint, function (responsePayload) { diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devices/devices.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devices/devices.js index 6a833308953..40d7ee1d6bb 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devices/devices.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devices/devices.js @@ -22,7 +22,6 @@ function onRequest(context) { var deviceModule = require("/app/modules/business-controllers/device.js")["deviceModule"]; var groupName = request.getParameter("groupName"); - var groupOwner = request.getParameter("groupOwner"); var groupId = request.getParameter("groupId"); var viewModel = {}; @@ -42,9 +41,9 @@ function onRequest(context) { } viewModel.currentUser = currentUser; var deviceCount = 0; - if (groupId && groupOwner) { + if (groupId) { var groupModule = require("/app/modules/business-controllers/group.js")["groupModule"]; - deviceCount = groupModule.getGroupDeviceCount(groupId, groupOwner); + deviceCount = groupModule.getGroupDeviceCount(groupId); } else { deviceCount = deviceModule.getDevicesCount(); } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.groups/public/js/listing.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.groups/public/js/listing.js index 140ba335594..6a5ca169141 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.groups/public/js/listing.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.groups/public/js/listing.js @@ -352,7 +352,6 @@ function attachEvents() { */ $("a.remove-group-link").click(function () { var groupId = $(this).data("group-id"); - var groupOwner = $(this).data("group-owner"); $(modalPopupContent).html($('#remove-group-modal-content').html()); showPopup();