From d7596fe8600b743c42df9cd5b6bfeefa69fee5c6 Mon Sep 17 00:00:00 2001 From: Ildar Kamalov Date: Tue, 2 Oct 2018 18:14:41 +0300 Subject: [PATCH 1/2] Add query log filtering Closes #322 --- client/src/components/Dashboard/index.js | 2 +- client/src/components/Logs/Logs.css | 16 ++++++ client/src/components/Logs/index.js | 67 +++++++++++++++++------- 3 files changed, 65 insertions(+), 20 deletions(-) diff --git a/client/src/components/Dashboard/index.js b/client/src/components/Dashboard/index.js index f71c2361..d847fb40 100644 --- a/client/src/components/Dashboard/index.js +++ b/client/src/components/Dashboard/index.js @@ -26,7 +26,7 @@ class Dashboard extends Component { getToggleFilteringButton = () => { const { isFilteringEnabled } = this.props.dashboard; const buttonText = isFilteringEnabled ? 'Disable' : 'Enable'; - const buttonClass = isFilteringEnabled ? 'btn-outline-secondary' : 'btn-outline-success'; + const buttonClass = isFilteringEnabled ? 'btn-gray' : 'btn-success'; return ( - {queryLogEnabled && + if (queryLogEnabled) { + return ( + + - } - {queryLogEnabled && - } - ); + + ); + } + + return ( + + ); } render() { const { queryLogs, dashboard } = this.props; const { queryLogEnabled } = dashboard; return ( -
- + + +
+ {this.renderButtons(queryLogEnabled)} +
+
- {this.renderButtons(queryLogEnabled)} {queryLogEnabled && queryLogs.processing && } {queryLogEnabled && !queryLogs.processing && this.renderLogs(queryLogs.logs)} -
+ ); } } From 991574f236ba691548839104a4218d749fbef10a Mon Sep 17 00:00:00 2001 From: Ildar Kamalov Date: Tue, 2 Oct 2018 18:30:34 +0300 Subject: [PATCH 2/2] Fix row original --- client/src/components/Logs/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/src/components/Logs/index.js b/client/src/components/Logs/index.js index f7d5009c..f0bb082d 100644 --- a/client/src/components/Logs/index.js +++ b/client/src/components/Logs/index.js @@ -145,7 +145,8 @@ class Logs extends Component { }, filterMethod: (filter, row) => { if (filter.value === 'filtered') { - return row.originalRow.reason.indexOf('Filtered') === 0; + // eslint-disable-next-line no-underscore-dangle + return row._original.reason.indexOf('Filtered') === 0; } return true; }, @@ -188,7 +189,6 @@ class Logs extends Component { defaultPageSize={50} minRows={7} noDataText="No logs found" - originalKey="originalRow" defaultSorted={[ { id: 'time',