Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #49 from istresearch/P4-1528
P4-1528 - Rule Matcher - Popover Functionality
- Loading branch information
Showing
19 changed files
with
827 additions
and
220 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
import _ from 'lodash'; | ||
import '../../common/jquery-plugins/observer'; | ||
|
||
const cleanTemplate = showPopover => { | ||
const clean = showPopover => { | ||
$(`.collection-table`) | ||
.closest(`td`) | ||
.children(`.euiToolTipAnchor`) | ||
.remove(); | ||
|
||
$(`.collection-table`) | ||
.closest(`.kbnDocTableCell__dataField`) | ||
.addClass('white-space-normal'); | ||
|
||
$(`.collection-table`) | ||
.closest(`.kbnDocViewer__value`) | ||
.addClass('white-space-normal'); | ||
|
||
$(`.collection-table-no-filter`) | ||
.closest('.kbnDocTableCell__dataField') | ||
.children('.kbnDocTableCell__filter') | ||
.empty(); | ||
|
||
$(`.collection-table-no-filter`) | ||
.closest(`tr[data-test-subj]`) | ||
.children('.kbnDocViewer__buttons') | ||
.children('span') | ||
.children(`button:not([data-test-subj='toggleColumnButton'])`) | ||
.attr('disabled', true); | ||
|
||
if (showPopover) { | ||
$(`.enable-filter-popover`) | ||
.closest('.kbnDocTableCell__dataField') | ||
.children('.kbnDocTableCell__filter') | ||
.children(`.kbnDocTableRowFilterButton`) | ||
.addClass('tippy-filter-button'); | ||
|
||
$(`.enable-filter-popover`) | ||
.closest(`tr[data-test-subj]`) | ||
.children('.kbnDocViewer__buttons') | ||
.children('span') | ||
.children(`button:not([data-test-subj='toggleColumnButton'])`) | ||
.closest(`.euiToolTipAnchor`) | ||
.addClass('tippy-filter-button'); | ||
} | ||
}; | ||
|
||
$('#kibana-app').observe( | ||
'.kbnDocTableCell__dataField', | ||
_.throttle(() => { | ||
clean(showPopover); | ||
}, 1000) | ||
); | ||
|
||
$('#kibana-app').observe( | ||
'.kbnDocViewerTable tr', | ||
_.throttle(() => { | ||
clean(showPopover); | ||
}, 1000) | ||
); | ||
}; | ||
|
||
export default (showPopover = false) => { | ||
setTimeout(() => { | ||
if ($('.application.tab-discover').length) { | ||
cleanTemplate(showPopover); | ||
} | ||
}, 0); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.