From 07d87ae4f2a311aad6b029ba13e0f03a7a59a3be Mon Sep 17 00:00:00 2001 From: lasanthaDLPDS Date: Tue, 29 Oct 2019 21:06:29 +0530 Subject: [PATCH 1/7] Fix public app installing issue in APPM --- .../application/mgt/core/impl/ApplicationManagerImpl.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/impl/ApplicationManagerImpl.java b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/impl/ApplicationManagerImpl.java index f5b7882659..8d25c6482f 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/impl/ApplicationManagerImpl.java +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/impl/ApplicationManagerImpl.java @@ -1872,6 +1872,7 @@ public class ApplicationManagerImpl implements ApplicationManager { this.applicationDAO.deleteAppCategories(categoryIds, applicationId, tenantId); appCategories.removeAll(removingAppCategories); } + applicationDTO.setAppCategories(appCategories); } List updatingAppTags = applicationUpdateWrapper.getTags(); @@ -1894,6 +1895,7 @@ public class ApplicationManagerImpl implements ApplicationManager { this.applicationDAO.deleteApplicationTags(removingTagIds, applicationId, tenantId); appTags.removeAll(removingTagList); } + applicationDTO.setTags(appTags); } if (!applicationDAO.updateApplication(applicationDTO, tenantId)){ ConnectionManagerUtil.rollbackDBTransaction(); From c54b29a1820f343258e60e6bd77b4e76d196ca07 Mon Sep 17 00:00:00 2001 From: Jayasanka Date: Wed, 30 Oct 2019 17:06:43 +0530 Subject: [PATCH 2/7] Remove managed configuration option from non android ent. apps in APPM UI --- .../apps/list-apps/AppDetailsDrawer/AppDetailsDrawer.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) 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 7eaea07d32..f06186beb1 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 @@ -449,18 +449,15 @@ class AppDetailsDrawer extends React.Component { width={this.state.drawerWidth} closable={false} onClose={onClose} - visible={visible} - > + visible={visible}>
{avatar} {name}
- - {/*display manage config button only if the app is public android app*/} - {(app.type === "PUBLIC") && (app.deviceType === "android") && + {(app.isAndroidEnterpriseApp) && (config.androidEnterpriseToken !== null) && (
From 5a32912a7b4fa30fc33ed538d4720032dd932f89 Mon Sep 17 00:00:00 2001 From: Jayasanka Date: Wed, 30 Oct 2019 22:03:24 +0530 Subject: [PATCH 3/7] Get updated data from payload in Application update in APPM UI --- .../list-apps/AppDetailsDrawer/AppDetailsDrawer.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) 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 f06186beb1..c6ce74dc6c 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 @@ -185,15 +185,16 @@ class AppDetailsDrawer extends React.Component { window.location.origin + config.serverConfig.invoker.uri + config.serverConfig.invoker.publisher + "/applications/" + id, data ).then(res => { - this.props.onUpdateApp("name", name); if (res.status === 200) { + const app = res.data.data; + this.props.onUpdateApp("name", app.name); notification["success"]({ message: 'Saved!', description: 'App name updated successfully!' }); this.setState({ loading: false, - name: name, + name: app.name, }); } @@ -268,6 +269,7 @@ class AppDetailsDrawer extends React.Component { data ).then(res => { if (res.status === 200) { + const app = res.data.data; this.props.onUpdateApp("categories", temporaryCategories); notification["success"]({ message: 'Saved!', @@ -275,7 +277,7 @@ class AppDetailsDrawer extends React.Component { }); this.setState({ loading: false, - categories: temporaryCategories, + categories: app.categories, isCategoriesEditEnabled: false }); @@ -334,13 +336,14 @@ class AppDetailsDrawer extends React.Component { data ).then(res => { if (res.status === 200) { + const app = res.data.data; notification["success"]({ message: 'Saved!', description: 'App tags updated successfully!' }); this.setState({ loading: false, - tags: temporaryTags, + tags: app.tags, isTagsEditEnabled: false }); } @@ -375,13 +378,14 @@ class AppDetailsDrawer extends React.Component { data ).then(res => { if (res.status === 200) { + const app = res.data.data; notification["success"]({ message: 'Saved!', description: 'App description updated successfully!' }); this.setState({ loading: false, - description: temporaryDescription, + description: app.description, isDescriptionEditEnabled: false }); } From 01de8aa6654c3a7e0851e014ee045c2fba9b28c1 Mon Sep 17 00:00:00 2001 From: Jayasanka Date: Thu, 31 Oct 2019 11:39:37 +0530 Subject: [PATCH 4/7] Remove unwanted code linei --- .../application/mgt/core/impl/ApplicationManagerImpl.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/impl/ApplicationManagerImpl.java b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/impl/ApplicationManagerImpl.java index 8d25c6482f..f5b7882659 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/impl/ApplicationManagerImpl.java +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/impl/ApplicationManagerImpl.java @@ -1872,7 +1872,6 @@ public class ApplicationManagerImpl implements ApplicationManager { this.applicationDAO.deleteAppCategories(categoryIds, applicationId, tenantId); appCategories.removeAll(removingAppCategories); } - applicationDTO.setAppCategories(appCategories); } List updatingAppTags = applicationUpdateWrapper.getTags(); @@ -1895,7 +1894,6 @@ public class ApplicationManagerImpl implements ApplicationManager { this.applicationDAO.deleteApplicationTags(removingTagIds, applicationId, tenantId); appTags.removeAll(removingTagList); } - applicationDTO.setTags(appTags); } if (!applicationDAO.updateApplication(applicationDTO, tenantId)){ ConnectionManagerUtil.rollbackDBTransaction(); From 8ed7c15bdd1ac3758695f419f801c77cacb745eb Mon Sep 17 00:00:00 2001 From: Jayasanka Date: Thu, 31 Oct 2019 13:34:44 +0530 Subject: [PATCH 5/7] Fix app offset issue in APPM Store UI --- .../src/components/new-app/subForms/NewAppDetailsForm.js | 2 +- .../react-app/src/components/apps/AppList.js | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/new-app/subForms/NewAppDetailsForm.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/new-app/subForms/NewAppDetailsForm.js index 1a0ac43127..36b5d4e79b 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/new-app/subForms/NewAppDetailsForm.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/new-app/subForms/NewAppDetailsForm.js @@ -344,7 +344,7 @@ class NewAppDetailsForm extends React.Component { banner closable/> )} - + {getFieldDecorator('unrestrictedRoles', { rules: [], initialValue: [] diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/components/apps/AppList.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/components/apps/AppList.js index 5667cf3b9b..fb2bf14a58 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/components/apps/AppList.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/components/apps/AppList.js @@ -57,7 +57,12 @@ class AppList extends React.Component { if (prevProps.deviceType !== this.props.deviceType) { const {deviceType} = this.props; this.props.changeSelectedMenuItem(deviceType); - this.fetchData(deviceType); + this.fetchData(0, limit, res => { + this.setState({ + apps: res, + loading: false + }); + }); } } From 51394159951e4679c1c77001214881e868344477 Mon Sep 17 00:00:00 2001 From: Jayasanka Date: Thu, 31 Oct 2019 14:04:03 +0530 Subject: [PATCH 6/7] Fix wrong offset value in app view of APPM Store UI --- .../react-app/src/components/apps/AppList.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/components/apps/AppList.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/components/apps/AppList.js index fb2bf14a58..d06f4a26ab 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/components/apps/AppList.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/components/apps/AppList.js @@ -60,7 +60,8 @@ class AppList extends React.Component { this.fetchData(0, limit, res => { this.setState({ apps: res, - loading: false + loading: false, + hasMore: true }); }); } @@ -139,6 +140,7 @@ class AppList extends React.Component { return (
Date: Thu, 31 Oct 2019 14:26:58 +0530 Subject: [PATCH 7/7] Increase initial limit value of apps to 30 in APPM Store --- .../react-app/src/components/apps/AppList.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/components/apps/AppList.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/components/apps/AppList.js index d06f4a26ab..7222fe5394 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/components/apps/AppList.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/components/apps/AppList.js @@ -24,7 +24,7 @@ import {withConfigContext} from "../../context/ConfigContext"; import {handleApiError} from "../../js/Utils"; import InfiniteScroll from "react-infinite-scroller"; -const limit = 10; +const limit = 30; class AppList extends React.Component { constructor(props) { @@ -44,7 +44,7 @@ class AppList extends React.Component { componentDidMount() { const {deviceType} = this.props; this.props.changeSelectedMenuItem(deviceType); - this.fetchData(0, limit, res => { + this.fetchData(0, 30, res => { this.setState({ apps: res, loading: false @@ -57,7 +57,7 @@ class AppList extends React.Component { if (prevProps.deviceType !== this.props.deviceType) { const {deviceType} = this.props; this.props.changeSelectedMenuItem(deviceType); - this.fetchData(0, limit, res => { + this.fetchData(0, 30, res => { this.setState({ apps: res, loading: false,