From 4232c1f4b591b4c8c1834a2aae6ef2ec5fa86651 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A4=D1=80=D0=BE=D0=BB=D0=BE=D0=B2?= Date: Mon, 31 May 2021 15:21:37 +0500 Subject: [PATCH] Rename Notification to notify --- src/components/WellTreeSelector.jsx | 3 ++- src/pages/Archive.jsx | 6 +++++- src/pages/Messages.jsx | 2 -- src/pages/Wells.jsx | 2 ++ 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/components/WellTreeSelector.jsx b/src/components/WellTreeSelector.jsx index 492a811..35bc235 100644 --- a/src/components/WellTreeSelector.jsx +++ b/src/components/WellTreeSelector.jsx @@ -4,6 +4,7 @@ import { WellService } from '../services/api' import Loader from '../components/Loader' import { TreeSelect } from 'antd' import { useHistory } from 'react-router-dom' +import notify from '/notify' const groupBy = (table, ...keys) => { let key = keys[0] @@ -49,7 +50,7 @@ export default function WellTreeSelector(props) { setWellsTree(wellsTree) } catch (e) { - + notify('Не удалось загрузить список скважин', 'error') console.error(`${e.message}`); } setLoader(false) diff --git a/src/pages/Archive.jsx b/src/pages/Archive.jsx index a256b99..d3497e3 100644 --- a/src/pages/Archive.jsx +++ b/src/pages/Archive.jsx @@ -12,6 +12,7 @@ import locale from 'antd/lib/locale/ru_RU' import {generateUUID} from '../services/UidGenerator' import { ArchiveColumn } from '../components/ArchiveColumn' import moment from 'moment' +import notify from '../components/notify' const { RangePicker } = DatePicker; @@ -96,7 +97,10 @@ export default function Archive() { DataService.getData(id, startDate, interval, 2048) .then(handleReceiveDataSaub) - .catch(error => console.error(error)) + .catch(error => { + notify(`Не удалось загрузить данные по скважине (${id}) c ${rangeDate[0]} по ${rangeDate[1]}`, 'error') + console.error(error) + }) }, [id, rangeDate]); let charts = null diff --git a/src/pages/Messages.jsx b/src/pages/Messages.jsx index 3a36515..7fcb2fa 100644 --- a/src/pages/Messages.jsx +++ b/src/pages/Messages.jsx @@ -10,8 +10,6 @@ import notify from '../components/notify' const {Option} = Select - - // Словарь категорий для строк таблицы const categoryDictionary = { 1: {title: 'Авария'}, diff --git a/src/pages/Wells.jsx b/src/pages/Wells.jsx index 579e5b4..0f5b97e 100644 --- a/src/pages/Wells.jsx +++ b/src/pages/Wells.jsx @@ -3,6 +3,7 @@ import { WellService } from '../services/api' import Loader from '../components/Loader' import { Table } from 'antd' // TreeSelect import { useHistory } from 'react-router-dom' +import notify from '../components/notify' const columns = [ { @@ -40,6 +41,7 @@ export default function Wells(props){ setWells( newWells ) } catch(e){ + notify('Не удалось загрузить список скважин', 'error') console.error(`${e.message}`); } setLoader(false)