Merge branch 'application-mgt-new' into 'application-mgt-new'

Fix app install issue in APPM store

See merge request entgra/carbon-device-mgt!181
feature/appm-store/pbac
Dharmakeerthi Lasantha 5 years ago
commit aef5b84b16

@ -179,15 +179,6 @@ class FiltersForm extends React.Component {
</Col> </Col>
</Row> </Row>
<Form.Item>
{getFieldDecorator('serach', {})(
<Input
prefix={<Icon type="user" style={{ color: 'rgba(0,0,0,.25)' }} />}
placeholder="Username"
/>,
)}
</Form.Item>
<Form.Item label="Categories"> <Form.Item label="Categories">
{getFieldDecorator('categories', { {getFieldDecorator('categories', {
rules: [{ rules: [{

@ -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() { render() {
const {isDrawerVisible, filters} = this.state; const {isDrawerVisible, filters} = this.state;
return ( return (
<Row gutter={28}>
<Col md={6}> <Card>
<Filters setFilters={this.setFilters}/> <Row gutter={28}>
</Col> <Col md={6}>
<Col md={18}> <Filters setFilters={this.setFilters}/>
<Card> </Col>
<Col md={18}>
<Row> <Row>
<Col span={6}> <Col span={6}>
<Title level={4}>Apps</Title> <Title level={4}>Apps</Title>
@ -60,7 +74,7 @@ class ListApps extends React.Component {
<Col span={18} style={{textAlign: "right"}}> <Col span={18} style={{textAlign: "right"}}>
<Search <Search
placeholder="input search text" placeholder="input search text"
// onSearch={value => console.log(value)} onSearch={this.setSearchText}
style={{width: 200}} style={{width: 200}}
/> />
</Col> </Col>
@ -69,13 +83,11 @@ class ListApps extends React.Component {
<AppsTable filters={filters} showDrawer={this.showDrawer}/> <AppsTable filters={filters} showDrawer={this.showDrawer}/>
<AppDetailsDrawer visible={isDrawerVisible} onClose={this.closeDrawer} <AppDetailsDrawer visible={isDrawerVisible} onClose={this.closeDrawer}
app={this.state.selectedApp}/> app={this.state.selectedApp}/>
</Card> </Col>
</Col> </Row>
</Row> </Card>
); );
} }
} }
// const ListApps = connect(mapStateToProps, {getApps})(ConnectedListApps);
export default ListApps; export default ListApps;

@ -277,7 +277,7 @@ class AddNewAppFormComponent extends React.Component {
message: 'Please select device type' message: 'Please select device type'
}, },
{ {
validator: this.validateIcon // validator: this.validateIcon
} }
], ],

@ -29,7 +29,7 @@ class ReleaseView extends React.Component {
this.setState({ this.setState({
loading: true, 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( axios.post(
url, url,
payload, payload,
@ -55,12 +55,11 @@ class ReleaseView extends React.Component {
message: "There was a problem", message: "There was a problem",
duration: 0, duration: 0,
description: description:
"We are unable to install the app.", "Error occurred while installing app",
}); });
} }
}).catch((error) => { }).catch((error) => {
console.log(error);
if (error.response.status === 401) { if (error.response.status === 401) {
window.location.href = config.serverConfig.protocol + "://" + config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + '/store/login'; window.location.href = config.serverConfig.protocol + "://" + config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + '/store/login';
} else { } else {
@ -72,7 +71,7 @@ class ReleaseView extends React.Component {
message: "There was a problem", message: "There was a problem",
duration: 0, duration: 0,
description: description:
"We are unable to add your review right now.", "Error occurred while installing the app.",
}); });
} }
}); });

@ -181,7 +181,7 @@ class DeviceInstall extends React.Component {
const payload = []; const payload = [];
selectedRows.map(device => { selectedRows.map(device => {
payload.push({ payload.push({
deviceIdentifier: device.deviceIdentifier, id: device.deviceIdentifier,
type: device.type type: device.type
}); });
}); });

Loading…
Cancel
Save