-
Notifications
You must be signed in to change notification settings - Fork 8.5k
[Discover] Use fields API to retrieve fields #83891
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
Changes from 4 commits
a232550
ba796e0
9fbcc82
5afd264
ac1e273
e6f2a22
c420e96
8ad5f99
64f0868
b843d33
1a3196d
0cf84e4
ad23b7f
3681311
5ac33bb
9e6c89f
d34ab66
4773949
d272609
30c7c5f
24a5f9d
9c7a967
5c124f8
79e59a8
f7d304b
4053bf1
ee33143
e3ace69
84136f6
804c5f8
29fe624
900637b
9fc9517
92253eb
00d6c68
5e6162c
e16cdcb
5e0f998
9791498
63e49d4
a80d44d
60119b9
8583723
e21e478
5108654
448bc7a
dc5f148
f260376
a2273f7
c8c4f47
57319da
d07b676
50f57ef
6990015
0965f30
ab4edb4
be9b9f4
1a6c620
95ea135
fc12250
eb309ee
b7a79d6
2b63157
0f65832
fad95e7
d3d38ef
e374d6f
5efe636
24ab2ae
88e81f0
711c757
f03e800
0d150e6
06112da
5eb9917
b5bfbc0
3ac1ec3
72fd6d5
1e85041
1e1d313
88e07b4
e893b93
b917a39
67606c2
6ea034e
5083d44
b1a7158
a16bebd
756d240
64a57df
f677240
ca8e798
36251a8
8424d71
1caa777
290dfdf
27d77d6
02c37cf
0eec11a
f1bd9e7
a37612a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -82,6 +82,8 @@ import { | |||||
| DOC_HIDE_TIME_COLUMN_SETTING, | ||||||
| MODIFY_COLUMNS_ON_SWITCH, | ||||||
| } from '../../../common'; | ||||||
| import { UI_SETTINGS } from '../../../../data/common'; | ||||||
| import { getIndexPatternFieldList } from '../helpers/get_index_pattern_field_list'; | ||||||
|
|
||||||
| const fetchStatuses = { | ||||||
| UNINITIALIZED: 'uninitialized', | ||||||
|
|
@@ -199,6 +201,14 @@ function discoverController($element, $route, $scope, $timeout, $window, Promise | |||||
| const savedSearch = $route.current.locals.savedObjects.savedSearch; | ||||||
| $scope.searchSource = savedSearch.searchSource; | ||||||
| $scope.indexPattern = resolveIndexPatternLoading(); | ||||||
| $scope.useNewFieldsApi = !$scope.searchSource.dependencies?.getConfig( | ||||||
| UI_SETTINGS.SEARCH_FIELDS_FROM_SOURCE | ||||||
| ); | ||||||
| $scope.showUnmappedFields = false; | ||||||
| $scope.onShowUnmappedFieldsChange = (val) => { | ||||||
| $scope.showUnmappedFields = val; | ||||||
| }; | ||||||
| const FIRST_N_COLUMNS_FROM_FIELDS_RESPONSE = 3; | ||||||
| //used for functional testing | ||||||
| $scope.fetchCounter = 0; | ||||||
|
|
||||||
|
|
@@ -291,7 +301,8 @@ function discoverController($element, $route, $scope, $timeout, $window, Promise | |||||
| nextIndexPattern, | ||||||
| $scope.state.columns, | ||||||
| $scope.state.sort, | ||||||
| config.get(MODIFY_COLUMNS_ON_SWITCH) | ||||||
| config.get(MODIFY_COLUMNS_ON_SWITCH), | ||||||
| $scope.useNewFieldsApi | ||||||
| ); | ||||||
| await replaceUrlAppState(nextAppState); | ||||||
| $route.reload(); | ||||||
|
|
@@ -594,15 +605,27 @@ function discoverController($element, $route, $scope, $timeout, $window, Promise | |||||
| }; | ||||||
| }; | ||||||
|
|
||||||
| function getDefaultColumns() { | ||||||
kertal marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
| const { columns } = savedSearch; | ||||||
| if ($scope.useNewFieldsApi) { | ||||||
| const indexOfSource = columns.indexOf('_source'); | ||||||
| if (indexOfSource === -1) { | ||||||
| return columns; | ||||||
| } | ||||||
| return columns.splice(indexOfSource, 1); | ||||||
| } else if (columns.length > 0) { | ||||||
| return columns; | ||||||
| } | ||||||
| return config.get(DEFAULT_COLUMNS_SETTING).slice(); | ||||||
|
||||||
| return config.get(DEFAULT_COLUMNS_SETTING).slice(); | |
| return [...config.get(DEFAULT_COLUMNS_SETTING)]; |
kertal marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
kertal marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
kertal marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,3 +2,7 @@ | |
| min-width: 260px; | ||
|
||
| max-width: 300px; | ||
| } | ||
|
|
||
| .dscSidebarItem__fieldPopoverPanel__unmappedSwitch { | ||
| margin-top: $euiSizeS; | ||
| } | ||
kertal marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To remove the padding-left add |
||
Uh oh!
There was an error while loading. Please reload this page.