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 d42a2a8a097..edfe0e73de1 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 @@ -490,7 +490,7 @@ class AppDetailsDrawer extends React.Component {
{(app.type === "ENTERPRISE") && ( - )} { + getSupportedOsVersions = (deviceType) => { const config = this.props.context; axios.get( - window.location.origin + config.serverConfig.invoker.uri + config.serverConfig.invoker.publisher + - "/admin/device-types/{deviceTypeName}/versions" + window.location.origin + config.serverConfig.invoker.uri + config.serverConfig.invoker.deviceMgt + + `/admin/device-types/${deviceType}/versions` ).then(res => { if (res.status === 200) { - - // let tags = JSON.parse(res.data.data); - // this.setState({ - // tags: tags, - // loading: false, - // }); + let supportedOsVersions = JSON.parse(res.data.data); + this.setState({ + supportedOsVersions, + loading: false, + }); } }).catch((error) => { handleApiError(error, "Error occurred while trying to load supported OS versions."); @@ -116,9 +117,8 @@ class AddNewReleaseFormComponent extends React.Component { isSharedWithAllTenants, metaData: "string", releaseType: releaseType, - supportedOsVersions: "4-30" + supportedOsVersions: `${this.lowerOsVersion}-${this.upperOsVersion}` }; - data.append('binaryFile', binaryFile[0].originFileObj); data.append('icon', icon[0].originFileObj); data.append('screenshot1', screenshots[0].originFileObj); @@ -132,7 +132,7 @@ class AddNewReleaseFormComponent extends React.Component { data.append("applicationRelease", blob); - const url = window.location.origin+ config.serverConfig.invoker.uri + config.serverConfig.invoker.publisher + "/applications/"+deviceType+"/ent-app/" + appId; + const url = window.location.origin + config.serverConfig.invoker.uri + config.serverConfig.invoker.publisher + "/applications/" + deviceType + "/ent-app/" + appId; axios.post( url, @@ -151,7 +151,7 @@ class AddNewReleaseFormComponent extends React.Component { const uuid = res.data.data.uuid; - this.props.history.push('/publisher/apps/releases/'+uuid); + this.props.history.push('/publisher/apps/releases/' + uuid); } }).catch((error) => { @@ -182,8 +182,16 @@ class AddNewReleaseFormComponent extends React.Component { }); }; + handleLowerOsVersionChange = (lowerOsVersion) => { + this.lowerOsVersion = lowerOsVersion; + }; + + handleUpperOsVersionChange = (upperOsVersion) => { + this.upperOsVersion = upperOsVersion; + }; + render() { - const {isFree, icons, screenshots, loading, binaryFiles} = this.state; + const {isFree, icons, screenshots, loading, binaryFiles, supportedOsVersions} = this.state; const {getFieldDecorator} = this.props.form; return (
@@ -291,6 +299,45 @@ class AddNewReleaseFormComponent extends React.Component { )} + + {getFieldDecorator('supportedOS')( +
+ + + + + + +

-

+ + + + +
+
+
+ )} +
+ {getFieldDecorator('select', { rules: [{required: true, message: 'Please select price Type'}],