-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(explore): Add view samples expansion to explore (#83545)
This adds a discover style expand stack button to the start of every row in the aggregation mode that can be used to drill down and view samples with the attributes of the row.
- Loading branch information
Showing
4 changed files
with
242 additions
and
41 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 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,122 @@ | ||
import {LocationFixture} from 'sentry-fixture/locationFixture'; | ||
import {ProjectFixture} from 'sentry-fixture/project'; | ||
|
||
import {viewSamplesTarget} from 'sentry/views/explore/utils'; | ||
|
||
describe('viewSamplesTarget', function () { | ||
const project = ProjectFixture(); | ||
const extras = {projects: [project]}; | ||
|
||
it('simple drill down with no group bys', function () { | ||
const location = LocationFixture(); | ||
const target = viewSamplesTarget(location, '', [], {}, extras); | ||
expect(target).toMatchObject({ | ||
query: { | ||
mode: 'samples', | ||
query: '', | ||
}, | ||
}); | ||
}); | ||
|
||
it('simple drill down with single group by', function () { | ||
const location = LocationFixture(); | ||
const target = viewSamplesTarget( | ||
location, | ||
'', | ||
['foo'], | ||
{foo: 'foo', 'count()': 10}, | ||
extras | ||
); | ||
expect(target).toMatchObject({ | ||
query: { | ||
mode: 'samples', | ||
query: 'foo:foo', | ||
}, | ||
}); | ||
}); | ||
|
||
it('simple drill down with multiple group bys', function () { | ||
const location = LocationFixture(); | ||
const target = viewSamplesTarget( | ||
location, | ||
'', | ||
['foo', 'bar', 'baz'], | ||
{ | ||
foo: 'foo', | ||
bar: 'bar', | ||
baz: 'baz', | ||
'count()': 10, | ||
}, | ||
extras | ||
); | ||
expect(target).toMatchObject({ | ||
query: { | ||
mode: 'samples', | ||
query: 'foo:foo bar:bar baz:baz', | ||
}, | ||
}); | ||
}); | ||
|
||
it('simple drill down with on environment', function () { | ||
const location = LocationFixture(); | ||
const target = viewSamplesTarget( | ||
location, | ||
'', | ||
['environment'], | ||
{ | ||
environment: 'prod', | ||
'count()': 10, | ||
}, | ||
extras | ||
); | ||
expect(target).toMatchObject({ | ||
query: { | ||
mode: 'samples', | ||
query: '', | ||
environment: 'prod', | ||
}, | ||
}); | ||
}); | ||
|
||
it('simple drill down with on project id', function () { | ||
const location = LocationFixture(); | ||
const target = viewSamplesTarget( | ||
location, | ||
'', | ||
['project.id'], | ||
{ | ||
'project.id': 1, | ||
'count()': 10, | ||
}, | ||
extras | ||
); | ||
expect(target).toMatchObject({ | ||
query: { | ||
mode: 'samples', | ||
query: '', | ||
project: '1', | ||
}, | ||
}); | ||
}); | ||
|
||
it('simple drill down with on project slug', function () { | ||
const location = LocationFixture(); | ||
const target = viewSamplesTarget( | ||
location, | ||
'', | ||
['project'], | ||
{ | ||
project: project.slug, | ||
'count()': 10, | ||
}, | ||
extras | ||
); | ||
expect(target).toMatchObject({ | ||
query: { | ||
mode: 'samples', | ||
query: '', | ||
project: String(project.id), | ||
}, | ||
}); | ||
}); | ||
}); |
Oops, something went wrong.