mirror of
https://github.com/getredash/redash.git
synced 2026-05-10 15:00:16 -04:00
* getredash/redash#2641 Step 1: split Add Widget/Add Textbox buttons * Convert Add widget/textbox dialogs to React components * getredash/redash#2641 Step 2: Implement new dashboard parameters logic * Resolve conflicts and fix build errors * getredash/redash#2641 Refactoring and improve code quality * Add Edit parameter mappings dialog to the widget * getredash/redash#2641 Changes after code review * Use Ant's Select component instead on <select> tags * Fix Antd imports * Fix Antd imports * Fix Cannot read property 'getParametersDefs' of undefined * Fix widgets static params bugs (don't show input, don't init from URL) * Minor UI/UX fixes
9 lines
420 B
JavaScript
9 lines
420 B
JavaScript
function escapeRegexp(queryToEscape) {
|
|
return ('' + queryToEscape).replace(/([.?*+^$[\]\\(){}|-])/g, '\\$1');
|
|
}
|
|
|
|
// https://github.com/angular-ui/ui-select/blob/master/src/common.js#L146
|
|
export default function highlight(matchItem, query, template = '<span class="ui-select-highlight">$&</span>') {
|
|
return query && matchItem ? ('' + matchItem).replace(new RegExp(escapeRegexp(query), 'gi'), template) : matchItem;
|
|
}
|