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

Penalty Tracking Page Enhancements #112

Merged

Conversation

official-sounding
Copy link
Contributor

@official-sounding official-sounding commented Jul 21, 2018

User-facing changes to the Penalty Tracking page:

  1. Use the Operator Team Name & Color, and name/color updates when updated on the WS, not when a skater is updated
  2. Make Background dark
  3. Penalties committed in the current jam are underlined
  4. Skaters in the current jam are highlighted green (similar to elsewhere)
  5. Sort penalties when added/updated
  6. Remove Legacy Penalty Tracking page, add link to "auto-height" version
  7. De-emphasize penalties in prior periods (penalties in the current period are bold)

Additionally, I've made the following set of backend/developer changes

  1. Wrap PT code in an IIFE, enabled strict mode on the PT page
  2. fix some conflicts between global and function-local variables are had the same name
  3. Added some unit tests to DefaultSkaterModel related to penalty adding/removing/editing

This doesn't technically do what #66 asks, in that it's not an option and it's not color, but I am pretty much alright with something opinionated for now. I am not totally sure that coloring the prior periods penalties justifies adding a set of operator settings/login functionality/etc on it's own. Maybe as we build up a few more settings for PT we can re-address.

I had to make a bunch of whitespace changes to index.js to keep it formatted properly which sort of screws up the unified diff, unfortunately.

Closes #91
Closes #101

1. use operator names/colors instead of overlay names/colors
2. update Name/Alternate Name when it is updated elsewhere, instead of
requiring a refresh or requiring skater changes to listen for it
1. make background color very dark grey
2. remove opacity setting from header, it just makes the colors look washed out and weird
re-indent after adding wrapping IIFE
Copy link
Contributor

@brian-brazil brian-brazil left a comment

Choose a reason for hiding this comment

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

I'm totally okay with keeping this simple and unconfigurable.

Do you have a screenshot?

teamMock = Mockito.mock(TeamModel.class);
skaterId = UUID.randomUUID();

model = new DefaultSkaterModel(teamMock, skaterId.toString(), "Test Skater","123","");
Copy link
Contributor

Choose a reason for hiding this comment

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

Spaces after comma is inconsistent here

@@ -151,6 +152,7 @@ public void AddPenaltyModel(String id, boolean foulout_explusion, int period, in
if (penalties.size() < 9) {
DefaultPenaltyModel dpm = new DefaultPenaltyModel(id, period, jam, code);
penalties.add(dpm);
sortPenalties();
Copy link
Contributor

Choose a reason for hiding this comment

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

The EVENT_PENALTY is no longer just about that individual penalty, as it could reorder other penalties. Thus I think the event should be considered to be more generic and not pass dpm to make that clearer. This doesn't require code changes in xml/json listeners as they currently replace the entire skater.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree that a single penalty object is not ideal, but I also want to avoid the potential pitfalls of not sending anything at all in as the event value (as that would violate the convention that null is a removal action of some sort). For now I've updated it to be the skater's list of penalties, but I can update it to be something else (like total count of penalties, a string/enum indicating the action type, etc) if you think that's more appropriate.

Copy link
Contributor

Choose a reason for hiding this comment

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

sgtm

@official-sounding
Copy link
Contributor Author

Here's a screenshot of the various UI updates, showing two skaters on the track, with penalties in both the prior period, a prior jam in the same period, and the current jam.

I will push some fixes momentarily to address the code review issues, plus a few bugs related to reloading the penalty tracking page I discovered while making screenshots.
image

@brian-brazil brian-brazil merged commit 3a2dbd7 into rollerderby:dev Aug 6, 2018
@brian-brazil
Copy link
Contributor

Thanks!

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.

Remove the "legacy" PT screen Penalties are recorded on the PT sheet ordered by entry time, not jam number
2 participants