In the place; in the proper or natural place.
A Geographic Information System (GIS) used by Ministério Público do Estado do Rio de Janeiro to show social, institutional and administrative data, made with React and Leaflet, interacting with a public GeoServer backend.
Our development objectives and open issues are all public on GitHub issues. Optionally, you can install ZenHub plugin (available on Chrome and Firefox) to see development plan board, see issues already in progress etc.
- Clone the project or download it to your machine.
- On Windows, install .NET Framework 2.0 SDK (Sass build dependency)
- If needed be, configure npm proxy
- Run
npm install
- Note: currently this step fails when running on Windows Subsystem for Linux.
- This project uses EditorConfig to configure its code standards, please use the appropriate plugin on your IDE or text editor.
$ npm install -g jest
$ npm run test
If you get error with jest, try running jest --no-cache
This mode does not call the geoserver, instead it simulates geoserver calls.
$ npm run mock
$ npm start
$ npm run prod
$ npm run build
The tests environment was made using jest and enzyme. At first, we're doing the following test types:
- Component rendering with Snapshot test. Example:
import React from 'react';
import App from '../../src/components/App/App.js';
import renderer from 'react-test-renderer';
it('component renders correctly', () => {
const app = shallow(<App/>);
expect(app).toMatchSnapshot();
});
- Property tests (props)
- Events tests
$ npm run test
: run all tests
$ npm run test:watch
: run all tests right now and also when some component change
$ npm run test:coverage
: run all tests and show coverage information
In order to contribute with the project, it is needed to documment the components. For each component we need to write:
- Basic description of what the component is, soon after component class declaration, write the description with a comment:
/** * App component that represents the application */
- What every component method does and what it returns, right after module declaration
/** * renders the element * @return html markup of the element */
Just like on following example, with App class.
import React from 'react';
import Input from '../input/Input.js';
require('./app.scss');
/**
* App component that represents the application
*/
export default class App extends React.Component {
/**
* renders the element
* @return html markup of the element
*/
render() {
return (
<div style={{textAlign: 'center'}} className="module-app">
<h1>Hello World</h1>
<Input />
<hr />
</div>
);
}
}
The development build (npm start
) will also start docs build (esdoc). This docs build will compile all components docs and show a webpage. To access it just:
$ npm start
- Access url
http://localhost:3000/esdoc/