-
-
-
-
- {{defineZone "bottomModalContent"}}
- {{defineZone "bottomLibJs"}}
- {{defineZone "bottomJs"}}
-
-
\ No newline at end of file
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/layouts/cdmf.layout.error.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/layouts/cdmf.layout.error.hbs
deleted file mode 100644
index d14f195c32..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/layouts/cdmf.layout.error.hbs
+++ /dev/null
@@ -1,48 +0,0 @@
-{{!-- Copyright (c) 2015, 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. --}}
-
-
-
-
-
-
-
- {{defineZone "title"}}
-
-
-
-
-
-
-
-
-
-
{{#defineZone "messageTitle"}}Oops something went wrong{{/defineZone}}
-
{{defineZone "messageDescription"}}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/layouts/cdmf.layout.loading.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/layouts/cdmf.layout.loading.hbs
deleted file mode 100644
index ab70bdc1cf..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/layouts/cdmf.layout.loading.hbs
+++ /dev/null
@@ -1,57 +0,0 @@
-{{!-- Copyright (c) 2015, 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. --}}
-
-
-
-
-
-
-
- {{defineZone "favicon"}}
-
- {{defineZone "title"}}
-
- {{defineZone "topLibCss"}}
- {{defineZone "topCss"}}
- {{defineZone "topJs"}}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{defineZone "content"}}
-
- {{defineZone "bottomModalContent"}}
- {{defineZone "bottomLibJs"}}
- {{defineZone "bottomJs"}}
-
-
\ No newline at end of file
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/batch-provider-api.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/batch-provider-api.js
deleted file mode 100644
index 2c56bde07d..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/batch-provider-api.js
+++ /dev/null
@@ -1,149 +0,0 @@
-/*
- * Copyright (c) 2018 - 2023, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved.
- *
- * Entgra (Pvt) Ltd. 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.
- */
-var batchProviders;
-
-batchProviders = function () {
- var operations = {};
- var CONTENT_TYPE_JSON = "application/json";
- var JS_MAX_VALUE = "9007199254740992";
- var JS_MIN_VALUE = "-9007199254740992";
-
- var TABLENAME_ANDROID = "ORG_WSO2_GEO_FUSEDSPATIALEVENT";
- var TABLENAME_ANDROID_SENSE = "ORG_WSO2_IOT_ANDROID_LOCATION";
-
- var tableName = function (deviceType) {
- switch (deviceType) {
- case "android" :
- return TABLENAME_ANDROID;
- break;
- case "android_sense" :
- return TABLENAME_ANDROID_SENSE;
- break;
- default:
- return null;
-
- }
- };
-
- var typeMap = {
- "bool": "string",
- "boolean": "string",
- "string": "string",
- "int": "number",
- "integer": "number",
- "long": "number",
- "double": "number",
- "float": "number",
- "time": "time"
- };
-
- var log = new Log();
- var carbon = require('carbon');
- var JSUtils = Packages.org.wso2.carbon.analytics.jsservice.Utils;
- var AnalyticsCachedJSServiceConnector = Packages.org.wso2.carbon.analytics.jsservice.AnalyticsCachedJSServiceConnector;
- var AnalyticsCache = Packages.org.wso2.carbon.analytics.jsservice.AnalyticsCachedJSServiceConnector.AnalyticsCache;
- var cacheTimeoutSeconds = 5;
-
- var cacheSizeBytes = 1024 * 1024 * 1024; // 1GB
- response.contentType = CONTENT_TYPE_JSON;
-
-
- var cache = application.get("AnalyticsWebServiceCache");
- if (cache == null) {
- cache = new AnalyticsCache(cacheTimeoutSeconds, cacheSizeBytes);
- application.put("AnalyticsWebServiceCache", cache);
- }
- var connector = new AnalyticsCachedJSServiceConnector(cache);
-
-
- /**
- * returns an array of column names & types
- * @param providerConfig
- */
- operations.getSchema = function (loggedInUser) {
- var tablename = tableName(deviceType);
- if (tablename == null) {
- return [];
- }
- var schema = [];
- var result = connector.getTableSchema(loggedInUser, tablename).getMessage();
- result = JSON.parse(result);
-
- var columns = result.columns;
- Object.getOwnPropertyNames(columns).forEach(function (name, idx, array) {
- var type = "ordinal";
- if (columns[name]['type']) {
- type = columns[name]['type'];
- }
- schema.push({
- fieldName: name,
- fieldType: typeMap[type.toLowerCase()]
- });
- });
- // log.info(schema);
- return schema;
- };
-
- /**
- * returns the actual data
- * @param providerConfig
- * @param limit
- */
- operations.getData = function (loggedInUser, deviceId, deviceType) {
- var luceneQuery = "";
- var limit = 100;
- var result;
- var tablename = tableName(deviceType);
- if (tablename == null) {
- return [];
- }
- //if there's a filter present, we should perform a Lucene search instead of reading the table
- if (luceneQuery) {
- luceneQuery = 'id:"' + deviceId + '" AND type:"' + deviceType + '"';
- var filter = {
- "query": luceneQuery,
- "start": 0,
- "count": limit
- };
- result = connector.search(loggedInUser, tablename, stringify(filter)).getMessage();
- } else {
- var from = JS_MIN_VALUE;
- var to = JS_MAX_VALUE;
- result = connector.getRecordsByRange(loggedInUser, tablename, from, to, 0, limit, null).getMessage();
-
- }
-
- // error handling ----
- var resultString = result.toString();
- if (resultString.contains("Failed to get records from table")) {
- return null;
- }
-
- result = JSON.parse(result);
- var data = [];
- for (var i = 0; i < result.length; i++) {
- var values = result[i].values;
- data.push(values);
- }
- return data;
- };
-
-
-
- return operations;
-}();
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/business-controllers/device.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/business-controllers/device.js
deleted file mode 100644
index b01afcbf25..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/business-controllers/device.js
+++ /dev/null
@@ -1,467 +0,0 @@
-/*
- * Copyright (c) 2018 - 2023, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved.
- *
- * Entgra (Pvt) Ltd. 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.
- */
-
-var deviceModule;
-deviceModule = function () {
- var log = new Log("/app/modules/business-controllers/device.js");
-
- var utility = require('/app/modules/utility.js')["utility"];
- var constants = require('/app/modules/constants.js');
- var devicemgtProps = require("/app/modules/conf-reader/main.js")["conf"];
- var serviceInvokers = require("/app/modules/oauth/token-protected-service-invokers.js")["invokers"];
- var batchProvider = require("/app/modules/batch-provider-api.js")["batchProviders"];
- var process = require("process");
- var carbon = require("carbon");
- var publicMethods = {};
- var privateMethods = {};
-
- /**
- * Only GET method is implemented for now since there are no other type of methods used this method.
- * @param url - URL to call the backend without the host
- * @param method - HTTP Method (GET, POST)
- * @returns An object with 'status': 'success'|'error', 'content': {}
- */
- privateMethods.callBackend = function (url, method) {
- if (constants["HTTP_GET"] == method) {
- return serviceInvokers.XMLHttp.get(url,
- function (backendResponse) {
- var response = {};
- response.content = backendResponse.responseText;
- if (backendResponse.status == 200) {
- response.status = "success";
- } else if (backendResponse.status == 400 || backendResponse.status == 401 ||
- backendResponse.status == 404 || backendResponse.status == 500) {
- response.status = "error";
- }
- return response;
- }
- );
- } else {
- log.error("Runtime error : This method only support HTTP GET requests.");
- }
- };
-
- privateMethods.validateAndReturn = function (value) {
- return (value == undefined || value == null) ? constants["UNSPECIFIED"] : value;
- };
-
- /*
- @Updated
- */
- publicMethods.viewDevice = function (deviceType, deviceId, owner, ownership) {
- var carbonUser = session.get(constants["USER_SESSION_KEY"]);
- if (!carbonUser) {
- log.error("User object was not found in the session");
- userModule.logout(function () {
- response.sendRedirect(devicemgtProps["appContext"] + "login");
- });
- }
- var userName = carbonUser.username + "@" + carbonUser.domain;
- var locationHistory = [];
- var geoServicesEnabled = devicemgtProps.serverConfig.geoLocationConfiguration.enabled;
- if (geoServicesEnabled) {
- try {
- var fromDate = new Date();
- fromDate.setHours(fromDate.getHours() - 2);
- var toDate = new Date();
- var serviceUrl = devicemgtProps["httpsURL"] + '/api/device-mgt/v1.0/geo-services/stats/' + deviceType + '/' + deviceId + '?from=' + fromDate.getTime() + '&to=' + toDate.getTime();
- serviceInvokers.XMLHttp.get(serviceUrl,
- function (backendResponse) {
- if (backendResponse.status === 200 && backendResponse.responseText) {
- locationHistory = JSON.parse(backendResponse.responseText);
- }
- });
- } catch (e) {
- log.error(e.message, e);
- }
- }
-
- var locationInfo = {};
- try {
- var url = devicemgtProps["httpsURL"] + "/api/device-mgt/v1.0/devices/" + deviceType + "/" + deviceId + "/location";
- serviceInvokers.XMLHttp.get(
- url,
- function (backendResponse) {
-
- if (backendResponse.status == 200 && backendResponse.responseText) {
- var device = parse(backendResponse.responseText);
- locationInfo.latitude = device.latitude;
- locationInfo.longitude = device.longitude;
- locationInfo.updatedOn = device.updatedTime;
- }
- });
- } catch (e) {
- log.error(e.message, e);
- }
-
- var utility = require('/app/modules/utility.js')["utility"];
- try {
- utility.startTenantFlow(carbonUser);
- var url = devicemgtProps["httpsURL"] + "/api/device-mgt/v1.0/devices/" + deviceType + "/" + deviceId;
- if (owner) {
- url = url + "?owner=" + owner;
- if (ownership){
- url = url + "&ownership=" + ownership;
- }
- } else if (ownership){
- url = url + "?ownership=" + ownership;
- }
- return serviceInvokers.XMLHttp.get(
- url,
- function (backendResponse) {
- var response = {};
- if (backendResponse.status == 200 && backendResponse.responseText) {
- var device = parse(backendResponse.responseText);
-
- var filteredDeviceData = {};
- if (device["deviceIdentifier"]) {
- filteredDeviceData["deviceIdentifier"] = device["deviceIdentifier"];
- }
- if (device["type"]) {
- filteredDeviceData["type"] = device["type"];
- }
- if (device["name"]) {
- filteredDeviceData["name"] = device["name"];
- }
- if (device["enrolmentInfo"]) {
- var enrolmentInfo = {};
- if (device["enrolmentInfo"]["status"]) {
- enrolmentInfo["status"] = device["enrolmentInfo"]["status"];
- }
- if (device["enrolmentInfo"]["owner"]) {
- enrolmentInfo["owner"] = device["enrolmentInfo"]["owner"];
- }
- if (device["enrolmentInfo"]["ownership"]) {
- enrolmentInfo["ownership"] = device["enrolmentInfo"]["ownership"];
- }
- filteredDeviceData["enrolmentInfo"] = enrolmentInfo;
- }
- if (device["properties"] && device["properties"].length > 0) {
- var propertiesList = device["properties"];
- var properties = {};
- if (propertiesList) {
- for (var i = 0; i < propertiesList.length; i++) {
- if (propertiesList[i]["value"]) {
- properties[propertiesList[i]["name"]] =
- propertiesList[i]["value"];
- }
- }
- }
-
- filteredDeviceData["initialDeviceInfo"] = properties;
-
- if (properties["DEVICE_INFO"]) {
- var initialDeviceInfoList = parse(properties["DEVICE_INFO"]);
- var initialDeviceInfo = {};
- if (Array.isArray(initialDeviceInfoList)) {
- for (var j = 0; j < initialDeviceInfoList.length; j++) {
- if (initialDeviceInfoList[j]["value"]) {
- initialDeviceInfo[initialDeviceInfoList[j]["name"]] =
- initialDeviceInfoList[j]["value"];
- }
- }
- } else {
- initialDeviceInfo = initialDeviceInfoList;
- }
-
-
- filteredDeviceData["initialDeviceInfo"]["DEVICE_INFO"] = initialDeviceInfo;
- }
- }
-
- if (filteredDeviceData["type"]) {
- if (filteredDeviceData["type"] == constants["PLATFORM_IOS"]) {
- if (filteredDeviceData["properties"]) {
- filteredDeviceData["properties"]["VENDOR"] = "Apple";
- }
- }
- }
-
- if (device["deviceInfo"]) {
- filteredDeviceData["latestDeviceInfo"] = device["deviceInfo"];
- } else {
- filteredDeviceData["latestDeviceInfo"] = {};
- filteredDeviceData["latestDeviceInfo"]["location"] = {};
- }
-
- //location related verification and modifications
- // adding the location histry for the movement path.
- filteredDeviceData["locationHistory"] = locationHistory;
-
- //checking for the latest location information based on historical data.
- if (locationHistory) {
- var infoDate;
- var locationDate;
- var historicalLatestLoc = locationHistory[locationHistory.length - 1];
- if (historicalLatestLoc && filteredDeviceData.latestDeviceInfo && filteredDeviceData.latestDeviceInfo.location) {
- infoDate = new Date(filteredDeviceData.latestDeviceInfo.location.updatedTime);
- locationDate = new Date(historicalLatestLoc.values.timeStamp);
- }
- if (infoDate < locationDate || filteredDeviceData.latestDeviceInfo.length === 0) {
- filteredDeviceData.latestDeviceInfo.location = {};
- filteredDeviceData.latestDeviceInfo.location.longitude = historicalLatestLoc.values.longitude;
- filteredDeviceData.latestDeviceInfo.location.latitude = historicalLatestLoc.values.latitude;
- filteredDeviceData.latestDeviceInfo.location.updatedTime = historicalLatestLoc.values.timeStamp;
- }
- }
-
- //checking for the latest location information.
- if (filteredDeviceData.latestDeviceInfo.location && locationInfo) {
- var infoDate = new Date(filteredDeviceData.latestDeviceInfo.location.updatedTime);
- var locationDate = new Date(locationInfo.updatedOn);
- if (infoDate < locationDate) {
- filteredDeviceData.latestDeviceInfo.location.longitude = locationInfo.longitude;
- filteredDeviceData.latestDeviceInfo.location.latitude = locationInfo.latitude;
- filteredDeviceData.latestDeviceInfo.location.updatedTime = locationInfo.updatedOn;
- }
- }
-
- response["content"] = filteredDeviceData;
- response["status"] = "success";
- return response;
- } else if (backendResponse.status == 401) {
- response["status"] = "unauthorized";
- return response;
- } else if (backendResponse.status == 404) {
- response["status"] = "notFound";
- return response;
- } else {
- response["status"] = "error";
- return response;
- }
- }
- );
- } catch (e) {
- throw e;
- } finally {
- utility.endTenantFlow();
- }
- };
-
- // Refactored methods
- publicMethods.getDevicesCount = function () {
- var carbonUser = session.get(constants.USER_SESSION_KEY);
- if (carbonUser) {
- var userModule = require("/app/modules/business-controllers/user.js")["userModule"];
- var uiPermissions = userModule.getUIPermissions();
- var url;
- if (uiPermissions.LIST_DEVICES) {
- url = devicemgtProps["httpsURL"] +
- devicemgtProps["backendRestEndpoints"]["deviceMgt"] + "/devices?offset=0&limit=1";
- } else if (uiPermissions.LIST_OWN_DEVICES) {
- url = devicemgtProps["httpsURL"] + devicemgtProps["backendRestEndpoints"]["deviceMgt"] +
- "/devices?offset=0&limit=1&user=" + carbonUser.username;
- } else {
- log.error("Access denied for user: " + carbonUser.username);
- return -1;
- }
- return serviceInvokers.XMLHttp.get(
- url, function (responsePayload) {
- if(!responsePayload["responseText"]){
- log.error("Error while fetching device count. API `" + url + "` returns HTTP: " + responsePayload["status"]);
- userModule.logout(function () {
- response.sendRedirect(devicemgtProps["appContext"] + "login");
- });
- }
- return parse(responsePayload["responseText"])["count"];
- },
- function (responsePayload) {
- log.error(responsePayload["responseText"]);
- return -1;
- }
- );
- } else {
- log.error("User object was not found in the session");
- userModule.logout(function () {
- response.sendRedirect(devicemgtProps["appContext"] + "login");
- });
- }
- };
-
- publicMethods.getDeviceTypeCount = function () {
- var carbonUser = session.get(constants.USER_SESSION_KEY);
- if (carbonUser) {
- var userModule = require("/app/modules/business-controllers/user.js")["userModule"];
- var uiPermissions = userModule.getUIPermissions();
- var url;
- if (uiPermissions.LIST_OWN_DEVICES) {
- url = devicemgtProps["httpsURL"] +
- devicemgtProps["backendRestEndpoints"]["deviceMgt"] + "/device-types";
- } else {
- log.error("Access denied for user: " + carbonUser.username);
- return -1;
- }
- return serviceInvokers.XMLHttp.get(
- url, function (responsePayload) {
- return parse(responsePayload["responseText"]).length;
- },
- function (responsePayload) {
- log.error(responsePayload["responseText"]);
- return -1;
- }
- );
- } else {
- log.error("User object was not found in the session");
- userModule.logout(function () {
- response.sendRedirect(devicemgtProps["appContext"] + "login");
- });
- }
- };
-
- publicMethods.getDeviceTypes = function () {
- var url = devicemgtProps["httpsURL"] + devicemgtProps["backendRestEndpoints"]["deviceMgt"] + "/device-types";
- var response = privateMethods.callBackend(url, constants["HTTP_GET"]);
- if (response.status == "success") {
- response.content = parse(response.content);
- }
- return response;
- };
-
- /*
- @Updated
- */
- // publicMethods.getLicense = function (deviceType) {
- // var url;
- // var license;
- // if (deviceType == "windows") {
- // url = mdmProps["httpURL"] + "/mdm-windows-agent/services/device/license";
- // } else if (deviceType == "ios") {
- // url = mdmProps["httpsURL"] + "/ios-enrollment/license/";
- // }
-
- // if (url != null && url != undefined) {
- // serviceInvokers.XMLHttp.get(url, function (responsePayload) {
- // license = responsePayload.text;
- // }, function (responsePayload) {
- // return null;
- // });
- // }
- // return license;
- // };
-
- publicMethods.getDevices = function (userName) {
- var url = devicemgtProps["httpsURL"] +
- devicemgtProps["backendRestEndpoints"]["deviceMgt"] + "/devices";
- if (userName && userName !== "") {
- url = url + "?user=" + userName;
- }
- return serviceInvokers.XMLHttp.get(
- url, function (responsePayload) {
- var devices = JSON.parse(responsePayload.responseText).devices;
- for (var i = 0; i < devices.length; i++) {
- devices[i].thumb = utility.getDeviceThumb(devices[i].type);
- }
- return devices;
- },
- function (responsePayload) {
- log.error(responsePayload);
- return -1;
- }
- );
- };
-
- publicMethods.getDeviceAgentConfig = function (type, deviceId) {
- var carbonUser = session.get(constants["USER_SESSION_KEY"]);
- if (!carbonUser) {
- log.error("User object was not found in the session");
- userModule.logout(function () {
- response.sendRedirect(devicemgtProps["appContext"] + "login");
- });
- }
- var userName = carbonUser.username + "@" + carbonUser.domain;
- var config = {};
- config.type = type;
- config.deviceId = deviceId;
- // register a tenant based app at API Manager
- var applicationName = type.replace(" ", "") + "_" + carbonUser.domain;
- var requestURL = (devicemgtProps["oauthProvider"]["appRegistration"]
- ["apiManagerClientAppRegistrationServiceURL"]).replace("/tenants","");
- var payload = {applicationName:applicationName, tags:["device_agent"],
- isAllowedToAllDomains:false, validityPeriod: 3600};
-
- serviceInvokers.XMLHttp.post(
- requestURL, payload, function (responsePayload) {
- var app = JSON.parse(responsePayload.responseText);
-
- config.clientId = app["client_id"];
- config.clientSecret = app["client_secret"];
- if (config.clientId && config.clientSecret) {
- var JWTClientManagerServicePackagePath =
- "io.entgra.device.mgt.core.identity.jwt.client.extension.service.JWTClientManagerService";
- //noinspection JSUnresolvedFunction, JSUnresolvedVariable
- var JWTClientManagerService = carbon.server.osgiService(JWTClientManagerServicePackagePath);
- //noinspection JSUnresolvedFunction
- var jwtClient = JWTClientManagerService.getJWTClient();
- // returning access token by JWT grant type
- var deviceScope = "device_" + type.replace(" ", "") + "_" + deviceId + " dm:device:enroll " +
- "dm:device:disenroll dm:device:modify dm:devices:ops:view dm:device:event:publish";
- var tokenInfo = jwtClient.getAccessToken(config.clientId, config.clientSecret,
- userName, deviceScope);
- config.accessToken = tokenInfo.getAccessToken();
- config.refreshToken = tokenInfo.getRefreshToken();
- if (config.accessToken == null) {
- return null;
- }
- config.mqttGateway = "tcp://" + process.getProperty("mqtt.broker.host") + ":" + process.getProperty("mqtt.broker.port");
- config.httpsGateway = "https://" + process.getProperty("iot.gateway.host") + ":" + process.getProperty("iot.gateway.https.port");
- config.httpGateway = "http://" + process.getProperty("iot.gateway.host") + ":" + process.getProperty("iot.gateway.http.port");
- return config;
- } else {
- return null;
- }
- return config;
- },
- function (responsePayload) {
- log.error(responsePayload);
- return null;
- }
- );
- return config;
-
- };
-
- /**
- * Retrieve device info details of a device
- * @param deviceType - Type of the device i.e ios, android
- * @param deviceId - Device ID of te device
- */
- publicMethods.getDeviceInfo = function (deviceType, deviceId) {
- try {
- var url = devicemgtProps["httpsURL"] + devicemgtProps["backendRestEndpoints"]["deviceMgt"]
- + "/devices/" + deviceType + "/" + deviceId + "/info";
- var response = {};
- return serviceInvokers.XMLHttp.get(
- url,
- function (backendResponse) {
- if (backendResponse.status === 200 && backendResponse.responseText) {
- response["status"] = "success";
- response["content"] = parse(backendResponse.responseText);
- } else {
- log.error("Error occurred while retrieving device info via " + url + ". Error code: "
- + backendResponse.status + ". Reason: " + backendResponse.responseText);
- response["status"] = "error";
- }
- return response;
- });
- } catch (e) {
- log.error("Error occurred while retrieving device info via " + url, e);
- }
- };
-
- return publicMethods;
-}();
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
deleted file mode 100644
index 9868f9d867..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/business-controllers/group.js
+++ /dev/null
@@ -1,143 +0,0 @@
-/*
- * Copyright (c) 2018 - 2023, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved.
- *
- * Entgra (Pvt) Ltd. 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.
- */
-
-var groupModule = {};
-(function (groupModule) {
- var log = new Log("/app/modules/business-controllers/group.js");
-
- var userModule = require("/app/modules/business-controllers/user.js")["userModule"];
- var constants = require('/app/modules/constants.js');
- var devicemgtProps = require("/app/modules/conf-reader/main.js")["conf"];
- var utility = require("/app/modules/utility.js").utility;
- var serviceInvokers = require("/app/modules/oauth/token-protected-service-invokers.js")["invokers"];
-
- var deviceServiceEndpoint = devicemgtProps["httpsURL"] + "/api/device-mgt/v1.0";
-
- var user = session.get(constants.USER_SESSION_KEY);
-
- var endPoint;
-
- groupModule.getGroupCount = function () {
- var permissions = userModule.getUIPermissions();
- if (permissions.LIST_ALL_GROUPS) {
- endPoint = deviceServiceEndpoint + "/admin/groups/count";
- } else if (permissions.LIST_GROUPS) {
- endPoint = deviceServiceEndpoint + "/groups/count";
- } else {
- if (!user) {
- log.error("User object was not found in the session");
- userModule.logout(function () {
- response.sendRedirect(devicemgtProps["appContext"] + "login");
- });
- }
- log.error("Access denied for user: " + user.username);
- return -1;
- }
- return serviceInvokers.XMLHttp.get(
- endPoint, function (responsePayload) {
- return parse(responsePayload["responseText"]);
- },
- function (responsePayload) {
- log.error(responsePayload["responseText"]);
- return -1;
- }
- );
- };
-
- groupModule.getGroupDeviceCount = function (groupId) {
- endPoint = deviceServiceEndpoint + "/groups/id/" + groupId + "/devices/count";
- return serviceInvokers.XMLHttp.get(
- endPoint, function (responsePayload) {
- return responsePayload["responseText"];
- },
- function (responsePayload) {
- log.error(responsePayload);
- return -1;
- }
- );
- };
-
- groupModule.getGroupDevices = function (groupId) {
- endPoint = deviceServiceEndpoint + "/groups/id/" + groupId + "/devices?limit=10";
- return serviceInvokers.XMLHttp.get(
- endPoint, function (responsePayload) {
- return responsePayload;
- },
- function (responsePayload) {
- log.error(responsePayload);
- return responsePayload;
- }
- );
- };
-
- groupModule.getGroups = function () {
- var permissions = userModule.getUIPermissions();
- if (permissions.LIST_ALL_GROUPS) {
- endPoint = deviceServiceEndpoint + "/admin/groups";
- } else if (permissions.LIST_GROUPS) {
- endPoint = deviceServiceEndpoint + "/groups";
- } else {
- log.error("Access denied for user: " + carbonUser.username);
- return -1;
- }
- return serviceInvokers.XMLHttp.get(
- endPoint, function (responsePayload) {
- var data = JSON.parse(responsePayload.responseText);
- if(data) {
- return data.deviceGroups;
- } else {
- return [];
- }
- },
- function (responsePayload) {
- log.error(responsePayload);
- return -1;
- }
- );
- };
-
- groupModule.getGroup = function (groupId) {
- return serviceInvokers.XMLHttp.get(
- deviceServiceEndpoint + "/groups/id/" + groupId, function (responsePayload) {
- return JSON.parse(responsePayload.responseText);
- },
- function (responsePayload) {
- log.error(responsePayload);
- return -1;
- }
- );
- };
-
- groupModule.getRolesOfGroup = function (groupId) {
- return serviceInvokers.XMLHttp.get(
- deviceServiceEndpoint + "/groups/id/" + groupId + "/roles", function (responsePayload) {
- var data = JSON.parse(responsePayload.responseText);
- if(data) {
- return data.roles;
- } else {
- return [];
- }
- },
- function (responsePayload) {
- log.error(responsePayload);
- return -1;
- }
- );
- };
-
-}(groupModule));
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/business-controllers/operation.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/business-controllers/operation.js
deleted file mode 100644
index d2401d86f0..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/business-controllers/operation.js
+++ /dev/null
@@ -1,168 +0,0 @@
-/*
- * Copyright (c) 2018 - 2023, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved.
- *
- * Entgra (Pvt) Ltd. 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.
- */
-
-var operationModule = function () {
- var log = new Log("/app/modules/business-controllers/operation.js");
- var utility = require('/app/modules/utility.js').utility;
- var constants = require('/app/modules/constants.js');
- var devicemgtProps = require("/app/modules/conf-reader/main.js")["conf"];
- var serviceInvokers = require("/app/modules/oauth/token-protected-service-invokers.js")["invokers"];
-
- var publicMethods = {};
- var privateMethods = {};
-
- /**
- * This method reads the token from the Token client and return the access token.
- * If the token pair s not set in the session this will send a redirect to the login page.
- */
- function getAccessToken(deviceType, owner, deviceId) {
- var TokenClient = Packages.org.wso2.carbon.device.mgt.iot.apimgt.TokenClient;
- var accessTokenClient = new TokenClient(deviceType);
- var accessTokenInfo = accessTokenClient.getAccessToken(owner, deviceId);
- return accessTokenInfo.getAccess_token();
- }
-
- privateMethods.getOperationsFromFeatures = function (deviceType, operationType) {
- var url = devicemgtProps["httpsURL"] + devicemgtProps["backendRestEndpoints"]["deviceMgt"] + "/device-types/"
- + deviceType + "/features?featureType=" + operationType + "&hidden=false";
- return serviceInvokers.XMLHttp.get(url, function (responsePayload) {
- var features = JSON.parse(responsePayload.responseText);
- var featureList = [];
- var feature;
- for (var i = 0; i < features.length; i++) {
- feature = {};
- feature["operation"] = features[i].code;
- feature["name"] = features[i].name;
- feature["description"] = features[i].description;
- feature["contentType"] = features[i].contentType;
- feature["deviceType"] = deviceType;
- feature["params"] = [];
- var metaData = features[i].metadataEntries;
- if (metaData) {
- for (var j = 0; j < metaData.length; j++) {
- if (metaData[j].name === "operationMeta") {
- var operationMeta = metaData[j].value;
- var params = {};
- params["method"] = operationMeta.method;
- params["pathParams"] = operationMeta.pathParams;
- params["queryParams"] = operationMeta.queryParams;
- params["formParams"] = operationMeta.formParams ? operationMeta.formParams : [];
- params["uri"] = operationMeta.uri;
- params["contentType"] = operationMeta.contentType;
- feature["params"].push(params);
- feature["permission"] = operationMeta.permission;
- if (operationMeta.icon) {
- //Check if icon is a path or font
- if (operationMeta.icon.indexOf("path:") === 0) {
- feature["icon"] = operationMeta.icon.replace("path:", "");
- } else {
- feature["iconFont"] = operationMeta.icon;
- }
- }
- if (operationMeta.uiParams && operationMeta.uiParams.length > 0) {
- feature["uiParams"] = operationMeta.uiParams;
- }
- if (operationMeta.filters) {
- feature["filters"] = operationMeta.filters;
- }
- if (operationMeta.ownershipDescription) {
- feature["ownershipDescription"] = operationMeta.ownershipDescription;
- }
- continue;
- }
- feature["metadata"].push(metaData[j].value);
- }
- featureList.push(feature);
- }
- }
- return featureList;
- }, function (responsePayload) {
- var response = {};
- response["status"] = "error";
- return response;
- }
- );
- };
-
- publicMethods.getControlOperations = function (device) {
- var deviceType = device.type;
- var operations = privateMethods.getOperationsFromFeatures(deviceType, "operation");
- for (var op in operations) {
- if (operations.hasOwnProperty(op)) {
- operations[op]["isDisabled"] = false;
- if (device && operations[op].filters && operations[op].filters.length > 0) {
- var filters = operations[op].filters;
- for (var filter in filters) {
- if (filters.hasOwnProperty(filter)) {
- if (device[filters[filter].property] !== filters[filter].value) {
- operations[op]["isDisabled"] = true;
- operations[op]["disabledText"] = operations[op]["disabledText"] ?
- operations[op]["disabledText"] + ", " + filters[filter].description :
- filters[filter].description;
- }
- }
- }
- }
- }
- }
- return operations;
- };
-
- publicMethods.getMonitorOperations = function (deviceType) {
- return privateMethods.getOperationsFromFeatures(deviceType, "monitor");
- };
-
- publicMethods.handlePOSTOperation = function (deviceType, operation, deviceId, params) {
- var user = session.get(constants.USER_SESSION_KEY);
- var endPoint = devicemgtProps["httpsURL"] + '/' + deviceType + "/controller/" + operation;
- var header = '{"owner":"' + user.username + '","deviceId":"' + deviceId +
- '","protocol":"mqtt", "sessionId":"' + session.getId() + '", "' +
- constants.AUTHORIZATION_HEADER + '":"' + constants.BEARER_PREFIX +
- getAccessToken(deviceType, user.username, deviceId) + '"}';
- return post(endPoint, params, JSON.parse(header), "json");
- };
-
- publicMethods.handleGETOperation = function (deviceType, operation, operationName, deviceId) {
- var user = session.get(constants.USER_SESSION_KEY);
- var endPoint = devicemgtProps["httpsURL"] + '/' + deviceType + "/controller/" + operation;
- var header = '{"owner":"' + user.username + '","deviceId":"' + deviceId +
- '","protocol":"mqtt", "' + constants.AUTHORIZATION_HEADER + '":"' +
- constants.BEARER_PREFIX + getAccessToken(deviceType, user.username, deviceId) +
- '"}';
- var result = get(endPoint, {}, JSON.parse(header), "json");
- if (result.data) {
- var values = result.data.sensorValue.split(',');
- if (operationName == 'gps') {
- result.data.map = {
- lat: parseFloat(values[0]),
- lng: parseFloat(values[1])
- }
- } else {
- var sqSum = 0;
- for (var v in values) {
- sqSum += Math.pow(values[v], 2);
- }
- result.data[operationName] = Math.sqrt(sqSum);
- }
- delete result.data['sensorValue'];
- }
- return result;
- };
-
- return publicMethods;
-}();
\ No newline at end of file
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/business-controllers/policy.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/business-controllers/policy.js
deleted file mode 100644
index b16dabac5e..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/business-controllers/policy.js
+++ /dev/null
@@ -1,282 +0,0 @@
-/*
- * Copyright (c) 2018 - 2023, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved.
- *
- * Entgra (Pvt) Ltd. 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.
- */
-
-var policyModule;
-policyModule = function () {
- var log = new Log("/app/modules/business-controllers/policy.js");
-
- var constants = require('/app/modules/constants.js');
- var utility = require("/app/modules/utility.js")["utility"];
- var devicemgtProps = require("/app/modules/conf-reader/main.js")["conf"];
- var serviceInvokers = require("/app/modules/oauth/token-protected-service-invokers.js")["invokers"];
-
- var publicMethods = {};
- var privateMethods = {};
-
- privateMethods.handleGetAllPoliciesResponse = function (backendResponse) {
- var response = {};
- if (backendResponse.status == 200 && backendResponse.responseText) {
- var isUpdated = false;
- var policyListFromRestEndpoint = parse(backendResponse.responseText)["policies"];
-
- var policyListToView = [];
- var i, policyObjectFromRestEndpoint, policyObjectToView;
- for (i = 0; i < policyListFromRestEndpoint.length; i++) {
- // get list object
- policyObjectFromRestEndpoint = policyListFromRestEndpoint[i];
- // populate list object values to view-object
- policyObjectToView = {};
- policyObjectToView["id"] = policyObjectFromRestEndpoint["id"];
- policyObjectToView["priorityId"] = policyObjectFromRestEndpoint["priorityId"];
- policyObjectToView["name"] = policyObjectFromRestEndpoint["policyName"];
- policyObjectToView["platform"] = policyObjectFromRestEndpoint["profile"]["deviceType"];
- policyObjectFromRestEndpoint["policyType"] = policyListFromRestEndpoint["policyType"];
- var payloadVersion = policyObjectFromRestEndpoint["policyPayloadVersion"];
- if (!parseFloat(payloadVersion) >= 2.0) {
- policyObjectFromRestEndpoint["correctiveActions"] = policyListFromRestEndpoint["correctiveActions"];
- }
- if (policyObjectToView["platform"] == "ios") {
- policyObjectToView["deviceTypeIcon"] = "apple";
- } else {
- policyObjectToView["deviceTypeIcon"] = policyObjectToView["platform"];
- }
- var ownershipType = "None";
- var deviceGroups = policyObjectFromRestEndpoint["deviceGroups"];
- if (deviceGroups) {
- for (var j = 0; j < deviceGroups.length; j++) {
- var deviceGroup = deviceGroups[j];
- if (deviceGroup.name === "COPE") {
- ownershipType = (ownershipType === "BYOD") ? "BYOD & COPE" : "COPE";
- } else if (deviceGroup.name === "BYOD") {
- ownershipType = (ownershipType === "COPE") ? "BYOD & COPE" : "BYOD";
- }
- }
- }
- policyObjectToView["ownershipType"] = ownershipType;
-
- var assignedRoleCount = policyObjectFromRestEndpoint["roles"].length;
- var assignedUserCount = policyObjectFromRestEndpoint["users"].length;
-
- if (assignedRoleCount == 0) {
- policyObjectToView["roles"] = "None";
- } else if (assignedRoleCount == 1) {
- policyObjectToView["roles"] = policyObjectFromRestEndpoint["roles"][0];
- } else if (assignedRoleCount > 1) {
- policyObjectToView["roles"] = policyObjectFromRestEndpoint["roles"][0] + ", ...";
- }
-
- if (assignedUserCount == 0) {
- policyObjectToView["users"] = "None";
- } else if (assignedUserCount == 1) {
- policyObjectToView["users"] = policyObjectFromRestEndpoint["users"][0];
- } else if (assignedUserCount > 1) {
- policyObjectToView["users"] = policyObjectFromRestEndpoint["users"][0] + ", ...";
- }
-
- policyObjectToView["compliance"] = policyObjectFromRestEndpoint["compliance"];
-
- if (policyObjectFromRestEndpoint["active"] == true &&
- policyObjectFromRestEndpoint["updated"] == true) {
- policyObjectToView["status"] = "Active/Updated";
- isUpdated = true;
- } else if (policyObjectFromRestEndpoint["active"] == true &&
- policyObjectFromRestEndpoint["updated"] == false) {
- policyObjectToView["status"] = "Active";
- } else if (policyObjectFromRestEndpoint["active"] == false &&
- policyObjectFromRestEndpoint["updated"] == true) {
- policyObjectToView["status"] = "Inactive/Updated";
- isUpdated = true;
- } else if (policyObjectFromRestEndpoint["active"] == false &&
- policyObjectFromRestEndpoint["updated"] == false) {
- policyObjectToView["status"] = "Inactive";
- }
- // push view-objects to list
- policyListToView.push(policyObjectToView);
- }
- // generate response
- response.updated = isUpdated;
- response.status = "success";
- response.content = policyListToView;
-
- return response;
- } else {
- response.status = "error";
- /* backendResponse.responseText == "Scope validation failed"
- Here the response.context("Scope validation failed") is used other then response.status(401).
- Reason for this is IDP return 401 as the status in 4 different situations such as,
- 1. UnAuthorized.
- 2. Scope Validation Failed.
- 3. Permission Denied.
- 4. Access Token Expired.
- 5. Access Token Invalid.
- In these cases in order to identify the correct situation we have to compare the unique value from status and
- context which is context.
- */
- if (backendResponse.responseText == "Scope validation failed") {
- response.content = "Permission Denied";
- } else {
- response.content = backendResponse.responseText;
- }
- return response;
- }
- };
-
- /*
- @Updated
- */
- publicMethods.getAllPolicies = function () {
- var carbonUser = session.get(constants["USER_SESSION_KEY"]);
- if (!carbonUser) {
- log.error("User object was not found in the session");
- userModule.logout(function () {
- response.sendRedirect(devicemgtProps["appContext"] + "login");
- });
- }
- try {
- var url = devicemgtProps["httpsURL"] + devicemgtProps["backendRestEndpoints"]["deviceMgt"] +
- "/policies?offset=0&limit=100";
- return serviceInvokers.XMLHttp.get(url, privateMethods.handleGetAllPoliciesResponse);
- } catch (e) {
- throw e;
- }
- };
-
- /**
- * Retrieve all policies based on policy type
- */
- publicMethods.getAllPoliciesByType = function (policyType) {
- var carbonUser = session.get(constants["USER_SESSION_KEY"]);
- if (!carbonUser) {
- log.error("User object was not found in the session");
- userModule.logout(function () {
- response.sendRedirect(devicemgtProps["appContext"] + "login");
- });
- }
- try {
- var url = devicemgtProps["httpsURL"] + devicemgtProps["backendRestEndpoints"]["deviceMgt"] +
- "/policies/type/" + policyType + "?offset=0&limit=100";
- return serviceInvokers.XMLHttp.get(url, privateMethods.handleGetAllPoliciesResponse);
- } catch (e) {
- log.error("Error occurred while retrieving policies by policy type " + policyType);
- throw e;
- }
- };
-
- /*
- Get policies count from backend services.
- */
- publicMethods.getPoliciesCount = function () {
- var carbonUser = session.get(constants["USER_SESSION_KEY"]);
- if (!carbonUser) {
- log.error("User object was not found in the session");
- userModule.logout(function () {
- response.sendRedirect(devicemgtProps["appContext"] + "login");
- });
- }
- try {
- var url = devicemgtProps["httpsURL"] + devicemgtProps["backendRestEndpoints"]["deviceMgt"] +
- "/policies?offset=0&limit=1";
- return serviceInvokers.XMLHttp.get(
- url, function (responsePayload) {
- return parse(responsePayload["responseText"])["count"];
- },
- function (responsePayload) {
- log.error(responsePayload["responseText"]);
- return -1;
- }
- );
- } catch (e) {
- throw e;
- }
- };
-
- /*
- Get apps available in the store from backend service.
- */
- publicMethods.getStoreAppsForPolicy = function () {
- var carbonUser = session.get(constants["USER_SESSION_KEY"]);
- if (!carbonUser) {
- log.error("User object was not found in the session");
- userModule.logout(function () {
- response.sendRedirect(devicemgtProps["appContext"] + "login");
- });
- }
- try {
- var url = devicemgtProps["managerHTTPSURL"] + devicemgtProps["backendRestEndpoints"]["appMgt"] +
- "/applications";
- var data = {
- limit: -1
- };
- return serviceInvokers.XMLHttp.post(url, data,
- function (backendResponse) {
- var response = {};
- if (backendResponse.status === 200 && backendResponse.responseText) {
- var appListFromRestEndpoint = parse(backendResponse.responseText)["applications"];
- var storeApps = [];
- var i, appObjectFromRestEndpoint, appObjectToView;
- for (i=0; i 0) {
- domain = username.substr(0, username.indexOf('/'));
- username = username.substr(username.indexOf('/') + 1);
- }
- try {
- utility.startTenantFlow(carbonUser);
- var url = devicemgtProps["httpsURL"] + devicemgtProps["backendRestEndpoints"]["deviceMgt"] + "/users/" +
- encodeURIComponent(username);
- if (domain) {
- url += '?domain=' + encodeURIComponent(domain);
- }
- var response = privateMethods.callBackend(url, constants["HTTP_GET"]);
- response["content"] = parse(response.content);
- response["userDomain"] = carbonUser.domain;
- return response;
- } catch (e) {
- throw e;
- } finally {
- utility.endTenantFlow();
- }
- };
-
- /**
- * Returns a set of roles assigned to a particular user
- * @param username
- * @returns {object} a response object with status and content on success.
- */
- publicMethods.getRolesByUsername = function (username) {
- var carbonUser = publicMethods.getCarbonUser();
- var domain;
- if (username.indexOf('/') > 0) {
- domain = username.substr(0, username.indexOf('/'));
- username = username.substr(username.indexOf('/') + 1);
- }
- try {
- utility.startTenantFlow(carbonUser);
- var url = devicemgtProps["httpsURL"] + devicemgtProps["backendRestEndpoints"]["deviceMgt"] + "/users/" +
- encodeURIComponent(username) + "/roles";
- if (domain) {
- url += '?domain=' + encodeURIComponent(domain);
- }
- var response = privateMethods.callBackend(url, constants["HTTP_GET"]);
- if (response.status == "success") {
- response.content = parse(response.content).roles;
- }
- return response;
- } catch (e) {
- throw e;
- } finally {
- utility.endTenantFlow();
- }
- };
-
- /*
- @NewlyAdded
- */
- publicMethods.getUsersByUsername = function () {
- var carbonUser = session.get(constants["USER_SESSION_KEY"]);
- var utility = require("/app/modules/utility.js")["utility"];
- if (!carbonUser) {
- log.error("User object was not found in the session");
- throw constants["ERRORS"]["USER_NOT_FOUND"];
- }
- try {
- utility.startTenantFlow(carbonUser);
- var url = devicemgtProps["httpsURL"] + "/mdm-admin/users/users-by-username";
- return privateMethods.callBackend(url, constants["HTTP_GET"]);
- } catch (e) {
- throw e;
- } finally {
- utility.endTenantFlow();
- }
- };
-
- /*
- @Updated
- */
- /**
- * Get User Roles from user store (Internal roles not included).
- */
- publicMethods.getRoles = function () {
- var carbonUser = session.get(constants["USER_SESSION_KEY"]);
- var utility = require("/app/modules/utility.js")["utility"];
- if (!carbonUser) {
- log.error("User object was not found in the session");
- throw constants["ERRORS"]["USER_NOT_FOUND"];
- }
- try {
- utility.startTenantFlow(carbonUser);
- var url = devicemgtProps["httpsURL"] + devicemgtProps["backendRestEndpoints"]["deviceMgt"] +
- "/roles?offset=0&limit=100&user-store=all";
- var response = privateMethods.callBackend(url, constants["HTTP_GET"]);
- if (response.status == "success") {
- response.content = parse(response.content).roles;
- }
- return response;
- } catch (e) {
- throw e;
- } finally {
- utility.endTenantFlow();
- }
- };
-
- /**
- * Get User Roles from user store (Internal roles not included).
- */
- publicMethods.getFilteredRoles = function (prefix) {
- var carbonUser = session.get(constants["USER_SESSION_KEY"]);
- var utility = require("/app/modules/utility.js")["utility"];
- if (!carbonUser) {
- log.error("User object was not found in the session");
- throw constants["ERRORS"]["USER_NOT_FOUND"];
- }
- try {
- utility.startTenantFlow(carbonUser);
- var url = devicemgtProps["httpsURL"] + devicemgtProps["backendRestEndpoints"]["deviceMgt"] +
- "/roles/filter/" + prefix + "?offset=0&limit=100&user-store=all";
- var response = privateMethods.callBackend(url, constants["HTTP_GET"]);
- if (response.status == "success") {
- response.content = parse(response.content);
- }
- return response;
- } catch (e) {
- throw e;
- } finally {
- utility.endTenantFlow();
- }
- };
-
- /**
- * Get User Roles count from user store (Internal roles not included).
- */
- publicMethods.getRolesCount = function () {
- var carbonUser = session.get(constants["USER_SESSION_KEY"]);
- var utility = require("/app/modules/utility.js")["utility"];
- if (!carbonUser) {
- log.error("User object was not found in the session");
- throw constants["ERRORS"]["USER_NOT_FOUND"];
- }
- try {
- utility.startTenantFlow(carbonUser);
- var url = devicemgtProps["httpsURL"] + devicemgtProps["backendRestEndpoints"]["deviceMgt"] +
- "/roles?offset=0&limit=1&user-store=all";
- return serviceInvokers.XMLHttp.get(
- url, function (responsePayload) {
- return parse(responsePayload["responseText"])["count"];
- },
- function (responsePayload) {
- log.error(responsePayload["responseText"]);
- return -1;
- }
- );
- } catch (e) {
- throw e;
- } finally {
- utility.endTenantFlow();
- }
- };
-
- /*
- @Updated
- */
- /**
- * Get User Roles from user store (Internal roles not included).
- * @returns {object} a response object with status and content on success.
- */
- publicMethods.getRolesByUserStore = function (userStore) {
- userStore = userStore ? userStore : "all";
- var carbonUser = session.get(constants["USER_SESSION_KEY"]);
- var utility = require("/app/modules/utility.js")["utility"];
- if (!carbonUser) {
- log.error("User object was not found in the session");
- throw constants["ERRORS"]["USER_NOT_FOUND"];
- }
- try {
- utility.startTenantFlow(carbonUser);
- var url = devicemgtProps["httpsURL"] + devicemgtProps["backendRestEndpoints"]["deviceMgt"] +
- "/roles?user-store=" + encodeURIComponent(userStore) + "&limit=100";
- var response = privateMethods.callBackend(url, constants["HTTP_GET"]);
- if (response.status == "success") {
- response.content = parse(response.content).roles;
- }
- return response;
- } catch (e) {
- throw e;
- } finally {
- utility.endTenantFlow();
- }
- };
-
- /**
- * Get Platforms.
- * @deprecated moved this device module under getDeviceTypes.
- */
- //TODO Move this piece of logic out of user.js to somewhere else appropriate.
- publicMethods.getPlatforms = function () {
- var carbonUser = session.get(constants["USER_SESSION_KEY"]);
- var utility = require("/app/modules/utility.js")["utility"];
- if (!carbonUser) {
- log.error("User object was not found in the session");
- throw constants["ERRORS"]["USER_NOT_FOUND"];
- }
- try {
- utility.startTenantFlow(carbonUser);
- var url = devicemgtProps["httpsURL"] + devicemgtProps["backendRestEndpoints"]["deviceMgt"] + "/device-types";
- var response = privateMethods.callBackend(url, constants["HTTP_GET"]);
- if (response.status == "success") {
- response.content = parse(response.content);
- }
- return response;
- } catch (e) {
- throw e;
- } finally {
- utility.endTenantFlow();
- }
- };
-
- /**
- * Get role
- */
- publicMethods.getRole = function (roleName) {
- var carbonUser = session.get(constants["USER_SESSION_KEY"]);
- var utility = require("/app/modules/utility.js")["utility"];
- var userStore;
- if (!carbonUser) {
- log.error("User object was not found in the session");
- throw constants["ERRORS"]["USER_NOT_FOUND"];
- }
- try {
- utility.startTenantFlow(carbonUser);
- if (roleName.indexOf('/') > 0) {
- userStore = roleName.substr(0, roleName.indexOf('/'));
- roleName = roleName.substr(roleName.indexOf('/') + 1);
- }
- var url = devicemgtProps["httpsURL"] + devicemgtProps["backendRestEndpoints"]["deviceMgt"] +
- "/roles/" + encodeURIComponent(roleName);
- if (userStore) {
- url += "?user-store=" + encodeURIComponent(userStore);
- }
- var response = privateMethods.callBackend(url, constants["HTTP_GET"]);
- if (response.status == "success") {
- response.content = parse(response.content);
- }
- return response;
- } catch (e) {
- throw e;
- } finally {
- utility.endTenantFlow();
- }
- };
-
- /**
- * Authenticate a user when he or she attempts to login to MDM.
- *
- * @param username Username of the user
- * @param password Password of the user
- * @param successCallback Function to be called at the event of successful authentication
- * @param failureCallback Function to be called at the event of failed authentication
- */
- publicMethods.login = function (username, password, successCallback, failureCallback) {
- var carbonModule = require("carbon");
- var carbonServer = application.get("carbonServer");
- try {
- // check if the user is an authenticated user.
- var isAuthenticated = carbonServer.authenticate(username, password);
- if (!isAuthenticated) {
- failureCallback("authentication");
- return;
- }
- var tenantUser = carbonModule.server.tenantUser(username);
- var isAuthorizedToLogin = privateMethods.isAuthorizedToLogin(tenantUser);
- if (!isAuthorizedToLogin) {
- failureCallback("authorization");
- return;
- }
- session.put(constants.USER_SESSION_KEY, tenantUser);
- successCallback(tenantUser);
- } catch (e) {
- throw e;
- }
- };
-
- publicMethods.logout = function (successCallback) {
- session.invalidate();
- successCallback();
- };
-
- publicMethods.isAuthorized = function (permission) {
- var carbon = require("carbon");
- var carbonServer = application.get("carbonServer");
- var carbonUser;
- try {
- carbonUser = session.get(constants.USER_SESSION_KEY);
- } catch (e) {
- log.error("User object was not found in the session");
- carbonUser = null;
- }
- var utility = require('/app/modules/utility.js').utility;
- if (!carbonUser) {
- log.error("User object was not found in the session");
- response.sendError(401, constants.ERRORS.USER_NOT_FOUND);
- exit();
- }
-
- try {
- utility.startTenantFlow(carbonUser);
- var tenantId = carbon.server.tenantId();
- var userManager = new carbon.user.UserManager(server, tenantId);
- var user = new carbon.user.User(userManager, carbonUser.username);
- return user.isAuthorized(permission, "ui.execute");
- } catch (e) {
- throw e;
- } finally {
- utility.endTenantFlow();
- }
- };
-
- privateMethods.isAuthorizedToLogin = function(carbonUser) {
- var utility = require('/app/modules/utility.js').utility;
- try {
- utility.startTenantFlow(carbonUser);
- var tenantId = carbon.server.tenantId();
- var userManager = new carbon.user.UserManager(server, tenantId);
- var user = new carbon.user.User(userManager, carbonUser.username);
- return user.isAuthorized("/permission/admin/login", "ui.execute");
- } catch (e) {
- throw e;
- } finally {
- utility.endTenantFlow();
- }
- };
-
- publicMethods.getUIPermissions = function () {
- var permissions = {};
- if (publicMethods.isAuthorized("/permission/admin/device-mgt/devices/any-device")) {
- permissions["LIST_DEVICES"] = true;
- permissions["LIST_OWN_DEVICES"] = true;
- }
- if (publicMethods.isAuthorized("/permission/admin/device-mgt/devices/owning-device/view")) {
- permissions["LIST_OWN_DEVICES"] = true;
- }
- if (publicMethods.isAuthorized("/permission/admin/device-mgt/admin/groups/view")) {
- permissions["LIST_ALL_GROUPS"] = true;
- }
- if (publicMethods.isAuthorized("/permission/admin/device-mgt/groups/view")) {
- permissions["LIST_GROUPS"] = true;
- }
- if (publicMethods.isAuthorized("/permission/admin/device-mgt/users/list")) {
- permissions["LIST_USERS"] = true;
- }
- if (publicMethods.isAuthorized("/permission/admin/device-mgt/roles/list")) {
- permissions["LIST_ROLES"] = true;
- }
- if (publicMethods.isAuthorized("/permission/admin/device-mgt/policies/list")) {
- permissions["LIST_ALL_POLICIES"] = true;
- }
- if (publicMethods.isAuthorized("/permission/admin/device-mgt/user/policies/list")) {
- permissions["LIST_POLICIES"] = true;
- }
- if (publicMethods.isAuthorized("/permission/admin/device-mgt/devices/enroll")) {
- permissions["ADD_DEVICE"] = true;
- }
- if (publicMethods.isAuthorized("/permission/admin/device-mgt/groups/add")) {
- permissions["ADD_GROUP"] = true;
- }
- if (publicMethods.isAuthorized("/permission/admin/device-mgt/users/add")) {
- permissions["ADD_USER"] = true;
- }
- if (publicMethods.isAuthorized("/permission/admin/device-mgt/groups/devices/add")) {
- permissions["ADD_GROUP_DEVICES"] = true;
- }
- if (publicMethods.isAuthorized("/permission/admin/device-mgt/groups/devices/remove")) {
- permissions["REMOVE_GROUP_DEVICES"] = true;
- }
- if (publicMethods.isAuthorized("/permission/admin/device-mgt/groups/devices/view")) {
- permissions["VIEW_GROUP_DEVICES"] = true;
- }
- if (publicMethods.isAuthorized("/permission/admin/device-mgt/groups/roles/view")) {
- permissions["VIEW_GROUP_ROLES"] = true;
- }
- if (publicMethods.isAuthorized("/permission/admin/device-mgt/groups/update")) {
- permissions["UPDATE_GROUP"] = true;
- }
- if (publicMethods.isAuthorized("/permission/admin/device-mgt/groups/share")) {
- permissions["SHARE_GROUP"] = true;
- }
- if (publicMethods.isAuthorized("/permission/admin/device-mgt/users/remove")) {
- permissions["REMOVE_USER"] = true;
- }
- if (publicMethods.isAuthorized("/permission/admin/device-mgt/groups/remove")) {
- permissions["REMOVE_GROUP"] = true;
- }
- if (publicMethods.isAuthorized("/permission/admin/device-mgt/roles/add")) {
- permissions["ADD_ROLE"] = true;
- }
- if (publicMethods.isAuthorized("/permission/admin/device-mgt/policies/add")) {
- permissions["ADD_ADMIN_POLICY"] = true;
- }
- if (publicMethods.isAuthorized("/permission/admin/device-mgt/user/policies/add")) {
- permissions["ADD_POLICY"] = true;
- }
- if (publicMethods.isAuthorized("/permission/admin/device-mgt/policies/priority")) {
- permissions["CHANGE_POLICY_PRIORITY"] = true;
- }
- if (publicMethods.isAuthorized("/permission/admin/device-mgt/dashboard/view")) {
- permissions["VIEW_DASHBOARD"] = true;
- }
- if (publicMethods.isAuthorized("/permission/admin/device-mgt/platform-configurations/view")) {
- permissions["TENANT_CONFIGURATION"] = true;
- }
- if (publicMethods.isAuthorized("/permission/admin/device-mgt/certificates/manage")) {
- permissions["CERTIFICATE_MANAGEMENT"] = true;
- }
- if (publicMethods.isAuthorized("/permission/admin/device-mgt/devices/change-status")) {
- permissions["CHANGE_DEVICE_STATUS"] = true;
- }
- if (publicMethods.isAuthorized("/permission/admin/device-mgt")) {
- permissions["IS_ADMIN"] = true;
- }
- if (publicMethods.isAuthorized("/permission/admin/device-mgt/topics/view")) {
- permissions["VIEW_TOPICS"] = true;
- }
- if (publicMethods.isAuthorized("/permission/admin/device-mgt/admin/devices/update-enrollment")) {
- permissions["UPDATE_ENROLLMENT"] = true;
- }
- if (publicMethods.isAuthorized("/permission/admin/device-mgt/admin/devices/permanent-delete")) {
- permissions["PERMANENT_DELETE"] = true;
- }
-
- return permissions;
- };
-
- /**
- * Add new role with permissions.
- *
- * @param roleName Name of the role
- * @param users List of users to assign the role
- * @param permissions List of permissions
- */
- publicMethods.addRole = function (roleName, users, permissions) {
- var carbon = require('carbon');
- var tenantId = carbon.server.tenantId();
- var url = carbon.server.address('https') + "/admin/services";
- var server = new carbon.server.Server(url);
- var userManager = new carbon.user.UserManager(server, tenantId);
-
- try {
- if (!userManager.roleExists(roleName)) {
- userManager.addRole(roleName, users, permissions);
- } else {
- var array = Object.keys(permissions);
- var i, permission;
- for (i = 0; i < array.length; i++) {
- permission = array[i];
- userManager.authorizeRole(roleName, permission, "ui.execute");
- }
- }
- } catch (e) {
- throw e;
- }
- };
-
- publicMethods.addPermissions = function (permissionList, path, init) {
- var registry, carbon = require("carbon");
- var carbonServer = application.get("carbonServer");
- var utility = require('/app/modules/utility.js').utility;
- var options = {system: true};
- if (init == "login") {
- try {
- var carbonUser = session.get(constants.USER_SESSION_KEY);
- if (!carbonUser) {
- log.error("User object was not found in the session");
- throw constants.ERRORS.USER_NOT_FOUND;
- }
- utility.startTenantFlow(carbonUser);
- var tenantId = carbon.server.tenantId();
- if (carbonUser) {
- options.tenantId = tenantId;
- }
- registry = new carbon.registry.Registry(carbonServer, options);
- var i, permission, resource;
- for (i = 0; i < permissionList.length; i++) {
- permission = permissionList[i];
- resource = {
- collection: true,
- name: permission.name,
- properties: {
- name: permission.name
- }
- };
- if (path != "") {
- registry.put("/_system/governance/permission/admin/" + path + "/" + permission.key, resource);
- } else {
- registry.put("/_system/governance/permission/admin/" + permission.key, resource);
- }
- }
- } catch (e) {
- throw e;
- } finally {
- utility.endTenantFlow();
- }
- } else {
- registry = new carbon.registry.Registry(carbonServer, options);
- var i, permission, resource;
- for (i = 0; i < permissionList.length; i++) {
- permission = permissionList[i];
- resource = {
- collection: true,
- name: permission.name,
- properties: {
- name: permission.name
- }
- };
- if (path != "") {
- registry.put("/_system/governance/permission/admin/" + path + "/" + permission.key, resource);
- } else {
- registry.put("/_system/governance/permission/admin/" + permission.key, resource);
- }
- }
- }
- };
-
- /**
- * Private method to be used by addUser() to
- * retrieve secondary user stores.
- * This needs Authentication since the method access admin services.
- *
- * @returns Array of secondary user stores.
- */
- publicMethods.getSecondaryUserStores = function () {
- var returnVal = [];
- // To call the userstore admin service, user needs to have admin permission
- if (publicMethods.isAuthorized("/permission/admin")) {
- var endpoint = devicemgtProps["adminService"] + constants["USER_STORE_CONFIG_ADMIN_SERVICE_END_POINT"];
- var wsPayload = "";
- serviceInvokers.WS.soapRequest(
- "urn:getSecondaryRealmConfigurations",
- wsPayload,
- endpoint,
- function (wsResponse) {
- var domainIDs = stringify(wsResponse. * ::['return']. * ::domainId.text());
- if (domainIDs != "\"\"") {
- var regExpForSearch = new RegExp(constants["USER_STORES_NOISY_CHAR"], "g");
- domainIDs = domainIDs.replace(regExpForSearch, "");
- returnVal = domainIDs.split(constants["USER_STORES_SPLITTING_CHAR"]);
- }
- }, function (e) {
- log.error("Error retrieving secondary user stores", e);
- },
- constants["SOAP_VERSION"]);
- } else {
- if (log.isDebugEnabled()) {
- log.debug("User does not have admin permission to get the secondary user store details.");
- }
- }
- return returnVal;
- };
-
- return publicMethods;
-}();
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/conf-reader/cloud.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/conf-reader/cloud.js
deleted file mode 100644
index 9427ed8b95..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/conf-reader/cloud.js
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Copyright (c) 2018 - 2023, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved.
- *
- * Entgra (Pvt) Ltd. 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.
- */
-
-var conf = function () {
- var cloudConf = application.get("CLOUD_CONF");
- if (!cloudConf) {
- cloudConf = require("/app/conf/toplink-menu.json");
- var pinch = require("/app/modules/conf-reader/pinch.min.js")["pinch"];
- var server = require("carbon")["server"];
- var process = require("process");
- pinch(cloudConf, /^/,
- function (path, key, value) {
- if ((typeof value === "string") && value.indexOf("%https.ip%") > -1) {
- //noinspection JSUnresolvedFunction
- return value.replace("%https.ip%", server.address("https"));
- } else if ((typeof value === "string") && value.indexOf("%http.ip%") > -1) {
- //noinspection JSUnresolvedFunction
- return value.replace("%http.ip%", server.address("http"));
- } else if ((typeof value === "string") && value.indexOf("%date-year%") > -1) {
- var year = new Date().getFullYear();
- return value.replace("%date-year%", year);
- } else if ((typeof value === "string") && value.indexOf("%server.ip%") > -1) {
- var getProperty = require("process").getProperty;
- return value.replace("%server.ip%", getProperty("carbon.local.ip"));
- } else {
- var paramPattern = new RegExp("%(.*?)%", "g");
- var out = value;
- while ((matches = paramPattern.exec(value)) !== null) {
- // This is necessary to avoid infinite loops with zero-width matches
- if (matches.index === paramPattern.lastIndex) {
- paramPattern.lastIndex++;
- }
- if (matches.length == 2) {
- var property = process.getProperty(matches[1]);
- if (property) {
- out = out.replace(new RegExp("%" + matches[1] + "%", "g"), property);
- }
- }
- }
- return out;
- }
- }
- );
- application.put("CLOUD_CONF", cloudConf);
- }
- return cloudConf;
-}();
\ No newline at end of file
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/conf-reader/main.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/conf-reader/main.js
deleted file mode 100644
index 4ff8c8ce77..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/conf-reader/main.js
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright (c) 2018 - 2023, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved.
- *
- * Entgra (Pvt) Ltd. 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.
- */
-
-var conf = function () {
- var conf = application.get("CONF");
- if (!conf) {
- conf = require("/app/conf/config.json");
- var pinch = require("/app/modules/conf-reader/pinch.min.js")["pinch"];
- var server = require("carbon")["server"];
- var process = require("process");
- pinch(conf, /^/,
- function (path, key, value) {
- if ((typeof value === "string") && value.indexOf("%https.ip%") > -1) {
- //noinspection JSUnresolvedFunction
- return value.replace("%https.ip%", server.address("https"));
- } else if ((typeof value === "string") && value.indexOf("%http.ip%") > -1) {
- //noinspection JSUnresolvedFunction
- return value.replace("%http.ip%", server.address("http"));
- } else if ((typeof value === "string") && value.indexOf("%date-year%") > -1) {
- var year = new Date().getFullYear();
- return value.replace("%date-year%", year);
- } else if ((typeof value === "string") && value.indexOf("%server.ip%") > -1) {
- var getProperty = require("process").getProperty;
- return value.replace("%server.ip%", getProperty("carbon.local.ip"));
- } else {
- var paramPattern = new RegExp("%(.*?)%", "g");
- var out = value;
- while ((matches = paramPattern.exec(value)) !== null) {
- // This is necessary to avoid infinite loops with zero-width matches
- if (matches.index === paramPattern.lastIndex) {
- paramPattern.lastIndex++;
- }
- if (matches.length == 2) {
- var property = process.getProperty(matches[1]);
- if (property) {
- out = out.replace(new RegExp("%" + matches[1] + "%", "g"), property);
- }
- }
- }
- return out;
- }
- }
- );
- var DeviceConfigurationManager = Packages.io.entgra.device.mgt.core.device.mgt.core.config.DeviceConfigurationManager;
- conf["serverConfig"] = DeviceConfigurationManager.getInstance().getDeviceManagementConfig();
- application.put("CONF", conf);
- }
- return conf;
-}();
\ No newline at end of file
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/conf-reader/pinch.min.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/conf-reader/pinch.min.js
deleted file mode 100644
index 5d22ca0eb7..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/conf-reader/pinch.min.js
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
-* Copyright (c) 2011 František Hába
-*
-* Permission is hereby granted, free of charge, to any person obtaining a copy of
-* this software and associated documentation files (the 'Software'), to deal in
-* the Software without restriction, including without limitation the rights to use,
-* copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
-* Software, and to permit persons to whom the Software is furnished to do so,
-* subject to the following conditions:
-* The above copyright notice and this permission notice shall be included in all
-* copies or substantial portions of the Software.
-
-* THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-* SOFTWARE.
-*
-* Reference:- https://github.com/Baggz/Pinch
-* */
-(function(){var k=function(a,c){return a.length!==c.length?!1:a.every(function(a,b){return c[b]===a})},j=function(a,c,d){var b,e;if("[object Array]"===Object.prototype.toString.call(a)){b=0;for(e=a.length;b= 200 && status < 300) {
- if (constants["STREAMING_FILES_ACCEPT_HEADERS"].indexOf(acceptTypeValue) > -1) {
- return successCallback(httpMethodObject.getResponseBodyAsStream(),
- httpMethodObject.getResponseHeaders());
- } else {
- return successCallback(httpMethodObject.getResponseBodyAsString(),
- httpMethodObject.getResponseHeaders());
- }
- } else {
- return errorCallback(httpMethodObject.getResponseBodyAsString(),
- httpMethodObject.getResponseHeaders());
- }
- } catch (e) {
- return errorCallback(response);
- } finally {
- //noinspection JSUnresolvedFunction
- if (method != constants["HTTP_GET"]) {
- method.releaseConnection();
- }
- }
- };
-
- /**
- * This method invokes return initiateHTTPClientRequest for get calls.
- * @param url target url.
- * @param successCallback a function to be called if the respond if successful.
- * @param errorCallback a function to be called if en error is reserved.
- * @param headers a list of name value pairs for additional http headers.
- */
- publicHTTPClientInvokers["get"] = function (url, successCallback, errorCallback, headers) {
- var requestPayload = null;
- return privateMethods.initiateHTTPClientRequest(constants["HTTP_GET"], url, successCallback, errorCallback,
- requestPayload, headers);
- };
-
- /**
- * This method invokes return initiateHTTPClientRequest for post calls.
- * @param url target url.
- * @param payload payload/data which need to be send.
- * @param successCallback a function to be called if the respond if successful.
- * @param errorCallback a function to be called if en error is reserved.
- * @param headers a list of name value pairs for additional http headers.
- */
- publicHTTPClientInvokers["post"] = function (url, payload, successCallback, errorCallback, headers) {
- return privateMethods.initiateHTTPClientRequest(constants["HTTP_POST"], url, successCallback, errorCallback,
- payload, headers);
- };
-
- /**
- * This method invokes return initiateHTTPClientRequest for put calls.
- * @param url target url.
- * @param payload payload/data which need to be send.
- * @param successCallback a function to be called if the respond if successful.
- * @param errorCallback a function to be called if en error is reserved.
- * @param headers a list of name value pairs for additional http headers.
- */
- publicHTTPClientInvokers["put"] = function (url, payload, successCallback, errorCallback, headers) {
- return privateMethods.initiateHTTPClientRequest(constants["HTTP_PUT"], url, successCallback, errorCallback,
- payload, headers);
- };
-
- /**
- * This method invokes return initiateHTTPClientRequest for delete calls.
- * @param url target url.
- * @param successCallback a function to be called if the respond if successful.
- * @param errorCallback a function to be called if en error is reserved.
- * @param headers a list of name value pairs for additional http headers.
- */
- publicHTTPClientInvokers["delete"] = function (url, successCallback, errorCallback, headers) {
- var requestPayload = null;
- return privateMethods.initiateHTTPClientRequest(constants["HTTP_DELETE"], url, successCallback, errorCallback,
- requestPayload, headers);
- };
-
- var publicMethods = {};
- publicMethods.XMLHttp = publicXMLHTTPInvokers;
- publicMethods.WS = publicWSInvokers;
- publicMethods.HttpClient = publicHTTPClientInvokers;
-
- return publicMethods;
-}();
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/utility.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/utility.js
deleted file mode 100644
index 452c9f5df5..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/utility.js
+++ /dev/null
@@ -1,396 +0,0 @@
-/*
- * Copyright (c) 2018 - 2023, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved.
- *
- * Entgra (Pvt) Ltd. 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.
- */
-
-var utility;
-utility = function () {
-
- var constants = require('/app/modules/constants.js');
- var devicemgtProps = require("/app/modules/conf-reader/main.js")["conf"];
- var log = new Log("/app/modules/utility.js");
- var JavaClass = Packages.java.lang.Class;
- var PrivilegedCarbonContext = Packages.org.wso2.carbon.context.PrivilegedCarbonContext;
- var server = require("carbon")["server"];
-
- var getOsgiService = function (className) {
- return PrivilegedCarbonContext.getThreadLocalCarbonContext().getOSGiService(JavaClass.forName(className));
- };
-
- var deviceTypeConfigMap = {};
-
- var publicMethods = {};
-
- publicMethods.startTenantFlow = function (userInfo) {
- var context, carbon = require('carbon');
- PrivilegedCarbonContext.startTenantFlow();
- context = PrivilegedCarbonContext.getThreadLocalCarbonContext();
- context.setTenantDomain(carbon.server.tenantDomain({
- tenantId: userInfo.tenantId
- }));
- context.setTenantId(userInfo.tenantId);
- context.setUsername(userInfo.username || null);
- };
-
- publicMethods.endTenantFlow = function () {
- PrivilegedCarbonContext.endTenantFlow();
- };
-
- publicMethods.getDeviceManagementService = function () {
- return getOsgiService('io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderService');
- };
-
- publicMethods.getAPIManagementProviderService = function () {
- return getOsgiService('io.entgra.device.mgt.core.apimgt.application.extension.APIManagementProviderService');
- };
-
- publicMethods.getUserManagementService = function () {
- return getOsgiService("org.wso2.carbon.device.mgt.user.core.UserManager");
- };
-
- publicMethods.getPolicyManagementService = function () {
- return getOsgiService("io.entgra.device.mgt.core.policy.mgt.core.PolicyManagerService");
- };
-
- publicMethods.getDeviceTypeConfig = function (deviceType) {
- var unitName = publicMethods.getTenantedDeviceUnitName(deviceType, "type-view");
- if (!unitName) {
- return null;
- }
-
- if (deviceType in deviceTypeConfigMap) {
- return deviceTypeConfigMap[deviceType];
- }
- var deviceTypeConfig;
- var deviceTypeConfigFile = new File("/app/units/" + unitName + "/private/config.json");
- if (deviceTypeConfigFile.isExists()) {
- try {
- deviceTypeConfigFile.open("r");
- var config = deviceTypeConfigFile.readAll();
- config = config.replace("%https.ip%", server.address("https"));
- config = config.replace("%http.ip%", server.address("http"));
- deviceTypeConfig = parse(config);
- } catch (err) {
- log.error("Error while reading device config file for `" + deviceType + "`: " + err);
- } finally {
- deviceTypeConfigFile.close();
- }
- }
- deviceTypeConfigMap[deviceType] = deviceTypeConfig;
- return deviceTypeConfig;
- };
-
- publicMethods.getOperationIcon = function (deviceType, operation) {
- var unitName = publicMethods.getTenantedDeviceUnitName(deviceType, "type-view");
- var iconPath = "/app/units/" + unitName + "/public/images/operations/" + operation + ".png";
- var icon = new File(iconPath);
- if (icon.isExists()) {
- return devicemgtProps["appContext"] + "public/" + unitName + "/images/operations/" + operation + ".png";
- } else {
- return null;
- }
- };
-
- publicMethods.getDeviceThumb = function (deviceType) {
- var unitName = publicMethods.getTenantedDeviceUnitName(deviceType, "type-view");
- if (!unitName) {
- unitName = "cdmf.unit.default.device.type.type-view";
- }
- var iconPath = "/app/units/" + unitName + "/public/images/thumb.png";
- var icon = new File(iconPath);
- if (icon.isExists()) {
- return devicemgtProps["appContext"] + "public/" + unitName + "/images/thumb.png";
- } else {
- return null;
- }
- };
-
- publicMethods.getTenantedDeviceUnitName = function (deviceType, unitPostfix) {
- var user = session.get(constants.USER_SESSION_KEY);
- if (!user) {
- log.error("User object was not found in the session");
- throw constants.ERRORS.USER_NOT_FOUND;
- }
- var unitName = user.domain + ".cdmf.unit.device.type." + deviceType + "." + unitPostfix;
- if (new File("/app/units/" + unitName).isExists()) {
- return unitName;
- }
- unitName = "cdmf.unit.device.type." + deviceType + "." + unitPostfix;
- if (new File("/app/units/" + unitName).isExists()) {
- return unitName;
- }
- return null;
- };
-
- publicMethods.getDeviceTypesScopesList = function () {
- var dirs = new File("/app/units/").listFiles();
- var scopesList = [];
- for (var i = 0; i < dirs.length; i++) {
- var unitName = dirs[i].getName();
- if (unitName.match(/^cdmf\.unit\.device\.type\..*\.type-view$/g)) {
- var deviceTypeConfigFile = new File("/app/units/" + unitName + "/private/config.json");
- if (deviceTypeConfigFile.isExists()) {
- try {
- deviceTypeConfigFile.open("r");
- var config = deviceTypeConfigFile.readAll();
- config = config.replace("%https.ip%", server.address("https"));
- config = config.replace("%http.ip%", server.address("http"));
- var deviceTypeConfig = parse(config);
- if (deviceTypeConfig.deviceType && deviceTypeConfig.deviceType.scopes) {
- scopesList = scopesList.concat(deviceTypeConfig.deviceType.scopes);
- }
- } catch (err) {
- log.error("Error while reading device config file for `" + deviceType + "`: " + err);
- } finally {
- deviceTypeConfigFile.close();
- }
- }
- }
- }
- return scopesList;
- };
-
-
- /**
- * Escapes special characters such as <,>,',",...etc
- * This will prevent XSS attacks upon JSON.
- * @param text
- * @returns {*}
- */
- publicMethods.encodeJson = function (text) {
- if (text) {
- return text
- .replace(/\\u003c/g, "<")
- .replace(//g, ">")
- .replace(/\\u0027/g, "'")
- .replace(/'/g, "'")
- .replace(/\\"/g, """)
- .replace(/\\u0022/g, """);
- } else {
- return "";
- }
- };
-
- publicMethods.md5 = function (s) {
- function L(k, d) {
- return (k << d) | (k >>> (32 - d))
- }
-
- function K(G, k) {
- var I, d, F, H, x;
- F = (G & 2147483648);
- H = (k & 2147483648);
- I = (G & 1073741824);
- d = (k & 1073741824);
- x = (G & 1073741823) + (k & 1073741823);
- if (I & d) {
- return (x ^ 2147483648 ^ F ^ H)
- }
- if (I | d) {
- if (x & 1073741824) {
- return (x ^ 3221225472 ^ F ^ H)
- } else {
- return (x ^ 1073741824 ^ F ^ H)
- }
- } else {
- return (x ^ F ^ H)
- }
- }
-
- function r(d, F, k) {
- return (d & F) | ((~d) & k)
- }
-
- function q(d, F, k) {
- return (d & k) | (F & (~k))
- }
-
- function p(d, F, k) {
- return (d ^ F ^ k)
- }
-
- function n(d, F, k) {
- return (F ^ (d | (~k)))
- }
-
- function u(G, F, aa, Z, k, H, I) {
- G = K(G, K(K(r(F, aa, Z), k), I));
- return K(L(G, H), F)
- }
-
- function f(G, F, aa, Z, k, H, I) {
- G = K(G, K(K(q(F, aa, Z), k), I));
- return K(L(G, H), F)
- }
-
- function D(G, F, aa, Z, k, H, I) {
- G = K(G, K(K(p(F, aa, Z), k), I));
- return K(L(G, H), F)
- }
-
- function t(G, F, aa, Z, k, H, I) {
- G = K(G, K(K(n(F, aa, Z), k), I));
- return K(L(G, H), F)
- }
-
- function e(G) {
- var Z;
- var F = G.length;
- var x = F + 8;
- var k = (x - (x % 64)) / 64;
- var I = (k + 1) * 16;
- var aa = Array(I - 1);
- var d = 0;
- var H = 0;
- while (H < F) {
- Z = (H - (H % 4)) / 4;
- d = (H % 4) * 8;
- aa[Z] = (aa[Z] | (G.charCodeAt(H) << d));
- H++
- }
- Z = (H - (H % 4)) / 4;
- d = (H % 4) * 8;
- aa[Z] = aa[Z] | (128 << d);
- aa[I - 2] = F << 3;
- aa[I - 1] = F >>> 29;
- return aa
- }
-
- function B(x) {
- var k = "", F = "", G, d;
- for (d = 0; d <= 3; d++) {
- G = (x >>> (d * 8)) & 255;
- F = "0" + G.toString(16);
- k = k + F.substr(F.length - 2, 2)
- }
- return k
- }
-
- function J(k) {
- k = k.replace(/rn/g, "n");
- var d = "";
- for (var F = 0; F < k.length; F++) {
- var x = k.charCodeAt(F);
- if (x < 128) {
- d += String.fromCharCode(x)
- } else {
- if ((x > 127) && (x < 2048)) {
- d += String.fromCharCode((x >> 6) | 192);
- d += String.fromCharCode((x & 63) | 128)
- } else {
- d += String.fromCharCode((x >> 12) | 224);
- d += String.fromCharCode(((x >> 6) & 63) | 128);
- d += String.fromCharCode((x & 63) | 128)
- }
- }
- }
- return d
- }
-
- var C = Array();
- var P, h, E, v, g, Y, X, W, V;
- var S = 7, Q = 12, N = 17, M = 22;
- var A = 5, z = 9, y = 14, w = 20;
- var o = 4, m = 11, l = 16, j = 23;
- var U = 6, T = 10, R = 15, O = 21;
- s = J(s);
- C = e(s);
- Y = 1732584193;
- X = 4023233417;
- W = 2562383102;
- V = 271733878;
- for (P = 0; P < C.length; P += 16) {
- h = Y;
- E = X;
- v = W;
- g = V;
- Y = u(Y, X, W, V, C[P + 0], S, 3614090360);
- V = u(V, Y, X, W, C[P + 1], Q, 3905402710);
- W = u(W, V, Y, X, C[P + 2], N, 606105819);
- X = u(X, W, V, Y, C[P + 3], M, 3250441966);
- Y = u(Y, X, W, V, C[P + 4], S, 4118548399);
- V = u(V, Y, X, W, C[P + 5], Q, 1200080426);
- W = u(W, V, Y, X, C[P + 6], N, 2821735955);
- X = u(X, W, V, Y, C[P + 7], M, 4249261313);
- Y = u(Y, X, W, V, C[P + 8], S, 1770035416);
- V = u(V, Y, X, W, C[P + 9], Q, 2336552879);
- W = u(W, V, Y, X, C[P + 10], N, 4294925233);
- X = u(X, W, V, Y, C[P + 11], M, 2304563134);
- Y = u(Y, X, W, V, C[P + 12], S, 1804603682);
- V = u(V, Y, X, W, C[P + 13], Q, 4254626195);
- W = u(W, V, Y, X, C[P + 14], N, 2792965006);
- X = u(X, W, V, Y, C[P + 15], M, 1236535329);
- Y = f(Y, X, W, V, C[P + 1], A, 4129170786);
- V = f(V, Y, X, W, C[P + 6], z, 3225465664);
- W = f(W, V, Y, X, C[P + 11], y, 643717713);
- X = f(X, W, V, Y, C[P + 0], w, 3921069994);
- Y = f(Y, X, W, V, C[P + 5], A, 3593408605);
- V = f(V, Y, X, W, C[P + 10], z, 38016083);
- W = f(W, V, Y, X, C[P + 15], y, 3634488961);
- X = f(X, W, V, Y, C[P + 4], w, 3889429448);
- Y = f(Y, X, W, V, C[P + 9], A, 568446438);
- V = f(V, Y, X, W, C[P + 14], z, 3275163606);
- W = f(W, V, Y, X, C[P + 3], y, 4107603335);
- X = f(X, W, V, Y, C[P + 8], w, 1163531501);
- Y = f(Y, X, W, V, C[P + 13], A, 2850285829);
- V = f(V, Y, X, W, C[P + 2], z, 4243563512);
- W = f(W, V, Y, X, C[P + 7], y, 1735328473);
- X = f(X, W, V, Y, C[P + 12], w, 2368359562);
- Y = D(Y, X, W, V, C[P + 5], o, 4294588738);
- V = D(V, Y, X, W, C[P + 8], m, 2272392833);
- W = D(W, V, Y, X, C[P + 11], l, 1839030562);
- X = D(X, W, V, Y, C[P + 14], j, 4259657740);
- Y = D(Y, X, W, V, C[P + 1], o, 2763975236);
- V = D(V, Y, X, W, C[P + 4], m, 1272893353);
- W = D(W, V, Y, X, C[P + 7], l, 4139469664);
- X = D(X, W, V, Y, C[P + 10], j, 3200236656);
- Y = D(Y, X, W, V, C[P + 13], o, 681279174);
- V = D(V, Y, X, W, C[P + 0], m, 3936430074);
- W = D(W, V, Y, X, C[P + 3], l, 3572445317);
- X = D(X, W, V, Y, C[P + 6], j, 76029189);
- Y = D(Y, X, W, V, C[P + 9], o, 3654602809);
- V = D(V, Y, X, W, C[P + 12], m, 3873151461);
- W = D(W, V, Y, X, C[P + 15], l, 530742520);
- X = D(X, W, V, Y, C[P + 2], j, 3299628645);
- Y = t(Y, X, W, V, C[P + 0], U, 4096336452);
- V = t(V, Y, X, W, C[P + 7], T, 1126891415);
- W = t(W, V, Y, X, C[P + 14], R, 2878612391);
- X = t(X, W, V, Y, C[P + 5], O, 4237533241);
- Y = t(Y, X, W, V, C[P + 12], U, 1700485571);
- V = t(V, Y, X, W, C[P + 3], T, 2399980690);
- W = t(W, V, Y, X, C[P + 10], R, 4293915773);
- X = t(X, W, V, Y, C[P + 1], O, 2240044497);
- Y = t(Y, X, W, V, C[P + 8], U, 1873313359);
- V = t(V, Y, X, W, C[P + 15], T, 4264355552);
- W = t(W, V, Y, X, C[P + 6], R, 2734768916);
- X = t(X, W, V, Y, C[P + 13], O, 1309151649);
- Y = t(Y, X, W, V, C[P + 4], U, 4149444226);
- V = t(V, Y, X, W, C[P + 11], T, 3174756917);
- W = t(W, V, Y, X, C[P + 2], R, 718787259);
- X = t(X, W, V, Y, C[P + 9], O, 3951481745);
- Y = K(Y, h);
- X = K(X, E);
- W = K(W, v);
- V = K(V, g)
- }
- var i = B(Y) + B(X) + B(W) + B(V);
- return i.toLowerCase()
- };
-
- return publicMethods;
-}();
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.certificate.create/create.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.certificate.create/create.hbs
deleted file mode 100644
index b128ceaf92..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.certificate.create/create.hbs
+++ /dev/null
@@ -1,111 +0,0 @@
-{{!
- 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.
-}}
-{{unit "cdmf.unit.ui.title" pageTitle="Add Certificate"}}
-
-{{#zone "breadcrumbs"}}
-
Please note that * sign represents required fields of data.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Certificate was added successfully.
-
- Please click "Add Another Certificate", if you wish to add another certificate or
- click
- "View Certificate List" to complete the process and go back to the certificate list.
-
-
-
-
-
-
-
- Add Another Certificate
-
-
-
-
-
-
-
- {{else}}
-
- Permission Denied
-
-
- You not authorized to enter Certificate Management Section.
-
- {{/if}}
-{{/zone}}
-
-{{#zone "bottomJs"}}
- {{js "/js/certificate-create.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/pages/cdmf.page.certificate.create/create.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.certificate.create/create.js
deleted file mode 100644
index c9a7ab5d00..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.certificate.create/create.js
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright (c) 2018 - 2023, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved.
- *
- * Entgra (Pvt) Ltd. 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.
- */
-
-/**
- * Returns the dynamic state to be populated by add-user page.
- *
- * @param viewModel Object that gets updated with the dynamic state of this page to be presented
- * @returns {*} A viewModel object that returns the dynamic state of this page to be presented
- */
-function onRequest(context) {
- // var log = new Log("units/user-create/create.js");
- var userModule = require("/app/modules/business-controllers/user.js")["userModule"];
- var mdmProps = require("/app/modules/conf-reader/main.js")["conf"];
- var viewModel = {};
- viewModel.isAuthorized = userModule.isAuthorized("/permission/admin/device-mgt/certificates/manage");
- var response = userModule.getRolesByUserStore();
- if (response["status"] == "success") {
- viewModel["roles"] = response["content"];
- }
-
- viewModel["charLimit"] = mdmProps["userValidationConfig"]["usernameLength"];
- viewModel["usernameJSRegEx"] = mdmProps["userValidationConfig"]["usernameJSRegEx"];
- viewModel["usernameHelpText"] = mdmProps["userValidationConfig"]["usernameHelpMsg"];
- viewModel["usernameRegExViolationErrorMsg"] = mdmProps["userValidationConfig"]["usernameRegExViolationErrorMsg"];
- viewModel["firstnameJSRegEx"] = mdmProps["userValidationConfig"]["firstnameJSRegEx"];
- viewModel["firstnameRegExViolationErrorMsg"] = mdmProps["userValidationConfig"]["firstnameRegExViolationErrorMsg"];
- viewModel["lastnameJSRegEx"] = mdmProps["userValidationConfig"]["lastnameJSRegEx"];
- viewModel["lastnameRegExViolationErrorMsg"] = mdmProps["userValidationConfig"]["lastnameRegExViolationErrorMsg"];
-
- return viewModel;
-}
\ No newline at end of file
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.certificate.create/create.json b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.certificate.create/create.json
deleted file mode 100644
index db293d5ab1..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.certificate.create/create.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "version": "1.0.0",
- "uri": "/certificates/add",
- "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/pages/cdmf.page.certificate.create/public/js/certificate-create.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.certificate.create/public/js/certificate-create.js
deleted file mode 100644
index e9a4a53641..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.certificate.create/public/js/certificate-create.js
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- * Copyright (c) 2018 - 2023, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved.
- *
- * Entgra (Pvt) Ltd. 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.
- */
-var pemContent = "";
-var errorMsgWrapper = "#certificate-create-error-msg";
-var errorMsg = "#certificate-create-error-msg span";
-var validateInline = {};
-var clearInline = {};
-
-var base_api_url = "/api/certificate-mgt/v1.0";
-
-var enableInlineError = function (inputField, errorMsg, errorSign) {
- var fieldIdentifier = "#" + inputField;
- var errorMsgIdentifier = "#" + inputField + " ." + errorMsg;
- var errorSignIdentifier = "#" + inputField + " ." + errorSign;
-
- if (inputField) {
- $(fieldIdentifier).addClass(" has-error has-feedback");
- }
-
- if (errorMsg) {
- $(errorMsgIdentifier).removeClass(" hidden");
- }
-
- if (errorSign) {
- $(errorSignIdentifier).removeClass(" hidden");
- }
-};
-
-var disableInlineError = function (inputField, errorMsg, errorSign) {
- var fieldIdentifier = "#" + inputField;
- var errorMsgIdentifier = "#" + inputField + " ." + errorMsg;
- var errorSignIdentifier = "#" + inputField + " ." + errorSign;
-
- if (inputField) {
- $(fieldIdentifier).removeClass(" has-error has-feedback");
- }
-
- if (errorMsg) {
- $(errorMsgIdentifier).addClass(" hidden");
- }
-
- if (errorSign) {
- $(errorSignIdentifier).addClass(" hidden");
- }
-};
-
-function readSingleFile(evt) {
- var f = evt.target.files[0];
- if (f) {
- var r = new FileReader();
- r.onload = function (e) {
- var contents = e.target.result;
- if (f.type == "application/x-x509-ca-cert") {
- pemContent = contents;
- console.log(contents);
- console.log(pemContent);
- pemContent = pemContent.substring(28, pemContent.length - 27);
- console.log(pemContent);
- $(errorMsgWrapper).addClass("hidden");
- } else {
- $(errorMsg).text("Certificate must be a .pem file containing a valid certificate data.");
- $(errorMsgWrapper).removeClass("hidden");
- }
- }
- r.readAsText(f);
- } else {
- //inline error
- }
-}
-
-$(document).ready(function () {
- pemContent = "";
- document.getElementById('certificate').addEventListener('change', readSingleFile, false);
-
- /**
- * Following click function would execute
- * when a user clicks on "Add Certificate" button.
- */
- $("button#add-certificate-btn").click(function () {
- var serialNoInput = $("input#serialNo");
- var serialNo = serialNoInput.val();
- if (!serialNo) {
- $(errorMsg).text("Serial Number is a required field. It cannot be empty.");
- $(errorMsgWrapper).removeClass("hidden");
- } else if (!pemContent) {
- $(errorMsg).text(" .pem file must contains certificate information.");
- $(errorMsgWrapper).removeClass("hidden");
- } else {
- var addCertificateFormData = {};
- addCertificateFormData.serial = serialNo;
- addCertificateFormData.pem = pemContent;
- var certificateList = [];
- certificateList.push(addCertificateFormData);
-
- var serviceUrl = base_api_url + "/admin/certificates";
- invokerUtil.post(
- serviceUrl,
- certificateList,
- function (data) {
- // Refreshing with success message
- $("#certificate-create-form").addClass("hidden");
- $("#certificate-created-msg").removeClass("hidden");
- }, function (data) {
- if (data["status"] == 500) {
- $(errorMsg).text("An unexpected error occurred at backend server. Please try again later.");
- } else {
- $(errorMsg).text(data);
- }
- $(errorMsgWrapper).removeClass("hidden");
- }
- );
- }
- });
-});
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.certificates/certificates.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.certificates/certificates.hbs
deleted file mode 100644
index 276bc83048..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.certificates/certificates.hbs
+++ /dev/null
@@ -1,122 +0,0 @@
-{{!
- 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.
-}}
-{{unit "cdmf.unit.ui.title" pageTitle="Add Certificate"}}
-{{unit "cdmf.unit.ui.modal"}}
-
-{{#zone "breadcrumbs"}}
-
-{{/zone}}
-
-{{#zone "bottomJs"}}
-
-
- {{js "/js/certificate-listing.js"}}
-{{/zone}}
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.certificates/certificates.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.certificates/certificates.js
deleted file mode 100644
index 4cb1e4099f..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.certificates/certificates.js
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright (c) 2018 - 2023, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved.
- *
- * Entgra (Pvt) Ltd. 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.
- */
-
-function onRequest(context) {
- var userModule = require("/app/modules/business-controllers/user.js")["userModule"];
- var mdmProps = require("/app/modules/conf-reader/main.js")["conf"];
- var viewModel = {};
-
-
- if (userModule.isAuthorized("/permission/admin/device-mgt/certificates/manage")) {
- viewModel["removePermitted"] = true;
- }
- if (userModule.isAuthorized("/permission/admin/device-mgt/certificates/view")) {
- viewModel["viewPermitted"] = true;
- }
-
- viewModel.adminUser = mdmProps.adminUser;
- return viewModel;
-}
\ No newline at end of file
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.certificates/certificates.json b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.certificates/certificates.json
deleted file mode 100644
index 39fb7ff01b..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.certificates/certificates.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "version": "1.0.0",
- "uri": "/certificates",
- "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/pages/cdmf.page.certificates/public/js/certificate-listing.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.certificates/public/js/certificate-listing.js
deleted file mode 100644
index 3e73a11999..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.certificates/public/js/certificate-listing.js
+++ /dev/null
@@ -1,201 +0,0 @@
-/*
- * Copyright (c) 2018 - 2023, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved.
- *
- * Entgra (Pvt) Ltd. 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.
- */
-
-/*
- * Sorting function of certificates
- * listed on Certificate Management page in WSO2 MDM Console.
- */
-$(function () {
- var sortableElem = '.wr-sortable';
- $(sortableElem).sortable({
- beforeStop: function () {
- var sortedIDs = $(this).sortable('toArray');
- }
- });
- $(sortableElem).disableSelection();
-});
-
-var modalPopup = ".modal";
-var modalPopupContainer = modalPopup + " .modal-content";
-var modalPopupContent = modalPopup + " .modal-content";
-var body = "body";
-var isInit = true;
-
-var base_api_url = "/api/certificate-mgt/v1.0";
-
-$(".icon .text").res_text(0.2);
-
-/*
- * set popup maximum height function.
- */
-function setPopupMaxHeight() {
- $(modalPopupContent).css('max-height', ($(body).height() - ($(body).height() / 100 * 30)));
- $(modalPopupContainer).css('margin-top', (-($(modalPopupContainer).height() / 2)));
-}
-
-/*
- * show popup function.
- */
-function showPopup() {
- $(modalPopup).modal('show');
-}
-
-/*
- * hide popup function.
- */
-function hidePopup() {
- $(modalPopupContent).html('');
- $(modalPopup).modal('hide');
- $('body').removeClass('modal-open').css('padding-right','0px');
- $('.modal-backdrop').remove();
-}
-
-/**
- * Following click function would execute
- * when a user clicks on "Remove" link
- * on Certificate Listing page in WSO2 MDM Console.
- */
-function removeCertificate(serialNumber) {
- var serviceUrl = base_api_url + "/admin/certificates/" + serialNumber;
- modalDialog.header('Do you really want to remove this certificate ?');
- modalDialog.footer('
-
-{{/each}}
\ No newline at end of file
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.cookie-policy/cookie-policy.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.cookie-policy/cookie-policy.hbs
deleted file mode 100644
index 85fdd17be9..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.cookie-policy/cookie-policy.hbs
+++ /dev/null
@@ -1,172 +0,0 @@
-{{!
- Copyright (c) 2018, 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 "title"}}{{! to override parent page title }}{{/zone}}
-{{unit "cdmf.unit.ui.title" pageTitle="Consent Page"}}
-
-{{#zone "content"}}
-
-
-
-
COOKIE POLICY
-
-
-
About Entgra IoT Server
-
Entgra IoT Server 4.1.0 is a complete solution that enables device manufacturers and enterprises to
- connect and manage their devices, build apps, manage events, secure devices and data, and visualize
- sensor data in a scalable manner.
-
It also offers a complete and secure Enterprise Mobility Management (EMM/MDM) solution that aims to
- address mobile computing challenges faced by enterprises today. Supporting iOS, Android, and Windows
- devices, it helps organizations deal with both Corporate Owned, Personally Enabled (COPE) and
- employee-owned devices with the Bring Your Own Device (BYOD) concept.
-
Entgra IoT Server 4.1.0 comes with advanced analytics, enabling users to analyze speed, proximity,
- and
- geo-fencing information of devices including details of those in motion and stationary state.
-
-
Cookie Policy
-
IoT Server uses cookies to provide you with the best user experience, and to securely identify you.
- You can disable cookies if you so wish . However you might not be able to access some of the services
- if you disable cookies.
-
What is a cookie?
-
A browser cookie is a small piece of data that is stored on your device to help websites and mobile
- apps remember things about you. Other technologies, including Web storage and identifiers associated
- with your device, may be used for similar purposes. In this policy, we use the term “cookies” to
- discuss all of these technologies.
-
How does Entgra IoT Server 4.1.0 process cookies?
-
Entgra IoT Server 4.1.0 uses cookies to store and retrieve information on your browser. This
- information is used to provide a better user experience. Some cookies serve the purpose of allowing a
- user to log in to the system, maintain sessions, and keep track of activities within the login
- session.
-
Some cookies in Entgra IoT Server 4.1.0 are used to personally identify you. However, the cookie
- lifetime ends once your session ends, i.e., after you log-out, or after the session expiry time has
- elapsed.
-
Some cookies are simply used to give you a more personalised web experience, and these cannot be used
- to identify you or your activities personally.
-
This Cookie Policy is part of the IoT Server Privacy Policy.
-
-
What does Entgra IoT Server 4.1.0 use cookies for?
-
Cookies are used for two purposes in Entgra IoT Server 4.1.0.
-
-
To identify you and provide security
-
To provide a satisfying user experience.
-
-
-
Preferences
-
Entgra IoT Server 4.1.0 uses cookies to remember your settings and preferences and to auto-fill the
- fields to make your interactions with the site easier.
-
These cookies can not be used to personally identify you.
-
-
Security
-
-
Entgra IoT Server 4.1.0 uses selected cookies to identify and prevent security risks. For
- example,
- Entgra IoT Server 4.1.0 may use cookies to store your session information to prevent others from
- changing your password without your username and password.
-
-
Entgra IoT Server 4.1.0 uses session cookie to maintain your active session.
-
Entgra IoT Server 4.1.0 may use a temporary cookie when performing multi-factor authentication
- and
- federated authentication.
-
-
Entgra IoT Server 4.1.0 may use permanent cookies to detect the devices you have logged in
- previously. This is to to calculate the risk level associated with your current login
- attempt. Using these cookies protects you and your account from possible attacks.
-
-
-
Performance
-
Entgra IoT Server 4.1.0 may use cookies to allow Remember Me functionalities.
-
Analytics
-
Entgra IoT Server 4.1.0 as a product does not use cookies for analytical purposes.
-
Third party cookies
-
Using Entgra IoT Server 4.1.0 may cause third-party cookie to be set in your browser. Entgra IoT
- Server
- 4.1.0 has no control over how any of them operate. The third-party cookies that maybe set
- include:
-
-
Any social login sites. For example, third-party cookies may be set when Entgra IoT Server 4.1.0
- is configured to use “social” or “federated” login, and you opt to login with your “Social
- Account”.
-
-
Any third party federated login.
-
-
Entgra strongly advises you to refer the respective cookie policies of such sites carefully as Entgra has
- no knowledge or use on these cookies.
-
What type of cookies does Entgra IoT Server 4.1.0 use?
-
Entgra IoT Server 4.1.0 uses persistent cookies and session cookies. A persistent cookie helps
- Entgra IS
- 3.8.0 to recognize you as an existing user so that it is easier to return to Entgra or interact with
- Entgra IS 3.8.0 without signing in again. After you sign in, a persistent cookie stays in your browser
- and will be read by Entgra IoT Server 4.1.0 when you return to Entgra IoT Server 4.1.0.
-
A session cookie is a cookie that is erased when the user closes the Web browser. The session cookie
- is stored in temporarily and is not retained after the browser is closed. Session cookies do not
- collect information from the user’s computer.
-
How do I control my cookies?
-
Most browsers allow you to control cookies through settings. However, if you limit the given ability
- for websites to set cookies, you may worsen your overall user experience since it will no longer be
- personalized to you. It may also stop you from saving customized settings like login information.
- Most likely, disabling cookies will make it unable for you to use authentication and authorization
- functionalities offered by Entgra IoT Server 4.1.0.
-
If you have any questions or concerns regarding the use of cookies, please contact the entity or
- individuals (or their data protection officer, if applicable) running this Entgra IoT Server 4.1.0
- instance.
-
What are the cookies used?
-
-
-
-
Cookie Name
-
Purpose
-
Retention
-
-
-
-
JSESSIONID
-
To keep your session data in order to give you a good user experience.
-
Session
-
-
-
commonAuthId
-
Used to authenticate the the logged in session.
-
Session
-
-
-
samlssoTokenId
-
Used to map the logged in user with the SAML token.
-
Request
-
-
-
requestedURI
-
The URI you are accessing.
-
Session
-
-
-
-
Disclaimer
-
This cookie policy is only for illustrative purposes of the product Entgra IoT Server 4.1.0. The
- content in the policy is technically correct at the time of the product shipment. The
- entity,organization or individual that runs this Entgra IoT Server 4.1.0 instance has full authority
- and responsibility with regard to the effective Cookie Policy. Entgra, its employees, partners, and
- affiliates do not have access to and do not require, store, process or control any of the data,
- including personal data contained in Entgra IoT Server 4.1.0. All data, including personal data is
- controlled and processed by the entity, organization or individual running Entgra IoT Server 4.1.0.
- Entgra, its employees partners and affiliates are not a data processor or a data controller within the
- meaning of any data privacy regulations. Entgra does not provide any warranties or undertake any
- responsibility or liability in connection with the lawfulness or the manner and purposes for which
- Entgra IoT Server 4.1.0 is used by such entities, organizations or persons.
-
-
-
-{{/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/pages/cdmf.page.cookie-policy/cookie-policy.json b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.cookie-policy/cookie-policy.json
deleted file mode 100644
index b531aa0319..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.cookie-policy/cookie-policy.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "version": "1.0.0",
- "layout": "uuf.layout.sign-in",
- "uri": "/cookie-policy",
- "isAnonymous": 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/pages/cdmf.page.dashboard/dashboard.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.dashboard/dashboard.hbs
deleted file mode 100644
index 689312a441..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.dashboard/dashboard.hbs
+++ /dev/null
@@ -1,234 +0,0 @@
-{{!
- 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.
-}}
-{{unit "cdmf.unit.ui.title" pageTitle="Home"}}
-
-{{#zone "breadcrumbs"}}
-
-{{/zone}}
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.dashboard/dashboard.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.dashboard/dashboard.js
deleted file mode 100644
index d61bb67833..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.dashboard/dashboard.js
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright (c) 2018 - 2023, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved.
- *
- * Entgra (Pvt) Ltd. 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.
- */
-
-function onRequest(context) {
- var constants = require("/app/modules/constants.js");
- var userModule = require("/app/modules/business-controllers/user.js")["userModule"];
- var devicemgtProps = require("/app/modules/conf-reader/main.js")["conf"];
- var deviceModule = require("/app/modules/business-controllers/device.js")["deviceModule"];
- var groupModule = require("/app/modules/business-controllers/group.js")["groupModule"];
- var policyModule = require("/app/modules/business-controllers/policy.js")["policyModule"];
-
- if(!session.get(constants["TOKEN_PAIR"])){
- response.sendRedirect(context.app.context + "/welcome");
- return;
- }
-
- var user = session.get(constants["USER_SESSION_KEY"]);
- var permissions = userModule.getUIPermissions();
-
- if (!permissions.VIEW_DASHBOARD) {
- response.sendRedirect(devicemgtProps["appContext"] + "devices");
- return;
- }
-
- var viewModel = {};
- viewModel.permissions = permissions;
- viewModel.enrollmentURL = devicemgtProps.enrollmentURL;
- viewModel.deviceCount = deviceModule.getDevicesCount();
- viewModel.groupCount = groupModule.getGroupCount();
- viewModel.userCount = userModule.getUsersCount();
- viewModel.policyCount = policyModule.getPoliciesCount();
- viewModel.deviceTypeCount = deviceModule.getDeviceTypeCount();
- viewModel.isCloud = devicemgtProps.isCloud;
- if (devicemgtProps.isCloud) {
- viewModel.roleCount = userModule.getFilteredRoles("devicemgt").content.count;
- } else {
- viewModel.roleCount = userModule.getRolesCount();
- }
- return viewModel;
-}
\ No newline at end of file
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.dashboard/dashboard.json b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.dashboard/dashboard.json
deleted file mode 100644
index 9674ea3a9b..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.dashboard/dashboard.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "version": "1.0.0",
- "uri": "/",
- "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/pages/cdmf.page.device.analytics/analytics.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.device.analytics/analytics.hbs
deleted file mode 100644
index f2120857e0..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.device.analytics/analytics.hbs
+++ /dev/null
@@ -1,67 +0,0 @@
-{{!
- 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 "topCss"}}
- {{css "css/analytics.css"}}
-{{/zone}}
-
-{{unit "cdmf.unit.ui.title" pageTitle="Analytics"}}
-{{unit "cdmf.unit.ui.content.title" pageHeader=title}}
-{{unit "cdmf.unit.lib.service-invoker-utility"}}
-{{unit "cdmf.unit.lib.handlebars"}}
-{{unit "cdmf.unit.lib.rickshaw-graph"}}
-
-{{#zone "breadcrumbs"}}
-
-{{/zone}}
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.device.analytics/analytics.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.device.analytics/analytics.js
deleted file mode 100644
index ca0ba7c9d9..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.device.analytics/analytics.js
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright (c) 2018 - 2023, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved.
- *
- * Entgra (Pvt) Ltd. 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.
- */
-
-function onRequest(context) {
- var utility = require("/app/modules/utility.js").utility;
- var deviceType = context.uriParams.deviceType;
- var deviceName = request.getParameter("deviceName");
- var deviceId = request.getParameter("deviceId");
- var unitName = utility.getTenantedDeviceUnitName(deviceType, "analytics-view");
- if (!unitName) {
- unitName = "cdmf.unit.default.device.type.analytics-view";
- }
- return {
- "deviceAnalyticsViewUnitName": unitName,
- "deviceType": deviceType,
- "deviceName": deviceName,
- "deviceId": deviceId
- };
-}
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.device.analytics/analytics.json b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.device.analytics/analytics.json
deleted file mode 100644
index 846ee092b8..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.device.analytics/analytics.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "version": "1.0.0",
- "uri": "/device/{deviceType}/analytics",
- "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/pages/cdmf.page.device.analytics/public/css/analytics.css b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.device.analytics/public/css/analytics.css
deleted file mode 100644
index 5dc50e2fa8..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.device.analytics/public/css/analytics.css
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 2018 - 2023, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved.
- *
- * Entgra (Pvt) Ltd. 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.
- */
-
-#rangeSliderWrapper {
- margin-top: 25px;
-}
-
-#chart {
- display: inline-block;
-}
-
-#legend {
- display: inline-block;
- position: relative;
- left: 8px;
-}
-
-#legend_container {
- position: absolute;
- right: 0;
- bottom: 26px;
- width: 0;
-}
-
-#chart_container {
- float: left;
- position: relative;
-}
-
-.ast-container {
- padding-bottom: 30px;
-}
-
-.container {
- width: auto;
-}
-
-.shrink {
- margin-right: 20px;
- margin-left: 20px;
-}
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.device.enroll/enroll.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.device.enroll/enroll.hbs
deleted file mode 100644
index cab8dffe4a..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.device.enroll/enroll.hbs
+++ /dev/null
@@ -1,66 +0,0 @@
-{{!
- 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.
-}}
-{{unit "cdmf.unit.ui.title" pageTitle="Device Types"}}
-{{unit "cdmf.unit.ui.content.title" pageHeader="Device List"}}
-
-{{unit "cdmf.unit.lib.data-table"}}
-{{unit "cdmf.unit.lib.handlebars"}}
-{{unit "cdmf.unit.lib.service-invoker-utility"}}
-
-{{#zone "breadcrumbs"}}
-
-{{/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/pages/cdmf.page.device.enroll/enroll.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.device.enroll/enroll.js
deleted file mode 100644
index 3c5739ea60..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.device.enroll/enroll.js
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright (c) 2018 - 2023, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved.
- *
- * Entgra (Pvt) Ltd. 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.
- */
-
-/**
- * Returns the dynamic state to be populated by device-enrollment page.
- *
- * @param context Object that gets updated with the dynamic state of this page to be presented
- * @returns {*} A context object that returns the dynamic state of this page to be presented
- */
-function onRequest(context) {
- var devicemgtProps = require("/app/modules/conf-reader/main.js")["conf"];
- var page = {};
- page["isCloud"] = devicemgtProps.isCloud;
- page["contact_form_url"] = "https://cloudmgt.cloud.wso2.com/cloudmgt/site/pages/contact-us.jag?cloud-type=device_cloud&subject=Requesting for a new device type";
- return page;
-}
\ No newline at end of file
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.device.enroll/enroll.json b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.device.enroll/enroll.json
deleted file mode 100644
index 3155ee3cec..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.device.enroll/enroll.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "version": "1.0.0",
- "uri": "/device/enroll",
- "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/pages/cdmf.page.device.search/public/js/bottomJs.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.device.search/public/js/bottomJs.js
deleted file mode 100644
index 7858a3678b..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.device.search/public/js/bottomJs.js
+++ /dev/null
@@ -1,227 +0,0 @@
-/*
- * Copyright (c) 2018 - 2023, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved.
- *
- * Entgra (Pvt) Ltd. 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.
- */
-
-var removeCustomParam = function () {
- $(this).parent().parent().remove();
-};
-
-/**
- * Following function would execute
- * when a user clicks on the list item
- * initial mode and with out select mode.
- */
-function InitiateViewOption() {
- $(location).attr('href', $(this).data("url"));
-}
-
-$("#back-to-search").click(function () {
- $('#advance-search-result').addClass('hidden');
- $("#advance-search-form").removeClass('hidden');
- $("#view-search-param").addClass('hidden');
- $("#back-to-search").addClass('hidden');
-});
-
-$("#view-search-param").click(function () {
- $("#advance-search-form").removeClass('hidden');
- $(".title-result").addClass('hidden');
- $("#view-search-param").addClass('hidden');
-});
-
-var dynamicForm = '
-
-
-{{/zone}}
-{{#zone "bottomJs"}}
- {{js "/js/bottomJs.js"}}
-
-{{/zone}}
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.device.search/search.json b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.device.search/search.json
deleted file mode 100644
index c202f579cf..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.device.search/search.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "version": "1.0.0",
- "uri": "/devices/search",
- "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/pages/cdmf.page.device.type.view/view.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.device.type.view/view.hbs
deleted file mode 100644
index 70c449653c..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.device.type.view/view.hbs
+++ /dev/null
@@ -1,58 +0,0 @@
-{{!
- 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.
-}}
-{{unit "cdmf.unit.ui.title" pageTitle="Device"}}
-{{! unit "cdmf.unit.ui.content.title" pageHeader="Device Download"}}
-
-{{unit "cdmf.unit.data-tables-extended"}}
-{{unit "cdmf.unit.lib.handlebars"}}
-{{unit "cdmf.unit.lib.service-invoker-utility"}}
-
-{{#zone "breadcrumbs"}}
-
- {{! dynamically resolves device type-view unit according to deviceType URI param }}
- {{unit deviceTypeViewUnitName}}
-
-
-
-{{/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/pages/cdmf.page.device.type.view/view.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.device.type.view/view.js
deleted file mode 100644
index 981126bbb3..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.device.type.view/view.js
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright (c) 2018 - 2023, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved.
- *
- * Entgra (Pvt) Ltd. 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.
- */
-
-function onRequest(context) {
- /**
- * {{#itr context}}key : {{key}} value : {{value}}{{/itr}}
- */
- context.handlebars.registerHelper("itr", function (obj, options) {
- var key, buffer = '';
- for (key in obj) {
- if (obj.hasOwnProperty(key)) {
- buffer += options.fn({key: key, value: obj[key]});
- }
- }
- return buffer;
- });
-
- var utility = require("/app/modules/utility.js").utility;
- var deviceType = context.uriParams.deviceType;
- var configs = utility.getDeviceTypeConfig(deviceType);
- var label = deviceType;
- if (configs) {
- label = configs["deviceType"]["label"];
- }
- var unitName = utility.getTenantedDeviceUnitName(deviceType, "type-view");
- if (!unitName) {
- unitName = "cdmf.unit.default.device.type.type-view";
- }
- return {
- "deviceTypeViewUnitName": unitName,
- "deviceType": deviceType,
- "label" : label
- };
-}
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.device.type.view/view.json b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.device.type.view/view.json
deleted file mode 100644
index dd1754fc08..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.device.type.view/view.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "version": "1.0.0",
- "uri": "/device/{deviceType}/enroll",
- "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/pages/cdmf.page.device.view/view.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.device.view/view.hbs
deleted file mode 100644
index 1a58360409..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.device.view/view.hbs
+++ /dev/null
@@ -1,46 +0,0 @@
-{{!
- 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.
-}}
-{{unit "cdmf.unit.ui.title" pageTitle="Device Details"}}
-{{unit "cdmf.unit.lib.service-invoker-utility"}}
-{{unit "cdmf.unit.lib.handlebars"}}
-
-
-{{#zone "breadcrumbs"}}
-
-{{/zone}}
-
-{{#zone "content"}}
- {{unit deviceViewUnitName}}
- {{unit "cdmf.unit.lib.data-table"}}
- {{unit "cdmf.unit.device.operation-mod"}}
- {{unit "cdmf.unit.device.view"}}
-{{/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/pages/cdmf.page.device.view/view.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.device.view/view.js
deleted file mode 100644
index 13f1c108ec..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.device.view/view.js
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (c) 2018 - 2023, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved.
- *
- * Entgra (Pvt) Ltd. 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.
- */
-
-function onRequest(context){
- var utility = require("/app/modules/utility.js").utility;
- context.handlebars.registerHelper('equal', function (lvalue, rvalue, options) {
- if (arguments.length < 3)
- throw new Error("Handlebars Helper equal needs 2 parameters");
- if( lvalue!=rvalue ) {
- return options.inverse(this);
- } else {
- return options.fn(this);
- }
- });
-
- var deviceType = context.uriParams.deviceType;
- var unitName = utility.getTenantedDeviceUnitName(deviceType, "device-view");
- if (!unitName) {
- unitName = "cdmf.unit.default.device.type.device-view";
- }
- return {"deviceViewUnitName": unitName};
-}
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.device.view/view.json b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.device.view/view.json
deleted file mode 100644
index 614f89ba43..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.device.view/view.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "version": "1.0.0",
- "uri": "/device/{deviceType}",
- "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/pages/cdmf.page.devicelocations/devicelocations.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devicelocations/devicelocations.hbs
deleted file mode 100644
index 0dd4d4016e..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devicelocations/devicelocations.hbs
+++ /dev/null
@@ -1,35 +0,0 @@
-{{!
- 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.
-}}
-{{unit "cdmf.unit.ui.title" pageTitle="Device Location"}}
-
-{{#zone "breadcrumbs"}}
-
-{{/zone}}
-
-{{#zone "content"}}
- {{unit "cdmf.unit.geo-devices"}}
-{{/zone}}
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devicelocations/devicelocations.json b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devicelocations/devicelocations.json
deleted file mode 100644
index 5021ee3906..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devicelocations/devicelocations.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "version": "1.0.0",
- "uri": "/device-locations",
- "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/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
deleted file mode 100644
index 3a12ea975e..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devices/devices.hbs
+++ /dev/null
@@ -1,760 +0,0 @@
-{{!
- 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.
-}}
-
-{{!
- Copyright (c) 2019, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved.
-
- Entgra (Pvt) Ltd. 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.
-}}
-{{unit "cdmf.unit.ui.title" pageTitle="Device Management"}}
-
-{{unit "cdmf.unit.data-tables-extended"}}
-{{unit "cdmf.unit.lib.ui-permissions-utility"}}
-
-{{#zone "breadcrumbs"}}
-
- You don't have any
- {{#if group}}
- devices assigned to this group. Let's add a device!
- {{else}}
- enrolled devices. Let's enroll a device!
- {{/if}}
-
-
- {{#if group}}
- Do you really want to remove this device(s) from '{{group.name}}' group?
- {{else}}
- Do you really want to remove this device(s) from your Devices?
- {{/if}}
-
- {{#if group}}
- Do you really want to permanently delete this device(s) from '{{group.name}}' group?
- {{else}}
- Do you really want to permanently delete this device(s) from your Devices?
- {{/if}}
-
- "View Device Type List" to complete the process and go back to the devie type list.
-
-
-
-
-
-
-
-
-
-
-
Device Type Updated
-
-
-
One fine body…
-
-
-
-
-
-
-
-
-
-
-
Device Type Update Failed
-
-
-
One fine body…
-
-
-
-
-
-
-
-
-
-
-
- {{else}}
-
- Permission Denied
-
-
- You not authorized to create device type.
-
- {{/if}}
-{{/zone}}
-
-{{#zone "bottomJs"}}
- {{js "js/bottomJs.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/pages/cdmf.page.devicetype.create/create.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devicetype.create/create.js
deleted file mode 100644
index 163141cbc0..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devicetype.create/create.js
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Copyright (c) 2018 - 2023, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved.
- *
- * Entgra (Pvt) Ltd. 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.
- */
-
-function onRequest(context) {
- var userModule = require("/app/modules/business-controllers/user.js")["userModule"];
- var deviceMgtProps = require("/app/modules/conf-reader/main.js")["conf"];
- var displayData = {};
-
- if (userModule.isAuthorized("/permission/admin/device-mgt/admin/device-type")) {
- displayData.canManage = true;
- }
-
- return displayData;
-}
\ No newline at end of file
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devicetype.create/create.json b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devicetype.create/create.json
deleted file mode 100644
index 0de47dfc78..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devicetype.create/create.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "version": "1.0.0",
- "uri": "/device-type/add",
- "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/pages/cdmf.page.devicetype.create/public/css/devicetype.css b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devicetype.create/public/css/devicetype.css
deleted file mode 100644
index 01233a0851..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devicetype.create/public/css/devicetype.css
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (c) 2018 - 2023, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved.
- *
- * Entgra (Pvt) Ltd. 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.
- */
-
-.wr-btn-horizontal{
- padding: 7px 10px;
-}
-
-.dontfloat {
- clear:both;
-}
-
-.hidden-div {
- display: none;
-}
-
-.feature-wrapper{
- margin-top: 10px;
-}
-
-.wr-btn-secondary{
- background-color: #617d8b;
-}
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devicetype.create/public/js/bottomJs.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devicetype.create/public/js/bottomJs.js
deleted file mode 100644
index 18022238fc..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devicetype.create/public/js/bottomJs.js
+++ /dev/null
@@ -1,243 +0,0 @@
-/*
- * Copyright (c) 2018 - 2023, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved.
- *
- * Entgra (Pvt) Ltd. 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.
- */
-
-/**
- * Checks if provided input is valid against RegEx input.
- *
- * @param regExp Regular expression
- * @param inputString Input string to check
- * @returns {boolean} Returns true if input matches RegEx
- */
-function inputIsValid(regExp, inputString) {
- regExp = new RegExp(regExp);
- return regExp.test(inputString);
-}
-
-var validateInline = {};
-var clearInline = {};
-
-var apiBasePath = "/api/device-mgt/v1.0";
-
-
-var enableInlineError = function (inputField, errorMsg, errorSign) {
- var fieldIdentifier = "#" + inputField;
- var errorMsgIdentifier = "#" + inputField + " ." + errorMsg;
- var errorSignIdentifier = "#" + inputField + " ." + errorSign;
-
- if (inputField) {
- $(fieldIdentifier).addClass(" has-error has-feedback");
- }
-
- if (errorMsg) {
- $(errorMsgIdentifier).removeClass(" hidden");
- }
-
- if (errorSign) {
- $(errorSignIdentifier).removeClass(" hidden");
- }
-};
-
-var disableInlineError = function (inputField, errorMsg, errorSign) {
- var fieldIdentifier = "#" + inputField;
- var errorMsgIdentifier = "#" + inputField + " ." + errorMsg;
- var errorSignIdentifier = "#" + inputField + " ." + errorSign;
-
- if (inputField) {
- $(fieldIdentifier).removeClass(" has-error has-feedback");
- }
-
- if (errorMsg) {
- $(errorMsgIdentifier).addClass(" hidden");
- }
-
- if (errorSign) {
- $(errorSignIdentifier).addClass(" hidden");
- }
-};
-
-
-function formatRepo(user) {
- if (user.loading) {
- return user.text
- }
- if (!user.username) {
- return;
- }
- var markup = '
- "View Device Type List" to complete the process and go back to the devie type list.
-
-
-
-
-
-
-
-
-
-
Device Type Definition Updated
-
-
-
-
-
-
-
-
-
-
- {{else}}
-
- Permission Denied
-
-
- You not authorized to edit device type.
-
- {{/if}}
-{{/zone}}
-
-{{#zone "bottomJs"}}
- {{js "js/bottomJs.js"}}
-{{/zone}}
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devicetype.edit/edit.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devicetype.edit/edit.js
deleted file mode 100644
index 5e6deb2198..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devicetype.edit/edit.js
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright (c) 2018 - 2023, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved.
- *
- * Entgra (Pvt) Ltd. 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.
- */
-
-function onRequest(context) {
- var userModule = require("/app/modules/business-controllers/user.js")["userModule"];
- var deviceMgtProps = require("/app/modules/conf-reader/main.js")["conf"];
- var displayData = {};
-
-
- if (userModule.isAuthorized("/permission/admin/device-mgt/admin/device-type")) {
- displayData.canManage = true;
- }
- context.handlebars.registerHelper('if_eq', function(a, b, opts) {
- if(a == b) // Or === depending on your needs
- return opts.fn(this);
- else
- return opts.inverse(this);
- });
-
- var deviceType = request.getParameter("type");
- var serviceInvokers = require("/app/modules/oauth/token-protected-service-invokers.js")["invokers"];
- var restAPIEndpoint = deviceMgtProps["httpsURL"] + devicemgtProps["backendRestEndpoints"]["deviceMgt"]
- + "/device-types/" + deviceType;
- displayData.name = deviceType;
- serviceInvokers.XMLHttp.get(
- restAPIEndpoint,
- function (restAPIResponse) {
- if (restAPIResponse["status"] == 200 && restAPIResponse["responseText"]) {
- var typeData = parse(restAPIResponse["responseText"]);
- displayData.type = typeData;
-
- }
- }
- );
-
- return displayData;
-}
\ No newline at end of file
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devicetype.edit/edit.json b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devicetype.edit/edit.json
deleted file mode 100644
index 26088b9d86..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devicetype.edit/edit.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "version": "1.0.0",
- "uri": "/device-type/edit",
- "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/pages/cdmf.page.devicetype.edit/public/css/devicetype.css b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devicetype.edit/public/css/devicetype.css
deleted file mode 100644
index 25203e2b1c..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devicetype.edit/public/css/devicetype.css
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright (c) 2018 - 2023, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved.
- *
- * Entgra (Pvt) Ltd. 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.
- */
-
-.wr-btn-horizontal{
- padding: 7px 10px;
-}
-
-.dontfloat {
- clear:both;
-}
-
-.hidden-div {
- display: none;
-}
-
-.hidden-input {
- display: none;
-}
-
-.feature-wrapper{
- margin-top: 10px;
-}
-.wr-btn-secondary{
- background-color: #617d8b;
-}
-.wr-btn-secondary{
- background-color: #617d8b;
-}
\ No newline at end of file
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devicetype.edit/public/js/bottomJs.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devicetype.edit/public/js/bottomJs.js
deleted file mode 100644
index a388654574..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devicetype.edit/public/js/bottomJs.js
+++ /dev/null
@@ -1,257 +0,0 @@
-/*
- * Copyright (c) 2018 - 2023, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved.
- *
- * Entgra (Pvt) Ltd. 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.
- */
-
-/**
- * Checks if provided input is valid against RegEx input.
- *
- * @param regExp Regular expression
- * @param inputString Input string to check
- * @returns {boolean} Returns true if input matches RegEx
- */
-function inputIsValid(regExp, inputString) {
- regExp = new RegExp(regExp);
- return regExp.test(inputString);
-}
-
-var validateInline = {};
-var clearInline = {};
-
-var apiBasePath = "/api/device-mgt/v1.0";
-var domain = $("#domain").val();
-
-
-var enableInlineError = function (inputField, errorMsg, errorSign) {
- var fieldIdentifier = "#" + inputField;
- var errorMsgIdentifier = "#" + inputField + " ." + errorMsg;
- var errorSignIdentifier = "#" + inputField + " ." + errorSign;
-
- if (inputField) {
- $(fieldIdentifier).addClass(" has-error has-feedback");
- }
-
- if (errorMsg) {
- $(errorMsgIdentifier).removeClass(" hidden");
- }
-
- if (errorSign) {
- $(errorSignIdentifier).removeClass(" hidden");
- }
-};
-
-var disableInlineError = function (inputField, errorMsg, errorSign) {
- var fieldIdentifier = "#" + inputField;
- var errorMsgIdentifier = "#" + inputField + " ." + errorMsg;
- var errorSignIdentifier = "#" + inputField + " ." + errorSign;
-
- if (inputField) {
- $(fieldIdentifier).removeClass(" has-error has-feedback");
- }
-
- if (errorMsg) {
- $(errorMsgIdentifier).addClass(" hidden");
- }
-
- if (errorSign) {
- $(errorSignIdentifier).addClass(" hidden");
- }
-};
-
-function formatRepo(user) {
- if (user.loading) {
- return user.text
- }
- if (!user.username) {
- return;
- }
- var markup = '
- "View Device Type List" to complete the process and go back to the devie type list.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Successfully Deployed Event Definition
-
-
-
-
-
-
- {{else}}
-
- Permission Denied
-
-
- You not authorized to edit device type.
-
- {{/if}}
-{{/zone}}
-
-{{#zone "bottomJs"}}
- {{js "js/bottomJs.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/pages/cdmf.page.devicetype.event.edit/edit.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devicetype.event.edit/edit.js
deleted file mode 100644
index 3945f57686..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devicetype.event.edit/edit.js
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 2018 - 2023, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved.
- *
- * Entgra (Pvt) Ltd. 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.
- */
-
-function onRequest(context) {
- var userModule = require("/app/modules/business-controllers/user.js")["userModule"];
- var deviceMgtProps = require("/app/modules/conf-reader/main.js")["conf"];
- var displayData = {};
-
-
- if (userModule.isAuthorized("/permission/admin/device-mgt/admin/device-type")) {
- displayData.canManage = true;
- }
- context.handlebars.registerHelper('selected', function(a, b, opts) {
- if(a == b) // Or === depending on your needs
- return "selected";
- else
- return "";
- });
-
- var deviceType = request.getParameter("type");
- var serviceInvokers = require("/app/modules/oauth/token-protected-service-invokers.js")["invokers"];
- var restAPIEndpoint = deviceMgtProps["httpsURL"] + devicemgtProps["backendRestEndpoints"]["deviceMgt"]
- + "/events/" + deviceType;
- displayData.name = deviceType;
- serviceInvokers.XMLHttp.get(
- restAPIEndpoint,
- function (restAPIResponse) {
- if (restAPIResponse["status"] == 200 && restAPIResponse["responseText"]) {
- var typeData = parse(restAPIResponse["responseText"]);
- displayData.event = typeData;
- }
- }
- );
-
- return displayData;
-}
\ No newline at end of file
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devicetype.event.edit/edit.json b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devicetype.event.edit/edit.json
deleted file mode 100644
index 9e773121e5..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devicetype.event.edit/edit.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "version": "1.0.0",
- "uri": "/device-type/edit-event",
- "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/pages/cdmf.page.devicetype.event.edit/public/css/devicetype.css b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devicetype.event.edit/public/css/devicetype.css
deleted file mode 100644
index 30c7b95769..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devicetype.event.edit/public/css/devicetype.css
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright (c) 2018 - 2023, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved.
- *
- * Entgra (Pvt) Ltd. 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.
- */
-
-
-
-.dontfloat {
- clear:both;
-}
-
-.hidden-div {
- display: none;
-}
-
-.hidden-input {
- display: none;
-}
-
-.event-wrapper{
- margin-top: 10px;
-}
-
-.wr-btn-horizontal{
- padding: 7px 10px;
-}
-
-.wr-btn-secondary{
- background-color: #617d8b;
-}
\ No newline at end of file
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devicetype.event.edit/public/js/bottomJs.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devicetype.event.edit/public/js/bottomJs.js
deleted file mode 100644
index 46cd46a361..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devicetype.event.edit/public/js/bottomJs.js
+++ /dev/null
@@ -1,181 +0,0 @@
-/*
- * Copyright (c) 2018 - 2023, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved.
- *
- * Entgra (Pvt) Ltd. 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.
- */
-
-/**
- * Checks if provided input is valid against RegEx input.
- *
- * @param regExp Regular expression
- * @param inputString Input string to check
- * @returns {boolean} Returns true if input matches RegEx
- */
-function inputIsValid(regExp, inputString) {
- regExp = new RegExp(regExp);
- return regExp.test(inputString);
-}
-
-var validateInline = {};
-var clearInline = {};
-
-var apiBasePath = "/api/device-mgt/v1.0";
-var domain = $("#domain").val();
-
-
-var enableInlineError = function (inputField, errorMsg, errorSign) {
- var fieldIdentifier = "#" + inputField;
- var errorMsgIdentifier = "#" + inputField + " ." + errorMsg;
- var errorSignIdentifier = "#" + inputField + " ." + errorSign;
-
- if (inputField) {
- $(fieldIdentifier).addClass(" has-error has-feedback");
- }
-
- if (errorMsg) {
- $(errorMsgIdentifier).removeClass(" hidden");
- }
-
- if (errorSign) {
- $(errorSignIdentifier).removeClass(" hidden");
- }
-};
-
-var disableInlineError = function (inputField, errorMsg, errorSign) {
- var fieldIdentifier = "#" + inputField;
- var errorMsgIdentifier = "#" + inputField + " ." + errorMsg;
- var errorSignIdentifier = "#" + inputField + " ." + errorSign;
-
- if (inputField) {
- $(fieldIdentifier).removeClass(" has-error has-feedback");
- }
-
- if (errorMsg) {
- $(errorMsgIdentifier).addClass(" hidden");
- }
-
- if (errorSign) {
- $(errorSignIdentifier).addClass(" hidden");
- }
-};
-
-function formatRepo(user) {
- if (user.loading) {
- return user.text
- }
- if (!user.username) {
- return;
- }
- var markup = '
';
- return markup;
-}
-
-function formatRepoSelection(user) {
- return user.username || user.text;
-}
-
-
-
-$(document).ready(function () {
-
- var appContext = $("#app-context").data("app-context");
- var addEventButton = $('.add_event_button'); //Add button selector
- var eventWrapper = $('.event_field_wrapper'); //Input field wrapper
- $(addEventButton).click(function(){ //Once add button is clicked
- var eventFieldHtml = '
' +
- '
' +
- '
' +
- '
'
- $(eventWrapper).append(eventFieldHtml); // Add field html
-
- });
- $(eventWrapper).on('click', '.remove_event_button', function(e){ //Once remove button is clicked
- e.preventDefault();
- $(this).parent('div').remove();
- });
-
- /**
- * Following click function would execute
- * when a user clicks on "Add Device type" button.
- */
- $("button#add-event-btn").click(function () {
-
- var errorMsgWrapper = "#devicetype-create-error-msg";
- var errorMsg = "#devicetype-create-error-msg span";
- var successMsgWrapper = "#devicetype-create-success-msg";
- var successMsg = "#devicetype-create-success-msg span";
- var deviceTypeEvent = {};
- var deviceTypeName = $("#deviceTypeName").val();
- var deviceTypeDescription = $("#deviceTypeDescription").val();
- if (!deviceTypeName || deviceTypeName.trim() == "" ) {
- $(errorMsg).text("Device Type Name Cannot be empty.");
- $(errorMsgWrapper).removeClass("hidden");
- return;
- }
-
-
- deviceTypeEvent.eventAttributes = {};
-
- deviceTypeEvent.transport = $("#transport").val();
-
- var attributes = [];
- $('div[name^="deviceEvent"]').each(function() {
- var eventName = $(this).find("#event-name").val();
- var eventType = $(this).find("#event-type").val();
- if (eventName && eventName.trim() != "" && eventType && eventType.trim() != "" && eventName != "deviceId") {
- var attribute = {};
- attribute.name = eventName.trim();
- attribute.type = eventType.trim();
- attributes.push(attribute);
- }
- });
- deviceTypeEvent.eventAttributes.attributes = attributes;
-
- var addEventsAPI = apiBasePath + "/events/" + deviceTypeName;
-
- invokerUtil.post(
- addEventsAPI,
- deviceTypeEvent,
- function (data, textStatus, jqXHR) {
- if (jqXHR.status == 200) {
- $("#modalDevice").modal('show');
- }
- },
- function (jqXHR) {
- if (jqXHR.status == 500) {
- $(errorMsg).text("Failed to deploy event definition, Please Contact Administrator");
- $(errorMsgWrapper).removeClass("hidden");
- }
-
- if (jqXHR.status == 409) {
- $(errorMsg).text("Device type definition cannot be updated");
- $(errorMsgWrapper).removeClass("hidden");
- }
- }
- );
- });
-
-
-
-});
\ No newline at end of file
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devicetypes/devicetypes.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devicetypes/devicetypes.hbs
deleted file mode 100644
index e59b248e4f..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devicetypes/devicetypes.hbs
+++ /dev/null
@@ -1,114 +0,0 @@
-{{!
- 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.
-}}
-
-{{unit "cdmf.unit.ui.title" pageTitle="Device Type Management"}}
-{{unit "cdmf.unit.data-tables-extended"}}
-{{unit "cdmf.unit.ui.modal"}}
-
-{{#zone "topCss"}}
- {{css "css/custom.css"}}
-{{/zone}}
-
-{{#zone "breadcrumbs"}}
-
-
- {{/if}}
-{{/zone}}
-
-{{#zone "bottomJs"}}
-
-
- {{js "js/devicetype-listing.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/pages/cdmf.page.devicetypes/devicetypes.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devicetypes/devicetypes.js
deleted file mode 100644
index e83b53d265..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devicetypes/devicetypes.js
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright (c) 2018 - 2023, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved.
- *
- * Entgra (Pvt) Ltd. 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.
- */
-
-function onRequest(context) {
- var deviceModule = require("/app/modules/business-controllers/device.js")["deviceModule"];
- var deviceMgtProps = require("/app/modules/conf-reader/main.js")["conf"];
-
- context["permissions"] = userModule.getUIPermissions();
- if (userModule.isAuthorized("/permission/admin/device-mgt/admin/device-type")) {
- context["editPermitted"] = true;
- }
- var deviceTypeCount = deviceModule.getDeviceTypeCount();
-
- if (deviceTypeCount > 0) {
- context["hasDeviceTypes"] = true;
- } else {
- context["hasDeviceTypes"] = false;
- }
-
- return context;
-}
\ No newline at end of file
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devicetypes/devicetypes.json b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devicetypes/devicetypes.json
deleted file mode 100644
index 4dfd684380..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devicetypes/devicetypes.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "version": "1.0.0",
- "uri": "/device-types",
- "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/pages/cdmf.page.devicetypes/public/css/custom.css b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devicetypes/public/css/custom.css
deleted file mode 100644
index e7d3595bec..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devicetypes/public/css/custom.css
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Copyright (c) 2018 - 2023, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved.
- *
- * Entgra (Pvt) Ltd. 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.
- */
-
-#devicetype-table .dataTablesTop{
- Display : none;
-}
\ No newline at end of file
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devicetypes/public/js/devicetype-listing.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devicetypes/public/js/devicetype-listing.js
deleted file mode 100644
index e2002277c3..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devicetypes/public/js/devicetype-listing.js
+++ /dev/null
@@ -1,207 +0,0 @@
-/*
- * Copyright (c) 2018 - 2023, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved.
- *
- * Entgra (Pvt) Ltd. 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.
- */
-
-var loadDeviceTypeBasedActionURL = function (action, deviceTypeName) {
- href = $("#ast-container").data("app-context") + "device-type/" + action + "?type=" + encodeURIComponent(deviceTypeName);
- $(location).attr('href', href);
-};
-
-$(function () {
- var sortableElem = '.wr-sortable';
- $(sortableElem).sortable({
- beforeStop: function () {
- $(this).sortable('toArray');
- }
- });
- $(sortableElem).disableSelection();
-});
-
-var apiBasePath = "/api/device-mgt/v1.0";
-var modalPopup = ".modal";
-var modalPopupContainer = modalPopup + " .modal-content";
-var modalPopupContent = modalPopup + " .modal-content";
-var body = "body";
-var isInit = true;
-var isCloud = false;
-
-
-/**
- *
- * Fires the res_text when ever a data table redraw occurs making
- * the font icons change the size to respective screen resolution.
- *
- */
-$(document).on('draw.dt', function () {
- $(".icon .text").res_text(0.2);
-});
-
-
-/*
- * set popup maximum height function.
- */
-function setPopupMaxHeight() {
- $(modalPopupContent).css('max-height', ($(body).height() - ($(body).height() / 100 * 30)));
- $(modalPopupContainer).css('margin-top', (-($(modalPopupContainer).height() / 2)));
-}
-
-/*
- * show popup function.
- */
-function showPopup() {
- $(modalPopup).modal('show');
- //setPopupMaxHeight();
-}
-
-/*
- * hide popup function.
- */
-function hidePopup() {
- $(modalPopupContent).html('');
- $(modalPopup).modal('hide');
- $('body').removeClass('modal-open').css('padding-right', '0px');
- $('.modal-backdrop').remove();
-}
-
-
-/**
- * Following function would execute
- * when a user clicks on the list item
- * initial mode and with out select mode.
- */
-function InitiateViewOption() {
- // $(location).attr('href', $(this).data("url"));
-}
-
-function htmlspecialchars(text) {
- return jQuery('').text(text).html();
-}
-
-function loadDeviceTypes() {
- var loadingContent = $("#loading-content");
- loadingContent.show();
-
- var dataFilter = function (data) {
- data = JSON.parse(data);
- var objects = [];
- $(data).each(function (index) {
- objects.push(
- {
- name: htmlspecialchars(data[index].name),
- DT_RowId: "devicetype-" + htmlspecialchars(data[index].name),
- metaDefinition: (data[index].deviceTypeMetaDefinition ? true : false)
- }
- )
- });
-
- var json = {
- "recordsTotal": data.length,
- "recordsFiltered": data.length,
- "data": objects
- };
-
- return JSON.stringify(json);
- };
-
- //noinspection JSUnusedLocalSymbols
- var fnCreatedRow = function (nRow, aData, iDataIndex) {
- $(nRow).attr('data-type', 'selectable');
- };
-
- //noinspection JSUnusedLocalSymbols
- var columns = [
- {
- class: "remove-padding content-fill",
- data: null,
- defaultContent: "
-{{/each}}
\ No newline at end of file
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.effective-policy.view/view.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.effective-policy.view/view.hbs
deleted file mode 100644
index c8c9b5e23c..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.effective-policy.view/view.hbs
+++ /dev/null
@@ -1,44 +0,0 @@
-{{!
- 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.
-}}
-
-{{unit "cdmf.unit.ui.title" pageTitle="Policy Management | View Policy"}}
-
-{{#zone "breadcrumbs"}}
-
-{{/zone}}
-
-{{#zone "content"}}
- {{unit "cdmf.unit.device.operation-mod"}}
- {{unit "cdmf.unit.effective-policy.view"}}
- {{unit "cdmf.unit.lib.data-table"}}
-{{/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/pages/cdmf.page.effective-policy.view/view.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.effective-policy.view/view.js
deleted file mode 100644
index 9293982898..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.effective-policy.view/view.js
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Copyright (c) 2018 - 2023, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved.
- *
- * Entgra (Pvt) Ltd. 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.
- */
-
-function onRequest(context) {
- var utility = require("/app/modules/utility.js")["utility"];
- var deviceType = context.uriParams.deviceType;
- var deviceId = context.uriParams.deviceId;
- return {"deviceTypePolicyView": utility.getTenantedDeviceUnitName(deviceType, deviceId,"policy-view")};
-}
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.effective-policy.view/view.json b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.effective-policy.view/view.json
deleted file mode 100644
index ec79d2b203..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.effective-policy.view/view.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "version": "1.0.0",
- "uri": "/policy/effective-policy/",
- "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/pages/cdmf.page.error/error.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.error/error.hbs
deleted file mode 100644
index a1a620b4b8..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.error/error.hbs
+++ /dev/null
@@ -1,22 +0,0 @@
-{{!
- 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 "title"}}Error | {{@app.conf.appName}}{{/zone}}
-
-{{#zone "messageDescription"}}
- {{@page.params.status}} - {{@page.params.message}}
-{{/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/pages/cdmf.page.error/error.json b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.error/error.json
deleted file mode 100644
index adad4c3291..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.error/error.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "version": "1.0.0",
- "uri": "/errors/default",
- "layout" : "cdmf.layout.error"
-}
\ No newline at end of file
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.group.analytics/analytics.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.group.analytics/analytics.hbs
deleted file mode 100644
index 8b81fdd212..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.group.analytics/analytics.hbs
+++ /dev/null
@@ -1,84 +0,0 @@
-{{!
- 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 "topCss"}}
- {{css "css/analytics.css"}}
-{{/zone}}
-
-{{unit "cdmf.unit.ui.title" pageTitle="Analytics"}}
-{{unit "cdmf.unit.ui.content.title" pageHeader=title}}
-{{unit "cdmf.unit.lib.service-invoker-utility"}}
-{{unit "cdmf.unit.lib.handlebars"}}
-{{unit "cdmf.unit.lib.rickshaw-graph"}}
-
-{{#zone "breadcrumbs"}}
-
-{{/zone}}
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.group.analytics/analytics.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.group.analytics/analytics.js
deleted file mode 100644
index 2436a3495d..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.group.analytics/analytics.js
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Copyright (c) 2018 - 2023, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved.
- *
- * Entgra (Pvt) Ltd. 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.
- */
-
-function onRequest(context) {
- var utility = require("/app/modules/utility.js").utility;
- var groupModule = require("/app/modules/business-controllers/group.js")["groupModule"];
- var groupId = context.uriParams.id;
- var group = groupModule.getGroup(groupId);
- var devices = [];
- var deviceResponse = groupModule.getGroupDevices(groupId).responseText;
-
- if(deviceResponse != null) {
- var deviceResponseObj = parse(deviceResponse);
- devices = deviceResponseObj.devices;
- }
- var page = {
- "groupId": groupId,
- "groupName": group.name,
- "title": group.name + " Analytics"
- };
- if (devices) {
- var deviceTypes = [];
- for (var i = 0; i < devices.length; i++) {
- var hasDeviceType = false;
- for (var j = 0; j < deviceTypes.length; j++) {
- if (deviceTypes[j].type === devices[i].type) {
- deviceTypes[j].devices.push(devices[i]);
- hasDeviceType = true;
- break;
- }
- }
- if (!hasDeviceType) {
- var deviceType = {};
- deviceType.type = devices[i].type;
- deviceType.devices = [];
- deviceType.devices.push(devices[i]);
- deviceType.deviceAnalyticsViewUnitName = utility.getTenantedDeviceUnitName(deviceType.type, "analytics-view");
- deviceTypes.push(deviceType);
- }
- }
- page.deviceTypes = deviceTypes;
- page.devices = devices;
- }
-
- return page;
-}
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.group.analytics/analytics.json b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.group.analytics/analytics.json
deleted file mode 100644
index 8535dab982..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.group.analytics/analytics.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "version": "1.0.0",
- "uri": "/group/{id}/analytics",
- "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/pages/cdmf.page.group.analytics/public/css/analytics.css b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.group.analytics/public/css/analytics.css
deleted file mode 100644
index 99514d0545..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.group.analytics/public/css/analytics.css
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Copyright (c) 2018 - 2023, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved.
- *
- * Entgra (Pvt) Ltd. 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.
- */
-
-#rangeSliderWrapper {
- margin-top: 25px;
-}
-
-#chart {
- display: inline-block;
-}
-
-#legend {
- display: inline-block;
- position: relative;
- left: 8px;
-}
-
-#legend_container {
- position: absolute;
- right: 0;
- bottom: 26px;
- width: 0;
-}
-
-#chart_container {
- float: left;
- position: relative;
-}
-
-.ast-container {
- padding-bottom: 30px;
-}
-
-.container {
- width: auto;
-}
-
-.shrink {
- margin-right: 20px;
- margin-left: 20px;
-}
-.date-range{
- border: 1px solid #ccc;
-}
-
-#dateRangePickerContainer button.active{
- background-color: #e6e6e6 !important;
-}
\ No newline at end of file
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.group.create/create.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.group.create/create.hbs
deleted file mode 100644
index 62cea7955e..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.group.create/create.hbs
+++ /dev/null
@@ -1,84 +0,0 @@
-{{unit "cdmf.unit.ui.title" pageTitle="Group Management"}}
-{{unit "cdmf.unit.ui.modal"}}
-
-{{#zone "breadcrumbs"}}
-
Create new device group on
- {{#if isCloud}}
- Device Cloud
- {{else}}
- IoT Server
- {{/if}}
- .
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Group was created successfully.
-
- You will be redirected to the Group Listing page in a moment.
-
-
-
-
-{{/zone}}
-{{#zone "bottomJs"}}
- {{js "js/group-add.js"}}
-{{/zone}}
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.group.create/create.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.group.create/create.js
deleted file mode 100644
index f4ec0e15d6..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.group.create/create.js
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright (c) 2018 - 2023, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved.
- *
- * Entgra (Pvt) Ltd. 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.
- */
-
-/**
- * Returns the dynamic state to be populated by add-group page.
- *
- * @param context Object that gets updated with the dynamic state of this page to be presented
- * @returns {*} A context object that returns the dynamic state of this page to be presented
- */
-function onRequest(context) {
- var devicemgtProps = require("/app/modules/conf-reader/main.js")["conf"];
- var page = {};
- page["isCloud"] = devicemgtProps.isCloud;
- page["groupNameJSRegEx"] = devicemgtProps.groupValidationConfig.groupNameJSRegEx;
- page["groupNameRegExViolationErrorMsg"] = devicemgtProps.groupValidationConfig.groupNameRegExViolationErrorMsg;
- page["groupNameHelpMsg"] = devicemgtProps.groupValidationConfig.groupNameHelpMsg;
- return page;
-}
\ No newline at end of file
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.group.create/create.json b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.group.create/create.json
deleted file mode 100644
index fe82d18f2d..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.group.create/create.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "version": "1.0.0",
- "uri": "/group/add",
- "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/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
deleted file mode 100644
index c2ed21ecba..0000000000
--- 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
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- * Copyright (c) 2018 - 2023, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved.
- *
- * Entgra (Pvt) Ltd. 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.
- */
-
-/**
- * Checks if provided input is valid against RegEx input.
- *
- * @param regExp Regular expression
- * @param inputString Input string to check
- * @returns {boolean} Returns true if input matches RegEx
- */
-function inputIsValid(regExp, inputString) {
- regExp = new RegExp(regExp);
- return regExp.test(inputString);
-}
-
-$(function () {
- $("button#add-group-btn").click(function () {
-
- var name = $("input#name").val();
- var description = $("input#description").val();
-
- if (!name) {
- triggerError($("input#name"),"Group Name is a required field. It cannot be empty.");
- return false;
- } else if (!inputIsValid($("input#name").data("regex"), name)) {
- triggerError($("input#name"),$("input#name").data("errormsg"));
- return false;
- } else {
- var group = {"name": name, "description": description};
-
- var successCallback = function (jqXHR, status, resp) {
- if (resp.status == 201) {
- $("#group-create-form").addClass("hidden");
- $("#group-created-msg").removeClass("hidden");
- setTimeout(function() {
- window.location.href = "/devicemgt/groups";
- }, 1000);
- } else {
- displayErrors(resp.status);
- }
- };
-
- invokerUtil.post("/api/device-mgt/v1.0/groups", group,
- successCallback, function (message) {
- displayErrors(message);
- });
-
- return false;
- }
- });
-});
-
-/**
- * @param el
- * @param errorMsg
- *
- * Triggers validation error for provided element.
- * Note : the basic jQuery validation elements should be present in the markup
- *
- */
-function triggerError(el,errorMsg){
- var parent = el.parents('.form-group'),
- errorSpan = parent.find('span'),
- errorMsgContainer = parent.find('label');
-
- errorSpan.on('click',function(event){
- event.stopPropagation();
- removeErrorStyling($(this));
- el.unbind('.errorspace');
- });
-
- el.bind('focusin.errorspace',function(){
- removeErrorStyling($(this))
- }).bind('focusout.errorspace',function(){
- addErrorStyling($(this));
- }).bind('keypress.errorspace',function(){
- $(this).unbind('.errorspace');
- removeErrorStyling($(this));
- });
-
- errorMsgContainer.text(errorMsg);
-
- parent.addClass('has-error has-feedback');
- errorSpan.removeClass('hidden');
- errorMsgContainer.removeClass('hidden');
-
- function removeErrorStyling(el){
- var parent = el.parents('.form-group'),
- errorSpan = parent.find('span'),
- errorMsgContainer = parent.find('label');
-
- parent.removeClass('has-error has-feedback');
- errorSpan.addClass('hidden');
- errorMsgContainer.addClass('hidden');
- }
-
- function addErrorStyling(el){
- var parent = el.parents('.form-group'),
- errorSpan = parent.find('span'),
- errorMsgContainer = parent.find('label');
-
- parent.addClass('has-error has-feedback');
- errorSpan.removeClass('hidden');
- errorMsgContainer.removeClass('hidden');
- }
-}
-
-function displayErrors(message) {
- $('#error-msg').html(message.responseText);
- modalDialog.header('Unexpected error occurred!');
- modalDialog.content('
');
- modalDialog.showAsError();
- $("a#group-unexpected-error-link").click(function () {
- modalDialog.hide();
- });
-}
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
deleted file mode 100644
index 7e556c556c..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.groups/groups.hbs
+++ /dev/null
@@ -1,428 +0,0 @@
-{{!
- 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.
-}}
-{{unit "cdmf.unit.ui.title" pageTitle="Group Management"}}
-{{unit "cdmf.unit.ui.content.title" pageHeader="Groups"}}
-
-{{unit "cdmf.unit.lib.service-invoker-utility"}}
-{{unit "cdmf.unit.data-tables-extended"}}
-{{unit "cdmf.unit.lib.ui-permissions-utility"}}
-
-{{#zone "topCss"}}
- {{css "css/groups.css"}}
-{{/zone}}
-
-{{#zone "breadcrumbs"}}
-
-{{/zone}}
-
-{{#zone "bottomJs"}}
- {{#if groupCount}}
- {{js "js/listing.js"}}
- {{/if}}
-{{/zone}}
-
-{{#zone "topCss"}}
-
-{{/zone}}
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.groups/groups.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.groups/groups.js
deleted file mode 100644
index c600f0515b..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.groups/groups.js
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (c) 2018 - 2023, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved.
- *
- * Entgra (Pvt) Ltd. 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.
- */
-
-function onRequest(context) {
- var groupModule = require("/app/modules/business-controllers/group.js")["groupModule"];
- var userModule = require("/app/modules/business-controllers/user.js")["userModule"];
- var constants = require("/app/modules/constants.js");
- var deviceMgtProps = require("/app/modules/conf-reader/main.js")["conf"];
- var currentUser = session.get(constants.USER_SESSION_KEY);
- var page = {};
- if (currentUser) {
- page.permissions = userModule.getUIPermissions();
- page.permissions.list = stringify(page.permissions);
- page.currentUser = currentUser;
- var groupCount = groupModule.getGroupCount();
- if (groupCount > 0) {
- page.groupCount = groupCount;
- }
- }
- page.isCloud = deviceMgtProps.isCloud;
- return page;
-}
\ No newline at end of file
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.groups/groups.json b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.groups/groups.json
deleted file mode 100644
index 4c9f556503..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.groups/groups.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "version": "1.0.0",
- "uri": "/groups",
- "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/pages/cdmf.page.groups/public/css/groups.css b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.groups/public/css/groups.css
deleted file mode 100644
index 58e0371132..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.groups/public/css/groups.css
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Copyright (c) 2018 - 2023, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved.
- *
- * Entgra (Pvt) Ltd. 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.
- */
-
-.dataTablesTop .dataTables_toolbar ul li:nth-child(1), .dataTables_toolbar ul li:nth-child(2) {
- display: none;
-}
\ No newline at end of file
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.groups/public/images/group-icon.png b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.groups/public/images/group-icon.png
deleted file mode 100644
index 156fbc6edc..0000000000
Binary files a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.groups/public/images/group-icon.png and /dev/null differ
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
deleted file mode 100644
index e53fdd38db..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.groups/public/js/listing.js
+++ /dev/null
@@ -1,646 +0,0 @@
-/*
- * Copyright (c) 2018 - 2023, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved.
- *
- * Entgra (Pvt) Ltd. 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.
- */
-
-/**
- * Following function would execute
- * when a user clicks on the list item
- * initial mode and with out select mode.
- */
-function InitiateViewOption(url) {
- if ($(".select-enable-btn").text() == "Select") {
- url = $(this).parent().data("url");
- $(location).attr('href', url);
- }
-}
-
-(function () {
- var cache = {};
- var validateAndReturn = function (value) {
- return (value == undefined || value == null) ? "Unspecified" : value;
- };
- Handlebars.registerHelper("deviceMap", function (device) {
- device.owner = validateAndReturn(device.owner);
- device.ownership = validateAndReturn(device.ownership);
- var arr = device.properties;
- if (arr) {
- device.properties = arr.reduce(function (total, current) {
- total[current.name] = validateAndReturn(current.value);
- return total;
- }, {});
- }
- });
-})();
-
-/*
- * Setting-up global variables.
- */
-var groupCheckbox = "#ast-container .ctrl-wr-asset .itm-select input[type='checkbox']";
-var assetContainer = "#ast-container";
-
-/*
- * On Select All Groups button click function.
- *
- * @param button: Select All Groups button
- */
-function selectAllDevices(button) {
- if (!$(button).data('select')) {
- $(groupCheckbox).each(function (index) {
- $(this).prop('checked', true);
- addGroupSelectedClass(this);
- });
- $(button).data('select', true);
- $(button).html('Deselect All Groups');
- } else {
- $(groupCheckbox).each(function (index) {
- $(this).prop('checked', false);
- addGroupSelectedClass(this);
- });
- $(button).data('select', false);
- $(button).html('Select All Groups');
- }
-}
-
-/*
- * On listing layout toggle buttons click function.
- *
- * @param view: Selected view type
- * @param selection: Selection button
- */
-function changeDeviceView(view, selection) {
- $(".view-toggle").each(function () {
- $(this).removeClass("selected");
- });
- $(selection).addClass("selected");
- if (view == "list") {
- $(assetContainer).addClass("list-view");
- } else {
- $(assetContainer).removeClass("list-view");
- }
-}
-
-/*
- * Add selected style class to the parent element function.
- *
- * @param checkbox: Selected checkbox
- */
-function addGroupSelectedClass(checkbox) {
- if ($(checkbox).is(":checked")) {
- $(checkbox).closest(".ctrl-wr-asset").addClass("selected device-select");
- } else {
- $(checkbox).closest(".ctrl-wr-asset").removeClass("selected device-select");
- }
-}
-
-function toTitleCase(str) {
- return str.replace(/\w\S*/g, function (txt) {
- return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();
- });
-}
-
-function htmlspecialchars(text) {
- return jQuery('').text(text).html();
-}
-
-function loadGroups() {
- var groupListing = $("#group-listing");
- var currentUser = groupListing.data("currentUser");
- var serviceURL;
- if ($.hasPermission("LIST_ALL_GROUPS")) {
- serviceURL = "/api/device-mgt/v1.0/admin/groups";
- } else if ($.hasPermission("LIST_GROUPS")) {
- //Get authenticated users groups
- serviceURL = "/api/device-mgt/v1.0/groups";
- } else {
- $("#loading-content").remove();
- $('#device-table').addClass('hidden');
- $('#device-listing-status-msg').text('Permission denied.');
- $("#device-listing-status").removeClass(' hidden');
- return;
- }
-
- var dataFilter = function (data) {
- data = JSON.parse(data);
- var objects = [];
- $(data.deviceGroups).each(function (index) {
- objects.push({
- groupId: htmlspecialchars(data.deviceGroups[index].id),
- name: htmlspecialchars(data.deviceGroups[index].name),
- description: htmlspecialchars(data.deviceGroups[index].description),
- owner: htmlspecialchars(data.deviceGroups[index].owner)
- })
- });
- var json = {
- "recordsTotal": data.count,
- "recordsFiltered": data.count,
- "data": objects
- };
- return JSON.stringify(json);
- };
-
- var columns = [
- {
- targets: 0,
- data: 'id',
- class: 'remove-padding icon-only content-fill viewEnabledIcon',
- render: function (data, type, row, meta) {
- return '
';
- }
- },
- {
- targets: 1,
- data: 'name',
- class: 'viewEnabledIcon'
- },
- {
- targets: 2,
- data: 'owner',
- class: 'remove-padding-top viewEnabledIcon'
- },
- {
- targets: 3,
- data: 'description',
- class: 'remove-padding-top viewEnabledIcon'
- },
- {
- targets: 4,
- data: 'id',
- class: 'text-right content-fill text-left-on-grid-view no-wrap tooltip-overflow-fix',
- render: function (id, type, row, meta) {
- var html = '';
- if ($.hasPermission("VIEW_GROUP_DEVICES")) {
- /*html += '' +
- ''
- +
- 'Analytics';*/
- }
- if (row.owner != "wso2.system.user") {
- if ($.hasPermission("SHARE_GROUP")) {
- html +=
- ''
- +
- 'Share';
- }
- if ($.hasPermission("UPDATE_GROUP")) {
- html +=
- '' +
- 'Edit';
- }
- if ($.hasPermission("REMOVE_GROUP")) {
- html +=
- ''
- +
- 'Delete';
- }
- }
- return html;
- }
- }
- ];
-
- var fnCreatedRow = function (row, data) {
- $(row).attr('data-type', 'selectable');
- if ($.hasPermission("VIEW_GROUP_DEVICES")) {
- $(row).attr('data-url', 'devices?groupId=' + data.groupId + '&groupName=' + data.name);
- }
- $.each($('td', row), function (colIndex) {
- switch (colIndex) {
- case 1:
- //TODO : The following line encodes html entities.
- //Should check for a better solution since it only changes the presentation layer
- $(this).text($("").html(this.innerText).text())
- $(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;
- case 3:
- $(this).attr('data-grid-label', "Description");
- $(this).attr('data-search', data.description);
- $(this).attr('data-display', data.description);
- break;
- }
- });
- };
-
- $('#group-grid').datatables_extended_serverside_paging(
- null,
- serviceURL,
- dataFilter,
- columns,
- fnCreatedRow,
- function (oSettings) {
- $(".icon .text").res_text(0.2);
- attachEvents();
- var thisTable = $(this).closest('.dataTables_wrapper').find('.dataTable').dataTable();
- thisTable.removeClass("table-selectable");
- },
- {
- "placeholder": "Search By Group Name",
- "searchKey": "name"
- }
- );
- $(groupCheckbox).click(function () {
- addGroupSelectedClass(this);
- });
-}
-
-function openCollapsedNav() {
- $('.wr-hidden-nav-toggle-btn').addClass('active');
- $('#hiddenNav').slideToggle('slideDown', function () {
- if ($(this).css('display') == 'none') {
- $('.wr-hidden-nav-toggle-btn').removeClass('active');
- }
- });
-}
-
-/*
- * DOM ready functions.
- */
-$(document).ready(function () {
-
- /* Adding selected class for selected devices */
- $(groupCheckbox).each(function () {
- addGroupSelectedClass(this);
- });
-
- var permissionSet = {};
-
- //This method is used to setup permission for device listing
- $.setPermission = function (permission) {
- permissionSet[permission] = true;
- };
-
- $.hasPermission = function (permission) {
- return permissionSet[permission];
- };
-
- var permissionList = $("#permission").data("permission");
- for (var key in permissionList) {
- if (permissionList.hasOwnProperty(key)) {
- $.setPermission(key);
- }
- }
-
- loadGroups();
- //$('#device-grid').datatables_extended();
-
- /* for device list sorting drop down */
- $(".ctrl-filter-type-switcher").popover(
- {
- html: true,
- content: function () {
- return $("#content-filter-types").html();
- }
- }
- );
-
- /* for data tables*/
- $('[data-toggle="tooltip"]').tooltip();
-
- $("[data-toggle=popover]").popover();
-
- $(".ctrl-filter-type-switcher").popover(
- {
- html: true,
- content: function () {
- return $('#content-filter-types').html();
- }
- }
- );
-
- $('#nav').affix(
- {
- offset: {
- top: $('header').height()
- }
- }
- );
-
-});
-
-var modalPopup = ".modal";
-var modalPopupContainer = modalPopup + " .modal-content";
-var modalPopupContent = modalPopup + " .modal-content";
-var body = "body";
-
-/*
- * set popup maximum height function.
- */
-function setPopupMaxHeight() {
- $(modalPopupContent).css('max-height', ($(body).height() - ($(body).height() / 100 * 30)));
- $(modalPopupContainer).css('margin-top', (-($(modalPopupContainer).height() / 2)));
-}
-
-/*
- * show popup function.
- */
-function showPopup() {
- $(modalPopup).modal('show');
-}
-
-/*
- * hide popup function.
- */
-function hidePopup() {
- $(modalPopupContent).html("");
- $(modalPopupContent).removeClass("operation-data");
- $(modalPopup).modal('hide');
- $('body').removeClass('modal-open').css('padding-right', '0px');
- $('.modal-backdrop').remove();
-}
-
-/**
- * Following functions should be triggered after AJAX request is made.
- */
-function attachEvents() {
- /**
- * Following click function would execute
- * when a user clicks on "Share" link
- * on Group Management page in WSO2 Device Management Server Console.
- */
- $("a.share-group-link").click(function () {
- var groupId = $(this).data("group-id");
- var groupOwner = $(this).data("group-owner");
-
- $(modalPopupContent).html($('#share-group-w1-modal-content').html());
- showPopup();
-
- listAllRoles(groupId);
- var shareGroupNextLink = $("a#share-group-next-link");
- shareGroupNextLink.click(function () {
- var roles = $("#roles").val();
- updateGroupShare(groupId, roles);
- });
-
- var shareGroupNewRoleFromSelectionLink = $("a#share-group-new-role-from-selection");
- shareGroupNewRoleFromSelectionLink.click(function () {
- var roles = $("#roles").val();
- if (roles && roles.length >= 2) {
- addNewRole(roles);
- } else {
- var errorMsgWrapper = "#notification-error-msg";
- var errorMsg = "#notification-error-msg span";
- $(errorMsg).text("To create a new role with the combination of roles, at least two roles should be" +
- " selected.");
- $(errorMsgWrapper).removeClass("hidden");
- }
- });
- });
-
- /**
- * Following click function would execute
- * when a user clicks on "Remove" link
- * on Group Management page in WSO2 IoT Server Console.
- */
- $("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();
-
- $("a#remove-group-yes-link").click(function () {
- var successCallback = function (data, textStatus, xhr) {
- if (xhr.status == 200) {
- $(modalPopupContent).html($('#remove-group-200-content').html());
- setTimeout(function () {
- hidePopup();
- location.reload(false);
- }, 2000);
- } else {
- displayErrors(xhr);
- }
- };
-
- invokerUtil.delete("/api/device-mgt/v1.0/groups/id/" + groupId,
- successCallback, function (message) {
- displayErrors(message);
- });
- });
-
- $("a#remove-group-cancel-link").click(function () {
- hidePopup();
- });
-
- });
-
- /**
- * Following click function would execute
- * when a user clicks on "Edit" link
- * 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");
-
- $(modalPopupContent).html($('#edit-group-modal-content').html());
- $('#edit-group-name').val(groupName);
- $('#edit-group-description').val(groupDescription);
- showPopup();
-
- $("a#edit-group-yes-link").click(function () {
- var newGroupName = $('#edit-group-name').val();
- var newGroupDescription = $('#edit-group-description').val();
- var group = {"name": newGroupName, "description": newGroupDescription, "owner": groupOwner};
-
- var successCallback = function (data, textStatus, xhr) {
- if (xhr.status == 200) {
- $(modalPopupContent).html($('#edit-group-200-content').html());
- setTimeout(function () {
- hidePopup();
- location.reload(false);
- }, 2000);
- } else {
- displayErrors(xhr);
- }
- };
-
- invokerUtil.put("/api/device-mgt/v1.0/groups/id/" + groupId, group,
- successCallback, function (message) {
- displayErrors(message);
- });
- });
-
- $("a#edit-group-cancel-link").click(function () {
- hidePopup();
- });
- });
-}
-
-function markAlreadySavedUsersRoles(groupId) {
- var successCallback = function (data, textStatus, xhr) {
- data = JSON.parse(data);
- if (xhr.status == 200) {
- if (data.roles.length > 0) {
- var selectedValues = [];
- for (var i = 0; i < data.roles.length; i++) {
- selectedValues.push(data.roles[i]);
- }
- $("#roles").val(selectedValues).trigger("change");
- } else {
- return;
- }
- } else {
- displayErrors(xhr);
- }
- };
-
- invokerUtil.get("/api/device-mgt/v1.0/groups/id/" + groupId + "/roles",
- successCallback, function (message) {
- displayErrors(message);
- });
-}
-
-function listAllRoles(groupId) {
- var successCallback = function (data, textStatus, xhr) {
- data = JSON.parse(data);
- if (xhr.status == 200) {
- if (data.roles.length > 0) {
- var html = '';
- $("#rolesListing").html(html);
- markAlreadySavedUsersRoles(groupId);
- $("select.select2[multiple=multiple]").select2({tags: false}).on("select2:select", function () {
- $("#notification-error-msg").addClass("hidden");
- });
- } else {
- $("#rolesListing").html("No roles available");
- }
- } else {
- displayErrors(xhr);
- }
- };
-
- invokerUtil.get("/api/device-mgt/v1.0/roles?offset=0&limit=100&user-store=all",
- successCallback, function (message) {
- displayErrors(message);
- });
-}
-
-function addNewRole(roles) {
- $(modalPopupContent).html($('#share-group-w3-modal-content').html());
- $("a#share-group-w3-yes-link").click(function () {
- var roleName = $('#group-sharing-role-name').val();
- if (roleName) {
- createNewCombinedRole(roleName, roles);
- } else {
- var errorMsgWrapper = "#notification-error-msg";
- var errorMsg = "#notification-error-msg span";
- $(errorMsg).text("Role name cannot be empty.");
- $(errorMsgWrapper).removeClass("hidden");
- }
- });
- $("a#share-group-w3-cancel-link").click(function () {
- hidePopup();
- });
-}
-
-function togglePermissionAction(element) {
- $(element).data('value', 'checked');
- var icon = $(element).find("i")[1];
- if ($(icon).hasClass('fw-minus')) {
- $(icon).removeClass('fw-minus');
- $(icon).addClass('fw-add');
- $(element).data('value', 'unchecked');
- } else {
- $(icon).removeClass('fw-add');
- $(icon).addClass('fw-minus');
- $(element).data('value', 'checked');
- }
-}
-
-function updateGroupShare(groupId, roles) {
- var successCallback = function (data) {
- $(modalPopupContent).html($('#share-group-200-content').html());
- };
-
- invokerUtil.post("/api/device-mgt/v1.0/groups/id/" + groupId + "/share",
- roles, successCallback, function (message) {
- displayErrors(message);
- });
-}
-
-function createNewCombinedRole(roleName, roleList) {
- var successCallback = function (data, status, jqXHR, isLast) {
- $(modalPopupContent).html($('#create-combined-role-200-content').html());
- showPopup();
- };
- invokerUtil.post("/api/device-mgt/v1.0/roles/create-combined-role/" + roleName, roleList,
- successCallback, function (message) {
- displayErrors(message);
- });
-}
-
-function displayErrors(jqXHR) {
- showPopup();
- if (jqXHR.status == 400) {
- $(modalPopupContent).html($('#group-400-content').html());
- if (jqXHR.responseText) {
- $('#error-msg').html(jqXHR.responseText.replace(new RegExp("\"", 'g'), ""));
- }
- $("a#group-400-link").click(function () {
- hidePopup();
- });
- } else if (jqXHR.status == 403) {
- $(modalPopupContent).html($('#group-403-content').html());
- $("a#group-403-link").click(function () {
- hidePopup();
- });
- } else if (jqXHR.status == 404) {
- $(modalPopupContent).html($('#group-404-content').html());
- $("#group-404-message").html(jqXHR.responseText);
- $("a#group-404-link").click(function () {
- hidePopup();
- });
- } else if (jqXHR.status == 409) {
- $(modalPopupContent).html($('#group-409-content').html());
- $("a#group-409-link").click(function () {
- hidePopup();
- });
- } else {
- $(modalPopupContent).html($('#group-unexpected-error-content').html());
- if (jqXHR.responseText) {
- $('#unexp-error-msg').html(jqXHR.responseText.replace(new RegExp("\"", 'g'), ""));
- }
- $("a#group-unexpected-error-link").click(function () {
- hidePopup();
- });
- console.log("Error code: " + jqXHR.status);
- }
-}
\ No newline at end of file
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.notification.listing/listing.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.notification.listing/listing.hbs
deleted file mode 100644
index 7e91f28497..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.notification.listing/listing.hbs
+++ /dev/null
@@ -1,34 +0,0 @@
-{{!
- 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.
-}}
-{{unit "cdmf.unit.data-tables-extended"}}
-{{unit "cdmf.unit.ui.title" pageTitle="Notification Listing"}}
-{{#zone "breadcrumbs"}}
-
-{{/zone}}
-{{#zone "content"}}
- {{unit "cdmf.unit.notification.listing"}}
-{{/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/pages/cdmf.page.notification.listing/listing.json b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.notification.listing/listing.json
deleted file mode 100644
index 99d43a16b4..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.notification.listing/listing.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "version": "1.0.0",
- "uri": "/notification-listing",
- "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/pages/cdmf.page.platform.configuration/configuration.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.platform.configuration/configuration.hbs
deleted file mode 100644
index b4c5c8af10..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.platform.configuration/configuration.hbs
+++ /dev/null
@@ -1,35 +0,0 @@
-{{!
- 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.
-}}
-{{unit "cdmf.unit.ui.title" pageTitle="Platform Configuration"}}
-
-{{#zone "breadcrumbs"}}
-
-{{/zone}}
-
-{{#zone "content"}}
- {{unit "cdmf.unit.platform.configuration"}}
-{{/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/pages/cdmf.page.platform.configuration/configuration.json b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.platform.configuration/configuration.json
deleted file mode 100644
index 7316b1146c..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.platform.configuration/configuration.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "version": "1.0.0",
- "uri": "/platform-configuration",
- "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/pages/cdmf.page.policies/policies.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.policies/policies.hbs
deleted file mode 100644
index 6742acaba5..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.policies/policies.hbs
+++ /dev/null
@@ -1,278 +0,0 @@
-{{!
- 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.
-}}
-{{unit "cdmf.unit.ui.title" pageTitle="Policy Management"}}
-{{unit "cdmf.unit.data-tables-extended"}}
-{{unit "cdmf.unit.ui.modal"}}
-
-{{#zone "topCss"}}
-
-{{/zone}}
-
-{{#zone "breadcrumbs"}}
-
-{{/zone}}
-
-{{#zone "bottomJs"}}
- {{js "js/policy-list.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/pages/cdmf.page.policies/policies.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.policies/policies.js
deleted file mode 100644
index f4e7459293..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.policies/policies.js
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Copyright (c) 2018 - 2023, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved.
- *
- * Entgra (Pvt) Ltd. 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.
- */
-
-function onRequest(context) {
- context.handlebars.registerHelper('equal', function (lvalue, rvalue, options) {
- if (arguments.length < 3) {
- throw new Error("Handlebars Helper equal needs 2 parameters");
- }
- if (lvalue != rvalue) {
- return options.inverse(this);
- } else {
- return options.fn(this);
- }
- });
- var page = {};
- var policyModule = require("/app/modules/business-controllers/policy.js")["policyModule"];
- var userModule = require("/app/modules/business-controllers/user.js")["userModule"];
- var utility = require("/app/modules/utility.js")["utility"];
- var response = policyModule.getAllPolicies();
- if (response["status"] == "success") {
- var policyListToView = response["content"];
- for(var index in policyListToView) {
- if(policyListToView.hasOwnProperty(index)) {
- policyListToView[index]["icon"] = utility.getDeviceThumb(policyListToView[index]["platform"]);
- }
- }
- page["policyListToView"] = policyListToView;
- var policyCount = policyListToView.length;
- if (policyCount == 0) {
- page["policyListingStatusMsg"] = "No policy is available to be displayed.";
- page["noPolicy"] = true;
- } else {
- page["noPolicy"] = false;
- page["isUpdated"] = response["updated"];
- }
- } else {
- // here, response["status"] == "error"
- page["policyListingStatusMsg"] = "An unexpected error occurred. Please try again later.";
- page["noPolicy"] = true;
- }
-
- if (userModule.isAuthorized("/permission/admin/device-mgt/policies/remove")) {
- page["removePermitted"] = true;
- }
- if (userModule.isAuthorized("/permission/admin/device-mgt/policies/update")) {
- page["editPermitted"] = true;
- }
- page.permissions = userModule.getUIPermissions();
- return page;
-}
\ No newline at end of file
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.policies/policies.json b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.policies/policies.json
deleted file mode 100644
index 07fd9fe9df..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.policies/policies.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "version": "1.0.0",
- "uri": "/policies",
- "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/pages/cdmf.page.policies/public/js/policy-list.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.policies/public/js/policy-list.js
deleted file mode 100644
index 437775da39..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.policies/public/js/policy-list.js
+++ /dev/null
@@ -1,391 +0,0 @@
-/*
- * Copyright (c) 2018 - 2023, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved.
- *
- * Entgra (Pvt) Ltd. 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.
- */
-
-/* sorting function */
-var sortUpdateBtn = "#sortUpdateBtn";
-// var sortedIDs;
-// var dataTableSelection = ".DTTT_selected";
-var settings = {
- "sorting": false
-};
-$('#policy-grid').datatables_extended(settings);
-// $(".icon .text").res_text(0.2);
-
-var saveNewPrioritiesButton = "#save-new-priorities-button";
-var saveNewPrioritiesButtonEnabled = Boolean($(saveNewPrioritiesButton).data("enabled"));
-if (saveNewPrioritiesButtonEnabled) {
- $(saveNewPrioritiesButton).removeClass("hide");
-}
-
-/**
- * Following function would execute
- * when a user clicks on the list item
- * initial mode and with out select mode.
- */
-function InitiateViewOption() {
- $(location).attr('href', $(this).data("url"));
-}
-
-/**
- * Modal related stuff are as follows.
- */
-
-var modalPopup = ".modal";
-var modalPopupContainer = modalPopup + " .modal-content";
-var modalPopupContent = modalPopup + " .modal-content";
-var body = "body";
-
-/*
- * set popup maximum height function.
- */
-function setPopupMaxHeight() {
- var maxHeight = "max-height";
- var marginTop = "margin-top";
- var body = "body";
- $(modalPopupContent).css(maxHeight, ($(body).height() - ($(body).height() / 100 * 30)));
- $(modalPopupContainer).css(marginTop, (-($(modalPopupContainer).height() / 2)));
-}
-
-/*
- * show popup function.
- */
-function showPopup() {
- $(modalPopup).modal('show');
-}
-
-/*
- * hide popup function.
- */
-function hidePopup() {
- $(modalPopupContent).html("");
- $(modalPopupContent).removeClass("operation-data");
- $(modalPopup).modal('hide');
- $('body').removeClass('modal-open').css('padding-right','0px');
- $('.modal-backdrop').remove();
-}
-
-/*
- * Function to get selected policies.
- */
-function getSelectedPolicyStates() {
- var policyList = [];
- var thisTable = $(".DTTT_selected").closest('.dataTables_wrapper').find('.dataTable').dataTable();
- thisTable.api().rows().every(function () {
- if ($(this.node()).hasClass('DTTT_selected')) {
- policyList.push($(thisTable.api().row(this).node()).data('status'));
- }
- });
-
- return policyList;
-}
-
-/*
- * Function to get selected policies.
- */
-function getSelectedPolicies() {
- var policyList = [];
- var thisTable = $(".DTTT_selected").closest('.dataTables_wrapper').find('.dataTable').dataTable();
- thisTable.api().rows().every(function () {
- if ($(this.node()).hasClass('DTTT_selected')) {
- policyList.push($(thisTable.api().row(this).node()).data('id'));
- }
- });
-
- return policyList;
-}
-
-
-$(document).ready(function () {
-
- /**
- * ********************************************
- * Click functions related to Policy Listing
- * ********************************************
- */
-
- // [1] logic for running apply-changes-for-devices use-case
-
- var applyChangesButtonId = "#appbar-btn-apply-changes";
-
- var isUpdated = $("#is-updated").val();
- if (!isUpdated) {
- // if no updated policies found, hide button from app bar
- $(applyChangesButtonId).addClass("hidden");
- } else {
- // if updated policies found, show button from app bar
- $(applyChangesButtonId).removeClass("hidden");
- }
-
- // click-event function for applyChangesButton
- $(applyChangesButtonId).click(function () {
- var serviceURL = "/api/device-mgt/v1.0/policies/apply-changes";
- modalDialog.header('Do you really want to apply changes to all policies?');
- modalDialog.footer('
');
- modalDialog.showAsAWarning();
- } else {
- var serviceURL = "/api/device-mgt/v1.0/policies/deactivate-policy";
- if (policyList.length == 0) {
- modalDialog.header('Action cannot be performed !');
- modalDialog.content('Please select a policy or a list of policies to un-publish.');
- modalDialog.footer('
');
- modalDialog.showAsAWarning();
- } else {
- var serviceURL = "/api/device-mgt/v1.0/policies/activate-policy";
- if (policyList.length == 0) {
- modalDialog.header('Action cannot be performed !');
- modalDialog.content('Please select a policy or a list of policies to publish.');
- modalDialog.footer('
');
- modalDialog.showAsAWarning();
- } else {
- var serviceURL = "/api/device-mgt/v1.0/policies/remove-policy";
- if (policyList.length == 0) {
- modalDialog.header('Action cannot be performed !');
- modalDialog.content('Please select a policy or a list of policies to remove.');
- modalDialog.footer('
');
- modalDialog.showAsError();
- $("a#remove-policy-error-link").click(function () {
- modalDialog.hide();
- });
- }
- );
- });
-
- // on-click function for policy removing "cancel" button
- $("a#remove-policy-cancel-link").click(function () {
- modalDialog.hide();
- });
- }
- });
-
- $("#loading-content").remove();
- if ($("#policy-listing-status-msg").text()) {
- $("#policy-listing-status").removeClass("hidden");
- }
- $("#policy-grid").removeClass("hidden");
-
- $('[data-toggle="tooltip"]').tooltip();
-
-});
\ No newline at end of file
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.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.policy.create.wizard/wizard.hbs
deleted file mode 100644
index f78cb71f65..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.policy.create.wizard/wizard.hbs
+++ /dev/null
@@ -1,40 +0,0 @@
-{{!
- 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.
-}}
-{{unit "cdmf.unit.ui.title" pageTitle="Policy Management"}}
-
-{{#zone "breadcrumbs"}}
-
-{{/zone}}
-
-{{#zone "content"}}
- {{unit policyWizardUnitName}}
-{{/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/pages/cdmf.page.policy.create.wizard/wizard.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.policy.create.wizard/wizard.js
deleted file mode 100644
index 427af8deb6..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.policy.create.wizard/wizard.js
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright (c) 2018 - 2023, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved.
- *
- * Entgra (Pvt) Ltd. 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.
- */
-
-function onRequest(context) {
- var utility = require("/app/modules/utility.js").utility;
- context.handlebars.registerHelper('equal', function (lvalue, rvalue, options) {
- if (arguments.length < 3) {
- throw new Error("Handlebars Helper equal needs 2 parameters");
- }
- if (lvalue != rvalue) {
- return options.inverse(this);
- } else {
- return options.fn(this);
- }
- });
- var deviceType = context.uriParams.deviceType;
-
- return {"policyWizardUnitName": utility.getTenantedDeviceUnitName(deviceType, "policy-wizard")};
-}
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
deleted file mode 100644
index 5322b6ff2b..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.policy.create.wizard/wizard.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "version": "1.0.0",
- "uri": "/policy/add/{deviceType}",
- "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/pages/cdmf.page.policy.create/create.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.policy.create/create.hbs
deleted file mode 100644
index 52c43d2be9..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.policy.create/create.hbs
+++ /dev/null
@@ -1,61 +0,0 @@
-{{!
- 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.
-
-
- Copyright (c) 2018, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved.
-
- Entgra (Pvt) Ltd. 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.
-}}
-
-{{unit "cdmf.unit.ui.title" pageTitle="Policy Management | Add Policy"}}
-
-{{#zone "breadcrumbs"}}
-
-{{/zone}}
-
-{{#zone "content"}}
- {{unit "cdmf.unit.device.operation-mod"}}
- {{unit "cdmf.unit.policy.create"}}
- {{unit "cdmf.unit.lib.data-table"}}
-{{/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/pages/cdmf.page.policy.create/create.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.policy.create/create.js
deleted file mode 100644
index ad7dcceaae..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.policy.create/create.js
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Copyright (c) 2018 - 2023, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved.
- *
- * Entgra (Pvt) Ltd. 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.
- */
-
-function onRequest(context){
- context.handlebars.registerHelper('equal', function (lvalue, rvalue, options) {
- if (arguments.length < 3)
- throw new Error("Handlebars Helper equal needs 2 parameters");
- if( lvalue!=rvalue ) {
- return options.inverse(this);
- } else {
- return options.fn(this);
- }
- });
-}
\ No newline at end of file
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.policy.create/create.json b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.policy.create/create.json
deleted file mode 100644
index 761dcb2d2d..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.policy.create/create.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "version": "1.0.0",
- "uri": "/policy/add",
- "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/pages/cdmf.page.policy.edit/edit.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.policy.edit/edit.hbs
deleted file mode 100644
index 89c472b4be..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.policy.edit/edit.hbs
+++ /dev/null
@@ -1,61 +0,0 @@
-{{!
- 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.
-
-
- Copyright (c) 2018, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved.
-
- Entgra (Pvt) Ltd. 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.
-}}
-
-{{unit "cdmf.unit.ui.title" pageTitle="Policy Management | Edit Policy"}}
-
-{{#zone "breadcrumbs"}}
-
-{{/zone}}
-
-{{#zone "content"}}
- {{unit "cdmf.unit.device.operation-mod"}}
- {{unit "cdmf.unit.policy.edit"}}
- {{unit "cdmf.unit.lib.data-table"}}
-{{/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/pages/cdmf.page.policy.edit/edit.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.policy.edit/edit.js
deleted file mode 100644
index c02a343604..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.policy.edit/edit.js
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Copyright (c) 2018 - 2023, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved.
- *
- * Entgra (Pvt) Ltd. 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.
- */
-
-function onRequest(context) {
- var utility = require("/app/modules/utility.js").utility;
- var deviceType = request.getParameter("type");
- return {"deviceTypePolicyEdit": utility.getTenantedDeviceUnitName(deviceType, "policy-edit")};
-}
\ No newline at end of file
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.policy.edit/edit.json b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.policy.edit/edit.json
deleted file mode 100644
index f2122eb998..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.policy.edit/edit.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "version": "1.0.0",
- "uri": "/policy/edit",
- "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/pages/cdmf.page.policy.priority/priority.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.policy.priority/priority.hbs
deleted file mode 100644
index e526b7eaf4..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.policy.priority/priority.hbs
+++ /dev/null
@@ -1,51 +0,0 @@
-{{!
- 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.
-}}
-{{unit "cdmf.unit.ui.title" pageTitle="Policy Management | Policy Priorities"}}
-
-{{#zone "breadcrumbs"}}
-
-
- You not authorized to enter Policy Management Section.
-
- {{/if}}
-{{/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/pages/cdmf.page.policy.priority/priority.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.policy.priority/priority.js
deleted file mode 100644
index 72b72edace..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.policy.priority/priority.js
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Copyright (c) 2018 - 2023, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved.
- *
- * Entgra (Pvt) Ltd. 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.
- */
-
-function onRequest(context){
- context.handlebars.registerHelper('equal', function (lvalue, rvalue, options) {
- if (arguments.length < 3)
- throw new Error("Handlebars Helper equal needs 2 parameters");
- if( lvalue!=rvalue ) {
- return options.inverse(this);
- } else {
- return options.fn(this);
- }
- });
- var viewModel = {};
- viewModel.isAuthorized = userModule.isAuthorized("/permission/admin/device-mgt/policies/manage");
- return viewModel;
-}
\ No newline at end of file
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.policy.priority/priority.json b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.policy.priority/priority.json
deleted file mode 100644
index b8be6d8bbb..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.policy.priority/priority.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "version": "1.0.0",
- "uri": "/policy/priority",
- "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/pages/cdmf.page.policy.view/view.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.policy.view/view.hbs
deleted file mode 100644
index fdbbaf6016..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.policy.view/view.hbs
+++ /dev/null
@@ -1,69 +0,0 @@
-{{!
- 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.
-
-
- Copyright (c) 2018, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved.
-
- Entgra (Pvt) Ltd. 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.
-}}
-
-{{unit "cdmf.unit.ui.title" pageTitle="Policy Management | View Policy"}}
-
-{{#zone "breadcrumbs"}}
-
- {{/if}}
-{{/zone}}
-
-{{#zone "content"}}
- {{unit "cdmf.unit.device.operation-mod"}}
- {{unit "cdmf.unit.policy.view"}}
- {{unit "cdmf.unit.lib.data-table"}}
-{{/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/pages/cdmf.page.policy.view/view.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.policy.view/view.js
deleted file mode 100644
index 0de2bb58ed..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.policy.view/view.js
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright (c) 2018 - 2023, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved.
- *
- * Entgra (Pvt) Ltd. 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.
- */
-
-function onRequest(context) {
- var userModule = require("/app/modules/business-controllers/user.js")["userModule"];
- var utility = require("/app/modules/utility.js")["utility"];
- var deviceType = request.getParameter("type");
-
- var canEdit = false;
- if(userModule.isAuthorized("/permission/admin/device-mgt/policy/manage")) {
- canEdit = true;
- }
-
- return {"deviceTypePolicyView": utility.getTenantedDeviceUnitName(deviceType, "policy-view"), "canEdit": canEdit};
-}
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.policy.view/view.json b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.policy.view/view.json
deleted file mode 100644
index a4d19525f6..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.policy.view/view.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "version": "1.0.0",
- "uri": "/policy/view",
- "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/pages/cdmf.page.privacy-policy/privacy-policy.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.privacy-policy/privacy-policy.hbs
deleted file mode 100644
index bfed7576e9..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.privacy-policy/privacy-policy.hbs
+++ /dev/null
@@ -1,195 +0,0 @@
-{{!
- Copyright (c) 2018, 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 "title"}}{{! to override parent page title }}{{/zone}}
-{{unit "cdmf.unit.ui.title" pageTitle="Consent Page"}}
-
-{{#zone "content"}}
-
-
-
-
PRIVACY POLICY
-
-
-
About Entgra IoT Server
-
Entgra IoT Server is a complete solution that enables device manufacturers and enterprises to connect
- and manage their devices, build apps, manage events, secure devices and data, and visualize sensor
- data in a scalable manner.
-
It also offers a complete and secure Enterprise Mobility Management (EMM/MDM) solution that aims to
- address mobile computing challenges faced by enterprises today. Supporting iOS, Android, and Windows
- devices, it helps organizations deal with both Corporate Owned, Personally Enabled (COPE) and
- employee-owned devices with the Bring Your Own Device (BYOD) concept.
-
Entgra IoT Server comes with advanced analytics, enabling users to analyze speed, proximity, and
- geo-fencing information of devices including details of those in motion and stationary state.
-
Privacy Policy
-
This policy describes how Entgra IoT Server 4.1.0 captures your personal information, the purposes of
- collection, and information about the retention of your personal information.
-
Please note that this policy is for reference only, and is applicable for the software as a product.
- Entgra and its developers have no access to the information held within Entgra IoT Server
- 4.1.0.Please see the Disclaimer section for more information. Entities, organisations or individuals
- controlling the use and administration of Entgra IoT Server 4.1.0 should create their own privacy
- policies setting out the manner in which data is controlled or processed by the respective entity,
- organisation or individual.
-
What is personal information?
-
Entgra IoT Server 4.1.0 considers anything related to you and by which you may be identified as your
- personal information.
-
Signing in to Entgra IoT Server 4.1.0
-
-
Your user name (except in cases where the user name created by your employer is under
- contract)
-
-
IP address used to log in
-
Email address
-
-
Enrolling a device with Entgra IoT Server 4.1.0
-
-
Your device ID (e.g., phone or tablet), mobile number, IMEI number, and IMSI number
-
Your device’s location
-
Your device’s application list, and memory usage
-
Your device’s usage statistics, such as RAM, battery level, connected hotspot details, and
- memory usage
-
-
-
However, Entgra IoT Server 4.1.0 also collects the following information that is not considered
- personal information, but is used only for statistical purposes. The reason for this is that
- this information can not be used to track you.
-
-
City/Country from which you originated the TCP/IP connection
-
Time of the day that you logged in (year, month, week, hour or minute)
-
Type of device that you used to log in (e.g., phone or tablet)
-
Operating system and generic browser information
-
-
Collection of personal information
-
Entgra IoT Server 4.1.0 collects your information only to serve your access requirements. For
- example:
-
-
Entgra IoT Server 4.1.0 uses your IP address to detect any suspicious login attempts to your
- account.
-
Entgra IoT Server 4.1.0 uses attributes like your first name, last name, etc., to provide a rich
- and personalized user experience.
-
Entgra IoT Server 4.1.0 uses your security questions and answers only to allow account recovery.
-
-
-
Tracking Technologies
-
Entgra IoT Server 4.1.0 collects your information by:
-
-
Collecting information from the user profile page where you enter your personal data.
-
Tracking your IP address with HTTP request, HTTP headers, and TCP/IP.
-
Tracking your geographic information with the IP address.
-
Tracking your login history with browser cookies. Please see our cookie policy
- for more
- information.
-
-
-
Use of personal information
-
Entgra IoT Server 4.1.0 will only use your personal information for the purposes for which it was
- collected (or for a use identified as consistent with that purpose).
-
Entgra IoT Server 4.1.0 uses your personal information only for the following purposes.
-
-
To provide you with a personalized user experience. Entgra IoT Server 4.1.0 uses your name and
- uploaded profile pictures for this purpose.
-
-
To protect your account from unauthorized access or potential hacking attempts. Entgra IoT Server
- 4.1.0 uses HTTP or TCP/IP Headers for this purpose.
-
-
-
This includes:
-
-
IP address
-
Browser fingerprinting
-
Cookies
-
-
-
Derive statistical data for analytical purposes on system performance improvements. Entgra IoT
- Server 4.1.0 will not keep any personal information after statistical calculations. Therefore,
- the statistical report has no means of identifying an individual person.
-
-
Entgra IoT Server 4.1.0 may use:
-
-
-
IP Address to derive geographic information
-
Browser fingerprinting to determine the browser technology or/and version
-
-
-
-
Disclosure of personal information
-
Entgra IoT Server 4.1.0 only discloses personal information to the relevant applications (also
- known as
- “Service Providers”) that are registered with Entgra IoT Server 4.1.0. These applications are
- registered by the identity administrator of your entity or organization. Personal information is
- disclosed only for the purposes for which it was collected (or for a use identified as consistent
- with that purpose) as controlled by such Service Providers, unless you have consented otherwise or
- where it is required by law.
-
Legal process
-
Please note that the organisation, entity or individual running Entgra IoT Server 4.1.0 may be
- compelled to disclose your personal information with or without your consent when it is required by
- law following due and lawful process.
-
Storage of personal information
-
Where your personal information is stored
-
Entgra IoT Server 4.1.0 stores your personal information in secured databases. Entgra IoT Server
- 4.1.0 exercises proper industry accepted security measures to protect the database where your
- personal information is held.Entgra IoT Server 4.1.0 as a product does not transfer or share your
- data with any third parties or locations.
-
Entgra IoT Server 4.1.0 may use encryption to keep your personal data with an added level of
- security.
-
How long your personal information is retained
-
Entgra IoT Server 4.1.0 retains your personal data as long as you are an active user of our system.
- You can update your personal data at any time using the given self-care user portals.
-
Entgra IoT Server 4.1.0 may keep hashed secrets to provide you with an added level of security. This
- includes:
-
-
Current password
-
Previously used passwords
-
-
How to request removal of your personal information
-
You can request the administrator to delete your account. The administrator is the administrator of
- the tenant you are registered under, or the super-administrator if you do not use the tenant
- feature.
-
Additionally, you can request to anonymize all traces of your activities that Entgra IoT Server 4.1.0
- may have retained in logs, databases or analytical storage.
-
More information
-
Changes to this policy
-
Upgraded versions of Entgra IoT Server 4.1.0 may contain changes to this policy. Revisions to this
- policy will be packaged within such upgrades and would only apply to users who choose to use upgraded
- versions.
-
Your choices
-
If you are already have an user account within Entgra IoT Server 4.1.0 ; you have the right to
- deactivate your account if you find that this privacy policy is unacceptable to you.
-
If you do not have an account and you do not agree with our privacy policy, you can chose not to
- create one.
-
Contact us
-
Please contact Entgra if you have any question or concerns regarding this privacy policy.
Entgra, its employees, partners, and affiliates do not have access to and do not require, store,
- process or control any of the data, including personal data contained in Entgra IoT Server 4.1.0. All
- data, including personal data is controlled and processed by the entity or individual running Entgra
- IoT Server 4.1.0. Entgra, its employees partners and affiliates are not a data processor or a data
- controller within the meaning of any data privacy regulations. Entgra does not provide any warranties
- or undertake any responsibility or liability in connection with the lawfulness or the manner and
- purposes for which Entgra IoT Server 4.1.0 is used by such entities or persons.
-
This privacy policy is for the informational purposes of the entity or persons running Entgra IoT
- Server 4.1.0 and sets out the processes and functionality contained within Entgra IoT Server 4.1.0
- regarding personal data protection. It is the responsibility of entities and persons running Entgra IoT
- Server 4.1.0 to create and administer its own rules and processes governing users’ personal data,
- Please note that the creation of such rules and processes may change the use, storage and disclosure
- policies contained herein. Therefore users should consult the entity or persons running Entgra IoT
- Server 4.1.0 for its own privacy policy for details governing users’ personal data.
-
-
-
-{{/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/pages/cdmf.page.privacy-policy/privacy-policy.json b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.privacy-policy/privacy-policy.json
deleted file mode 100644
index 2f12cb7da9..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.privacy-policy/privacy-policy.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "version": "1.0.0",
- "layout": "uuf.layout.sign-in",
- "uri": "/privacy-policy",
- "isAnonymous": 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/pages/cdmf.page.processing/processing.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.processing/processing.hbs
deleted file mode 100644
index ac4e28107d..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.processing/processing.hbs
+++ /dev/null
@@ -1,57 +0,0 @@
-{{!
- 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.
-}}
-{{unit "cdmf.unit.ui.title" pageTitle="Home"}}
-
-{{#zone "breadcrumbs"}}
-
-{{/zone}}
-
-{{#zone "bottomJs"}}
-
- {{js "/js/script.js"}}
-{{/zone}}
-
-{{#zone "topCss"}}
-
-{{/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/pages/cdmf.page.processing/processing.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.processing/processing.js
deleted file mode 100644
index f9f9a814a6..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.processing/processing.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Copyright (c) 2018 - 2023, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved.
- *
- * Entgra (Pvt) Ltd. 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.
- */
-
-function onRequest(context) {
- var constants = require("/app/modules/constants.js");
- var skipWelcomeScreen = session.get(constants.SKIP_WELCOME_SCREEN);
- if (skipWelcomeScreen) {
- response.sendRedirect(context.app.context + "/");
- exit();
- }
- return {};
-}
\ No newline at end of file
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.processing/processing.json b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.processing/processing.json
deleted file mode 100644
index add6d0c2de..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.processing/processing.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "version": "1.0.0",
- "uri": "/welcome",
- "layout": "cdmf.layout.loading"
-}
\ No newline at end of file
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.processing/public/js/script.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.processing/public/js/script.js
deleted file mode 100644
index 58f49e86eb..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.processing/public/js/script.js
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 2018 - 2023, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved.
- *
- * Entgra (Pvt) Ltd. 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.
- */
-
-var pollingCount = 24;
-function poll() {
- $.ajax({
- url: context + "/api/user/environment-loaded",
- type: "GET",
- success: function (data) {
- if (data.isLoaded) {
- window.location = context + "/";
- }
- },
- dataType: "json",
- complete: setTimeout(function () {
- pollingCount = pollingCount - 1;
- if (pollingCount > 0) {
- poll();
- } else {
- $(".loading-animation .logo").hide();
- $(".loading-animation").prepend(
- '');
- $(".loading-animation p").css("width", "150%")
- .html("Ops... it seems something went wrong. Refresh the page to retry!");
- }
- }, 5000),
- timeout: 5000
- });
-}
-
-$(document).ready(function () {
- poll();
-});
\ No newline at end of file
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.register/public/js/validate-register.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.register/public/js/validate-register.js
deleted file mode 100644
index 0be9a12ab7..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.register/public/js/validate-register.js
+++ /dev/null
@@ -1,168 +0,0 @@
-/*
- * Copyright (c) 2018 - 2023, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved.
- *
- * Entgra (Pvt) Ltd. 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.
- */
-
-/**
- * Checks if provided input is valid against RegEx input.
- *
- * @param regExp Regular expression
- * @param inputString Input string to check
- * @returns {boolean} Returns true if input matches RegEx
- */
-function inputIsValid(regExp, inputString) {
- regExp = new RegExp(regExp);
- return regExp.test(inputString);
-}
-
-/**
- * Checks if an email address has the valid format or not.
- *
- * @param email Email address
- * @returns {boolean} true if email has the valid format, otherwise false.
- */
-function emailIsValid(email) {
- var regExp = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;
- return regExp.test(email);
-}
-
-$(document).ready(function(){
-
- /**
- * Following click function would execute
- * when a user clicks on "Add User" button
- * on Add User page in WSO2 Devicemgt Console.
- */
- $("button#add-user-btn").click(function () {
-
- var usernameInput = $("input#user_name");
- var firstnameInput = $("input#first_name");
- var lastnameInput = $("input#last_name");
- var emailInput = $("input#email");
- var passwordInput = $("input#password");
- var passwordConfirmationInput = $("input#password_confirmation");
- var privacyPolicyConsentInput = $("input#privacy-consent");
-
- var username = usernameInput.val().trim();
- var firstname = firstnameInput.val();
- var lastname = lastnameInput.val();
- var emailAddress = emailInput.val();
- var password = passwordInput.val();
- var passwordConfirmation = passwordConfirmationInput.val();
- var privacyPolicyConsentChecked = privacyPolicyConsentInput.is(':checked');
- var errorMsgWrapper = "#user-create-error-msg";
- var errorMsg = "#user-create-error-msg span";
-
- if (!firstname) {
- $(errorMsg).text("Firstname is a required field. It cannot be empty.");
- $(errorMsgWrapper).removeClass("hidden");
- } else if (!inputIsValid(firstnameInput.data("regex"), firstname)) {
- $(errorMsg).text(firstnameInput.data("errormsg"));
- $(errorMsgWrapper).removeClass("hidden");
- } else if (!lastname) {
- $(errorMsg).text("Lastname is a required field. It cannot be empty.");
- $(errorMsgWrapper).removeClass("hidden");
- } else if (!inputIsValid(lastnameInput.data("regex"), lastname)) {
- $(errorMsg).text(lastnameInput.data("errormsg"));
- $(errorMsgWrapper).removeClass("hidden");
- } else if (!username) {
- $(errorMsg).text("Username is a required field. It cannot be empty.");
- $(errorMsgWrapper).removeClass("hidden");
- } else if (!inputIsValid(usernameInput.data("regex"), username)) {
- $(errorMsg).text(usernameInput.data("errormsg"));
- $(errorMsgWrapper).removeClass("hidden");
- } else if (!emailAddress) {
- $(errorMsg).text("Email is a required field. It cannot be empty.");
- $(errorMsgWrapper).removeClass("hidden");
- } else if (!emailIsValid(emailAddress)) {
- $(errorMsg).text(emailInput.data("errormsg"));
- $(errorMsgWrapper).removeClass("hidden");
- } else if (!password) {
- $(errorMsg).text("Password is a required field. It cannot be empty.");
- $(errorMsgWrapper).removeClass("hidden");
- } else if (password.length < 6) {
- $(errorMsg).text("Password should contain a minimum of 6 characters.");
- $(errorMsgWrapper).removeClass("hidden");
- } else if (password != passwordConfirmation) {
- $(errorMsg).text("Please enter the same password for confirmation.");
- $(errorMsgWrapper).removeClass("hidden");
- } else if (!privacyPolicyConsentChecked) {
- $(errorMsg).text("You need to agree with the Privacy policy in order to register with IoT Server.");
- $(errorMsgWrapper).removeClass("hidden");
- } else {
- $(errorMsgWrapper).addClass("hidden");
- $("#add-user-btn").prop('disabled', true);
-
- var addUserFormData = {};
- addUserFormData.username = username;
- addUserFormData.firstname = firstname;
- addUserFormData.lastname = lastname;
- addUserFormData.emailAddress = emailAddress;
- addUserFormData.password = $("input#password").val();
- addUserFormData.userRoles = null;
-
- var context = $(".form-login-box").data("context");
- var addUserAPI = context + "/api/user/register";
-
- $.ajax({
- type: 'POST',
- url: addUserAPI,
- contentType: 'application/json',
- data: JSON.stringify(addUserFormData),
- success: function (data) {
- $("#add-user-btn").prop('disabled', false);
- if (data == 200) {
- $('.wr-validation-summary strong').html(
- " Successfully Submitted.");
- $('.wr-validation-summary').removeClass("alert-danger");
- $('.wr-validation-summary').addClass("alert-success");
- } else if (data == 201) {
- $('.wr-validation-summary strong').html(
- " User created succssfully. You will be " +
- "redirected to login page.");
- $('.wr-validation-summary').removeClass("alert-danger");
- $('.wr-validation-summary').addClass("alert-success");
- $("#add-user-btn").prop('disabled', true);
- setTimeout(function () {
- window.location = context + "/login";
- }, 2000);
- } else if (data == 400) {
- $('.wr-validation-summary strong').html(
- " Exception at backend.");
- $('.wr-validation-summary').removeClass("alert-danger");
- $('.wr-validation-summary').addClass("alert-warning");
- } else if (data == 403) {
- $('.wr-validation-summary strong').html("Action not permitted.");
- } else if (data == 409) {
- $('.wr-validation-summary strong').html(
- " User name already exists.");
- $('.wr-validation-summary').removeClass("alert-default");
- $('.wr-validation-summary').addClass("alert-success");
- }
- $('.wr-validation-summary').removeClass("hidden");
- $('#password').val('');
- $('#password_confirmation').val('');
- },
- error: function (err) {
- $("#add-user-btn").prop('disabled', false);
- $('.wr-validation-summary strong').html(
- " An unexpected error occurred.");
- $('.wr-validation-summary').removeClass("hidden");
- }
- });
- }
- });
-});
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.register/register.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.register/register.hbs
deleted file mode 100644
index 98ee528e40..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.register/register.hbs
+++ /dev/null
@@ -1,98 +0,0 @@
-{{unit "cdmf.unit.ui.title" pageTitle="Register"}}
-
-{{#zone "content"}}
- {{unit "uuf.unit.lib.form-validation"}}
-
-
-
-
Register
-
-
Create a new account in Entgra IoT Server(All fields are required.)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- This site uses cookies. By logging in to the site, you are agreeing on the usage of cookies.
- For more information, refer
-
- Cookie policy
- .
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-{{/zone}}
-
-{{#zone "bottomJs"}}
- {{js "js/validate-register.js"}}
-{{/zone}}
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.register/register.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.register/register.js
deleted file mode 100644
index 88cec36cde..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.register/register.js
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright (c) 2018 - 2023, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved.
- *
- * Entgra (Pvt) Ltd. 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.
- */
-
-/**
- * Returns the dynamic state to be populated by add-user page.
- *
- * @param context Object that gets updated with the dynamic state of this page to be presented
- * @returns {*} A context object that returns the dynamic state of this page to be presented
- */
-function onRequest(context) {
- var devicemgtProps = require("/app/modules/conf-reader/main.js")["conf"];
- var page = {};
- page["usernameJSRegEx"] = devicemgtProps.userValidationConfig.usernameJSRegEx;
- page["usernameHelpText"] = devicemgtProps.userValidationConfig.usernameHelpMsg;
- page["usernameRegExViolationErrorMsg"] = devicemgtProps.userValidationConfig.usernameRegExViolationErrorMsg;
- page["firstnameJSRegEx"] = devicemgtProps.userValidationConfig.firstnameJSRegEx;
- page["firstnameRegExViolationErrorMsg"] = devicemgtProps.userValidationConfig.firstnameRegExViolationErrorMsg;
- page["lastnameJSRegEx"] = devicemgtProps.userValidationConfig.lastnameJSRegEx;
- page["lastnameRegExViolationErrorMsg"] = devicemgtProps.userValidationConfig.lastnameRegExViolationErrorMsg;
- page["emailJSRegEx"] = devicemgtProps.userValidationConfig.emailJSRegEx;
- page["emailRegExViolationErrorMsg"] = devicemgtProps.userValidationConfig.emailRegExViolationErrorMsg;
- return page;
-}
\ No newline at end of file
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.register/register.json b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.register/register.json
deleted file mode 100644
index 58346ba14a..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.register/register.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "version": "1.0.0",
- "uri": "/register",
- "isAnonymous": true,
- "layout": "uuf.layout.sign-in"
-}
\ No newline at end of file
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.role.create/create.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.role.create/create.hbs
deleted file mode 100644
index 45411b407f..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.role.create/create.hbs
+++ /dev/null
@@ -1,161 +0,0 @@
-{{!
- 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.
-}}
-{{unit "cdmf.unit.ui.title" pageTitle="Role Management"}}
-
-{{#zone "breadcrumbs"}}
-
- Please click "Add Another Role", if you wish to add another role or click
- "View Role List" to complete the process and go back to the role list.
-
-
-
-
-
-
-
-
- Add Another Role
-
-
-
-
-
-
-
-
- {{else}}
-
- Permission Denied
-
-
- You not authorized to enter Role Management Section.
-
- {{/if}}
-{{/zone}}
-{{#zone "bottomJs"}}
- {{js "js/bottomJs.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/pages/cdmf.page.role.create/create.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.role.create/create.js
deleted file mode 100644
index c24bbffbd9..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.role.create/create.js
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright (c) 2018 - 2023, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved.
- *
- * Entgra (Pvt) Ltd. 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.
- */
-
-/**
- * Returns the dynamic state to be populated by add-user page.
- *
- * @param context Object that gets updated with the dynamic state of this page to be presented
- * @returns {*} A displayData object that returns the dynamic state of this page to be presented
- */
-function onRequest(context) {
- var userModule = require("/app/modules/business-controllers/user.js")["userModule"];
- var deviceMgtProps = require("/app/modules/conf-reader/main.js")["conf"];
- var displayData = {};
-
- displayData["userStores"] = userModule.getSecondaryUserStores();
- displayData["roleNameJSRegEx"] = deviceMgtProps["roleValidationConfig"]["roleNameJSRegEx"];
- displayData["roleNameHelpText"] = deviceMgtProps["roleValidationConfig"]["roleNameHelpMsg"];
- displayData["roleNameRegExViolationErrorMsg"] = deviceMgtProps["roleValidationConfig"]["roleNameRegExViolationErrorMsg"];
-
- if (userModule.isAuthorized("/permission/admin/device-mgt/roles/manage")) {
- displayData.canManage = true;
- }
- if (userModule.isAuthorized("/permission/admin/device-mgt/users/view")) {
- displayData.canViewUsers = true;
- }
- displayData.isCloud = deviceMgtProps.isCloud;
-
- return displayData;
-}
\ No newline at end of file
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.role.create/create.json b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.role.create/create.json
deleted file mode 100644
index adab2be0f6..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.role.create/create.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "version": "1.0.0",
- "uri": "/role/add",
- "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/pages/cdmf.page.role.create/public/js/bottomJs.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.role.create/public/js/bottomJs.js
deleted file mode 100644
index 0e3c0f6d5f..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.role.create/public/js/bottomJs.js
+++ /dev/null
@@ -1,249 +0,0 @@
-/*
- * Copyright (c) 2018 - 2023, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved.
- *
- * Entgra (Pvt) Ltd. 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.
- */
-
-/**
- * Checks if provided input is valid against RegEx input.
- *
- * @param regExp Regular expression
- * @param inputString Input string to check
- * @returns {boolean} Returns true if input matches RegEx
- */
-function inputIsValid(regExp, inputString) {
- regExp = new RegExp(regExp);
- return regExp.test(inputString);
-}
-
-var validateInline = {};
-var clearInline = {};
-
-var apiBasePath = "/api/device-mgt/v1.0";
-var domain = $("#domain").val();
-var isCloud = $("#role-create-form").data("cloud");
-
-
-var enableInlineError = function (inputField, errorMsg, errorSign) {
- var fieldIdentifier = "#" + inputField;
- var errorMsgIdentifier = "#" + inputField + " ." + errorMsg;
- var errorSignIdentifier = "#" + inputField + " ." + errorSign;
-
- if (inputField) {
- $(fieldIdentifier).addClass(" has-error has-feedback");
- }
-
- if (errorMsg) {
- $(errorMsgIdentifier).removeClass(" hidden");
- }
-
- if (errorSign) {
- $(errorSignIdentifier).removeClass(" hidden");
- }
-};
-
-var disableInlineError = function (inputField, errorMsg, errorSign) {
- var fieldIdentifier = "#" + inputField;
- var errorMsgIdentifier = "#" + inputField + " ." + errorMsg;
- var errorSignIdentifier = "#" + inputField + " ." + errorSign;
-
- if (inputField) {
- $(fieldIdentifier).removeClass(" has-error has-feedback");
- }
-
- if (errorMsg) {
- $(errorMsgIdentifier).addClass(" hidden");
- }
-
- if (errorSign) {
- $(errorSignIdentifier).addClass(" hidden");
- }
-};
-
-/**
- *clear inline validation messages.
- */
-clearInline["role-name"] = function () {
- disableInlineError("roleNameField", "roleNameEmpty", "roleNameError");
-};
-
-
-/**
- * Validate if provided role-name is valid against RegEx configures.
- */
-validateInline["role-name"] = function () {
- var roleNameInput = $("input#roleName");
- var roleName = roleNameInput.val();
- if (inputIsValid(roleNameInput.data("regex"), roleName) && roleName.indexOf("@") < 0 && roleName.indexOf("/") < 0) {
- disableInlineError("roleNameField", "roleNameEmpty", "roleNameError");
- } else {
- enableInlineError("roleNameField", "roleNameEmpty", "roleNameError");
- }
-};
-
-function formatRepo(user) {
- if (user.loading) {
- return user.text
- }
- if (!user.username) {
- return;
- }
- var markup = '
';
- return markup;
-}
-
-function formatRepoSelection(user) {
- return user.username || user.text;
-}
-
-$(document).ready(function () {
- isCloud = $("#role-create-form").data("cloud");
-
- var appContext = $("#app-context").data("app-context");
- $("#users").select2({
- multiple: true,
- tags: false,
- ajax: {
- url: appContext + "/api/invoker/execute/",
- method: "POST",
- dataType: 'json',
- delay: 250,
- id: function (user) {
- return user.username;
- },
- data: function (params) {
- var postData = {};
- postData.requestMethod = "GET";
- postData.requestURL = "/api/device-mgt/v1.0/users/search/usernames?filter=" + params.term +
- "&domain=" + encodeURIComponent(domain);
- postData.requestPayload = null;
- return JSON.stringify(postData);
- },
- processResults: function (data) {
- var newData = [];
- $.each(data, function (index, value) {
- var user = {};
- user.id = value.username;
- user.username = value.username;
- if (value.firstname && value.lastname) {
- user.name = value.firstname + " " + value.lastname;
- }
- newData.push(user);
- });
- return {
- results: newData
- };
- },
- cache: true
- },
- escapeMarkup: function (markup) {
- return markup;
- }, // let our custom formatter work
- minimumInputLength: 1,
- templateResult: formatRepo, // omitted for brevity, see the source of this page
- templateSelection: formatRepoSelection // omitted for brevity, see the source of this page
- });
-
- /**
- * Following click function would execute
- * when a user clicks on "Add Role" button
- * on Add Role page in WSO2 MDM Console.
- */
- $("button#add-role-btn").click(function () {
-
- var domain = $("#domain").val();
- var roleNameInput = $("input#roleName");
- var roleName = roleNameInput.val();
- var users = $("#users").val();
-
- var errorMsgWrapper = "#role-create-error-msg";
- var errorMsg = "#role-create-error-msg span";
- if (!roleName) {
- $(errorMsg).text("Role name is a required field. It cannot be empty.");
- $(errorMsgWrapper).removeClass("hidden");
- } else if (!inputIsValid(roleNameInput.data("regex"), roleName) || roleName.indexOf("@") >= 0 ||
- roleName.indexOf("/") >= 0) {
- $(errorMsg).text(roleNameInput.data("error-msg"));
- $(errorMsgWrapper).removeClass("hidden");
- } else if (!domain) {
- $(errorMsg).text("Domain is a required field. It cannot be empty.");
- $(errorMsgWrapper).removeClass("hidden");
- } else if (!inputIsValid(/^[^~?!#$:;%^*`+={}\[\]\\()|<>,'"]/, domain)) {
- $(errorMsg).text("Provided domain is invalid.");
- $(errorMsgWrapper).removeClass("hidden");
- } else {
- var addRoleFormData = {};
- if (isCloud) {
- addRoleFormData.roleName = "devicemgt" + roleName;
- } else {
- addRoleFormData.roleName = roleName;
- }
- if (domain != "PRIMARY") {
- addRoleFormData.roleName = domain + "/" + roleName;
- }
- if (users == null) {
- users = [];
- }
- addRoleFormData.users = users;
-
- var addRoleAPI = apiBasePath + "/roles";
-
- invokerUtil.post(
- addRoleAPI,
- addRoleFormData,
- function (data, textStatus, jqXHR) {
- if (jqXHR.status == 201) {
- // Clearing user input fields.
- $("input#roleName").val("");
- $("#domain").val("PRIMARY");
- $("#users").val("");
- window.location.href = appContext + "/role/edit-permission/?rolename=" +
- encodeURIComponent(addRoleFormData.roleName);
- }
- },
- function (jqXHR) {
- if (jqXHR.status == 500) {
- $(errorMsg).text("Either role already exists or unexpected error.");
- $(errorMsgWrapper).removeClass("hidden");
- }
- }
- );
- }
- });
-
- var roleNameInputElement = "#roleName";
- $(roleNameInputElement).focus(function () {
- clearInline["role-name"]();
- });
-
- $(roleNameInputElement).blur(function () {
- validateInline["role-name"]();
- });
-
- /* When the user store domain value is changed, the users who are assigned to that role should be removed, as
- user and role can be mapped only if both are in same user store
- */
- $("#domain").change(function () {
- $("#users").select2("val", "");
- domain = $("#domain").val();
- });
-});
\ No newline at end of file
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.role.edit.permission/permission.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.role.edit.permission/permission.hbs
deleted file mode 100644
index a05a504ca0..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.role.edit.permission/permission.hbs
+++ /dev/null
@@ -1,44 +0,0 @@
-{{!
- 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.
-}}
-{{unit "cdmf.unit.ui.title" pageTitle="Role Management"}}
-
-{{unit "cdmf.unit.lib.service-invoker-utility"}}
-{{unit "cdmf.unit.lib.data-table"}}
-{{unit "cdmf.unit.lib.handlebars"}}
-
-{{#zone "breadcrumbs"}}
-
-{{/zone}}
-
-{{#zone "content"}}
- {{unit "cdmf.unit.role.edit.permission"}}
-{{/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/pages/cdmf.page.role.edit.permission/permission.json b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.role.edit.permission/permission.json
deleted file mode 100644
index 952c4abe20..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.role.edit.permission/permission.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "version": "1.0.0",
- "uri": "/role/edit-permission/",
- "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/pages/cdmf.page.role.edit/edit.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.role.edit/edit.hbs
deleted file mode 100644
index d1c488dbef..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.role.edit/edit.hbs
+++ /dev/null
@@ -1,43 +0,0 @@
-{{!
- 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.
-}}
-{{unit "cdmf.unit.ui.title" pageTitle="Role Management"}}
-
-{{unit "cdmf.unit.lib.select2"}}
-
-{{#zone "breadcrumbs"}}
-
-{{/each}}
\ No newline at end of file
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.roles/roles.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.roles/roles.hbs
deleted file mode 100644
index 98f85e8137..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.roles/roles.hbs
+++ /dev/null
@@ -1,120 +0,0 @@
-{{!
- 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.
-}}
-
-{{unit "cdmf.unit.ui.title" pageTitle="Role Management"}}
-{{unit "cdmf.unit.data-tables-extended"}}
-{{unit "cdmf.unit.ui.modal"}}
-
-{{#zone "breadcrumbs"}}
-
-
- {{/if}}
-{{/zone}}
-
-{{#zone "bottomJs"}}
-
-
- {{js "js/role-listing.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/pages/cdmf.page.roles/roles.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.roles/roles.js
deleted file mode 100644
index d2abe1a56b..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.roles/roles.js
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 2018 - 2023, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved.
- *
- * Entgra (Pvt) Ltd. 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.
- */
-
-function onRequest(context) {
- var userModule = require("/app/modules/business-controllers/user.js")["userModule"];
- var deviceMgtProps = require("/app/modules/conf-reader/main.js")["conf"];
-
- context["permissions"] = userModule.getUIPermissions();
- if (userModule.isAuthorized("/permission/admin/device-mgt/roles/delete")) {
- context["removePermitted"] = true;
- }
- if (userModule.isAuthorized("/permission/admin/device-mgt/roles/update")) {
- context["editPermitted"] = true;
- }
- if (userModule.isAuthorized("/permission/admin/device-mgt/roles/remove")) {
- context["removePermitted"] = true;
- }
-
- context["adminRole"] = deviceMgtProps["adminRole"];
- context["isCloud"] = deviceMgtProps["isCloud"];
- var roleCount = userModule.getRolesCount()
- if (deviceMgtProps["isCloud"]) {
- roleCount = userModule.getFilteredRoles("devicemgt").content.count;
- }
-
- if (roleCount > 0) {
- context["hasRoles"] = true;
- } else {
- context["hasRoles"] = false;
- }
-
- return context;
-}
\ No newline at end of file
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.roles/roles.json b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.roles/roles.json
deleted file mode 100644
index 44d4ee20c8..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.roles/roles.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "version": "1.0.0",
- "uri": "/roles",
- "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/pages/cdmf.page.sign-in.consent-do/consent-do.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.sign-in.consent-do/consent-do.hbs
deleted file mode 100644
index 22869a4828..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.sign-in.consent-do/consent-do.hbs
+++ /dev/null
@@ -1,75 +0,0 @@
-{{!
- Copyright (c) 2018, 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 "title"}}{{! to override parent page title }}{{/zone}}
-{{unit "cdmf.unit.ui.title" pageTitle="Consent Page"}}
-
-{{#zone "content"}}
-
-
-
-
User Consents
-
-
- {{appName}} application requests access to your profile information
-
-
-
-
-
-
-
-{{/zone}}
-{{#zone "bottomJs"}}
- {{js "js/script.js"}}
-{{/zone}}
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.sign-in.consent-do/consent-do.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.sign-in.consent-do/consent-do.js
deleted file mode 100644
index 6e8ed84016..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.sign-in.consent-do/consent-do.js
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Copyright (c) 2018 - 2023, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved.
- *
- * Entgra (Pvt) Ltd. 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.
- */
-
-function onRequest(context) {
- var Encode = Packages.org.owasp.encoder.Encode;
- var viewModel = {};
-
- // if sp is received, its a saml request or else its oidc
- if(request.getParameter("sp") !== null) {
- viewModel.appName = Encode.forHtml(request.getParameter("sp"));
- viewModel.action = "/commonauth";
- viewModel.sessionDataKey = Encode.forHtmlAttribute(request.getParameter("sessionDataKey"));
- viewModel.sessionDataKeyName = "sessionDataKey";
- viewModel.ssoProtocol = "saml";
- } else {
- viewModel.appName = Encode.forHtml(request.getParameter("application"));
- viewModel.action = "../oauth2/authorize";
- viewModel.sessionDataKey = Encode.forHtmlAttribute(request.getParameter("sessionDataKeyConsent"));
- viewModel.sessionDataKeyName = "sessionDataKeyConsent";
- viewModel.ssoProtocol = "oidc";
- }
- var mandatoryClaims = [];
- var requestedClaims = [];
- var singleMandatoryClaim = false;
-
- var mandatoryClaimsList, requestedClaimsList;
- var i, j, partOne, partTwo;
- if (request.getParameter("mandatoryClaims")) {
- mandatoryClaimsList = request.getParameter("mandatoryClaims").split(",");
- singleMandatoryClaim = (mandatoryClaimsList.length === 1);
- for (j = 0; j < mandatoryClaimsList.length; j++) {
- var mandatoryClaimsStr = mandatoryClaimsList[j];
- i = mandatoryClaimsStr.indexOf('_');
- partOne = mandatoryClaimsStr.slice(0, i);
- partTwo = mandatoryClaimsStr.slice(i + 1, mandatoryClaimsStr.length);
- mandatoryClaims.push(
- {"claimId": Encode.forHtmlAttribute(partOne), "displayName": Encode.forHtmlAttribute(partTwo)}
- );
- }
- }
- if (request.getParameter("requestedClaims")) {
- requestedClaimsList = request.getParameter("requestedClaims").split(",");
- for (j = 0; j < requestedClaimsList.length; j++) {
- var requestedClaimsStr = requestedClaimsList[j];
- i = requestedClaimsStr.indexOf('_');
- partOne = requestedClaimsStr.slice(0, i);
- partTwo = requestedClaimsStr.slice(i + 1, requestedClaimsStr.length);
- requestedClaims.push(
- {"claimId": Encode.forHtmlAttribute(partOne), "displayName": Encode.forHtmlAttribute(partTwo)}
- );
- }
- }
- viewModel.mandatoryClaims = mandatoryClaims;
- viewModel.requestedClaims = requestedClaims;
- viewModel.singleMandatoryClaim = singleMandatoryClaim;
- return viewModel;
-}
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.sign-in.consent-do/consent-do.json b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.sign-in.consent-do/consent-do.json
deleted file mode 100644
index 4ca8fc3a6c..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.sign-in.consent-do/consent-do.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "version": "1.0.0",
- "layout": "uuf.layout.sign-in",
- "uri": "/consent.do",
- "isAnonymous": 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/pages/cdmf.page.sign-in.consent-do/public/js/script.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.sign-in.consent-do/public/js/script.js
deleted file mode 100644
index 63a02f526f..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.sign-in.consent-do/public/js/script.js
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 2018 - 2023, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved.
- *
- * Entgra (Pvt) Ltd. 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.
- */
-
-function approved(ssoProtocol) {
- var mandatoryClaimCBs = $(".mandatory-claim");
- var checkedMandatoryClaimCBs = $(".mandatory-claim:checked");
-
- if (checkedMandatoryClaimCBs.length == mandatoryClaimCBs.length) {
- if(ssoProtocol === "saml") {
- document.getElementById('consent').value = "approve";
- } else if(ssoProtocol === "oidc") {
- document.getElementById('consent').value = "approveAlways";
- }
- document.getElementById("consentForm").submit();
- } else {
- $("#modal_claim_validation").modal();
- }
-}
-
-function deny() {
- document.getElementById('consent').value = "deny";
- document.getElementById("consentForm").submit();
-}
-
-$(document).ready(function () {
- $("#consent_select_all").click(function () {
- if (this.checked) {
- $('.checkbox input:checkbox').each(function () {
- $(this).prop("checked", true);
- });
- } else {
- $('.checkbox :checkbox').each(function () {
- $(this).prop("checked", false);
- });
- }
- });
- $(".checkbox input").click(function (e) {
- if (e.target.id !== 'consent_select_all') {
- $("#consent_select_all").prop("checked", false);
- }
- });
-});
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.sign-in.login-do/login-do.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.sign-in.login-do/login-do.hbs
deleted file mode 100644
index e2e0a92c1f..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.sign-in.login-do/login-do.hbs
+++ /dev/null
@@ -1,68 +0,0 @@
-{{!
- Copyright (c) 2018, 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 "title"}}{{! to override parent page title }}{{/zone}}
-{{unit "cdmf.unit.ui.title" pageTitle="Login"}}
-
-{{#zone "content"}}
-
-
-
-
Login
-
- {{#if message}}
-
- {{message}}!
-
- {{/if}}
-
-
-
-
-
-
-{{/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/pages/cdmf.page.sign-in.login-do/login-do.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.sign-in.login-do/login-do.js
deleted file mode 100644
index 0b0a29d8ef..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.sign-in.login-do/login-do.js
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 2018 - 2023, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved.
- *
- * Entgra (Pvt) Ltd. 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.
- */
-
-function onRequest(context) {
- var authModuleConfigs = context.app.conf["authModule"];
- var sessionDataKey = request.getParameter("sessionDataKey");
- var authFailure = request.getParameter("authFailure");
-
- //if sso enabled and sessionDataKey is empty redirect
- var ssoConfigs = authModuleConfigs["sso"];
- if (ssoConfigs && (ssoConfigs["enabled"].toString() == "true") && !sessionDataKey) {
- // SSO is enabled in Auth module.
- var redirectUri = context.app.context + "/uuf/login";
- var queryString = request.getQueryString();
- if (queryString && (queryString.length > 0)) {
- redirectUri = redirectUri + "?" + queryString;
- }
- response.sendRedirect(encodeURI(redirectUri));
- exit();
- }
-
- var viewModel = {};
- var loginActionUrl = context.app.context + "/uuf/login";
- if (sessionDataKey) {
- loginActionUrl = "/commonauth";
- }
-
- if (authFailure) {
- viewModel.message = "Login failed! Please recheck the username and password and try again.";
- }
-
- viewModel.sessionDataKey = sessionDataKey;
- viewModel.loginActionUrl = loginActionUrl;
- return viewModel;
-}
\ No newline at end of file
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.sign-in.login-do/login-do.json b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.sign-in.login-do/login-do.json
deleted file mode 100644
index 467bcc522b..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.sign-in.login-do/login-do.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "version": "1.0.0",
- "layout": "uuf.layout.sign-in",
- "uri": "/login.do",
- "isAnonymous": 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/pages/cdmf.page.sign-in.retry-do/retry-do.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.sign-in.retry-do/retry-do.hbs
deleted file mode 100644
index db89a9d7bc..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.sign-in.retry-do/retry-do.hbs
+++ /dev/null
@@ -1,32 +0,0 @@
-{{!
- Copyright (c) 2018, 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 "title"}}{{! to override parent page title }}{{/zone}}
-{{unit "cdmf.unit.ui.title" pageTitle="Authentication Failed!"}}
-
-{{#zone "content"}}
-
-
-
-
{{stat}}
-
-
- {{statusMessage}}
-
-
-
-{{/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/pages/cdmf.page.sign-in.retry-do/retry-do.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.sign-in.retry-do/retry-do.js
deleted file mode 100644
index bb0ec87cac..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.sign-in.retry-do/retry-do.js
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright (c) 2018 - 2023, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved.
- *
- * Entgra (Pvt) Ltd. 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.
- */
-
-function onRequest(context) {
- var Encode = Packages.org.owasp.encoder.Encode;
- session.invalidate();
- var viewModel = {};
-
- var stat = request.getParameter("status");
- var statusMessage = request.getParameter("statusMsg");
-
- if (!stat || !statusMessage) {
- stat = "Authentication Error!";
- statusMessage = "Something went wrong during the authentication process.Please try signing in again.";
- }
-
- viewModel.stat = Encode.forHtmlContent(stat);
- viewModel.statusMessage = Encode.forHtmlContent(statusMessage);
- return viewModel;
-}
\ No newline at end of file
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.sign-in.retry-do/retry-do.json b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.sign-in.retry-do/retry-do.json
deleted file mode 100644
index b66acf55c9..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.sign-in.retry-do/retry-do.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "version": "1.0.0",
- "layout": "uuf.layout.sign-in",
- "uri": "/retry.do",
- "isAnonymous": 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/pages/cdmf.page.sign-in/sign-in.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.sign-in/sign-in.hbs
deleted file mode 100644
index 104579406b..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.sign-in/sign-in.hbs
+++ /dev/null
@@ -1,23 +0,0 @@
-{{!
- 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 "title"}}{{! to override parent page title }}{{/zone}}
-{{unit "cdmf.unit.ui.title" pageTitle="Login"}}
-
-{{#zone "content"}}
- Redirecting, Please wait...
-{{/zone}}
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.sign-in/sign-in.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.sign-in/sign-in.js
deleted file mode 100644
index a300ba0785..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.sign-in/sign-in.js
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Copyright (c) 2018 - 2023, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved.
- *
- * Entgra (Pvt) Ltd. 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.
- */
-
-function onRequest(context) {
- response.sendRedirect(context.app.context + "/uuf/login");
-}
\ No newline at end of file
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.sign-in/sign-in.json b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.sign-in/sign-in.json
deleted file mode 100644
index 91d4a819bd..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.sign-in/sign-in.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "version": "1.0.0",
- "layout": "uuf.layout.sign-in",
- "uri": "/login",
- "isAnonymous": 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/pages/cdmf.page.sign-out/sign-out.json b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.sign-out/sign-out.json
deleted file mode 100644
index 48f1ee4829..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.sign-out/sign-out.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "version": "1.0.0",
- "uri": "/logout",
- "extends": "uuf.page.sign-out"
-}
\ No newline at end of file
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.topic/public/js/topic-listing.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.topic/public/js/topic-listing.js
deleted file mode 100644
index 568c2b80a3..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.topic/public/js/topic-listing.js
+++ /dev/null
@@ -1,283 +0,0 @@
-/*
- * Copyright (c) 2018 - 2023, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved.
- *
- * Entgra (Pvt) Ltd. 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.
- */
-
-/**
- * Following function would execute
- * when a user clicks on the list item
- * initial mode and with out select mode.
- */
-function InitiateViewOption(url) {
- if (!$(".select-enable-btn").text() == "Select" && !$(this).hasClass("btn")) {
- url = $(this).parent().data("url");
- $(location).attr('href', url);
- }
-}
-
-/*
- * DOM ready functions.
- */
-$(document).ready(function () {
-
- var permissionSet = {};
- $.setPermission = function (permission) {
- permissionSet[permission] = true;
- };
-
- $.hasPermission = function (permission) {
- return permissionSet[permission];
- };
-
- name = getParameterByName("name");
-
- /* for device list sorting drop down */
- $(".ctrl-filter-type-switcher").popover({
- html: true,
- content: function () {
- return $("#content-filter-types").html();
- }
- });
-});
-
-function loadTopics(searchType, searchParam) {
-
- var serviceURL;
- if ($.hasPermission("VIEW_TOPICS")) {
- serviceURL = "/api/mqtt-topics/v1.0/admin/topics";
- } else {
- $("#loading-content").remove();
- $('#topics-table').addClass('hidden');
- $('#topics-listing-status-msg').text('Permission denied.');
- $("#topics-listing-status").removeClass(' hidden');
- return;
- }
-
- var columns = [
- {
- targets: 0,
- data: 'localSubscribedQueueOrTopicName',
- class: 'remove-padding-top viewEnabledIcon',
- render: function (data, type, row, meta) {
- return '
';
- }
- },
- {
- targets: 1,
- data: 'localSubscribedQueueOrTopicName',
- class: 'remove-padding-top viewEnabledIcon',
- },
- {
- targets: 2,
- data: 'localNumberOfMessagesRemainingForSubscriber',
- class: 'remove-padding-top viewEnabledIcon',
- },
- {
- targets: 3,
- data: 'localActive',
- class: 'remove-padding-top viewEnabledIcon',
- },
- {
- targets: 4,
- data: 'localDurable',
- class: 'remove-padding-top viewEnabledIcon',
- },
- {
- targets: 5,
- data: 'localSubscriberQueueName',
- class: 'remove-padding-top viewEnabledIcon',
- },
- {
- targets: 6,
- data: 'localSubscriptionIdentifier',
- class: 'remove-padding-top viewEnabledIcon',
- }
- ];
-
- var fnCreatedRow = function (row, data, dataIndex) {
- $(row).attr('data-type', 'selectable');
- $(row).attr('localSubscribedQueueOrTopicName', htmlspecialchars(data.localSubscribedQueueOrTopicName));
- $(row).attr('localNumberOfMessagesRemainingForSubscriber', htmlspecialchars(data.localNumberOfMessagesRemainingForSubscriber));
- $(row).attr('data-url', context + '/device/' + htmlspecialchars(data.localSubscribedQueueOrTopicName) + '?id=' + htmlspecialchars(data.localNumberOfMessagesRemainingForSubscriber));
-
- var topicName = htmlspecialchars(data.localSubscribedQueueOrTopicName);
- var remainingMesgCount = htmlspecialchars(data.localNumberOfMessagesRemainingForSubscriber);
- var isActive = htmlspecialchars(data.localActive);
- var isDurable = htmlspecialchars(data.localDurable);
- var localSubscriberQueueName = htmlspecialchars(data.localSubscriberQueueName);
- var subscriptionIdentifier = htmlspecialchars(data.localSubscriptionIdentifier);
- $.each($('td', row), function (colIndex) {
- switch (colIndex) {
- case 1:
- $(this).attr('data-grid-label', "Topic Name");
- $(this).attr('data-search', topicName);
- $(this).attr('data-display', topicName);
- break;
- case 2:
- $(this).attr('data-grid-label', "Remaining Messages");
- $(this).attr('data-search', remainingMesgCount);
- $(this).attr('data-display', remainingMesgCount);
- break;
- case 3:
- $(this).attr('data-grid-label', "Active");
- $(this).attr('data-search', isActive);
- $(this).attr('data-display', isActive);
- break;
- case 4:
- $(this).attr('data-grid-label', "Durable");
- $(this).attr('data-search', isDurable);
- $(this).attr('data-display', isDurable);
- break;
- case 5:
- $(this).attr('data-grid-label', "Subscriber Queue Name");
- $(this).attr('data-search', localSubscriberQueueName);
- $(this).attr('data-display', localSubscriberQueueName);
- break;
- case 6:
- $(this).attr('data-grid-label', "SubscriptionIdentifier");
- $(this).attr('data-search', subscriptionIdentifier);
- $(this).attr('data-display', subscriptionIdentifier);
- break;
- }
- });
- };
-
- function htmlspecialchars(text) {
- return jQuery('').text(text).html();
- }
-
- var dataFilter = function (data) {
- data = JSON.parse(data);
- var objects = [];
- $(data.subscriptions).each(function (index) {
- objects.push(
- {
- localSubscribedQueueOrTopicName: data.subscriptions[index].localSubscribedQueueOrTopicName,
- localNumberOfMessagesRemainingForSubscriber: data.subscriptions[index].localNumberOfMessagesRemainingForSubscriber,
- localActive: data.subscriptions[index].localActive,
- localDurable: data.subscriptions[index].localDurable,
- localSubscriberQueueName: data.subscriptions[index].localSubscriberQueueName,
- localSubscriptionIdentifier: data.subscriptions[index].localSubscriptionIdentifier,
- name: data.subscriptions[index].localSubscribedQueueOrTopicName
- }
- );
- });
-
- var json = {
- "recordsTotal": data.count,
- "recordsFiltered": data.count,
- "data": objects
- };
-
- return JSON.stringify(json);
- };
-
- $('#topics-grid').datatables_extended_serverside_paging(
- null,
- serviceURL,
- dataFilter,
- columns,
- fnCreatedRow,
- function () {
- $(".icon .text").res_text(0.2);
- $('#topics-grid').removeClass('hidden');
- $("#loading-content").remove();
- }, {
- "placeholder": "Search By Topic Name",
- "searchKey": "name"
- }
- );
-}
-
-/*
- * DOM ready functions.
- */
-$(document).ready(function () {
- /* Adding selected class for selected devices */
- var permissionList = $("#permission").data("permission");
- for (var key in permissionList) {
- if (permissionList.hasOwnProperty(key)) {
- $.setPermission(key);
- }
- }
- loadTopics();
- $(".dataTables_toolbar").css("display", "none");
-
- /* for topic list sorting drop down */
- $(".ctrl-filter-type-switcher").popover({
- html: true,
- content: function () {
- return $("#content-filter-types").html();
- }
- });
-
- /* for data tables*/
- $('[data-toggle="tooltip"]').tooltip();
-
- $("[data-toggle=popover]").popover();
-
- $(".ctrl-filter-type-switcher").popover({
- html: true,
- content: function () {
- return $('#content-filter-types').html();
- }
- });
-
- $('#nav').affix({
- offset: {
- top: $('header').height()
- }
- });
-
-});
-
-var modalPopup = ".modal";
-var modalPopupContainer = modalPopup + " .modal-content";
-var modalPopupContent = modalPopup + " .modal-content";
-var body = "body";
-
-/*
- * set popup maximum height function.
- */
-function setPopupMaxHeight() {
- $(modalPopupContent).css('max-height', ($(body).height() - ($(body).height() / 100 * 30)));
- $(modalPopupContainer).css('margin-top', (-($(modalPopupContainer).height() / 2)));
-}
-
-/*
- * show popup function.
- */
-function showPopup() {
- $(modalPopup).modal('show');
-}
-
-/*
- * hide popup function.
- */
-function hidePopup() {
- $(modalPopupContent).html("");
- $(modalPopupContent).removeClass("operation-data");
- $(modalPopup).modal('hide');
- $('body').removeClass('modal-open').css('padding-right', '0px');
- $('.modal-backdrop').remove();
-}
-
-function getParameterByName(name) {
- name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
- var regex = new RegExp("[\\?&]" + name + "=([^]*)"),
- results = regex.exec(location.search);
- return results === null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
-}
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.topic/topic.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.topic/topic.hbs
deleted file mode 100644
index e34956912d..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.topic/topic.hbs
+++ /dev/null
@@ -1,131 +0,0 @@
-{{!
- 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.
-}}`
-{{unit "cdmf.unit.ui.title" pageTitle="MQTT Dashboard"}}
-
-{{unit "cdmf.unit.data-tables-extended"}}
-{{unit "cdmf.unit.lib.ui-permissions-utility"}}
-
-{{#zone "breadcrumbs"}}
-
-{{/zone}}
-
-{{#zone "bottomJs"}}
-
- {{js "js/topic-listing.js"}}
-{{/zone}}
-
-{{#zone "topCss"}}
-
-{{/zone}}
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.topic/topic.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.topic/topic.js
deleted file mode 100644
index df6a76b512..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.topic/topic.js
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright (c) 2018 - 2023, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved.
- *
- * Entgra (Pvt) Ltd. 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.
- */
-
-function onRequest(context) {
- var constants = require("/app/modules/constants.js");
- var userModule = require("/app/modules/business-controllers/user.js")["userModule"];
- var deviceModule = require("/app/modules/business-controllers/device.js")["deviceModule"];
- var groupModule = require("/app/modules/business-controllers/group.js")["groupModule"];
-
- var groupId = request.getParameter("groupId");
-
- var viewModel = {};
- var title = "Topics";
- viewModel.title = title;
- var currentUser = session.get(constants.USER_SESSION_KEY);
- if (currentUser) {
- viewModel.permissions = {};
- var uiPermissions = userModule.getUIPermissions();
- viewModel.permissions.list = stringify(uiPermissions);
- if (uiPermissions.VIEW_TOPICS) {
- viewModel.permissions.enroll = true;
- }
- viewModel.currentUser = currentUser;
- var deviceCount = 1;
- viewModel.deviceCount = deviceCount;
- var utility = require("/app/modules/utility.js").utility;
- }
- return viewModel;
-}
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.topic/topic.json b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.topic/topic.json
deleted file mode 100644
index a7f2976443..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.topic/topic.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "version": "1.0.0",
- "uri": "/topics",
- "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/pages/cdmf.page.user.create/create.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.user.create/create.hbs
deleted file mode 100644
index 6dc712ad2c..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.user.create/create.hbs
+++ /dev/null
@@ -1,154 +0,0 @@
-{{!
- 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.
-}}
-{{unit "cdmf.unit.ui.title" pageTitle="User Management | Add User"}}
-{{unit "cdmf.unit.ui.modal"}}
-{{#zone "breadcrumbs"}}
-
');
- modalDialog.show();
- generateQRCode("#user-created-msg .qr-code");
-
- }
- }, function (data) {
- var payload = JSON.parse(data.responseText);
- if (data.status == 409) {
- $(errorMsg).text("User : " + username + " already exists. Pick another username.");
- } else if (data.status == 500) {
- $(errorMsg).text("An unexpected error occurred at backend server. Please try again later.");
- } else {
- $(errorMsg).text(payload.message);
- }
- $(errorMsgWrapper).removeClass("hidden");
- }
- );
- }
- });
-
- $("#username").focus(function () {
- clearInline["user-name"]();
- });
-
- $("#username").blur(function () {
- validateInline["user-name"]();
- });
-
- $("#emailAddress").focus(function () {
- clearInline["emailAddress"]();
- });
-
- $("#emailAddress").blur(function () {
- validateInline["emailAddress"]();
- });
-
- $("#lastname").focus(function () {
- clearInline["last-name"]();
- });
-
- $("#lastname").blur(function () {
- validateInline["last-name"]();
- });
-
- $("#firstname").focus(function () {
- clearInline["first-name"]();
- });
-
- $("#firstname").blur(function () {
- validateInline["first-name"]();
- });
-});
\ No newline at end of file
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.user.edit/edit.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.user.edit/edit.hbs
deleted file mode 100644
index 41728ad0a8..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.user.edit/edit.hbs
+++ /dev/null
@@ -1,146 +0,0 @@
-{{!
- 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.
-}}
-{{unit "cdmf.unit.ui.title" pageTitle="User Management | Edit User"}}
-
-{{#zone "breadcrumbs"}}
-
- Please click "Add A New User", if you wish to add user or click
- "View User List" to navigate to the user list.
-
-
-
-
-
-
-
- Add Another User
-
-
-
- {{/if}}
- {{else}}
-
- Permission Denied
-
-
- You not authorized to enter User Management Section.
-
- {{/if}}
-{{/zone}}
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.user.view/view.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.user.view/view.js
deleted file mode 100644
index c308e39f1e..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.user.view/view.js
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright (c) 2018 - 2023, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved.
- *
- * Entgra (Pvt) Ltd. 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.
- */
-
-function onRequest(context) {
- var userModule = require("/app/modules/business-controllers/user.js")["userModule"];
- var deviceMgtProps = require("/app/modules/conf-reader/main.js")["conf"];
- var isExsistingUser = false;
- var userName = request.getParameter("username");
-
- var user, userRoles, devices;
-
- if (userName) {
- var response = userModule.getUser(userName);
-
- if (response["status"] == "success") {
- user = response["content"];
- user.domain = response["userDomain"];
- isExsistingUser = true;
- }
-
- response = userModule.getRolesByUsername(userName);
- if (response["status"] == "success") {
- userRoles = response["content"];
- }
- var deviceModule = require("/app/modules/business-controllers/device.js")["deviceModule"];
- devices = deviceModule.getDevices(userName);
- }
-
- var canView = false;
- if (userModule.isAuthorized("/permission/admin/device-mgt/users/view")) {
- canView = true;
- }
-
- var canEdit = false;
- if (userModule.isAuthorized("/permission/admin/device-mgt/users/edit") &&
- userName !== deviceMgtProps['adminUser'].split("@")[0]) {
- canEdit = true;
- }
-
- var isCloud = deviceMgtProps.isCloud;
-
- return {"exists": isExsistingUser, "user": user, "userRoles": userRoles, "devices": devices, "canEdit": canEdit,
- "canView": canView, "isCloud" : isCloud};
-}
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.user.view/view.json b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.user.view/view.json
deleted file mode 100644
index dada092ce4..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.user.view/view.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "version": "1.0.0",
- "uri": "/user/view",
- "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/pages/cdmf.page.users/public/js/listing.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.users/public/js/listing.js
deleted file mode 100644
index 3d800fe736..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.users/public/js/listing.js
+++ /dev/null
@@ -1,460 +0,0 @@
-/*
- * Copyright (c) 2018 - 2023, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved.
- *
- * Entgra (Pvt) Ltd. 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.
- */
-
-/**
- * Checks if provided input is valid against RegEx input.
- *
- * @param regExp Regular expression
- * @param inputString Input string to check
- * @returns {boolean} Returns true if input matches RegEx
- */
-function inputIsValid(regExp, inputString) {
- regExp = new RegExp(regExp);
- return regExp.test(inputString);
-}
-
-$(function () {
- var sortableElem = '.wr-sortable';
- $(sortableElem).sortable({
- beforeStop: function () {
- $(this).sortable('toArray');
- }
- });
- $(sortableElem).disableSelection();
-});
-
-var apiBasePath = "/api/device-mgt/v1.0";
-var body = "body";
-
-/**
- *
- * Fires the res_text when ever a data table redraw occurs making
- * the font icons change the size to respective screen resolution.
- *
- */
-$(document).on('draw.dt', function () {
- $(".icon .text").res_text(0.2);
-});
-
-/**
- * Following click function would execute
- * when a user clicks on "Invite" link
- * on User Management page in WSO2 MDM Console.
- */
-$("a#invite-user-link").click(function () {
- var usernameList = getSelectedUsernames();
- var inviteUserAPI = apiBasePath + "/users/send-invitation";
-
- if (usernameList.length == 0) {
- modalDialog.header("Operation cannot be performed !");
- modalDialog.content("Please select a user or a list of users to send invitation emails.");
- modalDialog.footer('
');
- modalDialog.showAsError();
- } else {
- modalDialog.header("");
- modalDialog.content("An invitation mail will be sent to the selected user(s) to initiate an enrolment " +
- "process. Do you wish to continue ?");
- modalDialog.footer('
');
- modalDialog.showAsError();
- }
- );
- });
-
-}
-
-/**
- * Following function would execute
- * when a user clicks on the list item
- * initial mode and with out select mode.
- */
-function InitiateViewOption() {
- if ($("#can-view").val()) {
- $(location).attr('href', $(this).data("url"));
- } else {
- modalDialog.header("Unauthorized action!");
- modalDialog.content("You don't have permissions to view users");
- modalDialog.footer('
-{{/each}}
\ No newline at end of file
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.users/users.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.users/users.hbs
deleted file mode 100644
index 34071d41b9..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.users/users.hbs
+++ /dev/null
@@ -1,158 +0,0 @@
-{{!
- 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.
-}}
-
-{{unit "cdmf.unit.ui.title" pageTitle="User Management"}}
-{{unit "cdmf.unit.data-tables-extended"}}
-{{unit "cdmf.unit.ui.modal"}}
-
-{{#zone "breadcrumbs"}}
-
-
-{{/zone}}
-{{#zone "common-navigation"}}
-
-{{/zone}}
-{{#zone "bottomJs"}}
-
-
- {{js "js/listing.js"}}
-{{/zone}}
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.users/users.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.users/users.js
deleted file mode 100644
index 58711710f7..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.users/users.js
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright (c) 2018 - 2023, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved.
- *
- * Entgra (Pvt) Ltd. 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.
- */
-
-function onRequest(context) {
- context.handlebars.registerHelper('unequal', function (lvalue, rvalue, options) {
- if (arguments.length < 3)
- throw new Error("Handlebars Helper equal needs 2 parameters");
- if (lvalue == rvalue) {
- return options.inverse(this);
- } else {
- return options.fn(this);
- }
- });
-
- var page = {};
- var userModule = require("/app/modules/business-controllers/user.js")["userModule"];
- var deviceMgtProps = require("/app/modules/conf-reader/main.js")["conf"];
-
- page["currentUser"] = userModule.getCarbonUser().username;
- page["adminUser"] = deviceMgtProps["adminUser"].split("@")[0];
- page["isCloud"] = deviceMgtProps["isCloud"];
-
- if (userModule.isAuthorized("/permission/admin/device-mgt/users/manage")) {
- page.canManage = true;
- }
-
- if (userModule.isAuthorized("/permission/admin/device-mgt/users/view")) {
- page.canView = true;
- }
- return page;
-}
\ No newline at end of file
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.users/users.json b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.users/users.json
deleted file mode 100644
index cd0eb1438d..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.users/users.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "version": "1.0.0",
- "uri": "/users",
- "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.analytics.date-range-picker/date-range-picker.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.analytics.date-range-picker/date-range-picker.hbs
deleted file mode 100755
index 6a7f2bb962..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.analytics.date-range-picker/date-range-picker.hbs
+++ /dev/null
@@ -1,48 +0,0 @@
-{{!
- 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 "topCss"}}
- {{css "css/daterangepicker.css"}}
-{{/zone}}
-
-
-
-
-
-
-
-
-
-
-
-
-{{#zone "bottomJs"}}
- {{js "js/moment.js"}}
- {{js "js/jquery.daterangepicker.js"}}
- {{js "js/date-picker.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.analytics.date-range-picker/date-range-picker.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.analytics.date-range-picker/date-range-picker.js
deleted file mode 100755
index 4775342cf7..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.analytics.date-range-picker/date-range-picker.js
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Copyright (c) 2018 - 2023, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved.
- *
- * Entgra (Pvt) Ltd. 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.
- */
-
-function onRequest(context) {
- var deviceTypes = context.unit.params.deviceTypes;
- var deviceType = context.uriParams.deviceType;
-
- var deviceTypesList = [];
- if (deviceTypes) {
- for (var i = 0; i < deviceTypes.length; i++) {
- deviceTypesList.push(deviceTypes[i].type);
- }
- } else if (deviceType) {
- deviceTypesList.push(deviceType);
- }
- return {"deviceTypes": stringify(deviceTypesList)};
-}
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.analytics.date-range-picker/date-range-picker.json b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.analytics.date-range-picker/date-range-picker.json
deleted file mode 100755
index 688e939808..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.analytics.date-range-picker/date-range-picker.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "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.analytics.date-range-picker/public/css/daterangepicker.css b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.analytics.date-range-picker/public/css/daterangepicker.css
deleted file mode 100644
index fed735c97b..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.analytics.date-range-picker/public/css/daterangepicker.css
+++ /dev/null
@@ -1,361 +0,0 @@
-/*
- * Copyright (c) 2018 - 2023, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved.
- *
- * Entgra (Pvt) Ltd. 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.
- */
-
-.date-picker {
- width: 170px;
- height: 25px;
- padding: 0;
- border: 0;
- line-height: 25px;
- padding-left: 10px;
- font-size: 12px;
- font-family: Arial;
- font-weight: bold;
- cursor: pointer;
- color: #303030;
- position: relative;
- z-index: 2;
-}
-
-.date-picker-wrapper {
- position: absolute;
- z-index: 1;
- border: 1px solid #bfbfbf;
- background-color: #efefef;
- width: 448px;
- padding: 5px 12px;
- font-size: 12px;
- line-height: 20px;
- color: #aaa;
- font-family: Arial;
- box-shadow: 3px 3px 10px rgba(0, 0, 0, 0.5);
-}
-
-.date-picker-wrapper.single-date {
- width: auto;
-}
-
-.date-picker-wrapper.no-shortcuts {
- padding-bottom: 12px;
-}
-
-.date-picker-wrapper .footer {
- display: none;
- font-size: 11px;
- padding-top: 3px;
-}
-
-.date-picker-wrapper b {
- color: #666;
- font-weight: 700;
-}
-
-.date-picker-wrapper a {
- color: rgb(107, 180, 214);
- text-decoration: underline;
-}
-
-.date-picker-wrapper .month-wrapper {
- border: 1px solid #bfbfbf;
- border-radius: 3px;
- background-color: #fff;
- padding: 5px;
- cursor: default;
- position: relative;
- _overflow: hidden;
-}
-
-.date-picker-wrapper .month-wrapper table {
- width: 190px;
- float: left;
-}
-
-.date-picker-wrapper .month-wrapper table.month2 {
- width: 190px;
- float: right;
-}
-
-.date-picker-wrapper .month-wrapper table th,
-.date-picker-wrapper .month-wrapper table td {
- vertical-align: middle;
- text-align: center;
- line-height: 14px;
- margin: 0px;
- padding: 0px;
-}
-
-.date-picker-wrapper .month-wrapper table .day {
- height: 19px;
- line-height: 19px;
- font-size: 12px;
- margin-bottom: 1px;
- color: #999;
- cursor: default;
-}
-
-.date-picker-wrapper .month-wrapper table div.day.lastMonth,
-.date-picker-wrapper .month-wrapper table div.day.nextMonth {
- color: #999;
- cursor: default;
-}
-
-.date-picker-wrapper .month-wrapper table .day.checked {
- background-color: rgb(156, 219, 247);
-}
-
-.date-picker-wrapper .month-wrapper table .week-name {
- height: 20px;
- line-height: 20px;
- font-weight: 100;
-}
-
-.date-picker-wrapper .month-wrapper table .day.has-tooltip {
- cursor: help !important;
-}
-
-.date-picker-wrapper .month-wrapper table .day.toMonth.valid {
- color: #333;
- cursor: pointer;
-}
-
-.date-picker-wrapper .month-wrapper table .day.real-today {
- background-color: rgb(255, 230, 132);
-}
-
-.date-picker-wrapper .month-wrapper table .day.real-today.checked {
- background-color: rgb(112, 204, 213);
-}
-
-.date-picker-wrapper table .caption {
- height: 40px;
-}
-
-.date-picker-wrapper table .caption .next,
-.date-picker-wrapper table .caption .prev {
- padding: 0 5px;
- cursor: pointer;
-}
-
-.date-picker-wrapper table .caption .next:hover,
-.date-picker-wrapper table .caption .prev:hover {
- background-color: #ccc;
- color: white;
-}
-
-.date-picker-wrapper .gap {
- position: absolute;
- display: none;
- top: 0px;
- left: 204px;
- z-index: 1;
- width: 15px;
- height: 100%;
- background-color: red;
- font-size: 0;
- line-height: 0;
-}
-
-.date-picker-wrapper .gap .gap-lines {
- height: 100%;
- overflow: hidden;
-}
-
-.date-picker-wrapper .gap .gap-line {
- height: 15px;
- width: 15px;
- position: relative;
-}
-
-.date-picker-wrapper .gap .gap-line .gap-1 {
- z-index: 1;
- height: 0;
- border-left: 8px solid white;
- border-top: 8px solid #eee;
- border-bottom: 8px solid #eee;
-}
-
-.date-picker-wrapper .gap .gap-line .gap-2 {
- position: absolute;
- right: 0;
- top: 0px;
- z-index: 2;
- height: 0;
- border-left: 8px solid transparent;
- border-top: 8px solid white;
-}
-
-.date-picker-wrapper .gap .gap-line .gap-3 {
- position: absolute;
- right: 0;
- top: 8px;
- z-index: 2;
- height: 0;
- border-left: 8px solid transparent;
- border-bottom: 8px solid white;
-}
-
-.date-picker-wrapper .gap .gap-top-mask {
- width: 6px;
- height: 1px;
- position: absolute;
- top: -1px;
- left: 1px;
- background-color: #eee;
- z-index: 3;
-}
-
-.date-picker-wrapper .gap .gap-bottom-mask {
- width: 6px;
- height: 1px;
- position: absolute;
- bottom: -1px;
- left: 7px;
- background-color: #eee;
- z-index: 3;
-}
-
-.date-picker-wrapper .selected-days {
- display: none;
-}
-
-.date-picker-wrapper .drp_top-bar {
- line-height: 40px;
- height: 40px;
- position: relative;
-}
-
-.date-picker-wrapper .drp_top-bar .error-top {
- display: none;
-}
-
-.date-picker-wrapper .drp_top-bar .normal-top {
- display: none;
-}
-
-.date-picker-wrapper .drp_top-bar .default-top {
- display: block;
-}
-
-.date-picker-wrapper .drp_top-bar.error .default-top {
- display: none;
-}
-
-.date-picker-wrapper .drp_top-bar.error .error-top {
- display: block;
- color: red;
-}
-
-.date-picker-wrapper .drp_top-bar.normal .default-top {
- display: none;
-}
-
-.date-picker-wrapper .drp_top-bar.normal .normal-top {
- display: block;
-}
-
-.date-picker-wrapper .drp_top-bar .apply-btn {
- position: absolute;
- right: 0px;
- top: 6px;
- padding: 3px 5px;
- margin: 0;
- font-size: 12px;
- border-radius: 4px;
- cursor: pointer;
-
- color: #d9eef7;
- border: solid 1px #0076a3;
- background: #0095cd;
- background: -webkit-gradient(linear, left top, left bottom, from(#00adee), to(#0078a5));
- background: -moz-linear-gradient(top, #00adee, #0078a5);
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00adee', endColorstr='#0078a5');
- color: white;
-}
-
-.date-picker-wrapper .drp_top-bar .apply-btn.disabled {
- pointer-events: none;
- color: #606060;
- border: solid 1px #b7b7b7;
- background: #fff;
- background: -webkit-gradient(linear, left top, left bottom, from(#fff), to(#ededed));
- background: -moz-linear-gradient(top, #fff, #ededed);
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#ededed');
-}
-
-/*time styling*/
-.time {
- position: relative;
-}
-
-.time input[type=range] {
- vertical-align: middle;
-}
-
-.time1, .time2 {
- width: 180px;
- padding: 0 5px;
- text-align: center;
-}
-
-.time1 {
- float: left;
-}
-
-.time2 {
- float: right;
-}
-
-.hour, .minute {
- text-align: left;
-}
-
-.hide {
- display: none;
-}
-
-input.hour-range, input.minute-range {
- width: 150px;
-}
-
-#dateRangePickerContainer .date-range, #dateRangePickerContainer .input-append {
- background: none !important;
-}
-
-#date-range {
- padding-right: 30px;
- width: 300px;
- height: 100%;
- display: inline-block;
-}
-
-#dateRangePickerContainer {
- float: right;
-}
-
-.date-range {
- border: 1px solid #ccc;
-}
-
-#dateRangePickerContainer button.active {
- background-color: #e6e6e6 !important;
-}
-
-#dateRangePickerContainer .btn-default:hover {
- background-color: #b2b2b2;
- border-color: #000000;
-}
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.analytics.date-range-picker/public/js/date-picker.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.analytics.date-range-picker/public/js/date-picker.js
deleted file mode 100755
index 5fc42a3a6d..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.analytics.date-range-picker/public/js/date-picker.js
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * Copyright (c) 2018 - 2023, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved.
- *
- * Entgra (Pvt) Ltd. 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.
- */
-
-var fromDate, toDate, currentDay = new Date();
-var startDate = new Date(currentDay.getTime() - (60 * 60 * 24 * 100));
-var endDate = new Date(currentDay.getTime());
-
-function initDate() {
- currentDay = new Date();
-}
-
-var DateRange = convertDate(startDate) + " to " + convertDate(endDate);
-
-$(document).ready(function () {
- initDate();
- var configObject = {
- startOfWeek: 'monday',
- separator: ' to ',
- format: 'YYYY-MM-DD HH:mm',
- autoClose: false,
- time: {
- enabled: true
- },
- shortcuts: 'hide',
- endDate: currentDay,
- maxDays: 2,
- getValue: function () {
- return this.value;
- },
- setValue: function (s) {
- this.value = s;
- }
- };
- $('#date-range').html(DateRange);
- $('#date-range').dateRangePicker(configObject)
- .bind('datepicker-apply', function (event, dateRange) {
- $(this).addClass('active');
- $(this).siblings().removeClass('active');
- fromDate = dateRange.date1 != "Invalid Date" ? dateRange.date1.getTime() / 1000 : null;
- toDate = dateRange.date2 != "Invalid Date" ? dateRange.date2.getTime() / 1000 : null;
- drawGraph(fromDate, toDate);
- }
- );
- setDateTime(currentDay.getTime() - 3600000, currentDay.getTime());
- $('#hour-btn').addClass('active');
-});
-
-//hour
-$('#hour-btn').on('click', function () {
- initDate();
- setDateTime(currentDay.getTime() - 3600000, currentDay.getTime());
-});
-
-//12 hours
-$('#h12-btn').on('click', function () {
- initDate();
- setDateTime(currentDay.getTime() - (3600000 * 12), currentDay.getTime());
-});
-
-//24 hours
-$('#h24-btn').on('click', function () {
- initDate();
- setDateTime(currentDay.getTime() - (3600000 * 24), currentDay.getTime());
-});
-
-//48 hours
-$('#h48-btn').on('click', function () {
- initDate();
- setDateTime(currentDay.getTime() - (3600000 * 48), currentDay.getTime());
-});
-
-$('body').on('click', '.btn-group button', function (e) {
- $(this).addClass('active');
- $(this).siblings().removeClass('active');
-});
-
-function setDateTime(from, to) {
- fromDate = from;
- toDate = to;
- startDate = new Date(from);
- endDate = new Date(to);
- DateRange = convertDate(startDate) + " to " + convertDate(endDate);
- $('#date-range').html(DateRange);
- var tzOffset = new Date().getTimezoneOffset() * 60 / 1000;
- from += tzOffset;
- to += tzOffset;
-
- // Implement drawGraph_ method in your UI unit for analytics.
- var deviceTypes = $("#device-type-details").data("devicetypes");
- for (var i = 0; i < deviceTypes.length; i++){
- try{
- window["drawGraph_" + deviceTypes](parseInt(from / 1000), parseInt(to / 1000));
- }catch(e){
- }
- try{
- window["drawTable"](parseInt(from / 1000), parseInt(to / 1000));
- }catch(e){
- }
- }
-}
-
-function convertDate(date) {
- var month = date.getMonth() + 1;
- var day = date.getDate();
- var hour = date.getHours();
- var minute = date.getMinutes();
- return date.getFullYear() + '-' + (('' + month).length < 2 ? '0' : '') + month + '-' +
- (('' + day).length < 2 ? '0' : '') + day + " " + (('' + hour).length < 2 ? '0' : '') +
- hour + ":" + (('' + minute).length < 2 ? '0' : '') + minute;
-}
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.analytics.date-range-picker/public/js/jquery-ui-timepicker-addon.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.analytics.date-range-picker/public/js/jquery-ui-timepicker-addon.js
deleted file mode 100644
index 180a8f8c92..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.analytics.date-range-picker/public/js/jquery-ui-timepicker-addon.js
+++ /dev/null
@@ -1,2238 +0,0 @@
-/*
- * Copyright (c) 2018 - 2023, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved.
- *
- * Entgra (Pvt) Ltd. 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.
- */
-
-(function ($) {
-
- /*
- * Lets not redefine timepicker, Prevent "Uncaught RangeError: Maximum call stack size exceeded"
- */
- $.ui.timepicker = $.ui.timepicker || {};
- if ($.ui.timepicker.version) {
- return;
- }
-
- /*
- * Extend jQueryUI, get it started with our version number
- */
- $.extend($.ui, {
- timepicker: {
- version: "1.5.0"
- }
- });
-
- /*
- * Timepicker manager.
- * Use the singleton instance of this class, $.timepicker, to interact with the time picker.
- * Settings for (groups of) time pickers are maintained in an instance object,
- * allowing multiple different settings on the same page.
- */
- var Timepicker = function () {
- this.regional = []; // Available regional settings, indexed by language code
- this.regional[''] = { // Default regional settings
- currentText: 'Now',
- closeText: 'Done',
- amNames: ['AM', 'A'],
- pmNames: ['PM', 'P'],
- timeFormat: 'HH:mm',
- timeSuffix: '',
- timeOnlyTitle: 'Choose Time',
- timeText: 'Time',
- hourText: 'Hour',
- minuteText: 'Minute',
- secondText: 'Second',
- millisecText: 'Millisecond',
- microsecText: 'Microsecond',
- timezoneText: 'Time Zone',
- isRTL: false
- };
- this._defaults = { // Global defaults for all the datetime picker instances
- showButtonPanel: true,
- timeOnly: false,
- timeOnlyShowDate: false,
- showHour: null,
- showMinute: null,
- showSecond: null,
- showMillisec: null,
- showMicrosec: null,
- showTimezone: null,
- showTime: true,
- stepHour: 1,
- stepMinute: 1,
- stepSecond: 1,
- stepMillisec: 1,
- stepMicrosec: 1,
- hour: 0,
- minute: 0,
- second: 0,
- millisec: 0,
- microsec: 0,
- timezone: null,
- hourMin: 0,
- minuteMin: 0,
- secondMin: 0,
- millisecMin: 0,
- microsecMin: 0,
- hourMax: 23,
- minuteMax: 59,
- secondMax: 59,
- millisecMax: 999,
- microsecMax: 999,
- minDateTime: null,
- maxDateTime: null,
- maxTime: null,
- minTime: null,
- onSelect: null,
- hourGrid: 0,
- minuteGrid: 0,
- secondGrid: 0,
- millisecGrid: 0,
- microsecGrid: 0,
- alwaysSetTime: true,
- separator: ' ',
- altFieldTimeOnly: true,
- altTimeFormat: null,
- altSeparator: null,
- altTimeSuffix: null,
- altRedirectFocus: true,
- pickerTimeFormat: null,
- pickerTimeSuffix: null,
- showTimepicker: true,
- timezoneList: null,
- addSliderAccess: false,
- sliderAccessArgs: null,
- controlType: 'slider',
- defaultValue: null,
- parse: 'strict'
- };
- $.extend(this._defaults, this.regional['']);
- };
-
- $.extend(Timepicker.prototype, {
- $input: null,
- $altInput: null,
- $timeObj: null,
- inst: null,
- hour_slider: null,
- minute_slider: null,
- second_slider: null,
- millisec_slider: null,
- microsec_slider: null,
- timezone_select: null,
- maxTime: null,
- minTime: null,
- hour: 0,
- minute: 0,
- second: 0,
- millisec: 0,
- microsec: 0,
- timezone: null,
- hourMinOriginal: null,
- minuteMinOriginal: null,
- secondMinOriginal: null,
- millisecMinOriginal: null,
- microsecMinOriginal: null,
- hourMaxOriginal: null,
- minuteMaxOriginal: null,
- secondMaxOriginal: null,
- millisecMaxOriginal: null,
- microsecMaxOriginal: null,
- ampm: '',
- formattedDate: '',
- formattedTime: '',
- formattedDateTime: '',
- timezoneList: null,
- units: ['hour', 'minute', 'second', 'millisec', 'microsec'],
- support: {},
- control: null,
-
- /*
- * Override the default settings for all instances of the time picker.
- * @param {Object} settings object - the new settings to use as defaults (anonymous object)
- * @return {Object} the manager object
- */
- setDefaults: function (settings) {
- extendRemove(this._defaults, settings || {});
- return this;
- },
-
- /*
- * Create a new Timepicker instance
- */
- _newInst: function ($input, opts) {
- var tp_inst = new Timepicker(),
- inlineSettings = {},
- fns = {},
- overrides, i;
-
- for (var attrName in this._defaults) {
- if (this._defaults.hasOwnProperty(attrName)) {
- var attrValue = $input.attr('time:' + attrName);
- if (attrValue) {
- try {
- inlineSettings[attrName] = eval(attrValue);
- } catch (err) {
- inlineSettings[attrName] = attrValue;
- }
- }
- }
- }
-
- overrides = {
- beforeShow: function (input, dp_inst) {
- if ($.isFunction(tp_inst._defaults.evnts.beforeShow)) {
- return tp_inst._defaults.evnts.beforeShow.call($input[0], input, dp_inst, tp_inst);
- }
- },
- onChangeMonthYear: function (year, month, dp_inst) {
- // Update the time as well : this prevents the time from disappearing from the $input field.
- tp_inst._updateDateTime(dp_inst);
- if ($.isFunction(tp_inst._defaults.evnts.onChangeMonthYear)) {
- tp_inst._defaults.evnts.onChangeMonthYear.call($input[0], year, month, dp_inst, tp_inst);
- }
- },
- onClose: function (dateText, dp_inst) {
- if (tp_inst.timeDefined === true && $input.val() !== '') {
- tp_inst._updateDateTime(dp_inst);
- }
- if ($.isFunction(tp_inst._defaults.evnts.onClose)) {
- tp_inst._defaults.evnts.onClose.call($input[0], dateText, dp_inst, tp_inst);
- }
- }
- };
- for (i in overrides) {
- if (overrides.hasOwnProperty(i)) {
- fns[i] = opts[i] || null;
- }
- }
-
- tp_inst._defaults = $.extend({}, this._defaults, inlineSettings, opts, overrides, {
- evnts: fns,
- timepicker: tp_inst // add timepicker as a property of datepicker: $.datepicker._get(dp_inst, 'timepicker');
- });
- tp_inst.amNames = $.map(tp_inst._defaults.amNames, function (val) {
- return val.toUpperCase();
- });
- tp_inst.pmNames = $.map(tp_inst._defaults.pmNames, function (val) {
- return val.toUpperCase();
- });
-
- // detect which units are supported
- tp_inst.support = detectSupport(
- tp_inst._defaults.timeFormat +
- (tp_inst._defaults.pickerTimeFormat ? tp_inst._defaults.pickerTimeFormat : '') +
- (tp_inst._defaults.altTimeFormat ? tp_inst._defaults.altTimeFormat : ''));
-
- // controlType is string - key to our this._controls
- if (typeof(tp_inst._defaults.controlType) === 'string') {
- if (tp_inst._defaults.controlType === 'slider' && typeof($.ui.slider) === 'undefined') {
- tp_inst._defaults.controlType = 'select';
- }
- tp_inst.control = tp_inst._controls[tp_inst._defaults.controlType];
- }
- // controlType is an object and must implement create, options, value methods
- else {
- tp_inst.control = tp_inst._defaults.controlType;
- }
-
- // prep the timezone options
- var timezoneList = [-720, -660, -600, -570, -540, -480, -420, -360, -300, -270, -240, -210, -180, -120, -60,
- 0, 60, 120, 180, 210, 240, 270, 300, 330, 345, 360, 390, 420, 480, 525, 540, 570, 600, 630, 660, 690, 720, 765, 780, 840];
- if (tp_inst._defaults.timezoneList !== null) {
- timezoneList = tp_inst._defaults.timezoneList;
- }
- var tzl = timezoneList.length, tzi = 0, tzv = null;
- if (tzl > 0 && typeof timezoneList[0] !== 'object') {
- for (; tzi < tzl; tzi++) {
- tzv = timezoneList[tzi];
- timezoneList[tzi] = { value: tzv, label: $.timepicker.timezoneOffsetString(tzv, tp_inst.support.iso8601) };
- }
- }
- tp_inst._defaults.timezoneList = timezoneList;
-
- // set the default units
- tp_inst.timezone = tp_inst._defaults.timezone !== null ? $.timepicker.timezoneOffsetNumber(tp_inst._defaults.timezone) :
- ((new Date()).getTimezoneOffset() * -1);
- tp_inst.hour = tp_inst._defaults.hour < tp_inst._defaults.hourMin ? tp_inst._defaults.hourMin :
- tp_inst._defaults.hour > tp_inst._defaults.hourMax ? tp_inst._defaults.hourMax : tp_inst._defaults.hour;
- tp_inst.minute = tp_inst._defaults.minute < tp_inst._defaults.minuteMin ? tp_inst._defaults.minuteMin :
- tp_inst._defaults.minute > tp_inst._defaults.minuteMax ? tp_inst._defaults.minuteMax : tp_inst._defaults.minute;
- tp_inst.second = tp_inst._defaults.second < tp_inst._defaults.secondMin ? tp_inst._defaults.secondMin :
- tp_inst._defaults.second > tp_inst._defaults.secondMax ? tp_inst._defaults.secondMax : tp_inst._defaults.second;
- tp_inst.millisec = tp_inst._defaults.millisec < tp_inst._defaults.millisecMin ? tp_inst._defaults.millisecMin :
- tp_inst._defaults.millisec > tp_inst._defaults.millisecMax ? tp_inst._defaults.millisecMax : tp_inst._defaults.millisec;
- tp_inst.microsec = tp_inst._defaults.microsec < tp_inst._defaults.microsecMin ? tp_inst._defaults.microsecMin :
- tp_inst._defaults.microsec > tp_inst._defaults.microsecMax ? tp_inst._defaults.microsecMax : tp_inst._defaults.microsec;
- tp_inst.ampm = '';
- tp_inst.$input = $input;
-
- if (tp_inst._defaults.altField) {
- tp_inst.$altInput = $(tp_inst._defaults.altField);
- if (tp_inst._defaults.altRedirectFocus === true) {
- tp_inst.$altInput.css({
- cursor: 'pointer'
- }).focus(function () {
- $input.trigger("focus");
- });
- }
- }
-
- if (tp_inst._defaults.minDate === 0 || tp_inst._defaults.minDateTime === 0) {
- tp_inst._defaults.minDate = new Date();
- }
- if (tp_inst._defaults.maxDate === 0 || tp_inst._defaults.maxDateTime === 0) {
- tp_inst._defaults.maxDate = new Date();
- }
-
- // datepicker needs minDate/maxDate, timepicker needs minDateTime/maxDateTime..
- if (tp_inst._defaults.minDate !== undefined && tp_inst._defaults.minDate instanceof Date) {
- tp_inst._defaults.minDateTime = new Date(tp_inst._defaults.minDate.getTime());
- }
- if (tp_inst._defaults.minDateTime !== undefined && tp_inst._defaults.minDateTime instanceof Date) {
- tp_inst._defaults.minDate = new Date(tp_inst._defaults.minDateTime.getTime());
- }
- if (tp_inst._defaults.maxDate !== undefined && tp_inst._defaults.maxDate instanceof Date) {
- tp_inst._defaults.maxDateTime = new Date(tp_inst._defaults.maxDate.getTime());
- }
- if (tp_inst._defaults.maxDateTime !== undefined && tp_inst._defaults.maxDateTime instanceof Date) {
- tp_inst._defaults.maxDate = new Date(tp_inst._defaults.maxDateTime.getTime());
- }
- tp_inst.$input.bind('focus', function () {
- tp_inst._onFocus();
- });
-
- return tp_inst;
- },
-
- /*
- * add our sliders to the calendar
- */
- _addTimePicker: function (dp_inst) {
- var currDT = (this.$altInput && this._defaults.altFieldTimeOnly) ? this.$input.val() + ' ' + this.$altInput.val() : this.$input.val();
-
- this.timeDefined = this._parseTime(currDT);
- this._limitMinMaxDateTime(dp_inst, false);
- this._injectTimePicker();
- },
-
- /*
- * parse the time string from input value or _setTime
- */
- _parseTime: function (timeString, withDate) {
- if (!this.inst) {
- this.inst = $.datepicker._getInst(this.$input[0]);
- }
-
- if (withDate || !this._defaults.timeOnly) {
- var dp_dateFormat = $.datepicker._get(this.inst, 'dateFormat');
- try {
- var parseRes = parseDateTimeInternal(dp_dateFormat, this._defaults.timeFormat, timeString, $.datepicker._getFormatConfig(this.inst), this._defaults);
- if (!parseRes.timeObj) {
- return false;
- }
- $.extend(this, parseRes.timeObj);
- } catch (err) {
- $.timepicker.log("Error parsing the date/time string: " + err +
- "\ndate/time string = " + timeString +
- "\ntimeFormat = " + this._defaults.timeFormat +
- "\ndateFormat = " + dp_dateFormat);
- return false;
- }
- return true;
- } else {
- var timeObj = $.datepicker.parseTime(this._defaults.timeFormat, timeString, this._defaults);
- if (!timeObj) {
- return false;
- }
- $.extend(this, timeObj);
- return true;
- }
- },
-
- /*
- * generate and inject html for timepicker into ui datepicker
- */
- _injectTimePicker: function () {
- var $dp = this.inst.dpDiv,
- o = this.inst.settings,
- tp_inst = this,
- litem = '',
- uitem = '',
- show = null,
- max = {},
- gridSize = {},
- size = null,
- i = 0,
- l = 0;
-
- // Prevent displaying twice
- if ($dp.find("div.ui-timepicker-div").length === 0 && o.showTimepicker) {
- var noDisplay = ' style="display:none;"',
- html = '
' + '
' + o.timeText + '
' +
- '';
-
- // Create the markup
- for (i = 0, l = this.units.length; i < l; i++) {
- litem = this.units[i];
- uitem = litem.substr(0, 1).toUpperCase() + litem.substr(1);
- show = o['show' + uitem] !== null ? o['show' + uitem] : this.support[litem];
-
- // Added by Peter Medeiros:
- // - Figure out what the hour/minute/second max should be based on the step values.
- // - Example: if stepMinute is 15, then minMax is 45.
- max[litem] = parseInt((o[litem + 'Max'] - ((o[litem + 'Max'] - o[litem + 'Min']) % o['step' + uitem])), 10);
- gridSize[litem] = 0;
-
- html += '
' + o[litem + 'Text'] + '
' +
- '
';
-
- if (show && o[litem + 'Grid'] > 0) {
- html += '
';
-
- if (litem === 'hour') {
- for (var h = o[litem + 'Min']; h <= max[litem]; h += parseInt(o[litem + 'Grid'], 10)) {
- gridSize[litem]++;
- var tmph = $.datepicker.formatTime(this.support.ampm ? 'hht' : 'HH', {hour: h}, o);
- html += '
' + tmph + '
';
- }
- }
- else {
- for (var m = o[litem + 'Min']; m <= max[litem]; m += parseInt(o[litem + 'Grid'], 10)) {
- gridSize[litem]++;
- html += '
-
-{{#zone "bottomJs"}}
- {{js "js/operation-bar.js"}}
-{{/zone}}
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.default.device.operation-bar/operation-bar.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.default.device.operation-bar/operation-bar.js
deleted file mode 100644
index e9f2253dae..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.default.device.operation-bar/operation-bar.js
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Copyright (c) 2018 - 2023, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved.
- *
- * Entgra (Pvt) Ltd. 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.
- */
-
-function onRequest(context) {
- var log = new Log("operation.js");
- var deviceType = context.uriParams.deviceType;
- var operationModule = require("/app/modules/business-controllers/operation.js")["operationModule"];
- var devicemgtProps = require("/app/modules/conf-reader/main.js")["conf"];
- var restAPIEndpoint = devicemgtProps["backendRestEndpoints"]["deviceMgt"]
- + "/devices/" + deviceType + "/operations";
- var device = context.unit.params.device;
- var features = context.unit.params.features;
- return {"control_operations": features, "device": device, "operationEndpoint": restAPIEndpoint};
-}
\ 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.default.device.operation-bar/operation-bar.json b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.default.device.operation-bar/operation-bar.json
deleted file mode 100644
index 688e939808..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.default.device.operation-bar/operation-bar.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "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.default.device.operation-bar/public/js/operation-bar.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.default.device.operation-bar/public/js/operation-bar.js
deleted file mode 100644
index 63191c86d2..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.default.device.operation-bar/public/js/operation-bar.js
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * Copyright (c) 2018 - 2023, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved.
- *
- * Entgra (Pvt) Ltd. 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.
- */
-
-/*
- * On operation click function.
- * @param selection: Selected operation
- */
-function operationSelect(selection) {
- $(modalPopupContent).addClass("operation-data");
- $(modalPopupContent).html($(" .operation[data-operation-code=" + selection + "]").html());
- $(modalPopupContent).data("operation-code", selection);
- showPopup();
-}
-
-function submitForm(formId) {
- var form = $("#" + formId);
- var operationDetails = $("#operation-details");
- var deviceId = operationDetails.data("deviceid");
- var operationEndpoint = operationDetails.data("endpoint");
- var contentType = "application/json";
-
- var payload = {};
- var devices=[];
- devices.push(deviceId);
- payload["deviceIdentifiers"] = devices;
- var operation = {};
- operation["code"] = form.find("#operation-code").val();
- operation["type"]= form.find("#operation-type").val();
- operation["status"] = "PENDING";
- operation["control"] = "REPEAT";
- operation["payLoad"] = form.find("#operation-payload").val();
- operation["enabled"] = true;
- payload["operation"] = operation;
-
- //setting responses callbacks
- var defaultStatusClasses = "fw fw-stack-1x";
- var content = $("#operation-response-template").find(".content");
- var title = content.find("#title");
- title.attr("class","center-block text-center");
- var statusIcon = content.find("#status-icon");
- var description = content.find("#description");
- var successCallBack = function (response) {
- var res = response;
- try {
- res = JSON.parse(response).messageFromServer;
- } catch (err) {
- //do nothing
- }
- title.html("Operation Triggered!");
- statusIcon.attr("class", defaultStatusClasses + " fw-check");
- description.html(res);
- $(modalPopupContent).html(content.html());
- };
- var errorCallBack = function (response) {
- console.log(response);
- title.html("An Error Occurred!");
- statusIcon.attr("class", defaultStatusClasses + " fw-error");
- var reason = (response.responseText == "null")?response.statusText:response.responseText;
- description.html(reason);
- $(modalPopupContent).html(content.html());
- };
- invokerUtil.post(operationEndpoint, payload, successCallBack, errorCallBack, contentType);
-}
-
-$(document).on('submit', 'form', function (e) {
- e.preventDefault();
- var postOperationRequest = $.ajax({
- url: $(this).attr("action") + '&' + $(this).serialize(),
- method: "post"
- });
-
- var btnSubmit = $('#btnSend', this);
- btnSubmit.addClass('hidden');
-
- var lblSending = $('#lblSending', this);
- lblSending.removeClass('hidden');
-
- var lblSent = $('#lblSent', this);
- postOperationRequest.done(function (data) {
- lblSending.addClass('hidden');
- lblSent.removeClass('hidden');
- setTimeout(function () {
- hidePopup();
- }, 3000);
- });
-
- postOperationRequest.fail(function (jqXHR, textStatus) {
- lblSending.addClass('hidden');
- lblSent.addClass('hidden');
- });
-});
-
-function operationTypeChage(selectElement) {
- if (selectElement.value == "COMMAND") {
- $("#operation-payload").hide();
- } else {
- $("#operation-payload").show();
- }
-}
\ 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.default.device.overview-section/overview-section.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.default.device.overview-section/overview-section.hbs
deleted file mode 100644
index e122c8539f..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.default.device.overview-section/overview-section.hbs
+++ /dev/null
@@ -1,27 +0,0 @@
-{{!
- 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.
-}}
-
-
- {{#each device.initialDeviceInfo}}
-
-
{{@key}}
-
{{this}}
-
- {{/each}}
-
-
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.default.device.overview-section/overview-section.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.default.device.overview-section/overview-section.js
deleted file mode 100644
index 9e30d378a0..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.default.device.overview-section/overview-section.js
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Copyright (c) 2018 - 2023, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved.
- *
- * Entgra (Pvt) Ltd. 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.
- */
-
-function onRequest (context) {
- var log = new Log("overview-section.js");
- var device = context.unit.params.device;
- return {"device" : device};
-}
\ 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.default.device.overview-section/overview-section.json b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.default.device.overview-section/overview-section.json
deleted file mode 100644
index 688e939808..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.default.device.overview-section/overview-section.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "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.default.device.type.analytics-view/analytics-view.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.default.device.type.analytics-view/analytics-view.hbs
deleted file mode 100644
index 456b895631..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.default.device.type.analytics-view/analytics-view.hbs
+++ /dev/null
@@ -1,47 +0,0 @@
-{{!
- 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.
-}}
-
-{{unit "cdmf.unit.data-tables-extended"}}
-
-
-
-{{#if attributes}}
-
-
-
-
Timestamp
- {{#each attributes}}
-
{{this}}
- {{/each}}
-
-
-
-
-
-{{else}}
-
Analytics Not Configured
-{{/if}}
-
-
-{{#zone "bottomJs"}}
- {{js "js/device.js"}}
-{{/zone}}
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.default.device.type.analytics-view/analytics-view.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.default.device.type.analytics-view/analytics-view.js
deleted file mode 100644
index 197dde9430..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.default.device.type.analytics-view/analytics-view.js
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Copyright (c) 2018 - 2023, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved.
- *
- * Entgra (Pvt) Ltd. 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.
- */
-
-function onRequest(context) {
-
- var deviceType = context.uriParams.deviceType;
- var deviceId = request.getParameter("deviceId");
- var keys = [];
- var serviceInvokers = require("/app/modules/oauth/token-protected-service-invokers.js")["invokers"];
- var devicemgtProps = require("/app/modules/conf-reader/main.js")["conf"];
-
- if (deviceType != null && deviceType != undefined && deviceId != null && deviceId != undefined) {
- var deviceModule = require("/app/modules/business-controllers/device.js")["deviceModule"];
- var device = deviceModule.viewDevice(deviceType, deviceId);
-
- var restAPIEndpoint = devicemgtProps["httpsURL"] + devicemgtProps["backendRestEndpoints"]["deviceMgt"]
- + "/events/" + deviceType;
- serviceInvokers.XMLHttp.get(
- restAPIEndpoint,
- function (restAPIResponse) {
- if (restAPIResponse["status"] == 200 && restAPIResponse["responseText"]) {
- var data = parse(restAPIResponse["responseText"]);
- if (data.eventAttributes.attributes.length > 0) {
- for (var i = 0; i < data.eventAttributes.attributes.length; i++) {
- var attribute = data.eventAttributes.attributes[i];
- if (attribute['name'] == "deviceId") {
- continue;
- }
- keys.push(attribute['name']);
- }
- }
-
- }
- }
- );
-
- if (device && device.status != "error") {
- if (keys.length === 0 || keys.length === undefined) {
- return {
- "device": device.content,
- "backendApiUri": "/api/device-mgt/v1.0/events/" + deviceType
- };
- } else {
-
- return {
- "device": device.content,
- "backendApiUri": "/api/device-mgt/v1.0/events/" + deviceType,
- "attributes": keys
- };
- }
- } else {
- response.sendError(404, "Device Id " + deviceId + " of type " + deviceType + " cannot be found!");
- exit();
- }
- }
-}
\ 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.default.device.type.analytics-view/analytics-view.json b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.default.device.type.analytics-view/analytics-view.json
deleted file mode 100644
index 688e939808..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.default.device.type.analytics-view/analytics-view.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "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.default.device.type.analytics-view/public/js/device.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.default.device.type.analytics-view/public/js/device.js
deleted file mode 100644
index 322e92f35c..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.default.device.type.analytics-view/public/js/device.js
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Copyright (c) 2018 - 2023, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved.
- *
- * Entgra (Pvt) Ltd. 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.
- */
-
-var InitiateViewOption = null;
-var deviceId = null;
-var deviceType = null;
-var fromTime = null;
-var toTime = null;
-var keys = null;
-
-function drawTable(from, to) {
- var device = $("#device-details");
- deviceId = device.data("deviceid");
- deviceType = device.data("devicetype");
- keys = device.data("attributes").split(",");
- fromTime = from * 1000;
- toTime = to * 1000;
- if ( $.fn.dataTable.isDataTable( '#stats-table' ) ) {
- var table = $('#stats-table').DataTable();
- table.clear().draw();
- table.ajax.reload();
- }
- else {
- $("#stats-table").datatables_extended({
- serverSide: true,
- processing: false,
- searching: false,
- ordering: false,
- pageLength: 100,
- order: [],
- ajax: {
- url: "/devicemgt/api/stats/paginate",
- data: buildAjaxData,
- dataSrc: function(json) {
- return json.data.map(function(event) {
- event[0] = new moment(event[0]).
- format("YYYY-MM-DD HH:mm:ss.SSS");
- return event;
- })
- }
- }
- });
- }
-}
-
-function buildAjaxData (){
- var settings = $("#stats-table").dataTable().fnSettings();
-
- var obj = {
- //default params
- "draw" : settings.iDraw,
- "start" : settings._iDisplayStart,
- "length" : settings._iDisplayLength,
- "columns" : "",
- "order": "",
- "deviceType" : deviceType,
- "deviceId" : deviceId,
- "from": fromTime,
- "to" : toTime,
- "attributes" : JSON.stringify(keys)
- };
-
- return obj;
-
-
-}
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.default.device.type.device-view/device-view.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.default.device.type.device-view/device-view.hbs
deleted file mode 100644
index a3f87bfb29..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.default.device.type.device-view/device-view.hbs
+++ /dev/null
@@ -1,204 +0,0 @@
-{{!
- 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 "topCss"}}
-
-{{/zone}}
-
-{{#zone "device-thumbnail"}}
-
-{{/zone}}
-
-{{#zone "device-details"}}
- {{unit "cdmf.unit.default.device.overview-section" device=device}}
-{{/zone}}
-
-{{#zone "device-opetations"}}
- {{#if features}}
-