Fix server starting issue

This issue is occurred as a result of having java8 codes in the source. Hence remove and replace the code.
feature/appm-store/pbac
Dharmakeerthi Lasantha 5 years ago
parent 0e22d24e61
commit 5c92401265

@ -67,28 +67,7 @@
"text": "The final state of an application, where no transition of states will be allowed after this."
}
},
"installationTypes": {
"ENTERPRISE": {
"deviceTypes": [
"android",
"ios"
]
},
"PUBLIC": {
"deviceTypes": [
"android",
"ios"
]
},
"WEB_CLIP": {
"deviceTypes": [
"android",
"ios"
]
},
"CUSTOM": {
"deviceTypes": [
]
}
"deviceTypes": {
"mobileTypes": ["android", "ios"]
}
}

@ -414,6 +414,7 @@ class AppDetailsDrawer extends React.Component {
}
};
render() {
const config = this.props.context;
const {app, visible, onClose} = this.props;
@ -459,12 +460,11 @@ class AppDetailsDrawer extends React.Component {
<div>
<Drawer
placement="right"
width={this.state.drawerWidth}
width={640}
closable={false}
onClose={onClose}
visible={visible}
>
<Spin spinning={loading} delay={500}>
<div style={{textAlign: "center"}}>
{avatar}
@ -555,7 +555,6 @@ class AppDetailsDrawer extends React.Component {
)}
<Divider dashed={true}/>
<Text strong={true}>Categories </Text>
{!isCategoriesEditEnabled && (<Text
style={{color: config.theme.primaryColor, cursor: "pointer"}}
@ -600,8 +599,8 @@ class AppDetailsDrawer extends React.Component {
}</span>
)}
<Divider dashed={true}/>
<Divider dashed={true}/>
<Text strong={true}>Tags </Text>
{!isTagsEditEnabled && (<Text
style={{color: config.theme.primaryColor, cursor: "pointer"}}

@ -148,21 +148,31 @@ class NewAppDetailsForm extends React.Component {
getDeviceTypes = () => {
const config = this.props.context;
const {formConfig} = this.props;
console.log("test");
const {installationType} = formConfig;
axios.get(
window.location.origin + config.serverConfig.invoker.uri + config.serverConfig.invoker.deviceMgt + "/device-types"
).then(res => {
if (res.status === 200) {
const allDeviceTypes = JSON.parse(res.data.data);
const whitelistedDeviceTypes = config.installationTypes[formConfig.installationType].deviceTypes;
const mobileDeviceTypes = config.deviceTypes.mobileTypes;
const allowedDeviceTypes = [];
allDeviceTypes.forEach(deviceType=>{
if(whitelistedDeviceTypes.includes(deviceType.name)){
allowedDeviceTypes.push(deviceType);
}
});
// exclude mobile device types if installation type is custom
if(installationType==="CUSTOM"){
allDeviceTypes.forEach(deviceType=>{
if(!mobileDeviceTypes.includes(deviceType.name)){
allowedDeviceTypes.push(deviceType);
}
});
}else{
allDeviceTypes.forEach(deviceType=>{
if(mobileDeviceTypes.includes(deviceType.name)){
allowedDeviceTypes.push(deviceType);
}
});
}
this.setState({
deviceTypes: allowedDeviceTypes,
loading: false,

Loading…
Cancel
Save