From 5388541fd7dbefc7300c46b23e280872bdf61881 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=A4ggmark?= Date: Tue, 12 Feb 2019 08:03:43 +0100 Subject: [PATCH] Fixes bug #12972 with a new type of input that escapes and unescapes special regexp characters --- .../components/OrgActionBar/OrgActionBar.tsx | 10 ++-- .../__snapshots__/OrgActionBar.test.tsx.snap | 5 +- .../RegExpSafeInput/RegExpSafeInput.tsx | 48 +++++++++++++++++++ .../features/alerting/AlertRuleList.test.tsx | 5 +- .../app/features/alerting/AlertRuleList.tsx | 11 ++--- .../__snapshots__/AlertRuleList.test.tsx.snap | 6 +-- .../features/api-keys/ApiKeysPage.test.tsx | 9 ++-- public/app/features/api-keys/ApiKeysPage.tsx | 16 ++----- .../panel_editor/VisualizationTab.tsx | 7 ++- .../datasources/NewDataSourcePage.tsx | 10 ++-- public/app/features/teams/TeamList.test.tsx | 9 ++-- public/app/features/teams/TeamList.tsx | 12 ++--- .../app/features/teams/TeamMembers.test.tsx | 3 +- public/app/features/teams/TeamMembers.tsx | 8 ++-- .../__snapshots__/TeamMembers.test.tsx.snap | 9 ++-- public/app/features/users/UsersActionBar.tsx | 6 +-- .../UsersActionBar.test.tsx.snap | 20 ++++---- 17 files changed, 109 insertions(+), 85 deletions(-) create mode 100644 public/app/core/components/RegExpSafeInput/RegExpSafeInput.tsx diff --git a/public/app/core/components/OrgActionBar/OrgActionBar.tsx b/public/app/core/components/OrgActionBar/OrgActionBar.tsx index b6b2046736f..9bf1eacc515 100644 --- a/public/app/core/components/OrgActionBar/OrgActionBar.tsx +++ b/public/app/core/components/OrgActionBar/OrgActionBar.tsx @@ -1,5 +1,6 @@ import React, { PureComponent } from 'react'; import LayoutSelector, { LayoutMode } from '../LayoutSelector/LayoutSelector'; +import { RegExpSafeInput } from '../RegExpSafeInput/RegExpSafeInput'; export interface Props { searchQuery: string; @@ -23,12 +24,11 @@ export default class OrgActionBar extends PureComponent {
diff --git a/public/app/core/components/OrgActionBar/__snapshots__/OrgActionBar.test.tsx.snap b/public/app/core/components/OrgActionBar/__snapshots__/OrgActionBar.test.tsx.snap index 25de037930a..db453b8cc3f 100644 --- a/public/app/core/components/OrgActionBar/__snapshots__/OrgActionBar.test.tsx.snap +++ b/public/app/core/components/OrgActionBar/__snapshots__/OrgActionBar.test.tsx.snap @@ -10,11 +10,10 @@ exports[`Render should render component 1`] = `