Page MenuHomeWildfire Games

Remember selected graphs when switching tabs in summary
ClosedPublic

Authored by mmoanis on Jun 3 2017, 5:22 PM.

Details

Summary

Restore the selected charts options when switching tabs in the summary page. The user selection is always saved so that
when selecting the charts panel, they are loaded - initially 0. But when the user is changing the categories, we must reset the value/type selection to 0.

Test Plan
1 Choose chart category, value, and/or type. Go to another panel and then back to charts, must have the same selection you made before.


2 Choose any chart category, the list of values and/or types must have the first item selected.

Diff Detail

Repository
rP 0 A.D. Public Repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

mmoanis created this revision.Jun 3 2017, 5:22 PM
mmoanis edited the test plan for this revision. (Show Details)
vladislavbelov requested changes to this revision.Jun 3 2017, 5:41 PM
vladislavbelov added subscribers: elexis, vladislavbelov.
vladislavbelov added inline comments.
binaries/data/mods/public/gui/summary/summary.js
113 ↗(On Diff #2402)

The first letter has to be capital, no?

117 ↗(On Diff #2402)

I think, it should have the same style with all file, upper case for the first word after g_.

Also unnecessary indents. We've have already discussed with @elexis, that we've to avoid this, because if we'll add more lines, we need to add spaces for all of them.

I think, it'd be better to use an object, like:

var g_SelectedChart = {
    "caterogy": [0, 0],
    // ...
};
138 ↗(On Diff #2402)

{ on new line.

141 ↗(On Diff #2402)

Looks like a hack, couldn't we avoid it?

214 ↗(On Diff #2402)

Useless brackets.

240 ↗(On Diff #2402)

Useless brackets.

This revision now requires changes to proceed.Jun 3 2017, 5:41 PM
mmoanis updated this revision to Diff 2405.Jun 3 2017, 6:13 PM
mmoanis edited edge metadata.

Removed the hack used to reset the saved selection also fixed the styling issues.

mmoanis updated this revision to Diff 2406.Jun 3 2017, 6:19 PM
mmoanis marked 6 inline comments as done.

unnecessary white spaces

Imarok added a subscriber: Imarok.Jun 8 2017, 11:44 PM

Patch looks good.

vladislavbelov added inline comments.Jun 9 2017, 12:09 AM
binaries/data/mods/public/gui/summary/summary.js
189 ↗(On Diff #2406)

g_SelectedChart["category"] could be written as g_SelectedChart.category.[number]. The same for lines below.

mmoanis updated this revision to Diff 2488.Jun 9 2017, 9:33 AM
This revision was automatically updated to reflect the committed changes.