svn commit: r1826796 - /ofbiz/ofbiz-framework/trunk/themes/common-theme/webapp/common/js/util/OfbizUtil.js

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1826796 - /ofbiz/ofbiz-framework/trunk/themes/common-theme/webapp/common/js/util/OfbizUtil.js

jleroux@apache.org
Author: jleroux
Date: Thu Mar 15 11:28:45 2018
New Revision: 1826796

URL: http://svn.apache.org/viewvc?rev=1826796&view=rev
Log:
Reverted: The getJSONuiLabel javascript function is no longer working
(OFBIZ-10277)

Damned I committed from another instance :/

Modified:
    ofbiz/ofbiz-framework/trunk/themes/common-theme/webapp/common/js/util/OfbizUtil.js

Modified: ofbiz/ofbiz-framework/trunk/themes/common-theme/webapp/common/js/util/OfbizUtil.js
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/themes/common-theme/webapp/common/js/util/OfbizUtil.js?rev=1826796&r1=1826795&r2=1826796&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/themes/common-theme/webapp/common/js/util/OfbizUtil.js (original)
+++ ofbiz/ofbiz-framework/trunk/themes/common-theme/webapp/common/js/util/OfbizUtil.js Thu Mar 15 11:28:45 2018
@@ -1057,11 +1057,11 @@ function getJSONuiLabel(uiResource, errU
             type: "POST",
             data: {"requiredLabel" : requiredLabelStr},
             success: function(data) {
-                returnVal = data;
+                returnVal = data[0];
             }
         });
     }
-    return returnVal[arguments[0]];
+    return returnVal;
 }
 
 /**
@@ -1196,67 +1196,3 @@ function submitPagination(obj, url) {
         }
     }
 }
-
-function getJwtToken(webAppName) {
-    var JwtToken = "";
-    var userLoginId = getAutoUserLoginId(webAppName);
-
-    if (userLoginId != null && userLoginId != "") {
-        jQuery.ajax({
-            url: "getJwtToken",
-            type: "POST",
-            async: false,
-            dataType: "text",
-            data: {"userLoginId" : userLoginId},
-            success: function(data) {
-                JwtToken = data;
-            },
-            error: function(textStatus, errorThrown){
-                alert('Failure, errorThrown: ' + errorThrown);
-            }
-        });
-    }
-    return JwtToken;
-}
-
-function getAutoUserLoginId(webAppName) {
-    var userLoginId = ""
-        jQuery.ajax({
-            url: "getAutoUserLoginId",
-            type: "POST",
-            async: false,
-            dataType: "text",
-            data: {"webAppName" : webAppName},
-            success: function(data) {
-                userLoginId = data;
-            },
-            error: function(textStatus, errorThrown){
-                alert('Failure, errorThrown: ' + errorThrown);
-            }
-        });
-    return userLoginId;
-}
-
-//POST, or GET necessary ?
-function sendJwtToken(webAppName, targetUrl) {
-    var redirectUrl = targetUrl;
-    var jwtToken = getJwtToken(webAppName);
-    if (jwtToken != null && jwtToken != "") {
-        jQuery.ajax({
-            url: targetUrl,
-            async: false,
-            type: 'POST',
-//            ContentType: 'text/plain',
-//            xhrFields: {withCredentials: true},
-//            beforeSend: function (request) {
-//                request.setRequestHeader("Access-Control-Allow-Origin", "https://localhost"); // TODO check this is OK (it allows all)
-//                request.setRequestHeader("Access-Control-Allow-Headers", "Origin, X-Requested-With, X-Requested-By, Content-Type, Accept, Authorization");
-//                request.setRequestHeader("Access-Control-Allow-Credentials", "true");
-//            },
-            headers: { 'Content-Type': 'text/plain', "Authorization" : jwtToken},
-            success: function(data, textStatus, XMLHttpRequest){
-                window.location.href = redirectUrl;
-            }
-        });
-    }
-}