-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Discover] Fix context view for document ids containing special characters #122737
Merged
Merged
Changes from 3 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
d9948c4
[Discover] fix encoded param for context
dimaanj a7bd66b
[Discover] add functional test
dimaanj 76a7586
[Discover] add test file
dimaanj 2a8fa71
[Discover] change field name
dimaanj 5a7e5a5
Merge branch 'main' into fix-context-encoded-params
kibanamachine File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
55 changes: 55 additions & 0 deletions
55
test/functional/apps/discover/_context_encoded_url_param.ts
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,55 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
import expect from '@kbn/expect'; | ||
import { FtrProviderContext } from '../../ftr_provider_context'; | ||
|
||
export default function ({ getService, getPageObjects }: FtrProviderContext) { | ||
const dataGrid = getService('dataGrid'); | ||
const kibanaServer = getService('kibanaServer'); | ||
const PageObjects = getPageObjects(['common', 'discover', 'timePicker', 'settings', 'header']); | ||
const testSubjects = getService('testSubjects'); | ||
const es = getService('es'); | ||
|
||
describe('context encoded id param', () => { | ||
before(async function () { | ||
await PageObjects.common.navigateToApp('settings'); | ||
await es.transport.request({ | ||
path: '/includes-plus-symbol-doc-id/_doc/1+1=2', | ||
method: 'PUT', | ||
body: { | ||
username: 'matt', | ||
'@timestamp': '2015-09-21T09:30:23', | ||
}, | ||
}); | ||
await PageObjects.settings.createIndexPattern('includes-plus-symbol-doc-id'); | ||
|
||
await kibanaServer.uiSettings.update({ 'doc_table:legacy': false }); | ||
await PageObjects.timePicker.setDefaultAbsoluteRangeViaUiSettings(); | ||
await PageObjects.common.navigateToApp('discover'); | ||
}); | ||
|
||
it('should navigate to context page correctly', async () => { | ||
await PageObjects.discover.selectIndexPattern('includes-plus-symbol-doc-id'); | ||
await PageObjects.header.waitUntilLoadingHasFinished(); | ||
|
||
// navigate to the context view | ||
await dataGrid.clickRowToggle({ rowIndex: 0 }); | ||
const [, surroundingActionEl] = await dataGrid.getRowActions({ | ||
isAnchorRow: false, | ||
rowIndex: 0, | ||
}); | ||
await surroundingActionEl.click(); | ||
await PageObjects.header.waitUntilLoadingHasFinished(); | ||
|
||
const headerElement = await testSubjects.find('contextDocumentSurroundingHeader'); | ||
|
||
expect(await headerElement.getVisibleText()).to.be('Documents surrounding #1+1=2'); | ||
}); | ||
}); | ||
} |
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
didn't have this way to create testdata on the radar, TIL. only disadvantage is, that it might be slower, more UI interaction needed to create the required testing data but, fine with that.
only nit: username should be
Dmitry
, thematt
you are mentioning here just added comments here, else he was lazy as usual 😄.