From d19d9f20c43ecabe6b0417633876bfab08179749 Mon Sep 17 00:00:00 2001 From: nipun Date: Mon, 14 Oct 2019 15:35:42 +0530 Subject: [PATCH 1/2] Improve the profile feature to Show the logged user name --- .../react-app/src/App.js | 1 + .../react-app/src/pages/dashboard/Dashboard.js | 2 +- .../react-app/src/App.js | 1 + .../react-app/src/pages/dashboard/Dashboard.js | 3 ++- 4 files changed, 5 insertions(+), 2 deletions(-) diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/App.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/App.js index 0765dcff5f4..e027a155f7e 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/App.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/App.js @@ -102,6 +102,7 @@ class App extends React.Component { window.location.origin + "/publisher-ui-request-handler/user", "platform=publisher" ).then(res => { + config.user = res.data.data; const pageURL = window.location.pathname; const lastURLSegment = pageURL.substr(pageURL.lastIndexOf('/') + 1); if (lastURLSegment === "login") { diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/dashboard/Dashboard.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/dashboard/Dashboard.js index dc011aa8b7f..802ddc5bd87 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/dashboard/Dashboard.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/dashboard/Dashboard.js @@ -122,7 +122,7 @@ class Dashboard extends React.Component { - Profile + {this.config.user} }> diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/App.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/App.js index 9f4690c87a5..7031c03cc84 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/App.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/App.js @@ -82,6 +82,7 @@ class App extends React.Component { window.location.origin + "/store-ui-request-handler/user", "platform=publisher" ).then(res => { + config.user = res.data.data; const pageURL = window.location.pathname; const lastURLSegment = pageURL.substr(pageURL.lastIndexOf('/') + 1); if (lastURLSegment === "login") { diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/pages/dashboard/Dashboard.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/pages/dashboard/Dashboard.js index fe070711722..30c7da2df18 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/pages/dashboard/Dashboard.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/pages/dashboard/Dashboard.js @@ -41,6 +41,7 @@ class Dashboard extends React.Component { collapsed: false }; this.logo = this.props.context.theme.logo; + this.config = this.props.context; } componentDidMount() { @@ -138,7 +139,7 @@ class Dashboard extends React.Component { title={ - Profile + {this.config.user} }> From 820f94815f0388c970c4393ada9584f2ed7e3e08 Mon Sep 17 00:00:00 2001 From: nipun Date: Mon, 14 Oct 2019 16:45:49 +0530 Subject: [PATCH 2/2] Fix the os version issue of the APPM publisher --- .../src/components/new-app/subForms/NewAppUploadForm.js | 5 +++-- 1 file changed, 3 insertions(+), 2 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 d8e52bc2be3..79fd42a5f5c 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 @@ -221,7 +221,7 @@ class NewAppUploadForm extends React.Component { }; handleLowerOsVersionChange = (lowerOsVersion) => { - this.lowerOsVersion = lowerOsVersion; + this.lowerOsVersion = parseFloat(lowerOsVersion); this.setState({ osVersionsValidateStatus: 'validating', osVersionsHelperText: '' @@ -229,7 +229,7 @@ class NewAppUploadForm extends React.Component { }; handleUpperOsVersionChange = (upperOsVersion) => { - this.upperOsVersion = upperOsVersion; + this.upperOsVersion = parseFloat(upperOsVersion); this.setState({ osVersionsValidateStatus: 'validating', osVersionsHelperText: '' @@ -479,6 +479,7 @@ class NewAppUploadForm extends React.Component { required: true, message: 'Please select' }], + initialValue: false })( } unCheckedChildren={}