From 12706d4a970ceed64348bfedb7aff38456fa8c46 Mon Sep 17 00:00:00 2001 From: Mustakim Ali Date: Sat, 20 Oct 2018 16:49:02 +0100 Subject: [PATCH 1/5] Added missing JSDoc --- client/src/helpers/trackers/trackers.js | 1 + 1 file changed, 1 insertion(+) diff --git a/client/src/helpers/trackers/trackers.js b/client/src/helpers/trackers/trackers.js index 485cd31b..b2488b57 100644 --- a/client/src/helpers/trackers/trackers.js +++ b/client/src/helpers/trackers/trackers.js @@ -62,6 +62,7 @@ const getTrackerDataFromDb = (domainName, trackersDb, source) => { /** * Gets the source metadata for the specified tracker * @param {TrackerData} trackerData tracker data + * @returns {source} source metadata or null if no matching tracker found */ export const getSourceData = (trackerData) => { if (!trackerData || !trackerData.source) { From 66b83a5fb5c9dae880107acde750339ebe5f9816 Mon Sep 17 00:00:00 2001 From: Mustakim Ali Date: Sat, 20 Oct 2018 16:50:25 +0100 Subject: [PATCH 2/5] Formatted 'Rules count' number with ',' separator 147500 => 147,500 --- client/src/components/Filters/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/client/src/components/Filters/index.js b/client/src/components/Filters/index.js index ebc69973..8c886cf7 100644 --- a/client/src/components/Filters/index.js +++ b/client/src/components/Filters/index.js @@ -50,6 +50,7 @@ class Filters extends Component { Header: 'Rules count', accessor: 'rulesCount', className: 'text-center', + Cell: props => props.value.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",") }, { Header: 'Last time updated', accessor: 'lastUpdated', From 0c4646201f61873929c2415c4ba95399aa2be59a Mon Sep 17 00:00:00 2001 From: Mustakim Ali Date: Sat, 20 Oct 2018 17:03:36 +0100 Subject: [PATCH 3/5] Fixed linter issue --- client/src/components/Filters/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/components/Filters/index.js b/client/src/components/Filters/index.js index 8c886cf7..41b0273d 100644 --- a/client/src/components/Filters/index.js +++ b/client/src/components/Filters/index.js @@ -50,7 +50,7 @@ class Filters extends Component { Header: 'Rules count', accessor: 'rulesCount', className: 'text-center', - Cell: props => props.value.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",") + Cell: props => props.value.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ','), }, { Header: 'Last time updated', accessor: 'lastUpdated', From 98bf5322a36b173bc8949934848f4974d29bf31d Mon Sep 17 00:00:00 2001 From: Mo Mustakim Ali Date: Tue, 23 Oct 2018 13:48:51 +0100 Subject: [PATCH 4/5] Using culture-specific approach instead of regex --- client/src/components/Filters/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/components/Filters/index.js b/client/src/components/Filters/index.js index 41b0273d..6fd16012 100644 --- a/client/src/components/Filters/index.js +++ b/client/src/components/Filters/index.js @@ -50,7 +50,7 @@ class Filters extends Component { Header: 'Rules count', accessor: 'rulesCount', className: 'text-center', - Cell: props => props.value.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ','), + Cell: props => new Number(props.value).toLocaleString(), }, { Header: 'Last time updated', accessor: 'lastUpdated', From e466a09e206624e2a40439203048cb75a4de3079 Mon Sep 17 00:00:00 2001 From: Mo Mustakim Ali Date: Tue, 23 Oct 2018 15:58:07 +0100 Subject: [PATCH 5/5] Update index.js --- client/src/components/Filters/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/components/Filters/index.js b/client/src/components/Filters/index.js index 6fd16012..6f9d41d4 100644 --- a/client/src/components/Filters/index.js +++ b/client/src/components/Filters/index.js @@ -50,7 +50,7 @@ class Filters extends Component { Header: 'Rules count', accessor: 'rulesCount', className: 'text-center', - Cell: props => new Number(props.value).toLocaleString(), + Cell: props => props.value.toLocaleString(), }, { Header: 'Last time updated', accessor: 'lastUpdated',