From c1f4467c8d03ae8647c7e33d9e6a9c2c8406fa0c Mon Sep 17 00:00:00 2001 From: Sonam Gupta <71771131+sonamgupta21@users.noreply.github.com> Date: Fri, 13 Sep 2024 12:58:13 +0530 Subject: [PATCH] UI: Handle Null Columns (#1611) * Fix Query Builder For Null Values * Added the hide-null0column-checkbox * Checkbox Style * CSS * Lint Fix * Null columns updates with scroll * Lint Fix * Available Fields * Lint Fix --------- Signed-off-by: Sonam Gupta <71771131+sonamgupta21@users.noreply.github.com> Co-authored-by: Kunal Nawale --- eslint.config.mjs | 4 +- static/css/siglens.css | 54 ++++++++++++++ static/index.html | 3 + static/js/common.js | 6 ++ static/js/event-handlers.js | 145 ++++++++++++++++++++++++++++++++++-- static/js/query-builder.js | 8 +- static/js/search.js | 4 + 7 files changed, 213 insertions(+), 11 deletions(-) diff --git a/eslint.config.mjs b/eslint.config.mjs index f7ead0544..48e7a486f 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -198,8 +198,8 @@ export default [ "toggleClearButtonVisibility": true, "updateQueryModeUI": true, "queryMode": true, - - + "allColumns": true, + "columnsWithNonNullValues":true }, }, rules: { diff --git a/static/css/siglens.css b/static/css/siglens.css index 41ab7bd5e..bd69e5ec4 100644 --- a/static/css/siglens.css +++ b/static/css/siglens.css @@ -2488,7 +2488,61 @@ input[type="submit" i] { /* end save query dialog */ +#hide-null-column-box{ + display: flex; + align-items: center; +} + +#hide-null-columns-checkbox{ + color: var(--select-unselect-header-text-color); + font-size: 14px; + position: relative; + margin-right: 6px; + display: flex; + align-items: center; + width: 18px; +} +#hide-null-columns-checkbox[type="checkbox"] { + width: 16px; + height: 16px; + accent-color: var(--purple-1); +} + +#hide-null-columns-checkbox[type="checkbox"] { + appearance: none; + -webkit-appearance: none; + display: flex; + align-content: center; + justify-content: center; + padding: 0.1rem; + background-color: white; + border: 1.5px solid var(--purple-1); + border-radius: 2px; +} + +#hide-null-columns-checkbox[type="checkbox"]:not(:checked)::before { + content: ''; +} + +#hide-null-columns-checkbox[type="checkbox"]:checked { + background-color: var(--purple-1); +} + +#hide-null-columns-checkbox[type="checkbox"]:checked::before { + content: '\2713'; /* Unicode for checkmark */ + color: white; + font-size: 13px; + position: absolute; + left: 2px; + top: -3px; + transform: scale(1); +} + +#hide-null-columns-checkbox[type="checkbox"]:hover { + cursor: pointer; +} + /* datepicker */ #date-picker-btn { diff --git a/static/index.html b/static/index.html index 4356328f3..58285fa49 100644 --- a/static/index.html +++ b/static/index.html @@ -296,6 +296,9 @@
+