From a34c98aadfe053abfaa3dcc101084962719f6cc7 Mon Sep 17 00:00:00 2001 From: Jayasanka Date: Wed, 17 Jul 2019 16:25:28 +0530 Subject: [PATCH] Fix app install issue in APPM store --- .../src/components/apps/list-apps/Filters.js | 9 ----- .../src/components/apps/list-apps/ListApps.js | 36 ++++++++++++------- .../src/components/new-app/AddNewAppForm.js | 2 +- .../components/apps/release/ReleaseView.js | 7 ++-- .../apps/release/install/DeviceInstall.js | 2 +- 5 files changed, 29 insertions(+), 27 deletions(-) diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/list-apps/Filters.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/list-apps/Filters.js index 09446b47c25..716612a5d13 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/list-apps/Filters.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/list-apps/Filters.js @@ -179,15 +179,6 @@ class FiltersForm extends React.Component { - - {getFieldDecorator('serach', {})( - } - placeholder="Username" - />, - )} - - {getFieldDecorator('categories', { rules: [{ diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/list-apps/ListApps.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/list-apps/ListApps.js index db65496773c..2273df72357 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/list-apps/ListApps.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/list-apps/ListApps.js @@ -44,15 +44,29 @@ class ListApps extends React.Component { }); }; + setSearchText = (appName) => { + const filters = {...this.state.filters}; + if (appName === '' && filters.hasOwnProperty("appName")) { + delete filters["appName"]; + } else { + filters.appName = appName; + } + this.setState({ + filters + }); + console.log(filters); + }; + render() { const {isDrawerVisible, filters} = this.state; return ( - - - - - - + + + + + + + Apps @@ -60,7 +74,7 @@ class ListApps extends React.Component { console.log(value)} + onSearch={this.setSearchText} style={{width: 200}} /> @@ -69,13 +83,11 @@ class ListApps extends React.Component { - - - + + + ); } } -// const ListApps = connect(mapStateToProps, {getApps})(ConnectedListApps); - export default ListApps; \ No newline at end of file diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/new-app/AddNewAppForm.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/new-app/AddNewAppForm.js index be2b8452153..cf7d6fc4c9a 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/new-app/AddNewAppForm.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/new-app/AddNewAppForm.js @@ -277,7 +277,7 @@ class AddNewAppFormComponent extends React.Component { message: 'Please select device type' }, { - validator: this.validateIcon + // validator: this.validateIcon } ], diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/components/apps/release/ReleaseView.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/components/apps/release/ReleaseView.js index 3597036318e..80098733ebf 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/components/apps/release/ReleaseView.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/components/apps/release/ReleaseView.js @@ -29,7 +29,7 @@ class ReleaseView extends React.Component { this.setState({ loading: true, }); - const url = config.serverConfig.protocol + "://" + config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + config.serverConfig.invoker.uri + config.serverConfig.invoker.store + "/subscription/install/" + uuid + "/" + type + "/install"; + const url = config.serverConfig.protocol + "://" + config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + config.serverConfig.invoker.uri + config.serverConfig.invoker.store + "/subscription/" + uuid + "/" + type + "/install"; axios.post( url, payload, @@ -55,12 +55,11 @@ class ReleaseView extends React.Component { message: "There was a problem", duration: 0, description: - "We are unable to install the app.", + "Error occurred while installing app", }); } }).catch((error) => { - console.log(error); if (error.response.status === 401) { window.location.href = config.serverConfig.protocol + "://" + config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + '/store/login'; } else { @@ -72,7 +71,7 @@ class ReleaseView extends React.Component { message: "There was a problem", duration: 0, description: - "We are unable to add your review right now.", + "Error occurred while installing the app.", }); } }); diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/components/apps/release/install/DeviceInstall.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/components/apps/release/install/DeviceInstall.js index 60a69960fcb..9ddd0886979 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/components/apps/release/install/DeviceInstall.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/components/apps/release/install/DeviceInstall.js @@ -181,7 +181,7 @@ class DeviceInstall extends React.Component { const payload = []; selectedRows.map(device => { payload.push({ - deviceIdentifier: device.deviceIdentifier, + id: device.deviceIdentifier, type: device.type }); });