diff --git a/src/core_plugins/kibana/public/visualize/saved_visualizations/saved_visualizations.js b/src/core_plugins/kibana/public/visualize/saved_visualizations/saved_visualizations.js index 512cfd407cb44..2b845d6391563 100644 --- a/src/core_plugins/kibana/public/visualize/saved_visualizations/saved_visualizations.js +++ b/src/core_plugins/kibana/public/visualize/saved_visualizations/saved_visualizations.js @@ -86,7 +86,8 @@ app.service('savedVisualizations', function (Promise, es, kbnIndex, SavedVis, Pr simple_query_string: { query: searchString + '*', fields: ['title^3', 'description'], - default_operator: 'AND' + default_operator: 'AND', + analyze_wildcard: true } } }; diff --git a/src/ui/public/utils/__tests__/slugify_id.js b/src/ui/public/utils/__tests__/slugify_id.js index 18541030f0c4d..57f7f2181501b 100644 --- a/src/ui/public/utils/__tests__/slugify_id.js +++ b/src/ui/public/utils/__tests__/slugify_id.js @@ -9,18 +9,22 @@ describe('slugifyId()', function () { ['test?test', 'test-questionmark-test'], ['test=test', 'test-equal-test'], ['test&test', 'test-ampersand-test'], + ['test%test', 'test-percent-test'], ['test / test', 'test-slash-test'], ['test ? test', 'test-questionmark-test'], ['test = test', 'test-equal-test'], ['test & test', 'test-ampersand-test'], + ['test % test', 'test-percent-test'], ['test / ^test', 'test-slash-^test'], ['test ? test', 'test-questionmark-test'], ['test = test', 'test-equal-test'], ['test & test', 'test-ampersand-test'], + ['test % test', 'test-percent-test'], ['test/test/test', 'test-slash-test-slash-test'], ['test?test?test', 'test-questionmark-test-questionmark-test'], ['test&test&test', 'test-ampersand-test-ampersand-test'], - ['test=test=test', 'test-equal-test-equal-test'] + ['test=test=test', 'test-equal-test-equal-test'], + ['test%test%test', 'test-percent-test-percent-test'] ]; _.each(fixtures, function (fixture) { diff --git a/src/ui/public/utils/slugify_id.js b/src/ui/public/utils/slugify_id.js index b0f1920e501e6..0894d9356593e 100644 --- a/src/ui/public/utils/slugify_id.js +++ b/src/ui/public/utils/slugify_id.js @@ -6,7 +6,8 @@ export default function (id) { '/' : '-slash-', '\\?' : '-questionmark-', '\\&' : '-ampersand-', - '=' : '-equal-' + '=' : '-equal-', + '%' : '-percent-' }; _.each(trans, function (val, key) { let regex = new RegExp(key, 'g'); diff --git a/test/functional/apps/visualize/_area_chart.js b/test/functional/apps/visualize/_area_chart.js index 977a30339e259..8176333202185 100644 --- a/test/functional/apps/visualize/_area_chart.js +++ b/test/functional/apps/visualize/_area_chart.js @@ -62,6 +62,18 @@ bdd.describe('visualize app', function describeIndexTests() { bdd.describe('area charts', function indexPatternCreation() { var vizName1 = 'Visualization AreaChart'; + bdd.it('should save and load with special characters', function pageHeader() { + const vizNamewithSpecialChars = vizName1 + '/?&=%'; + return PageObjects.visualize.saveVisualization(vizNamewithSpecialChars) + .then(function (message) { + PageObjects.common.debug(`Saved viz message = ${message}`); + expect(message).to.be(`Visualization Editor: Saved Visualization "${vizNamewithSpecialChars}"`); + }) + .then(function testVisualizeWaitForToastMessageGone() { + return PageObjects.visualize.waitForToastMessageGone(); + }); + }); + bdd.it('should save and load', function pageHeader() { return PageObjects.visualize.saveVisualization(vizName1) .then(function (message) {