diff --git a/src/panels/corpglory-dataexporter-panel/components/Panel.tsx b/src/panels/corpglory-dataexporter-panel/components/Panel.tsx index 5ebbd74..9d4e364 100644 --- a/src/panels/corpglory-dataexporter-panel/components/Panel.tsx +++ b/src/panels/corpglory-dataexporter-panel/components/Panel.tsx @@ -25,11 +25,11 @@ export function Panel({ options, data, width, height, timeRange, onChangeTimeRan const [dataFrame, setDataFrame] = useState(null); useEffect(() => { - if(tasks === null) { + if (tasks === null) { return; } const dataFrame = getDataFrameForTable(tasks, setTasks); - setDataFrame(dataFrame) + setDataFrame(dataFrame); }, [tasks]); useEffect(() => { @@ -38,11 +38,13 @@ export function Panel({ options, data, width, height, timeRange, onChangeTimeRan return makeRequest('/tasks', {}); } - getTasks().then(tasks => setTasks(tasks)).catch(err => console.error(err)); + getTasks() + .then((tasks) => setTasks(tasks)) + .catch((err) => console.error(err)); }, []); function onAddTaskClick(): void { - if(tasks === null) { + if (tasks === null) { return; } const configs = [...tasks, createConfigItem()]; @@ -51,9 +53,10 @@ export function Panel({ options, data, width, height, timeRange, onChangeTimeRan return (
- {dataFrame === null ? + {dataFrame === null ? ( // TODO: if datasource responds with error, display the error - : + + ) : (
@@ -68,7 +71,7 @@ export function Panel({ options, data, width, height, timeRange, onChangeTimeRan - } + )} ); }