From f0bdf9c4236161de8301ee7763c36c3715153601 Mon Sep 17 00:00:00 2001 From: Erik Bigler Date: Sun, 24 Mar 2024 17:08:05 -0500 Subject: [PATCH 1/2] feat: implement item table advanced search options popover --- .../directives/controls/firebot-checkbox.js | 3 +- .../firebot-item-table.html | 36 +++++++++++++++---- .../firebot-item-table/firebot-item-table.js | 8 +++++ src/gui/app/directives/misc/tooltip.js | 3 +- src/gui/scss/core/_firebot-item-table.scss | 22 ++++++++++++ src/gui/scss/core/_helpers.scss | 17 +++++++++ 6 files changed, 80 insertions(+), 9 deletions(-) diff --git a/src/gui/app/directives/controls/firebot-checkbox.js b/src/gui/app/directives/controls/firebot-checkbox.js index 811e068cf..280ac08cf 100644 --- a/src/gui/app/directives/controls/firebot-checkbox.js +++ b/src/gui/app/directives/controls/firebot-checkbox.js @@ -7,12 +7,13 @@ bindings: { label: "@", tooltip: "@?", + tooltipPlacement: "@?", model: "=", style: "@?", disabled: " {{$ctrl.label}} + diff --git a/src/gui/app/directives/misc/firebot-item-table/firebot-item-table.html b/src/gui/app/directives/misc/firebot-item-table/firebot-item-table.html index d68766b93..490c6e470 100644 --- a/src/gui/app/directives/misc/firebot-item-table/firebot-item-table.html +++ b/src/gui/app/directives/misc/firebot-item-table/firebot-item-table.html @@ -28,13 +28,35 @@ query="searchQuery" class="fit-header-search" > - + + +
diff --git a/src/gui/app/directives/misc/firebot-item-table/firebot-item-table.js b/src/gui/app/directives/misc/firebot-item-table/firebot-item-table.js index 0e08f940a..c464bb842 100644 --- a/src/gui/app/directives/misc/firebot-item-table/firebot-item-table.js +++ b/src/gui/app/directives/misc/firebot-item-table/firebot-item-table.js @@ -53,6 +53,12 @@ return $ctrl.useFullTextSearch ? null : $ctrl.customFilterName; }; + $ctrl.showAdvancedOptionsButton = false; + + $ctrl.hasAdvancedOptionsApplied = () => { + return $ctrl.useFullTextSearch; + }; + $ctrl.$onInit = () => { if ($ctrl.items == null) { $ctrl.items = []; @@ -63,6 +69,8 @@ $ctrl.showStatusIndicator = $ctrl.statusField != null; $ctrl.headerClass = `${$ctrl.sortTagContext.split(' ').join('-')}-header`; + + $ctrl.showAdvancedOptionsButton = $ctrl.customFilterName != null; }; $ctrl.triggerItemsUpdate = () => { diff --git a/src/gui/app/directives/misc/tooltip.js b/src/gui/app/directives/misc/tooltip.js index a664f4519..8d39ab225 100644 --- a/src/gui/app/directives/misc/tooltip.js +++ b/src/gui/app/directives/misc/tooltip.js @@ -5,10 +5,11 @@ bindings: { text: "<", type: "@", + placement: "@?", styles: "@" }, template: ` - + `, controller: function() { const ctrl = this; diff --git a/src/gui/scss/core/_firebot-item-table.scss b/src/gui/scss/core/_firebot-item-table.scss index 0fff885e3..5e0037a09 100644 --- a/src/gui/scss/core/_firebot-item-table.scss +++ b/src/gui/scss/core/_firebot-item-table.scss @@ -73,4 +73,26 @@ } } } +} + +.fbit-advance-search-btn { + position: relative; + margin-left: 10px; + margin-right: 5px; + padding: 2px; + &:hover { + cursor: pointer; + i { + opacity: 0.75; + } + } + .options-applied-indicator { + position: absolute; + top: -5px; + right: -5px; + background-color: #1c9dc1; + border-radius: 50%; + width: 10px; + height: 10px; + } } \ No newline at end of file diff --git a/src/gui/scss/core/_helpers.scss b/src/gui/scss/core/_helpers.scss index 115f6d211..b3575c045 100644 --- a/src/gui/scss/core/_helpers.scss +++ b/src/gui/scss/core/_helpers.scss @@ -203,4 +203,21 @@ font-weight: 900; .text-center { text-align: center; +} + +.relative { + position: relative; +} + +.absolute { + position: absolute; +} + +.btn-reset { + background: none; + border: none; + padding: 0; + font: inherit; + cursor: pointer; + outline: inherit; } \ No newline at end of file From ceff9747345ee307bff663c25fbdee5a4d4b934d Mon Sep 17 00:00:00 2001 From: Erik Bigler Date: Sun, 24 Mar 2024 17:11:20 -0500 Subject: [PATCH 2/2] chore: remove search-field option for item table now that its been superseded --- .../misc/firebot-item-table/firebot-item-table.js | 9 --------- src/gui/app/templates/chat/_commands.html | 1 - 2 files changed, 10 deletions(-) diff --git a/src/gui/app/directives/misc/firebot-item-table/firebot-item-table.js b/src/gui/app/directives/misc/firebot-item-table/firebot-item-table.js index c464bb842..30701ec3b 100644 --- a/src/gui/app/directives/misc/firebot-item-table/firebot-item-table.js +++ b/src/gui/app/directives/misc/firebot-item-table/firebot-item-table.js @@ -40,15 +40,6 @@ reverse: false }; - $ctrl.getSearchQuery = () => { - if ($ctrl.searchField) { - return { - [$ctrl.searchField]: $scope.searchQuery - }; - } - return $scope.searchQuery; - }; - $ctrl.getFilterName = () => { return $ctrl.useFullTextSearch ? null : $ctrl.customFilterName; }; diff --git a/src/gui/app/templates/chat/_commands.html b/src/gui/app/templates/chat/_commands.html index 53cfc9b80..2e2303d90 100644 --- a/src/gui/app/templates/chat/_commands.html +++ b/src/gui/app/templates/chat/_commands.html @@ -40,7 +40,6 @@ no-data-message="No custom commands saved. You should make one! :)" none-found-message="No custom commands found." search-placeholder="Search commands" - search-field="trigger" test-button="true" on-test-button-clicked="manuallyTriggerCommand(itemId)" status-field="active"