Rework user info window
Rework the user info window with react.
Issue-ID: CLAMP-449
Change-Id: I260bcb3c15cae73af0c180706928415ddc81dfbf
Signed-off-by: xuegao <xg353y@intl.att.com>
diff --git a/ui-react/src/api/UserService.js b/ui-react/src/api/UserService.js
index 22168d4..be21e69 100644
--- a/ui-react/src/api/UserService.js
+++ b/ui-react/src/api/UserService.js
@@ -47,5 +47,26 @@
return UserService.notLoggedUserName;
});
}
-}
+ static getUserInfo() {
+ return fetch('/restservices/clds/v1/clds/cldsInfo', {
+ method: 'GET',
+ credentials: 'same-origin',
+ })
+ .then(function (response) {
+ console.debug("getUserInfo response received, status code:", response.status);
+ if (response.ok) {
+ return response.json();
+ }
+ })
+ .then(function (data) {
+ console.info ("User info received:",data)
+ return data;
+ })
+ .catch(function(error) {
+ console.warn("getUserInfo error received, user set to: ",UserService.notLoggedUserName);
+ console.error("getUserInfo error:",error);
+ return;
+ });
+ }
+}