From c33d8fc7d23da216e132a9e29dcde68a92bf7a00 Mon Sep 17 00:00:00 2001 From: Omer Lachish Date: Sun, 10 Nov 2019 14:22:10 +0200 Subject: [PATCH 1/2] handle a console warning about passing in string page options --- client/app/components/admin/RQStatus.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/app/components/admin/RQStatus.jsx b/client/app/components/admin/RQStatus.jsx index 147ac5330b..88c937dd17 100644 --- a/client/app/components/admin/RQStatus.jsx +++ b/client/app/components/admin/RQStatus.jsx @@ -49,7 +49,7 @@ export function WorkersTable({ loading, items }) { dataSource={items} pagination={{ defaultPageSize: 25, - pageSizeOptions: [10, 25, 50], + pageSizeOptions: ['10', '25', '50'], showSizeChanger: true, }} /> From 0390c7e31a451db28e3ccaf148141bd144741946 Mon Sep 17 00:00:00 2001 From: Omer Lachish Date: Sun, 10 Nov 2019 14:22:56 +0200 Subject: [PATCH 2/2] preserve selected tab in the location hash --- client/app/pages/admin/Jobs.jsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/client/app/pages/admin/Jobs.jsx b/client/app/pages/admin/Jobs.jsx index 44dc6e3bf9..203fa1f604 100644 --- a/client/app/pages/admin/Jobs.jsx +++ b/client/app/pages/admin/Jobs.jsx @@ -16,6 +16,7 @@ import moment from 'moment'; class Jobs extends React.Component { state = { + activeTab: location.hash.replace('#', '') || null, isLoading: true, error: null, @@ -67,7 +68,12 @@ class Jobs extends React.Component { }; render() { - const { isLoading, error, queueCounters, startedJobs, overallCounters, workers } = this.state; + const { isLoading, error, queueCounters, startedJobs, overallCounters, workers, activeTab } = this.state; + + const changeTab = (newTab) => { + location.replace(`${location.pathname}#${newTab}`); + this.setState({ activeTab: newTab }); + }; return ( @@ -87,7 +93,7 @@ class Jobs extends React.Component { - +