Rename Notification to notify

This commit is contained in:
Фролов 2021-05-31 15:21:37 +05:00
parent a6bf82eafe
commit 4232c1f4b5
4 changed files with 9 additions and 4 deletions

View File

@ -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)

View File

@ -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

View File

@ -10,8 +10,6 @@ import notify from '../components/notify'
const {Option} = Select
// Словарь категорий для строк таблицы
const categoryDictionary = {
1: {title: 'Авария'},

View File

@ -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)