From 12d68579a6a8ffc569149da72d6b4139dd2b8077 Mon Sep 17 00:00:00 2001 From: Jayasanka Weerasinghe Date: Wed, 16 Oct 2019 12:06:19 +0000 Subject: [PATCH] Fix ui issues in android enterprise - Hide managed configs when android enterprise is disabled - Send current host and port to get android enterprise token --- .../react-app/src/App.js | 5 +- .../AppDetailsDrawer/AppDetailsDrawer.js | 60 ++++++++++--------- .../react-app/src/index.html | 11 ++-- 3 files changed, 41 insertions(+), 35 deletions(-) diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/App.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/App.js index e027a155f7..01250e3791 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/App.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/App.js @@ -79,9 +79,10 @@ class App extends React.Component { getAndroidEnterpriseToken = (config) => { axios.get( - window.location.origin + config.serverConfig.invoker.uri + "/device-mgt/android/v1.0/enterprise/store-url?approveApps=true" + + window.location.origin + config.serverConfig.invoker.uri + + "/device-mgt/android/v1.0/enterprise/store-url?approveApps=true" + "&searchEnabled=true&isPrivateAppsEnabled=true&isWebAppEnabled=true&isOrganizeAppPageVisible=true&isManagedConfigEnabled=true" + - "&host=https://localhost:9443", + "&host=" + window.location.origin, ).then(res => { config.androidEnterpriseToken = res.data.data.token; this.setState({ diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/list-apps/AppDetailsDrawer/AppDetailsDrawer.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/list-apps/AppDetailsDrawer/AppDetailsDrawer.js index 7b453a4098..335e1c46dd 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/list-apps/AppDetailsDrawer/AppDetailsDrawer.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/list-apps/AppDetailsDrawer/AppDetailsDrawer.js @@ -72,7 +72,7 @@ const formats = [ class AppDetailsDrawer extends React.Component { constructor(props) { super(props); - const drawerWidth = window.innerWidth<=770 ? '80%' : '40%'; + const drawerWidth = window.innerWidth <= 770 ? '80%' : '40%'; this.state = { loading: false, @@ -460,7 +460,9 @@ class AppDetailsDrawer extends React.Component { {/*display manage config button only if the app is public android app*/} - {(app.type === "PUBLIC") && (app.deviceType === "android") && ( + {(app.type === "PUBLIC") && (app.deviceType === "android") && + (config.androidEnterpriseToken !== null) && + (
Set up managed configurations @@ -490,8 +492,9 @@ class AppDetailsDrawer extends React.Component {
{(app.type === "ENTERPRISE") && ( - )} (
- - - - - } - title={release.version} - description={ -
- - - - - -
- } - /> -
- -
+ + + + + } + title={release.version} + description={ +
+ + + + + +
+ } + /> +
+ +
)} /> @@ -661,7 +665,7 @@ class AppDetailsDrawer extends React.Component {
{app.applicationReleases.length > 0 && ( - )} + )}
diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/index.html b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/index.html index 989f52c67a..345bcc4521 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/index.html +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/index.html @@ -18,10 +18,11 @@ - - - Entgra App Publisher - - + + + + Entgra App Publisher + +
\ No newline at end of file