From 11650fea46adf2eba2a23d0549638168fd0c6f8f Mon Sep 17 00:00:00 2001 From: KharchenkoVV Date: Thu, 7 Oct 2021 15:34:59 +0500 Subject: [PATCH] CF2-49: Added 'no data' display if no measures are uploaded --- src/pages/Measure/MeasureTable.jsx | 2 +- src/pages/Measure/drillingFluidData.js | 1 - src/pages/Measure/index.jsx | 3 --- src/pages/Measure/mudDiagramData.js | 1 - src/pages/Measure/nnbData.js | 1 - 5 files changed, 1 insertion(+), 7 deletions(-) diff --git a/src/pages/Measure/MeasureTable.jsx b/src/pages/Measure/MeasureTable.jsx index 103ada1..1f64da3 100644 --- a/src/pages/Measure/MeasureTable.jsx +++ b/src/pages/Measure/MeasureTable.jsx @@ -170,7 +170,7 @@ export const MeasureTable = ({idWell, idCategory, title, columns, values, update : null} > - {moment.utc(item.timestamp).local().format(format)} + {item.timestamp ? moment.utc(item.timestamp).local().format(format) : 'Нет данных'} )} diff --git a/src/pages/Measure/drillingFluidData.js b/src/pages/Measure/drillingFluidData.js index 520e2c4..0783106 100644 --- a/src/pages/Measure/drillingFluidData.js +++ b/src/pages/Measure/drillingFluidData.js @@ -36,7 +36,6 @@ export const drillingFluidDefaultData = { idWell: 0, key: 'drillingFluidDefaultData', idCategory: 0, - timestamp: new Date().toISOString(), isDefaultData: true, data: { "name": 0, diff --git a/src/pages/Measure/index.jsx b/src/pages/Measure/index.jsx index 8fa4dee..e4b6dd9 100644 --- a/src/pages/Measure/index.jsx +++ b/src/pages/Measure/index.jsx @@ -22,13 +22,10 @@ export default function Measure({idWell}){ setIsMeasuresUpdating(false) const fluids = measures.filter(el => el.idCategory === 1) - drillingFluidDefaultData.timestamp = new Date().toISOString() setFluidValues(fluids.length ? fluids : [drillingFluidDefaultData]) const muds = measures.filter(el => el.idCategory === 2) - mudDiagramDefaultData.timestamp = new Date().toISOString() setMudValues(muds.length ? muds : [mudDiagramDefaultData]) const nnbs = measures.filter(el => el.idCategory === 3) - nnbDefaultData.timestamp = new Date().toISOString() setNnbValues(nnbs.length ? nnbs : [nnbDefaultData]) } ,setShowLoader diff --git a/src/pages/Measure/mudDiagramData.js b/src/pages/Measure/mudDiagramData.js index fd2b830..89256a5 100644 --- a/src/pages/Measure/mudDiagramData.js +++ b/src/pages/Measure/mudDiagramData.js @@ -30,7 +30,6 @@ export const mudDiagramDefaultData = { idWell: 0, key: 'mudDiagramDefaultData', idCategory: 0, - timestamp: new Date().toISOString(), isDefaultData: true, data: { "probeNumber": 0, diff --git a/src/pages/Measure/nnbData.js b/src/pages/Measure/nnbData.js index 628da25..2f7e770 100644 --- a/src/pages/Measure/nnbData.js +++ b/src/pages/Measure/nnbData.js @@ -25,7 +25,6 @@ export const nnbDefaultData = { idWell: 0, key: 'nnbDefaultData', idCategory: 0, - timestamp: new Date().toISOString(), isDefaultData: true, data: { "depth": 0,