Merge branch 'fix/appm-store/device-install' into 'master'

Load both active & inactive devices in APPM device installation

Closes product-iots#318

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

@ -138,7 +138,6 @@ class DeviceInstall extends React.Component {
const extraParams = { const extraParams = {
offset: 10 * (currentPage - 1), // calculate the offset offset: 10 * (currentPage - 1), // calculate the offset
limit: 10, limit: 10,
status: 'ACTIVE',
requireDeviceInfo: true, requireDeviceInfo: true,
}; };
@ -146,11 +145,11 @@ class DeviceInstall extends React.Component {
extraParams.type = deviceType; extraParams.type = deviceType;
} }
// note: encode with '%26' not '&' let encodedExtraParams = Object.keys(extraParams)
const encodedExtraParams = Object.keys(extraParams)
.map(key => key + '=' + extraParams[key]) .map(key => key + '=' + extraParams[key])
.join('&'); .join('&');
encodedExtraParams += '&status=ACTIVE&status=INACTIVE'; // fetch only active and inactive devices
// send request to the invoker // send request to the invoker
axios axios
.get( .get(

@ -136,18 +136,18 @@ class DeviceUninstall extends React.Component {
const extraParams = { const extraParams = {
offset: 10 * (currentPage - 1), // calculate the offset offset: 10 * (currentPage - 1), // calculate the offset
limit: 10, limit: 10,
status: 'ACTIVE',
}; };
if (deviceType !== 'ANY') { if (deviceType !== 'ANY') {
extraParams.type = deviceType; extraParams.type = deviceType;
} }
// note: encode with '%26' not '&' let encodedExtraParams = Object.keys(extraParams)
const encodedExtraParams = Object.keys(extraParams)
.map(key => key + '=' + extraParams[key]) .map(key => key + '=' + extraParams[key])
.join('&'); .join('&');
encodedExtraParams += '&status=ACTIVE&status=INACTIVE'; // fetch only active and inactive devices
const uuid = this.props.uuid; const uuid = this.props.uuid;
axios axios
.get( .get(

Loading…
Cancel
Save