Skip to content

Commit

Permalink
Merge pull request #496 from PEM-Humboldt/hotfix/1.7.2
Browse files Browse the repository at this point in the history
Hotfix/1.7.2
  • Loading branch information
erikasv authored Jun 30, 2021
2 parents dc44e87 + 34c6fc2 commit dcfbf41
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 20 deletions.
33 changes: 22 additions & 11 deletions src/pages/Search.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -517,14 +517,23 @@ class Search extends Component {
break;
case 'paramo':
case 'dryForest':
case 'wetland':
case 'wetland': {
request = () => RestAPI.requestHFGeometryBySEInGeofence(
selectedAreaTypeId, selectedAreaId, layerType,
);
shutOtherLayers = false;
layerStyle = this.featureStyle({ type: layerType, color: layerType });
fitBounds = false;
let name;
if (layerType === 'paramo') name = 'Páramos';
else if (layerType === 'dryForest') name = 'Bosque Seco Tropical';
else name = 'Humedales';
newActiveLayer = {
id: `${layerType}HH`,
name: `HH - Persistencia - ${name}`,
};
break;
}
case 'hfTimeline':
request = () => RestAPI.requestHFPersistenceGeometry(
selectedAreaTypeId, selectedAreaId,
Expand All @@ -533,7 +542,7 @@ class Search extends Component {
layerKey = 'hfPersistence';
newActiveLayer = {
id: 'hfPersistence',
name: 'HH - Histórico y Ecosistemas estratégicos (EE)',
name: 'HH - Persistencia y Ecosistemas estratégicos (EE)',
};
break;
case 'hfPersistence':
Expand Down Expand Up @@ -588,7 +597,7 @@ class Search extends Component {
layerStyle = this.featureStyle({ type: layerType, fKey: 'dpc_cat' });
newActiveLayer = {
id: layerType,
name: 'Conectividad actual de áreas protegidas',
name: 'Conectividad de áreas protegidas',
};
});
break;
Expand All @@ -605,9 +614,10 @@ class Search extends Component {
);
shutOtherLayers = false;
layerStyle = this.featureStyle({ type: 'currentPAConn', fKey: 'dpc_cat' });
layerKey = 'currentPAConn';
newActiveLayer = {
id: layerType,
name: 'Histórico de conectividad áreas protegidas',
id: 'currentPAConn',
name: 'Conectividad de áreas protegidas',
};
});
break;
Expand All @@ -623,10 +633,11 @@ class Search extends Component {
selectedAreaId,
);
shutOtherLayers = false;
layerStyle = this.featureStyle({ type: 'currentSEPAConn', fKey: 'dpc_cat' });
layerStyle = this.featureStyle({ type: 'currentPAConn', fKey: 'dpc_cat' });
layerKey = 'currentPAConn';
newActiveLayer = {
id: layerType,
name: 'Conectividad actual de áreas protegidas por ecosistemas estratégicos',
id: 'currentPAConn',
name: 'Conectividad de áreas protegidas y Ecosistemas estratégicos (EE)',
};
});
break;
Expand All @@ -639,7 +650,7 @@ class Search extends Component {
fitBounds = false;
newActiveLayer = {
id: 'paramoPAConn',
name: 'Conectividad actual de áreas protegidas - Páramo',
name: 'Conectividad de áreas protegidas - Páramo',
};
break;
case 'dryForestPAConn':
Expand All @@ -651,7 +662,7 @@ class Search extends Component {
fitBounds = false;
newActiveLayer = {
id: 'dryForestPAConn',
name: 'Conectividad actual de áreas protegidas - Bosque Seco Tropical',
name: 'Conectividad de áreas protegidas - Bosque Seco Tropical',
};
break;
case 'wetlandPAConn':
Expand All @@ -663,7 +674,7 @@ class Search extends Component {
fitBounds = false;
newActiveLayer = {
id: 'wetlandPAConn',
name: 'Conectividad actual de áreas protegidas - Humedales',
name: 'Conectividad de áreas protegidas - Humedales',
};
break;
default:
Expand Down
16 changes: 13 additions & 3 deletions src/pages/search/drawer/Landscape.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ class Landscape extends React.Component {

render() {
const { areaId } = this.context;
const { childMap } = this.state;
const initialArray = [
{
label: {
Expand All @@ -75,23 +76,32 @@ class Landscape extends React.Component {
name: 'Huella humana',
},
component: HumanFootprint,
componentProps: { handlerAccordionGeometry: this.handlerAccordionGeometry },
componentProps: {
handlerAccordionGeometry: this.handlerAccordionGeometry,
openTab: childMap.hf,
},
},
{
label: {
id: 'forest',
name: 'Bosques',
},
component: Forest,
componentProps: { handlerAccordionGeometry: this.handlerAccordionGeometry },
componentProps: {
handlerAccordionGeometry: this.handlerAccordionGeometry,
openTab: childMap.forest,
},
},
{
label: {
id: 'connectivity',
name: 'Conectividad de Áreas Protegidas',
},
component: PAConnectivity,
componentProps: { handlerAccordionGeometry: this.handlerAccordionGeometry },
componentProps: {
handlerAccordionGeometry: this.handlerAccordionGeometry,
openTab: childMap.connectivity,
},
},
];

Expand Down
6 changes: 5 additions & 1 deletion src/pages/search/drawer/landscape/Forest.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import LandscapeAccordion from 'pages/search/drawer/landscape/LandscapeAccordion
const Forest = (props) => {
const {
handlerAccordionGeometry,
openTab,
} = props;

const componentsArray = [
Expand All @@ -16,14 +17,15 @@ const Forest = (props) => {
id: 'forestLP-2016-2019',
name: 'Perdida y persistencia',
disabled: true,
collapsed: true,
collapsed: openTab !== 'forestLP-2016-2019',
},
component: ForestLossPersistence,
},
{
label: {
id: 'forestIntegrity',
name: 'Integridad',
collapsed: openTab !== 'forestIntegrity',
},
component: ForestIntegrity,
},
Expand All @@ -43,10 +45,12 @@ const Forest = (props) => {

Forest.propTypes = {
handlerAccordionGeometry: PropTypes.func,
openTab: PropTypes.string,
};

Forest.defaultProps = {
handlerAccordionGeometry: () => {},
openTab: '',
};

export default Forest;
6 changes: 6 additions & 0 deletions src/pages/search/drawer/landscape/HumanFootprint.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@ import LandscapeAccordion from 'pages/search/drawer/landscape/LandscapeAccordion
const HumanFootprint = (props) => {
const {
handlerAccordionGeometry,
openTab,
} = props;

const componentsArray = [
{
label: {
id: 'hfCurrent',
name: 'Actual',
collapsed: openTab !== 'hfCurrent',
expandIcon: <AddIcon />,
detailId: 'Huella humana actual en área de consulta',
description: 'Huella humana identificada en el último año de medición disponible, sobre el área de consulta',
Expand All @@ -27,6 +29,7 @@ const HumanFootprint = (props) => {
label: {
id: 'hfPersistence',
name: 'Persistencia',
collapsed: openTab !== 'hfPersistence',
expandIcon: <AddIcon />,
detailId: 'Persistencia de la huella humana en la unidad de consulta',
description: 'Representa la persistencia desde el origen del muestreo hasta el periodo actual, producto de análisis de huella humana en el tiempo y en esta área de consulta',
Expand All @@ -37,6 +40,7 @@ const HumanFootprint = (props) => {
label: {
id: 'hfTimeline',
name: 'Histórico y Ecosistémas estratégicos (EE)',
collapsed: openTab !== 'hfTimeline',
expandIcon: <AddIcon />,
detailId: 'Huella humana a través del tiempo en el área',
description: 'Representa diferentes análisis de huella humana en esta área de consulta',
Expand All @@ -59,10 +63,12 @@ const HumanFootprint = (props) => {

HumanFootprint.propTypes = {
handlerAccordionGeometry: PropTypes.func,
openTab: PropTypes.string,
};

HumanFootprint.defaultProps = {
handlerAccordionGeometry: () => {},
openTab: '',
};

export default HumanFootprint;
16 changes: 11 additions & 5 deletions src/pages/search/drawer/landscape/PAConnectivity.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,30 +9,34 @@ import LandscapeAccordion from 'pages/search/drawer/landscape/LandscapeAccordion
const PAConnectivity = (props) => {
const {
handlerAccordionGeometry,
openTab,
} = props;

const componentsArray = [
{
label: {
id: 'currentPAConn',
name: 'Actual',
collapsed: openTab !== 'currentPAConn',
},
component: CurrentPAConnectivity,
},
{
label: {
id: 'timelinePAConn',
name: 'Histórico',
collapsed: openTab !== 'timelinePAConn',
},
component: TimelinePAConnectivity,
},
{
label: {
id: 'currentSEPAConn',
name: 'Ecosistemas Estratégicos (EE)',
},
component: CurrentSEPAConnectivity,
label: {
id: 'currentSEPAConn',
name: 'Ecosistemas Estratégicos (EE)',
collapsed: openTab !== 'currentSEPAConn',
},
component: CurrentSEPAConnectivity,
},
];
return (
<div style={{ width: '100%' }}>
Expand All @@ -49,10 +53,12 @@ const PAConnectivity = (props) => {

PAConnectivity.propTypes = {
handlerAccordionGeometry: PropTypes.func,
openTab: PropTypes.string,
};

PAConnectivity.defaultProps = {
handlerAccordionGeometry: () => {},
openTab: '',
};

export default PAConnectivity;

0 comments on commit dcfbf41

Please sign in to comment.