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

Fix app install issue in APPM store

See merge request entgra/carbon-device-mgt!181
merge-requests/183/head
Dharmakeerthi Lasantha 5 years ago
commit aef5b84b16

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

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

@ -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.",
});
}
});

@ -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
});
});

Loading…
Cancel
Save