From cad686b43c5264b6e3bb59fb3a6399fbef41a101 Mon Sep 17 00:00:00 2001 From: charitha Date: Thu, 1 Dec 2016 15:28:39 +0530 Subject: [PATCH 1/2] 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 From 265b6248efeea0a0dda7bd7c425765807a418613 Mon Sep 17 00:00:00 2001 From: charitha Date: Thu, 1 Dec 2016 15:41:21 +0530 Subject: [PATCH 2/2] Add email templates --- .../email/templates/user-enrollment.vm | 71 ++++++++++++++++ .../email/templates/user-registration.vm | 81 +++++++++++++++++++ .../src/main/resources/p2.inf | 4 +- 3 files changed, 155 insertions(+), 1 deletion(-) create mode 100644 features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/email/templates/user-enrollment.vm create mode 100644 features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/email/templates/user-registration.vm diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/email/templates/user-enrollment.vm b/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/email/templates/user-enrollment.vm new file mode 100644 index 0000000000..61cc9340d4 --- /dev/null +++ b/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/email/templates/user-enrollment.vm @@ -0,0 +1,71 @@ +#* + Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. + + WSO2 Inc. licenses this file to you under the Apache License, + Version 2.0 (the "License"); you may not use this file except + in compliance with the License. + you may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. +*# + + You have been invited to enroll your devices in WSO2 IoT Server + + + + WSO2 IoT Server + + +
    +
    +
    +
    + WSO2 +
    +
    +
    +

    + Hi $first-name, +

    + +

    + You have been invited to enrol devices with WSO2 IoT Server. + Click here to enrol the WSO2 IoT Server devices to begin.

    + +

    + Should you need assistance, please contact your administrator. +

    + +

    + Regards, +

    + +

    + WSO2 IoT Server Administrator +

    +
    +
    + + + + +
    WSO2
    +
    +
    +
    + + + ]]> + + diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/email/templates/user-registration.vm b/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/email/templates/user-registration.vm new file mode 100644 index 0000000000..4d60d15e90 --- /dev/null +++ b/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/email/templates/user-registration.vm @@ -0,0 +1,81 @@ +#* + Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. + + WSO2 Inc. licenses this file to you under the Apache License, + Version 2.0 (the "License"); you may not use this file except + in compliance with the License. + you may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. +*# + + You have successfully been registered in WSO2 IoT Server + + + + WSO2 IoT Server + + +
    +
    +
    +
    + WSO2 +
    +
    +
    +

    + Hi $first-name, +

    + +

    + You have been registered in WSO2 IoT Server and invited to enrol your device. + Click here to enrol the WSO2 IoT Server devices to begin.

    + +

    + Use following credentials to log in to WSO2 IoT Server. +

    + +

    + Username: $username +
    + Password: $password +

    + +

    + Should you need assistance, please contact your administrator. +

    + +

    + Regards, +

    + +

    + WSO2 IoT Server Administrator +

    +
    +
    + + + + +
    WSO2
    +
    +
    +
    + + + ]]> + +
    diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/p2.inf b/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/p2.inf index a53516b80e..5675919164 100644 --- a/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/p2.inf +++ b/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/p2.inf @@ -3,4 +3,6 @@ org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../featur org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.server_${feature.version}/conf/license-config.xml,target:${installFolder}/../../conf/etc/license-config.xml,overwrite:true);\ org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.server_${feature.version}/conf/remote-appmanager-config.xml,target:${installFolder}/../../conf/etc/remote-appmanager-config.xml,overwrite:true);\ org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.server_${feature.version}/dbscripts/cdm,target:${installFolder}/../../../dbscripts/cdm,overwrite:true);\ -org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.server_${feature.version}/rxts/license.rxt,target:${installFolder}/../../../repository/resources/rxts/license.rxt,overwrite:true);\ \ No newline at end of file +org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.server_${feature.version}/rxts/license.rxt,target:${installFolder}/../../../repository/resources/rxts/license.rxt,overwrite:true);\ +org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/resources/email-templates);\ +org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.server_${feature.version}/email/templates,target:${installFolder}/../../../repository/resources/email-templates,overwrite:true);\ \ No newline at end of file