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

[7.x] [Visualize] Remove legacy appState in visualize (#57330) #58105

Merged
merged 1 commit into from
Feb 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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 @@ -23,6 +23,7 @@ import { shallowWithIntl, mountWithIntl } from 'test_utils/enzyme_helpers';
import { findTestSubject } from '@elastic/eui/lib/test';
import { getDepsMock, getIndexPatternMock } from '../../test_utils';
import { ControlsTab, ControlsTabUiProps } from './controls_tab';
import { Vis } from 'src/legacy/core_plugins/visualizations/public';

const indexPatternsMock = {
get: getIndexPatternMock,
Expand All @@ -32,7 +33,7 @@ let props: ControlsTabUiProps;
beforeEach(() => {
props = {
deps: getDepsMock(),
vis: {
vis: ({
API: {
indexPatterns: indexPatternsMock,
},
Expand All @@ -46,7 +47,7 @@ beforeEach(() => {
requiresSearch: false,
hidden: false,
},
},
} as unknown) as Vis,
stateParams: {
controls: [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,11 @@
* directly where they are needed.
*/

// @ts-ignore
export { AppState, AppStateProvider } from 'ui/state_management/app_state';
export { State } from 'ui/state_management/state';
// @ts-ignore
export { GlobalStateProvider } from 'ui/state_management/global_state';
// @ts-ignore
export { StateManagementConfigProvider } from 'ui/state_management/config_provider';
export { stateMonitorFactory } from 'ui/state_management/state_monitor_factory';
export { PersistedState } from 'ui/persisted_state';

export { subscribeWithScope } from 'ui/utils/subscribe_with_scope';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ import { i18nDirective, i18nFilter, I18nProvider } from '@kbn/i18n/angular';

import { AppMountContext } from 'kibana/public';
import {
AppStateProvider,
AppState,
configureAppAngularModule,
createTopNavDirective,
createTopNavHelper,
Expand Down Expand Up @@ -116,12 +114,6 @@ function createLocalStateModule() {
'app/visualize/Promise',
'app/visualize/PersistedState',
])
.factory('AppState', function(Private: IPrivate) {
return Private(AppStateProvider);
})
.service('getAppState', function(Private: IPrivate) {
return Private<AppState>(AppStateProvider).getAppState;
})
.service('globalState', function(Private: IPrivate) {
return Private(GlobalStateProvider);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<!-- Linked search. -->
<div
ng-show="isVisible"
ng-if="vis.type.requiresSearch && state.linked"
ng-if="vis.type.requiresSearch && linked"
class="fullWidth visEditor__linkedMessage"
>
<div class="kuiVerticalRhythmSmall">
Expand Down Expand Up @@ -42,9 +42,9 @@
show-filter-bar="showFilterBar() && isVisible"
show-date-picker="showQueryBarTimePicker()"
show-auto-refresh-only="!showQueryBarTimePicker()"
query="state.query"
query="query"
saved-query="savedQuery"
screen-title="state.vis.title"
screen-title="vis.title"
on-query-submit="updateQueryAndFetch"
index-patterns="[indexPattern]"
filters="filters"
Expand Down Expand Up @@ -97,7 +97,9 @@
ui-state="uiState"
time-range="timeRange"
filters="filters"
query="query"/>
query="query"
app-state="appState"
/>

<h1
class="euiScreenReaderOnly"
Expand All @@ -117,6 +119,7 @@
filters="filters"
query="query"
class="visEditor__content"
app-state="appState"
/>

</visualize-app>
Loading