From 3d25102d30cea853c99a39fc452e8474a38938be Mon Sep 17 00:00:00 2001 From: Rasika Perera Date: Tue, 2 Aug 2016 15:37:45 +0530 Subject: [PATCH] Adding enrollment url into view model --- .../app/pages/mdm.page.dashboard/dashboard.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/mdm.page.dashboard/dashboard.js b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/mdm.page.dashboard/dashboard.js index 8843a908e..2f881b830 100644 --- a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/mdm.page.dashboard/dashboard.js +++ b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/mdm.page.dashboard/dashboard.js @@ -19,10 +19,12 @@ function onRequest(context) { var userModule = require("/app/modules/business-controllers/user.js")["userModule"]; var generalConfig = context.app.conf["generalConfig"]; + var mdmProps = require('/app/conf/reader/main.js')["conf"]; - context["permissions"] = userModule.getUIPermissions(); - new Log().info("## Permissions : "+ stringify(userModule.getUIPermissions())); - context["enrollmentURL"] = generalConfig["host"] + generalConfig["enrollmentDir"]; - - return context; + var viewModel = {}; + viewModel.permissions = userModule.getUIPermissions(); + new Log().debug("## Permissions : " + stringify(userModule.getUIPermissions())); + //TODO: Move enrollment URL into app-conf.json + viewModel.enrollmentURL = mdmProps.enrollmentUrl; + return viewModel; } \ No newline at end of file