Commit cf47d9f7 authored by juminet's avatar juminet

[client/geothermie] reorganise general text and add contextual information

parent eeba5d78
import { DIV, SPAN } from 'sdi/components/elements';
import tr from 'sdi/locale';
import { markdown } from 'sdi/ports/marked';
import {
isConstraintWater,
getSystem,
getBedrockDepth
} from '../../queries/geothermie';
const renderInfoGeneralClose = () =>
DIV({},
tr.geo('bedrockDepth'),
SPAN({}, getBedrockDepth().toFixed(1)),
' m.'
);
const renderInfoGeneralOpen = () =>
DIV({},
// TODO need information: épaisseur des aquifères potentiellement intéressants
);
const render = () =>
isConstraintWater()
? getSystem().getOrElse('close') === 'close'
? DIV(
{ className: 'paginator-text' },
markdown(tr.geo('generalInfoClosedNotOk'))
)
: DIV(
{ className: 'paginator-text' },
markdown(tr.geo('generalInfoOpenNotOk'))
)
: getSystem().getOrElse('close') === 'close'
? DIV(
{ className: 'paginator-text' },
markdown(tr.geo('generalInfoClosedOk')),
renderInfoGeneralClose(),
)
: DIV(
{ className: 'paginator-text' },
markdown(tr.geo('generalInfoOpenOk')),
renderInfoGeneralOpen(),
);
export default render;
......@@ -2,13 +2,8 @@ import { DIV, NODISPLAY } from 'sdi/components/elements';
import tr from 'sdi/locale';
import { getLayout } from '../../queries/app';
import {
getSystem,
//getFormatAddress,
isConstraintWater
} from '../../queries/geothermie';
import renderLicense from './license';
import { markdown } from 'sdi/ports/marked';
import renderGeneral from './general';
// const getTranslatedSystem = () => tr.geo(getSystem().getOrElse('close'));
//
......@@ -20,25 +15,7 @@ import { markdown } from 'sdi/ports/marked';
const render = () => {
switch (getLayout()) {
case 'general':
return isConstraintWater()
? getSystem().getOrElse('close') === 'close'
? DIV(
{ className: 'paginator-text' },
markdown(tr.geo('generalInfoClosedNotOk'))
)
: DIV(
{ className: 'paginator-text' },
markdown(tr.geo('generalInfoOpenNotOk'))
)
: getSystem().getOrElse('close') === 'close'
? DIV(
{ className: 'paginator-text' },
markdown(tr.geo('generalInfoClosedOk'))
)
: DIV(
{ className: 'paginator-text' },
markdown(tr.geo('generalInfoOpenOk'))
);
return renderGeneral();
case 'license':
return renderLicense();
case 'finance':
......
......@@ -420,6 +420,12 @@ const messages = {
en: ''
},
bedrockDepth: {
fr: 'Profondeur du socle: ',
nl: 'todo',
en: 'Bedrock depth: '
},
'US/RBC 11-14': {
fr: 'Formations quaternaires indifférenciées',
nl: 'TODO'
......
......@@ -151,10 +151,20 @@ export const getQuaternaireThicknesses = () => {
};
export const getLayersTotalDepth = // total of the depth for all the layers
() => getLayersThicknesses().fold(
export const getLayersTotalDepth = () =>
/*
* total of the depth for all the layers (m)
*/
getLayersThicknesses().fold(
0,
layersThicknesses => layersThicknesses.reduce((sum, curThickness) => sum + curThickness, 0));
layersThicknesses => layersThicknesses.reduce((sum, curThickness) => sum + curThickness, 0)
);
export const getBedrockDepth = () =>
/*
* Depth of the bedrock (m)
*/
getLayersTotalDepth() - BEDROCK_THICKNESS;
export const getQLayersTotalDepth =
() => getQuaternaireThicknesses().reduce((sum, curThickness) => sum + curThickness, 0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment