scorelab / dengue-stop-old

Dengue-Stop
Apache License 2.0
25 stars 64 forks source link

Reports Section: Filter reports according to disease #296

Open rheo-chiti opened 4 years ago

rheo-chiti commented 4 years ago

This fixes #295

In the Reports Section, users can report their disease by providing their name, description of the disease, symptoms, name of the disease. Users can also view reports worldwide as well as in their area.
The demo video

20200415_005433

Firstly all the unique diseases are loaded and stored and then displayed in the dropdown menu. On selecting any disease filter is applied and relevant reports are displayed.
For filtering this code is used:-
reports = this.state.reports let newReports = [] for (let i = 0; i < reports.length; i++) { if (reports[i].disease === value) newReports.push(reports[i]) } if (value === 'all') newReports = reports this.setState({ displayReports: newReports })