From c5bc96d8cc0cd68219f6b3fa296b255786b5cc09 Mon Sep 17 00:00:00 2001 From: Jayasanka Date: Sat, 26 Oct 2019 19:40:20 +0530 Subject: [PATCH] Fix invalid support OS version issue in APPM publisher UI --- .../components/new-app/subForms/NewAppUploadForm.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/new-app/subForms/NewAppUploadForm.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/new-app/subForms/NewAppUploadForm.js index a0aa1e6efaf..ebb761c322f 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/new-app/subForms/NewAppUploadForm.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/new-app/subForms/NewAppUploadForm.js @@ -117,7 +117,7 @@ class NewAppUploadForm extends React.Component { osVersionsHelperText: 'Please select supported OS versions', osVersionsValidateStatus: 'error', }); - } else if (this.lowerOsVersion >= this.upperOsVersion) { + } else if (parseFloat(this.lowerOsVersion) >= parseFloat(this.upperOsVersion)) { isFormValid = false; this.setState({ osVersionsHelperText: 'Please select valid range', @@ -221,7 +221,7 @@ class NewAppUploadForm extends React.Component { }; handleLowerOsVersionChange = (lowerOsVersion) => { - this.lowerOsVersion = parseFloat(lowerOsVersion); + this.lowerOsVersion = lowerOsVersion; this.setState({ osVersionsValidateStatus: 'validating', osVersionsHelperText: '' @@ -229,7 +229,11 @@ class NewAppUploadForm extends React.Component { }; handleUpperOsVersionChange = (upperOsVersion) => { - this.upperOsVersion = parseFloat(upperOsVersion); + if (upperOsVersion === "all") { + this.upperOsVersion = this.props.supportedOsVersions[this.props.supportedOsVersions.length - 1]["versionName"]; + }else{ + this.upperOsVersion = upperOsVersion; + } this.setState({ osVersionsValidateStatus: 'validating', osVersionsHelperText: '' @@ -445,7 +449,7 @@ class NewAppUploadForm extends React.Component { onChange={this.handleUpperOsVersionChange}> {(supportedOsVersions.length > 0) && ( )}