Skip to content

Commit

Permalink
tslint
Browse files Browse the repository at this point in the history
  • Loading branch information
nreese committed Mar 13, 2024
1 parent f1a6d52 commit d651e70
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ describe('filters notification action', () => {
getAllDataViews: jest.fn(),
getDashboardPanelFromId: jest.fn(),
},
localFilters: filtersSubject,
localQuery: querySubject,
filters: filtersSubject,
query: querySubject,
},
};
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ describe('filters notification popover', () => {
getAllDataViews: jest.fn(),
getDashboardPanelFromId: jest.fn(),
},
localFilters: filtersSubject,
localQuery: querySubject,
filters: filtersSubject,
query: querySubject,
};
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,23 +34,23 @@ export function FiltersNotificationPopover({ api }: { api: FiltersNotificationAc

const editPanelAction = getEditPanelAction();

const filters = useMemo(() => api.localFilters?.value, [api]);
const filters = useMemo(() => api.filters?.value, [api]);
const displayName = dashboardFilterNotificationActionStrings.getDisplayName();

const { queryString, queryLanguage } = useMemo(() => {
const localQuery = api.localQuery?.value;
if (!localQuery) return {};
if (isOfQueryType(localQuery)) {
if (typeof localQuery.query === 'string') {
return { queryString: localQuery.query };
const query = api.query?.value;
if (!query) return {};
if (isOfQueryType(query)) {
if (typeof query.query === 'string') {
return { queryString: query.query };
} else {
return { queryString: JSON.stringify(localQuery.query, null, 2) };
return { queryString: JSON.stringify(query.query, null, 2) };
}
} else {
setDisableEditButton(true);
const language: 'sql' | 'esql' | undefined = getAggregateQueryMode(localQuery);
const language: 'sql' | 'esql' | undefined = getAggregateQueryMode(query);
return {
queryString: localQuery[language as keyof AggregateQuery],
queryString: query[language as keyof AggregateQuery],
queryLanguage: language,
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ export const initializeDashboard = async ({
);

// --------------------------------------------------------------------------------------
// Set parentApi.localFilters to include dashboardContainer filters and control group filters
// Set parentApi.filters to include dashboardContainer filters and control group filters
// --------------------------------------------------------------------------------------
untilDashboardReady().then((dashboardContainer) => {
if (!dashboardContainer.controlGroup) {
Expand All @@ -486,8 +486,8 @@ export const initializeDashboard = async ({
);
}

const localFilters = new BehaviorSubject<Filter[] | undefined>(getCombinedFilters());
dashboardContainer.localFilters = localFilters;
const filters = new BehaviorSubject<Filter[] | undefined>(getCombinedFilters());
dashboardContainer.filters = filters;

const inputFilters$ = dashboardContainer.getInput$().pipe(
startWith(dashboardContainer.getInput()),
Expand All @@ -505,7 +505,7 @@ export const initializeDashboard = async ({

dashboardContainer.integrationSubscriptions.add(
combineLatest([inputFilters$, controlGroupFilters$]).subscribe(() => {
localFilters.next(getCombinedFilters());
filters.next(getCombinedFilters());
})
);
});
Expand Down

0 comments on commit d651e70

Please sign in to comment.