From 148eaa69da23c4a512375135491aaef6a9a95dec Mon Sep 17 00:00:00 2001 From: shamalka Date: Sat, 7 Dec 2019 08:29:39 +0530 Subject: [PATCH] Fix pagination in store UI install/uninstall --- .../src/components/apps/release/install/DeviceInstall.js | 5 +++-- .../src/components/apps/release/install/DeviceUninstall.js | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) 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 8850e84394..c7e123d843 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 @@ -158,7 +158,7 @@ class DeviceInstall extends React.Component { const pagination = {...this.state.pagination}; this.setState({ loading: false, - data: res.data.data.devices, + data: res.data.data, pagination, }); } @@ -224,11 +224,12 @@ class DeviceInstall extends React.Component { style={{paddingTop: 20}} columns={columns} rowKey={record => record.deviceIdentifier} - dataSource={data} + dataSource={data.devices} pagination={{ ...pagination, size: "small", // position: "top", + total: data.count, showTotal: (total, range) => `showing ${range[0]}-${range[1]} of ${total} devices` // showQuickJumper: true }} diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/components/apps/release/install/DeviceUninstall.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/components/apps/release/install/DeviceUninstall.js index a8533ef663..6f4e09e793 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/components/apps/release/install/DeviceUninstall.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/components/apps/release/install/DeviceUninstall.js @@ -155,7 +155,7 @@ class DeviceUninstall extends React.Component { const pagination = {...this.state.pagination}; this.setState({ loading: false, - data: res.data.data.devices, + data: res.data.data, pagination, }); } @@ -220,10 +220,11 @@ class DeviceUninstall extends React.Component { style={{paddingTop: 20}} columns={columns} rowKey={record => record.deviceIdentifier} - dataSource={data} + dataSource={data.devices} pagination={{ ...pagination, size: "small", + total: data.count, showTotal: (total, range) => `showing ${range[0]}-${range[1]} of ${total} devices` }} loading={loading}