Skip to content
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] Migrate AppState/GlobalState to new app state helpers #57175

Merged
merged 85 commits into from
Mar 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
85 commits
Select commit Hold shift + click to select a range
a2bcb06
Remove AppState
kertal Feb 10, 2020
30c0374
Fix sort
kertal Feb 10, 2020
c2869e0
Merge remote-tracking branch 'upstream/master' into kertal-pr-2020-02…
kertal Feb 10, 2020
5081d16
Replace GlobalState
kertal Feb 12, 2020
d3f432b
Merge remote-tracking branch 'upstream/master' into kertal-pr-2020-02…
kertal Feb 12, 2020
a18455a
Fix refreshInterval, cleanup $appStatus + stateMonitor
kertal Feb 12, 2020
968a91b
Add hash history
kertal Feb 12, 2020
bff416a
Fix sorting
kertal Feb 12, 2020
e9b1979
Merge branch 'master' into kertal-pr-2020-02-09-discover-state
elasticmachine Feb 12, 2020
73343b3
Fix search embeddable column update handling
kertal Feb 13, 2020
c2b8539
Merge branch 'kertal-pr-2020-02-09-discover-state' of github.com:kert…
kertal Feb 13, 2020
30a5c1e
Merge remote-tracking branch 'upstream/master' into kertal-pr-2020-02…
kertal Feb 13, 2020
4573220
Fix functional test
kertal Feb 13, 2020
c6ac8b9
Add interval syncing to url
kertal Feb 13, 2020
2936217
Sync initial app state to URL
kertal Feb 13, 2020
dee2bd9
Merge branch 'master' into kertal-pr-2020-02-09-discover-state
elasticmachine Feb 13, 2020
c9e1aa2
Merge branch 'master' into kertal-pr-2020-02-09-discover-state
elasticmachine Feb 13, 2020
00c4e09
Merge branch 'master' into kertal-pr-2020-02-09-discover-state
elasticmachine Feb 14, 2020
ad8e45b
Merge branch 'master' into kertal-pr-2020-02-09-discover-state
elasticmachine Feb 14, 2020
1251fbf
Merge remote-tracking branch 'upstream/master' into kertal-pr-2020-02…
kertal Feb 14, 2020
551fce2
Improve code
kertal Feb 15, 2020
956882d
Improve code
kertal Feb 17, 2020
7ebf01e
Add jest tests
kertal Feb 17, 2020
6b02984
Merge branch 'kertal-pr-2020-02-09-discover-state' of github.com:kert…
kertal Feb 17, 2020
837e371
Merge remote-tracking branch 'upstream/master' into kertal-pr-2020-02…
kertal Feb 17, 2020
66493e1
Fix broken Discover bootstrap (due to an async/await function)
kertal Feb 17, 2020
5a8e13d
Merge remote-tracking branch 'upstream/master' into kertal-pr-2020-02…
kertal Feb 18, 2020
8926425
Fix testsuite, broken by filter cleanup
kertal Feb 18, 2020
472e480
Remove Filter cleanup
kertal Feb 18, 2020
55eb696
Merge remote-tracking branch 'upstream/master' into kertal-pr-2020-02…
kertal Feb 18, 2020
5167b31
Cleanup code
kertal Feb 18, 2020
fe0e580
Code improvements
kertal Feb 19, 2020
5726b18
Refactoring of wordings
kertal Feb 19, 2020
ac31008
Add missing angular state library, that was removed in the last commit
kertal Feb 19, 2020
8678933
Migrate GlobalState handling to use helper functions
kertal Feb 20, 2020
870a0ab
Fix test
kertal Feb 20, 2020
32b23cb
Merge branch 'master' into kertal-pr-2020-02-09-discover-state
elasticmachine Feb 20, 2020
90b46fb
Adapt test, fix global filters for context
kertal Feb 20, 2020
79d9b06
Merge branch 'kertal-pr-2020-02-09-discover-state' of github.com:kert…
kertal Feb 20, 2020
bc878a9
Merge remote-tracking branch 'upstream/master' into kertal-pr-2020-02…
kertal Feb 21, 2020
eb2ad4c
Fix url back navigation test
kertal Feb 21, 2020
d427b88
Refactoring to remove use-default-behaviors="true" to topnav
kertal Feb 24, 2020
f2b09a8
Merge branch 'master' into kertal-pr-2020-02-09-discover-state
elasticmachine Feb 24, 2020
69e05fd
Merge remote-tracking branch 'upstream/master' into kertal-pr-2020-02…
kertal Feb 24, 2020
a29ee6c
Merge branch 'master' into kertal-pr-2020-02-09-discover-state
elasticmachine Feb 24, 2020
c1ccfd0
Merge branch 'kertal-pr-2020-02-09-discover-state' of github.com:kert…
kertal Feb 24, 2020
9e5f2d5
Remove filters where not needed
kertal Feb 24, 2020
146763b
Remove unnecessary imports
kertal Feb 24, 2020
417f270
Merge remote-tracking branch 'upstream/master' into kertal-pr-2020-02…
kertal Feb 24, 2020
4ff82ab
Fix missing fetch when using back button and query string changes
kertal Feb 24, 2020
06f125a
Cleanup and improve code
kertal Feb 25, 2020
be925c3
Address PR comments
kertal Feb 25, 2020
c85d8f5
Fix merge conflicts
kertal Feb 25, 2020
bba2240
merge upstream/master
kertal Feb 28, 2020
06e0e43
Use syncQueryStateWithUrl & stopSyncingQueryAppStateWithStateContainer
kertal Mar 2, 2020
6449f11
Merge branch 'master' into kertal-pr-2020-02-09-discover-state
elasticmachine Mar 2, 2020
3c1e892
Fix persisted state problem
kertal Mar 2, 2020
fac1e4b
Remove discoverPersistedState
alexwizp Mar 2, 2020
73885ac
Allow indexPattern switch without $route.reload()
kertal Mar 2, 2020
70d80a4
Fix TypeScript issue
kertal Mar 2, 2020
3cb2f1d
Code improvements
kertal Mar 2, 2020
df7a7fe
Merge remote-tracking branch 'upstream/master' into kertal-pr-2020-02…
kertal Mar 2, 2020
df71585
Fix filter issue
kertal Mar 3, 2020
7900ef0
Fix filter issue
kertal Mar 3, 2020
46c9d10
Add deepClone when setting AppFilters
kertal Mar 3, 2020
4137db2
Remove kbn-top-nav duplicates
kertal Mar 5, 2020
39646ec
Remove refreshInterval
kertal Mar 5, 2020
a2ea6de
Merge remote-tracking branch 'upstream/master' into kertal-pr-2020-02…
kertal Mar 5, 2020
ec46c63
Code improvements
kertal Mar 5, 2020
46e9866
Migrate IndexPattern type to IIndexPattern
kertal Mar 5, 2020
3eec564
Remove timeRangeObj because it's not needed
kertal Mar 5, 2020
478ef9b
Improve updateQuery
kertal Mar 5, 2020
be21d45
Remove redundant $scope.updateTime();
kertal Mar 5, 2020
a83c823
Don't update $scope.filters, remove from doc_table since not needed
kertal Mar 5, 2020
ce695c2
Remove redundant async of history.push
kertal Mar 5, 2020
f877cd3
omit using default export of lodash
kertal Mar 5, 2020
b682c8d
Remove redundant getAppFilters of discover_state.ts
kertal Mar 5, 2020
47c83fd
Create new getDefaultQuery in data plugin
kertal Mar 5, 2020
79b5d57
Simplify check for null in sync_state_with_url.ts
kertal Mar 6, 2020
85ce050
Merge branch 'master' into kertal-pr-2020-02-09-discover-state
elasticmachine Mar 8, 2020
e684870
Merge branch 'master' into kertal-pr-2020-02-09-discover-state
elasticmachine Mar 9, 2020
f2e426d
Merge upstream/master and fix conflicts
kertal Mar 9, 2020
16d1719
Remove unused stateMonitorFactory
kertal Mar 9, 2020
117bafa
Merge branch 'kertal-pr-2020-02-09-discover-state' of github.com:kert…
kertal Mar 9, 2020
cf09106
Merge upstream/master and fix conflicts, again
kertal Mar 9, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,9 @@
// They can stay even after NP cutover
import angular from 'angular';
import { EuiIcon } from '@elastic/eui';
// @ts-ignore
import { StateProvider } from 'ui/state_management/state';
import { i18nDirective, i18nFilter, I18nProvider } from '@kbn/i18n/angular';
import { CoreStart, LegacyCoreStart, IUiSettingsClient } from 'kibana/public';
// @ts-ignore
import { AppStateProvider } from 'ui/state_management/app_state';
// @ts-ignore
import { GlobalStateProvider } from 'ui/state_management/global_state';
// @ts-ignore
import { StateManagementConfigProvider } from 'ui/state_management/config_provider';
// @ts-ignore
import { KbnUrlProvider, RedirectWhenMissingProvider } from 'ui/url';
Expand Down Expand Up @@ -117,8 +111,6 @@ export function initializeInnerAngularModule(
createLocalConfigModule(core.uiSettings);
createLocalKbnUrlModule();
createLocalTopNavModule(navigation);
createLocalGlobalStateModule();
createLocalAppStateModule();
createLocalStorageModule();
createElasticSearchModule(data);
createPagerFactoryModule();
Expand All @@ -136,6 +128,7 @@ export function initializeInnerAngularModule(
'discoverPrivate',
'discoverDocTable',
'discoverPagerFactory',
'discoverPromise',
])
.config(watchMultiDecorator)
.directive('icon', reactDirective => reactDirective(EuiIcon))
Expand All @@ -153,9 +146,8 @@ export function initializeInnerAngularModule(
'discoverConfig',
'discoverI18n',
'discoverPrivate',
'discoverPromise',
'discoverTopNav',
'discoverGlobalState',
'discoverAppState',
'discoverLocalStorageProvider',
'discoverEs',
'discoverDocTable',
Expand All @@ -178,19 +170,6 @@ export function initializeInnerAngularModule(
.service('debounce', ['$timeout', DebounceProviderTimeout]);
}

export function createLocalGlobalStateModule() {
angular
.module('discoverGlobalState', [
'discoverPrivate',
'discoverConfig',
'discoverKbnUrl',
'discoverPromise',
])
.service('globalState', function(Private: IPrivate) {
return Private(GlobalStateProvider);
});
}

function createLocalKbnUrlModule() {
angular
.module('discoverKbnUrl', ['discoverPrivate', 'ngRoute'])
Expand Down Expand Up @@ -236,26 +215,6 @@ function createLocalI18nModule() {
.directive('i18nId', i18nDirective);
}

function createLocalAppStateModule() {
angular
.module('discoverAppState', [
'discoverGlobalState',
'discoverPrivate',
'discoverConfig',
'discoverKbnUrl',
'discoverPromise',
])
.service('AppState', function(Private: IPrivate) {
return Private(AppStateProvider);
})
.service('getAppState', function(Private: any) {
return Private(AppStateProvider).getAppState;
})
.service('State', function(Private: any) {
return Private(StateProvider);
});
}

function createLocalStorageModule() {
angular
.module('discoverLocalStorageProvider', ['discoverPrivate'])
Expand Down Expand Up @@ -287,7 +246,6 @@ function createDocTableModule() {
.module('discoverDocTable', [
'discoverKbnUrl',
'discoverConfig',
'discoverAppState',
'discoverPagerFactory',
'react',
])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,12 @@ export { wrapInI18nContext } from 'ui/i18n';
export { getRequestInspectorStats, getResponseInspectorStats } from '../../../data/public';
// @ts-ignore
export { intervalOptions } from 'ui/agg_types';
export { stateMonitorFactory } from 'ui/state_management/state_monitor_factory';
export { subscribeWithScope } from 'ui/utils/subscribe_with_scope';
// @ts-ignore
export { timezoneProvider } from 'ui/vis/lib/timezone';
export { tabifyAggResponse } from '../../../data/public';
kertal marked this conversation as resolved.
Show resolved Hide resolved
export { unhashUrl } from '../../../../../plugins/kibana_utils/public';
export {
migrateLegacyQuery,
ensureDefaultIndexPattern,
formatMsg,
formatStack,
Expand All @@ -80,7 +78,6 @@ export {
SortDirection,
} from '../../../../../plugins/data/public';
export { ElasticSearchHit } from './np_ready/doc_views/doc_views_types';
export { registerTimefilterWithGlobalStateFactory } from 'ui/timefilter/setup_router';
export { getFormat } from 'ui/visualize/loader/pipeline_helpers/utilities';
// @ts-ignore
export { buildPointSeriesData } from 'ui/agg_response/point_series/point_series';
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,15 @@ <h1 class="euiScreenReaderOnly">{{screenTitle}}</h1>
<kbn-top-nav
app-name="'discover'"
config="topNavMenu"
screen-title="screenTitle"
show-search-bar="true"
show-date-picker="enableTimeRangeSelector"
index-patterns="[indexPattern]"

query="state.query"
on-query-submit="updateQuery"

show-save-query="showSaveQuery"
saved-query-id="state.savedQuery"
on-saved-query-id-change="updateSavedQueryId"

query="state.query"
saved-query-id="state.savedQuery"
screen-title="screenTitle"
show-date-picker="enableTimeRangeSelector"
show-save-query="showSaveQuery"
show-search-bar="true"
use-default-behaviors="true"
kertal marked this conversation as resolved.
Show resolved Hide resolved
>
</kbn-top-nav>
Expand Down Expand Up @@ -186,7 +183,6 @@ <h1 class="euiScreenReaderOnly">{{screenTitle}}</h1>
columns="state.columns"
infinite-scroll="true"
filter="filterQuery"
filters="state.filters"
data-shared-item
data-title="{{opts.savedSearch.lastSavedTitle}}"
data-description="{{opts.savedSearch.description}}"
Expand Down
Loading