From 5c92401265359abecb7be762434e90691f035129 Mon Sep 17 00:00:00 2001 From: Dharmakeerthi Lasantha Date: Sun, 15 Sep 2019 16:34:10 +0000 Subject: [PATCH] Fix server starting issue This issue is occurred as a result of having java8 codes in the source. Hence remove and replace the code. --- .../react-app/public/conf/config.json | 25 ++---------------- .../AppDetailsDrawer/AppDetailsDrawer.js | 7 +++-- .../new-app/subForms/NewAppDetailsForm.js | 26 +++++++++++++------ 3 files changed, 23 insertions(+), 35 deletions(-) diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/public/conf/config.json b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/public/conf/config.json index a79fbbc55a2..21457feb390 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/public/conf/config.json +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/public/conf/config.json @@ -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"] } } 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 c6c24fea280..841e9215cb8 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 @@ -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 {
-
{avatar} @@ -555,7 +555,6 @@ class AppDetailsDrawer extends React.Component { )} - Categories {!isCategoriesEditEnabled && ( )} - + Tags {!isTagsEditEnabled && ( { 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,