From 85b437a0f0ee383c6fcbe06e234d197bfcc8f5f7 Mon Sep 17 00:00:00 2001 From: Menaka Jayawardena Date: Tue, 29 Aug 2017 15:35:44 +0530 Subject: [PATCH] Redirect to Policy Listing page after editing a policy. --- .../app/units/cdmf.unit.policy.edit/edit.hbs | 16 ++-------------- .../public/js/policy-edit.js | 6 ++++++ 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.edit/edit.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.edit/edit.hbs index 4abf440dc3..e5822f5736 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.edit/edit.hbs +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.edit/edit.hbs @@ -35,20 +35,8 @@

Policy is successfully re-configured.

-
Please click "Add Another Policy", if you wish to add another policy or click - "View policy list" to complete the process and go back to the policy list. -
- - - - - - - Add another policy - +
You will be redirected to Policy Listing page in a moment. +
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.edit/public/js/policy-edit.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.edit/public/js/policy-edit.js index e2a7182b6b..4bd3691b44 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.edit/public/js/policy-edit.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.edit/public/js/policy-edit.js @@ -495,6 +495,9 @@ var updatePolicy = function (policy, state) { if (jqXHR.status == 200) { $(".add-policy").addClass("hidden"); $(".policy-message").removeClass("hidden"); + setTimeout(function(){ + window.location.href = "/devicemgt/policies"; + }, 1000); } }, // on error @@ -513,6 +516,9 @@ var updatePolicy = function (policy, state) { $(".add-policy").addClass("hidden"); $(".policy-naming").addClass("hidden"); $(".policy-message").removeClass("hidden"); + setTimeout(function(){ + window.location.href = "/devicemgt/policies"; + }, 1000); } }, // on error