From 1bcea7cc1b6fbf58418d94f43601d55d99835a21 Mon Sep 17 00:00:00 2001 From: charitha Date: Fri, 25 Nov 2016 14:22:00 +0530 Subject: [PATCH 01/44] Move components with org.wso2.mdm group id to org.wso2.carbon.devicemgt group --- .../dynamic-client-web-proxy/pom.xml | 5 ++--- .../dynamic-client-registration/dynamic-client-web/pom.xml | 5 ++--- .../pom.xml | 5 +++-- pom.xml | 5 +++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/components/identity-extensions/dynamic-client-registration/dynamic-client-web-proxy/pom.xml b/components/identity-extensions/dynamic-client-registration/dynamic-client-web-proxy/pom.xml index 336e3112d7..6eb38b205c 100644 --- a/components/identity-extensions/dynamic-client-registration/dynamic-client-web-proxy/pom.xml +++ b/components/identity-extensions/dynamic-client-registration/dynamic-client-web-proxy/pom.xml @@ -16,7 +16,8 @@ ~ under the License. --> - + dynamic-client-registration @@ -26,9 +27,7 @@ 4.0.0 - org.wso2.mdm dynamic-client-web-proxy - 2.0.1-SNAPSHOT WSO2 Carbon - Proxy endpoint of Dynamic Client Registration Web Service WSO2 Carbon - Dynamic Client Registration Web Proxy war diff --git a/components/identity-extensions/dynamic-client-registration/dynamic-client-web/pom.xml b/components/identity-extensions/dynamic-client-registration/dynamic-client-web/pom.xml index 20ecc08c74..95db22be32 100644 --- a/components/identity-extensions/dynamic-client-registration/dynamic-client-web/pom.xml +++ b/components/identity-extensions/dynamic-client-registration/dynamic-client-web/pom.xml @@ -16,7 +16,8 @@ ~ under the License. --> - + dynamic-client-registration @@ -26,9 +27,7 @@ 4.0.0 - org.wso2.mdm dynamic-client-web - 2.0.1-SNAPSHOT WSO2 Carbon - Dynamic Client Registration Web Service WSO2 Carbon - Dynamic Client Registration Web war diff --git a/features/dynamic-client-registration/org.wso2.carbon.dynamic.client.registration.server.feature/pom.xml b/features/dynamic-client-registration/org.wso2.carbon.dynamic.client.registration.server.feature/pom.xml index a44ec0f52c..b43201e0f9 100644 --- a/features/dynamic-client-registration/org.wso2.carbon.dynamic.client.registration.server.feature/pom.xml +++ b/features/dynamic-client-registration/org.wso2.carbon.dynamic.client.registration.server.feature/pom.xml @@ -18,7 +18,8 @@ ~ under the License. --> - + org.wso2.carbon.devicemgt @@ -96,7 +97,7 @@ - org.wso2.mdm + org.wso2.carbon.devicemgt dynamic-client-web ${carbon.device.mgt.version} war diff --git a/pom.xml b/pom.xml index 7f0b6e4112..1e1180f9bd 100644 --- a/pom.xml +++ b/pom.xml @@ -17,7 +17,8 @@ ~ under the License. --> - + 4.0.0 org.wso2.carbon.devicemgt @@ -246,7 +247,7 @@ ${carbon.device.mgt.version} - org.wso2.mdm + org.wso2.carbon.devicemgt dynamic-client-web ${carbon.device.mgt.version} From d90c9ab68a7d406e6fa9f033ca2376a7e3833a53 Mon Sep 17 00:00:00 2001 From: Imesh Chandrasiri Date: Mon, 28 Nov 2016 11:33:16 +0530 Subject: [PATCH 02/44] Data table fix when list view --- .../cdmf.unit.ui.theme/public/css/custom-desktop.css | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.ui.theme/public/css/custom-desktop.css b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.ui.theme/public/css/custom-desktop.css index 1a89379d3f..0f440ddf2a 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.ui.theme/public/css/custom-desktop.css +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.ui.theme/public/css/custom-desktop.css @@ -6510,4 +6510,14 @@ select > option:hover { /* Adding style for required fields */ .required:before { content: "*"; +} + +.table.list-table:not(.grid-view){ + margin: 0px !important; +} +.table.list-table:not(.grid-view) > thead, .table.list-table:not(.grid-view) > tbody, .table.list-table:not(.grid-view) > tfoot{ + margin-bottom: 10px !important; +} +.table.list-table:not(.grid-view) tbody{ + margin: 0px !important; } \ No newline at end of file From 0dfde40b7cb76e64c0e00117030e0915dd81f4eb Mon Sep 17 00:00:00 2001 From: Madawa Soysa Date: Thu, 24 Nov 2016 17:59:30 +0530 Subject: [PATCH 03/44] IOTS-296: Generalizing policy UI for policy create wizard This commit is done to seperate policy related client side logic and UIs from device type specific logics. This is a part of creating self contained plugins for device types. This commit generalizes the policy creation wizard in the CDMF core and removes device type specific UIs and client side logic from the core. Also, this introduces a generic policy configuration UI in a new unit. --- .../wizard.json | 4 +- .../policy-wizard.hbs | 14 + .../policy-wizard.json | 3 + .../public/css/codemirror.css | 0 .../public/js/codemirror.js | 0 .../public/js/editor.js | 37 + .../public/js/sql.js | 0 .../public/js/utils.js | 24 +- .../units/cdmf.unit.policy.create/create.hbs | 327 ++++++-- .../public/js/policy-create.js | 532 +++++++++++++ .../public/js/policy-create.js | 701 ++++++------------ .../units/cdmf.unit.policy.wizard/wizard.hbs | 53 +- .../units/cdmf.unit.policy.wizard/wizard.js | 16 +- 13 files changed, 1135 insertions(+), 576 deletions(-) create mode 100644 components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.generic.policy-wizard/policy-wizard.hbs create mode 100644 components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.generic.policy-wizard/policy-wizard.json rename components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/{cdmf.unit.policy.wizard => cdmf.unit.device.type.generic.policy-wizard}/public/css/codemirror.css (100%) rename components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/{cdmf.unit.policy.wizard => cdmf.unit.device.type.generic.policy-wizard}/public/js/codemirror.js (100%) create mode 100644 components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.generic.policy-wizard/public/js/editor.js rename components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/{cdmf.unit.policy.wizard => cdmf.unit.device.type.generic.policy-wizard}/public/js/sql.js (100%) create mode 100644 components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.create/public/js/policy-create.js diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.policy.create.wizard/wizard.json b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.policy.create.wizard/wizard.json index 13574a2cb4..5322b6ff2b 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.policy.create.wizard/wizard.json +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.policy.create.wizard/wizard.json @@ -1,5 +1,5 @@ { - "version": "1.0.0", + "version": "1.0.0", "uri": "/policy/add/{deviceType}", - "layout": "cdmf.layout.default" + "layout": "cdmf.layout.default" } \ No newline at end of file diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.generic.policy-wizard/policy-wizard.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.generic.policy-wizard/policy-wizard.hbs new file mode 100644 index 0000000000..20db2036a4 --- /dev/null +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.generic.policy-wizard/policy-wizard.hbs @@ -0,0 +1,14 @@ +{{#zone "topCss"}} + {{css "css/codemirror.css"}} +{{/zone}} +
+
+ +
+
+
+{{#zone "bottomJs"}} + {{js "js/codemirror.js"}} + {{js "js/sql.js"}} + {{js "js/editor.js"}} +{{/zone}} \ No newline at end of file diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.generic.policy-wizard/policy-wizard.json b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.generic.policy-wizard/policy-wizard.json new file mode 100644 index 0000000000..b88788f78b --- /dev/null +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.generic.policy-wizard/policy-wizard.json @@ -0,0 +1,3 @@ +{ + "version" : "1.0.0" +} \ No newline at end of file diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.wizard/public/css/codemirror.css b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.generic.policy-wizard/public/css/codemirror.css similarity index 100% rename from components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.wizard/public/css/codemirror.css rename to components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.generic.policy-wizard/public/css/codemirror.css diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.wizard/public/js/codemirror.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.generic.policy-wizard/public/js/codemirror.js similarity index 100% rename from components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.wizard/public/js/codemirror.js rename to components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.generic.policy-wizard/public/js/codemirror.js diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.generic.policy-wizard/public/js/editor.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.generic.policy-wizard/public/js/editor.js new file mode 100644 index 0000000000..aca1bf0a7c --- /dev/null +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.generic.policy-wizard/public/js/editor.js @@ -0,0 +1,37 @@ +/* + * 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. + */ + +window.queryEditor = CodeMirror.fromTextArea(document.getElementById('policy-definition-input'), { + mode: MIME_TYPE_SIDDHI_QL, + indentWithTabs: true, + smartIndent: true, + lineNumbers: true, + matchBrackets: true, + autofocus: true, + extraKeys: { + "Shift-2": function (cm) { + insertStr(cm, cm.getCursor(), '@'); + CodeMirror.showHint(cm, getAnnotationHints); + }, + "Ctrl-Space": "autocomplete" + } +}); + +var validatePolicyProfile = function () { + return true; +}; \ No newline at end of file diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.wizard/public/js/sql.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.generic.policy-wizard/public/js/sql.js similarity index 100% rename from components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.wizard/public/js/sql.js rename to components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.generic.policy-wizard/public/js/sql.js diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.lib.handlebars/public/js/utils.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.lib.handlebars/public/js/utils.js index e64704b078..4e99b801b9 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.lib.handlebars/public/js/utils.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.lib.handlebars/public/js/utils.js @@ -33,12 +33,26 @@ callback(template); } }; + + $.isResourceExists = function (location, callback) { + $.ajax({ + url: location, + type: 'HEAD', + success: function () { + callback(true); + }, + error: function () { + callback(false); + } + }); + }; + $.registerPartial = function (name, location, callback) { - $.get(location, function (data) { - Handlebars.registerPartial( name, data); - console.log("Partial " + name + " has been registered"); - callback(); - }); + $.get(location, function (data) { + Handlebars.registerPartial(name, data); + console.log("Partial " + name + " has been registered"); + callback(); + }); }; })(); diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.create/create.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.create/create.hbs index 6ca4a63285..50d5548c1d 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.create/create.hbs +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.create/create.hbs @@ -1,74 +1,293 @@ -{{! - 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. -}} {{#zone "content"}} {{#if isAuthorized}}
-
+ + + +