Commit 58e39ac9 authored by Henrique Varella Ehrenfried's avatar Henrique Varella Ehrenfried
Browse files

Merge branch 'demandas_novas_simope_rafae' into 'development'

fim das demandas 3

See merge request !97
parents c9e4c96a f7728e15
......@@ -43,8 +43,12 @@ function CsvTable(props){
}
}
setCsvData(aux)
if(props.func)
props.func(aux.length)
} else {
setCsvData(csvTable)
if(props.func)
props.func(csvTable.length)
}
})
......
......@@ -131,7 +131,8 @@ class Eixo1 extends Component {
data: {},
clickedRow: {},
csvData: [],
dummy: null
dummy: null,
countTituladas: 255
};
this.getMapClick = this.getMapClick.bind(this);
this.clearMap = this.clearMap.bind(this);
......@@ -140,6 +141,8 @@ class Eixo1 extends Component {
this.closeModal = this.closeModal.bind(this);
this.fixData = this.fixData.bind(this);
this.communitiesSort = this.communitiesSort.bind(this);
this.countTituladas = this.countTituladas.bind(this);
// this.readCSV = this.readCSV.bind(this);
......@@ -177,25 +180,17 @@ class Eixo1 extends Component {
componentWillMount(){
this.setState({data: this.fixData(null)});
//state: null, []
// this.readCSV(csv5)
}
componentDidMount() {
this.clearMap();
// this.setState({dummy:""})
//state: []
// this.readCSV(csv5)
}
// readCSV(csv){
// var aux = []
// d3.csv(csv, function(csv) {
// aux.push(csv)
// });
// this.setState({csvData:aux})
// }
countTituladas(count){
this.setState({countTituladas:count})
}
shapeMap() {
if(this.state.clickedRow['shape_territorio'] === null){
......@@ -345,11 +340,7 @@ class Eixo1 extends Component {
<Button className="clearmapbtn" onClick={this.clearMap}> Limpar Mapa </Button>
</Row>
{data.gete1p1()[getStateExtendedName(this.state.clickedInMap).currentState] ? (
<UfBar img={MapMarker} ufname={getStateExtendedName(this.state.clickedInMap).currentState} val={data.gete1p1()[getStateExtendedName(this.state.clickedInMap).currentState].Certificadas + " territórios"} />//mudar fonte de val para função que conta do csv5
) : (
<UfBar img={MapMarker} ufname={getStateExtendedName(this.state.clickedInMap).currentState} val="Sem informação" />
)}
<UfBar img={MapMarker} ufname={getStateExtendedName(this.state.clickedInMap).currentState} val={this.state.countTituladas.toString() + ' Território(s)'} />
<p>* Não territórios quilombolas certificadas no Distrito Federal e nos Estados do Acre e Roraima. As maiores concentrações estão nos Estados da Bahia e do Maranhão, respectivamente.</p>
<CardFooter
......@@ -503,6 +494,7 @@ class Eixo1 extends Component {
mouseCursor='pointer'
filterable = {true}
uf={getStateAcronym(this.state.clickedInMap)}
func={this.countTituladas}
/>
{/* carregando dados na hora errada faz a tabela ficar nula, descobrir como evitar isso */}
<CardFooter
......
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