Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UI Refactor #75

Merged
merged 3 commits into from
Feb 24, 2020
Merged

UI Refactor #75

merged 3 commits into from
Feb 24, 2020

Conversation

lucernae
Copy link
Contributor

@lucernae lucernae commented Feb 24, 2020

MV Summary for roads refactor

  • Change column name to follow standard conventions
  • Uncomment population charts

Use GWC endpoint

Address issue: #48
Apparently we don't use GWC endpoint in the frontend.
This commit uses GWC endpoint and include tiled: true options in a WMS requests.

- Change column name to follow standard conventions
- Uncomment population charts
Copy link
Contributor Author

@lucernae lucernae left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some several points to review

@@ -66,7 +66,7 @@ CREATE MATERIALIZED VIEW public.mv_flood_event_road_district_summary AS
), flooded_count_selection AS (
SELECT a.flood_event_id,
a.district_id,
sum(a.road_type_count) AS flooded_flooded_road_count,
sum(a.road_type_count) AS flooded_road_count,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Standardize column name to follow conventions.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hi @lucernae it was because that's from the db

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I also fix it in the db side, because it's confusing and make the frontend code difficult to understand. The db should not make the frontend job harder.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh okay cool, yeah at that time, I thought it would take a long time to change the db so I just adjusted the front end according to db

// this.population_village_summaries = new PopulationVillageSummaryCollection();
// this.population_district_summaries = new PopulationDistrictSummaryCollection();
// this.population_subdistrict_summaries = new PopulationSubDistrictSummaryCollection();
this.population_village_summaries = new PopulationVillageSummaryCollection();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uncomment Population collections. It is now available

that.roadDistrictStats = data;
if (that.roadVillageStats !== null && that.roadDistrictStats !== null && that.roadSubDistrictStats !== null) {
that.fetchRoadStatisticData('district', that.selected_forecast.id, true);
that.populationDistrictStats = data;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix typo

@@ -176,7 +176,7 @@ define([

let total_vulnerability_score = data['total_vulnerability_score'] ? data['total_vulnerability_score'].toFixed(2): 0;
$('#vulnerability-score-' + element).html(total_vulnerability_score);
$('#'+ element +'-count').html(data['flooded_flooded_road_count']);
$('#'+ element +'-count').html(data['flooded_road_count']);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use standard column name conventions

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hi @lucernae that name is from the db? is db using that name now?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I saw the frontend is using weird column name, so I check back if the backend actually have those name. It have those, so I fixed it in the backend too.

@lucernae lucernae requested a review from anitanh February 24, 2020 16:06
@lucernae lucernae changed the title Refactor mv_flood_event_road_* columns UI Refactor Feb 24, 2020
@lucernae lucernae mentioned this pull request Feb 24, 2020
@lucernae lucernae merged commit 2dcd9dc into inasafe:master Feb 24, 2020
@lucernae lucernae deleted the fix_frontend branch February 24, 2020 18:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants