From cad686b43c5264b6e3bb59fb3a6399fbef41a101 Mon Sep 17 00:00:00 2001 From: charitha Date: Thu, 1 Dec 2016 15:28:39 +0530 Subject: [PATCH] Bug fixes & UI/UX improvements --- .../app/modules/business-controllers/user.js | 2 +- .../app/pages/cdmf.page.devices/devices.hbs | 52 ++++++++++--------- .../app/pages/cdmf.page.groups/groups.hbs | 13 +++-- .../public/js/dataTables.extended.js | 34 ++++++------ .../listing.hbs | 25 ++++----- .../public/js/listing.js | 6 +-- .../cdmf.unit.ui.navbar.nav-menu/nav-menu.hbs | 8 --- .../lib/theme-wso2_1.0/js/theme-wso2.js | 36 ++++++++++--- 8 files changed, 96 insertions(+), 80 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/business-controllers/user.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/business-controllers/user.js index f8a0fd1ad4..693d00b236 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/business-controllers/user.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/business-controllers/user.js @@ -525,7 +525,7 @@ var userModule = function () { if (publicMethods.isAuthorized("/permission/admin/device-mgt/user/policies/list")) { permissions["LIST_POLICIES"] = true; } - if (publicMethods.isAuthorized("/permission/admin/device-mgt/devices/add")) { + if (publicMethods.isAuthorized("/permission/admin/device-mgt/devices/enroll")) { permissions["ADD_DEVICE"] = true; } if (publicMethods.isAuthorized("/permission/admin/device-mgt/groups/add")) { diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devices/devices.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devices/devices.hbs index 7cf43cc2af..2b50aa21c3 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devices/devices.hbs +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devices/devices.hbs @@ -73,11 +73,6 @@ {{/zone}} {{#zone "content"}} -
-
- {{title}} -
-
@@ -157,34 +152,41 @@ {{else}}
{{/if}} 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 2c32a1227a..5aeca7d38c 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 @@ -79,18 +79,21 @@ {{else}}
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.data-tables-extended/public/js/dataTables.extended.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.data-tables-extended/public/js/dataTables.extended.js index bcbbbae3f9..411eecc39f 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.data-tables-extended/public/js/dataTables.extended.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.data-tables-extended/public/js/dataTables.extended.js @@ -151,22 +151,26 @@ $.fn.datatables_extended = function(settings){ } function getAdvanceToolBar(){ - if(table.hasClass('sorting-enabled')){ - return '' + if (!table.hasClass('no-toolbar')) { + if (table.hasClass('sorting-enabled')) { + return '' + } else { + return '' + } }else{ - return '' - }; + return ''; + } } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.types.listing/listing.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.types.listing/listing.hbs index 08aae161eb..095a701dd5 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.types.listing/listing.hbs +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.types.listing/listing.hbs @@ -15,38 +15,33 @@ specific language governing permissions and limitations under the License. }} + +
+
+ Device Types +
+
+
- - +
- - - - -
By Device Type

- {{#if virtualDeviceTypesList}}
- Virtual Devices + Virtual Device Types

Don't have a device?

diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.types.listing/public/js/listing.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.types.listing/public/js/listing.js index 269f503a52..1fbbe479c2 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.types.listing/public/js/listing.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.types.listing/public/js/listing.js @@ -141,7 +141,7 @@ function loadDevices(searchType, searchParam){ compileTemplate(viewModel, deviceListingSrc); } } else { - $('#device-grid').addClass('hidden'); + $('#device-type-grid').addClass('hidden'); $('#device-listing-status-msg').html( '

' + '

No device type is available to be displayed.

' + @@ -167,7 +167,7 @@ function compileTemplate(viewModel, templateSrc){ $("#ast-container").html($("#ast-container").html() + template(viewModel)); compiledDeviceTypesCount++; if(deviceTypeCount == compiledDeviceTypesCount){ - $('#device-grid').datatables_extended({"bFilter": true, "order": [[ 1, "asc" ]]}); + $('#device-type-grid').datatables_extended({"bFilter": false, "order": [[ 1, "asc" ]]}); } }); } @@ -194,7 +194,7 @@ function openCollapsedNav(){ */ $(document).ready(function () { loadDevices(); - //$('#device-grid').datatables_extended(); + //$('#device-type-grid').datatables_extended(); /* Adding selected class for selected devices */ $(deviceCheckbox).each(function () { diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.ui.navbar.nav-menu/nav-menu.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.ui.navbar.nav-menu/nav-menu.hbs index 0a6a7d5b7e..e19fb188be 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.ui.navbar.nav-menu/nav-menu.hbs +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.ui.navbar.nav-menu/nav-menu.hbs @@ -22,14 +22,6 @@ {{/zone}} {{#zone "navMenu-items"}} - {{#if permissions.VIEW_DASHBOARD}} -
  • - - - Admin Dashboard - -
  • - {{/if}} {{#if permissions.LIST_OWN_DEVICES}}
  • diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/uuf-template-app/app/units/uuf.unit.theme/public/lib/theme-wso2_1.0/js/theme-wso2.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/uuf-template-app/app/units/uuf.unit.theme/public/lib/theme-wso2_1.0/js/theme-wso2.js index 6a68457693..13f6bbcad0 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/uuf-template-app/app/units/uuf.unit.theme/public/lib/theme-wso2_1.0/js/theme-wso2.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/uuf-template-app/app/units/uuf.unit.theme/public/lib/theme-wso2_1.0/js/theme-wso2.js @@ -309,14 +309,34 @@ var responsiveTextRatio = 0.2, } }); - //Append advance operations to list table toolbar - $('.dataTable.list-table').closest('.dataTables_wrapper').find('.dataTablesTop .dataTables_toolbar').html('' + - '' + function getAdvanceToolBar() { + if (!table.hasClass('no-toolbar')) { + if (table.hasClass('sorting-enabled')) { + return '' + } else { + return '' + } + } else { + return ''; + } + } + + /** + * append advance operations to list table toolbar + */ + $('.dataTable.list-table').closest('.dataTables_wrapper').find('.dataTablesTop .dataTables_toolbar').html( + getAdvanceToolBar() ); //Sorting dropdown menu select function