From 6245e564a4be01c7fb1135cbcc98276f6b145d3a Mon Sep 17 00:00:00 2001 From: Jayasanka Date: Sat, 26 Oct 2019 13:04:02 +0530 Subject: [PATCH] Add refresh button to subscription details table --- .../react-app/src/components/apps/AppCard.js | 2 +- .../components/apps/release/ReleaseView.js | 4 +-- ...DevicesTable.js => SubscriptionDetails.js} | 26 ++++++++++++++----- 3 files changed, 22 insertions(+), 10 deletions(-) rename components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/components/apps/release/{InstalledDevicesTable.js => SubscriptionDetails.js} (88%) diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/components/apps/AppCard.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/components/apps/AppCard.js index e60e8652a1..64d155299f 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/components/apps/AppCard.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/components/apps/AppCard.js @@ -50,7 +50,7 @@ class AppCard extends React.Component { {app.name}
- {app.subMethod.toLowerCase()}
+ {app.type.toLowerCase()}
- + diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/components/apps/release/InstalledDevicesTable.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/components/apps/release/SubscriptionDetails.js similarity index 88% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/components/apps/release/InstalledDevicesTable.js rename to components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/components/apps/release/SubscriptionDetails.js index 39fd3ef27c..f6bace7dd0 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/components/apps/release/InstalledDevicesTable.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/components/apps/release/SubscriptionDetails.js @@ -53,7 +53,16 @@ const columns = [ title: 'Action', dataIndex: 'action', key: 'action', - render: action => action.toLowerCase() + render: action => { + action = action.toLowerCase(); + let color = "fff"; + if(action==="subscribed"){ + color = "#6ab04c" + }else if(action === "unsubscribed"){ + color = "#f0932b" + } + return {action} + } }, { title: 'Triggered By', @@ -128,7 +137,7 @@ const getTimeAgo = (time) => { }; -class InstalledDevicesTable extends React.Component { +class SubscriptionDetails extends React.Component { constructor(props) { super(props); config = this.props.context; @@ -171,12 +180,10 @@ class InstalledDevicesTable extends React.Component { `/admin/subscription/${this.props.uuid}?` + encodedExtraParams, ).then(res => { if (res.status === 200) { - const pagination = {...this.state.pagination}; console.log(res.data.data.data); this.setState({ loading: false, - data: res.data.data.data, - pagination, + data: res.data.data.data }); } @@ -192,9 +199,14 @@ class InstalledDevicesTable extends React.Component {
- The following are the subscription details of the application in each respective device. + The following are the subscription details of the application in each respective device.
+
+ +
(record.device.deviceIdentifier + record.device.enrolmentInfo.owner + record.device.enrolmentInfo.ownership)} @@ -214,4 +226,4 @@ class InstalledDevicesTable extends React.Component { } } -export default withConfigContext(InstalledDevicesTable); \ No newline at end of file +export default withConfigContext(SubscriptionDetails); \ No newline at end of file