From 8223588e82817312a7498b54bf8e37e8f39b4787 Mon Sep 17 00:00:00 2001 From: Rasika Perera Date: Wed, 5 Jul 2017 06:27:42 +0530 Subject: [PATCH] Fixing https://github.com/wso2/product-iots/issues/1119: monetization --- .../devicemgt/app/conf/toplink-menu.json | 235 ++++++++++-------- .../public/js/monetize.js | 24 ++ .../user-menu.hbs | 59 ++++- .../user-menu.js | 138 +++++++++- 4 files changed, 345 insertions(+), 111 deletions(-) create mode 100644 components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.ui.header.cloud.user-menu/public/js/monetize.js diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/conf/toplink-menu.json b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/conf/toplink-menu.json index 4e303190d5..26a6198550 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/conf/toplink-menu.json +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/conf/toplink-menu.json @@ -1,112 +1,137 @@ { - "Logo": { - "name": "Cloud", - "url": "https://cloudmgt.cloud.wso2.com/cloudmgt", - "target": "_parent" - }, - "Main": { - "Domain": { - "url": "#", - "icon": "fw fw-organization", - "isAdminOnly": false, - "target": "_parent", - "dropDown": { - "Organization": { - "url": "https://cloudmgt.cloud.wso2.com/cloudmgt/site/pages/organization.jag", - "icon": "fw fw-organization", - "dropDown": "false", - "target": "_self" + "Logo": { + "name": "Cloud", + "url": "https://cloudmgt.cloud.wso2.com/cloudmgt", + "target": "_parent" + }, + "Main": { + "Domain": { + "url": "#", + "icon": "fw fw-organization", + "isAdminOnly": false, + "target": "_parent", + "dropDown": { + "Organization": { + "url": "https://cloudmgt.cloud.wso2.com/cloudmgt/site/pages/organization.jag", + "icon": "fw fw-organization", + "dropDown": "false", + "target": "_self" + }, + "Members": { + "url": "https://cloudmgt.cloud.wso2.com/cloudmgt/site/pages/user.jag", + "icon": "fa fa-users", + "dropDown": "false", + "target": "_self" + } + } + }, + "Account": { + "url": "#", + "icon": "fw fw-resource", + "isAdminOnly": false, + "billingEnabled": true, + "billingApi": { + "username": "admin", + "password": "admin" + }, + "cloudMgtIndexPage": "https://cloudmgt.cloud.wso2.com/cloudmgt/site/pages/index.jag", + "dropDown": { + "Upgrade Now": { + "url": "https://cloudmgt.cloud.wso2.com/cloudmgt/site/pages/payment-plans.jag?cloud-type=device_cloud", + "icon": "fw fw-export", + "dropDown": "true", + "target": "_self" + }, + "Request Extension": { + "url": "https://cloudmgt.cloud.wso2.com/cloudmgt/site/pages/contact-us.jag?cloud-type=device_cloud&request-extension=true", + "icon": "fa fa-mail", + "dropDown": "true", + "target": "_self" + } + } + }, + "Support": { + "url": "https://cloudmgt.cloud.wso2.com/cloudmgt/site/pages/contact-us.jag?cloud-type=device_cloud", + "icon": "fw fw-mail", + "isAdminOnly": false, + "target": "_self", + "dropDown": "false" }, - "Members": { - "url": "https://cloudmgt.cloud.wso2.com/cloudmgt/site/pages/user.jag", - "icon": "fa fa-users", - "dropDown": "false", - "target": "_self" + "Documentation": { + "url": "#", + "icon": "fw fw-document", + "isAdminOnly": false, + "dropDown": { + "Device Cloud": { + "id": "device_cloud", + "url": "https://docs.wso2.com/display/DeviceCloud/WSO2+Device+Cloud+Documentation", + "icon": "fw fw-mobile", + "target": "_blank" + } + } } - } }, - "Support": { - "url": "https://cloudmgt.cloud.wso2.com/cloudmgt/site/pages/contact-us.jag", - "icon": "fw fw-mail", - "isAdminOnly": false, - "target": "_self", - "dropDown": "false" - }, - "Documentation": { - "url": "#", - "icon": "fw fw-document", - "isAdminOnly": false, - "dropDown": { - "Device Cloud": { - "id": "device_cloud", - "url": "https://docs.wso2.com/display/DeviceCloud/WSO2+Device+Cloud+Documentation", - "icon": "fw fw-mobile", - "target": "_blank" - } - } - } - }, - "User": { - "url": "#", - "icon": "fw fw-user", - "dropDown": { - "Profile": { - "url": "https://cloudmgt.cloud.wso2.com/cloudmgt/site/pages/user-profile.jag", + "User": { + "url": "#", "icon": "fw fw-user", - "dropDown": "true", - "target": "_self" - }, - "Change Password": { - "url": "https://cloudmgt.cloud.wso2.com/cloudmgt/site/pages/change-password.jag", - "icon": "fw fw-lock", - "dropDown": "true", - "target": "_self" - }, - "Logout": { - "url": "https://api.cloud.wso2.com/publisher/site/pages/logout.jag", - "icon": "fw fw-sign-out", - "dropDown": "true", - "target": "_self" - } - } - }, - "Expand": { - "Clouds": { - "API Cloud": { - "id": "api_cloud", - "url": "https://api.cloud.wso2.com/publisher", - "icon": "fw fw-api fw-3x", - "dropDown": "true", - "target": "_self" - }, - "Integration Cloud": { - "id": "integration_cloud", - "url": "https://integration.cloud.wso2.com/appmgt", - "icon": "fw fw-service fw-3x", - "dropDown": "true", - "target": "_self" - }, - "Identity Cloud": { - "id": "integration_cloud", - "url": "https://identity.cloud.wso2.com/admin", - "icon": "fw fw-security fw-3x", - "dropDown": "true", - "target": "_self" - } + "dropDown": { + "Profile": { + "url": "https://cloudmgt.cloud.wso2.com/cloudmgt/site/pages/user-profile.jag", + "icon": "fw fw-user", + "dropDown": "true", + "target": "_self" + }, + "Change Password": { + "url": "https://cloudmgt.cloud.wso2.com/cloudmgt/site/pages/change-password.jag", + "icon": "fw fw-lock", + "dropDown": "true", + "target": "_self" + }, + "Logout": { + "url": "https://device.cloud.wso2.com/devicemgt/logout", + "icon": "fw fw-sign-out", + "dropDown": "true", + "target": "_self" + } + } }, - "Actions": { - "Organization": { - "url": "https://cloudmgt.cloud.wso2.com/cloudmgt/site/pages/organization.jag", - "icon": "fw fw-organization fw-3x", - "dropDown": "true", - "target": "_self" - }, - "Members": { - "url": "https://cloudmgt.cloud.wso2.com/cloudmgt/site/pages/user.jag", - "icon": "fa fa-users fa-3x", - "dropDown": "true", - "target": "_self" - } + "Expand": { + "Clouds": { + "API Cloud": { + "id": "api_cloud", + "url": "https://api.cloud.wso2.com/publisher", + "icon": "fw fw-api fw-3x", + "dropDown": "true", + "target": "_self" + }, + "Integration Cloud": { + "id": "integration_cloud", + "url": "https://integration.cloud.wso2.com/appmgt", + "icon": "fw fw-service fw-3x", + "dropDown": "true", + "target": "_self" + }, + "Identity Cloud": { + "id": "integration_cloud", + "url": "https://identity.cloud.wso2.com/admin", + "icon": "fw fw-security fw-3x", + "dropDown": "true", + "target": "_self" + } + }, + "Actions": { + "Organization": { + "url": "https://cloudmgt.cloud.wso2.com/cloudmgt/site/pages/organization.jag", + "icon": "fw fw-organization fw-3x", + "dropDown": "true", + "target": "_self" + }, + "Members": { + "url": "https://cloudmgt.cloud.wso2.com/cloudmgt/site/pages/user.jag", + "icon": "fa fa-users fa-3x", + "dropDown": "true", + "target": "_self" + } + } } - } -} +} \ 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.ui.header.cloud.user-menu/public/js/monetize.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.ui.header.cloud.user-menu/public/js/monetize.js new file mode 100644 index 0000000000..04143c7078 --- /dev/null +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.ui.header.cloud.user-menu/public/js/monetize.js @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2017, 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. + */ +$(document).ready(function(){ + var expireModal = $('#expire-modal-content'); + modalDialog.content(expireModal.find('.modal-body')); + modalDialog.header(expireModal.find('.modal-header .modal-title')); + modalDialog.footer(expireModal.find('.modal-footer')); + modalDialog.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.ui.header.cloud.user-menu/user-menu.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.ui.header.cloud.user-menu/user-menu.hbs index c9016ccf3e..9b726e0a63 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.ui.header.cloud.user-menu/user-menu.hbs +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.ui.header.cloud.user-menu/user-menu.hbs @@ -15,6 +15,7 @@ specific language governing permissions and limitations under the License. }} +{{unit "cdmf.unit.ui.modal"}}