Browse Source

hotfix

pull/13/head
rozetko 2 years ago
parent
commit
d0319ab96b
  1. 8
      src/panels/corpglory-dataexporter-panel/components/Panel.tsx

8
src/panels/corpglory-dataexporter-panel/components/Panel.tsx

@ -109,7 +109,7 @@ export function Panel({ width, height, timeRange, eventBus, timeZone }: Props) {
setQueriesDataFrame(getDataFrameForQueriesTable(queries));
}, [queries]); // eslint-disable-line react-hooks/exhaustive-deps
async function updateQueries(dashboard: Dashboard | null, datasources: DataSourceSettings[] | null): Promise<void> {
async function updateQueries(): Promise<void> {
if (!dashboard || !datasources) {
console.warn(`Can't update queries if there is no dashboard or datasources`);
return;
@ -213,8 +213,8 @@ export function Panel({ width, height, timeRange, eventBus, timeZone }: Props) {
setQueries(queries.map((query: DashboardQuery) => ({ ...query, selected: false })));
}
function openDatasourceModal(dashboard: Dashboard | null, datasources: DataSourceSettings[] | null): void {
updateQueries(dashboard, datasources);
function openDatasourceModal(): void {
updateQueries();
setTimeRange(timeRange);
setModalVisibility(true);
}
@ -441,7 +441,7 @@ export function Panel({ width, height, timeRange, eventBus, timeZone }: Props) {
aria-label="Rich history button"
icon="plus"
style={{ marginTop: '8px' }}
onClick={() => openDatasourceModal(dashboard, datasources)}
onClick={openDatasourceModal}
>
Add Task
</Button>

Loading…
Cancel
Save