Fix ui issues in android enterprise

- Hide managed configs when android enterprise is disabled
- Send current host and port to get android enterprise token
feature/appm-store/pbac
Jayasanka Weerasinghe 5 years ago committed by Dharmakeerthi Lasantha
parent 8b52acf1f5
commit 12d68579a6

@ -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({

@ -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 {
<Divider/>
{/*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) &&
(
<div>
<div>
<Text strong={true}>Set up managed configurations</Text>
@ -490,8 +492,9 @@ class AppDetailsDrawer extends React.Component {
<div className="releases-details">
{(app.type === "ENTERPRISE") && (
<Link to={`/publisher/apps/${app.deviceType}/${app.id}/add-release`}><Button htmlType="button"
size="small">Add
<Link to={`/publisher/apps/${app.deviceType}/${app.id}/add-release`}><Button
htmlType="button"
size="small">Add
new release</Button></Link>)}
<List
style={{paddingTop: 16}}
@ -499,29 +502,30 @@ class AppDetailsDrawer extends React.Component {
dataSource={app.applicationReleases}
renderItem={release => (
<div className="app-release-cards">
<List.Item>
<Link to={"apps/releases/" + release.uuid}>
<Card className="release-card">
<Meta
avatar={
<Avatar size="large" shape="square" src={release.iconPath}/>
}
title={release.version}
description={
<div style={{
fontSize: "0.7em"
}} className="description-view">
<IconText type="check" text={release.currentStatus}/>
<Divider type="vertical"/>
<IconText type="upload" text={release.releaseType}/>
<Divider type="vertical"/>
<IconText type="star-o" text={release.rating.toFixed(1)}/>
</div>
}
/>
</Card>
</Link>
</List.Item>
<List.Item>
<Link to={"apps/releases/" + release.uuid}>
<Card className="release-card">
<Meta
avatar={
<Avatar size="large" shape="square" src={release.iconPath}/>
}
title={release.version}
description={
<div style={{
fontSize: "0.7em"
}} className="description-view">
<IconText type="check" text={release.currentStatus}/>
<Divider type="vertical"/>
<IconText type="upload" text={release.releaseType}/>
<Divider type="vertical"/>
<IconText type="star-o"
text={release.rating.toFixed(1)}/>
</div>
}
/>
</Card>
</Link>
</List.Item>
</div>
)}
/>
@ -661,7 +665,7 @@ class AppDetailsDrawer extends React.Component {
<div className="app-rate">
{app.applicationReleases.length > 0 && (
<DetailedRating type="app" uuid={app.applicationReleases[0].uuid} />)}
<DetailedRating type="app" uuid={app.applicationReleases[0].uuid}/>)}
</div>
</Spin>
</Drawer>

@ -18,10 +18,11 @@
<!doctype html>
<html>
<head>
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=0"/>
<title>Entgra App Publisher</title>
<script src="https://apis.google.com/js/client.js"></script>
</head>
<head>
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=0"/>
<meta charset="utf-8"/>
<title>Entgra App Publisher</title>
<script src="https://apis.google.com/js/client.js"></script>
</head>
<div id="root"></div>
</html>
Loading…
Cancel
Save