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

[Dashboard] Un-skip Show Underlying Data Tests #148409

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 @@ -99,6 +99,11 @@ export const dashboardDiffingFunctions: DashboardDiffFunctions = {
return true;
},

refreshInterval: ({ currentValue, lastValue, currentInput }) => {
if (!currentInput.timeRestore) return true; // if time restore is set to false, refresh interval doesn't count as a change.
return fastIsEqual(currentValue, lastValue);
},

controlGroupInput: ({ currentValue, lastValue }) =>
persistableControlGroupInputIsEqual(currentValue, lastValue),

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Side Public License, v 1.
*/

import { merge, Subject } from 'rxjs';
import { Subject } from 'rxjs';
import { distinctUntilChanged, finalize, switchMap, tap } from 'rxjs/operators';

import type { Filter, Query } from '@kbn/es-query';
Expand Down Expand Up @@ -35,7 +35,7 @@ export function syncUnifiedSearchState(
getState,
dispatch,
onStateChange,
actions: { setFiltersAndQuery, setTimeRange },
actions: { setFiltersAndQuery, setTimeRange, setRefreshInterval },
} = this.getReduxEmbeddableTools();

// get Observable for when the dashboard's saved filters or query change.
Expand Down Expand Up @@ -76,10 +76,13 @@ export function syncUnifiedSearchState(
}
);

const timeRefreshSubscription = merge(
timefilterService.getRefreshIntervalUpdate$(),
timefilterService.getTimeUpdate$()
).subscribe(() => dispatch(setTimeRange(timefilterService.getTime())));
const timeUpdateSubscription = timefilterService
.getTimeUpdate$()
.subscribe(() => dispatch(setTimeRange(timefilterService.getTime())));

const refreshIntervalSubscription = timefilterService
.getRefreshIntervalUpdate$()
.subscribe(() => dispatch(setRefreshInterval(timefilterService.getRefreshInterval())));

const autoRefreshSubscription = timefilterService
.getAutoRefreshFetch$()
Expand All @@ -96,7 +99,8 @@ export function syncUnifiedSearchState(

const stopSyncingUnifiedSearchState = () => {
autoRefreshSubscription.unsubscribe();
timeRefreshSubscription.unsubscribe();
timeUpdateSubscription.unsubscribe();
refreshIntervalSubscription.unsubscribe();
unsubscribeFromSavedFilterChanges();
stopSyncingAppFilters();
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,15 @@ export const dashboardContainerReducers = {

state.explicitInput.tags = action.payload.tags;
state.explicitInput.title = action.payload.title;
state.explicitInput.timeRange = action.payload.timeRange;
state.explicitInput.description = action.payload.description;
state.explicitInput.timeRestore = action.payload.timeRestore;
state.explicitInput.refreshInterval = action.payload.refreshInterval;

if (action.payload.refreshInterval) {
state.explicitInput.refreshInterval = action.payload.refreshInterval;
}
if (action.payload.timeRange) {
state.explicitInput.timeRange = action.payload.timeRange;
}
},

setDescription: (
Expand Down Expand Up @@ -174,6 +179,13 @@ export const dashboardContainerReducers = {
state.explicitInput.timeRange = action.payload;
},

setRefreshInterval: (
state: DashboardReduxState,
action: PayloadAction<DashboardContainerByValueInput['refreshInterval']>
) => {
state.explicitInput.refreshInterval = action.payload;
},

setTimeslice: (
state: DashboardReduxState,
action: PayloadAction<DashboardContainerByValueInput['timeslice']>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
const browser = getService('browser');
const retry = getService('retry');

// Failing: See https://github.com/elastic/kibana/issues/147625
describe.skip('lens show underlying data from dashboard', () => {
describe('lens show underlying data from dashboard', () => {
it('should show the open button for a compatible saved visualization', async () => {
await PageObjects.visualize.gotoVisualizationLandingPage();
await listingTable.searchForItemWithName('lnsXYvis');
Expand Down