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

Add option to replace instead of undo #178

Merged
merged 3 commits into from
Oct 9, 2018

Conversation

frank-weinberg
Copy link
Contributor

Useful e.g. if what the operator thought was a jam starting whistle
turns out to be a timeout instead.

Useful e.g. if what the operator thought was a jam starting whistle
turns out to be a timeout instead.
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.

Frontend doesn't seem right here.

Just thinking there - should we log operator clock-related actions to the js console? That'd help debug if someone presses the wrong thing

function setReplaceButton(value) {
$("#EnableReplaceButton").prop("checked", value);
$("label.EnableReplaceButton").toggleClass("ui-state-active", value);
$("#ClockUndo").toggleClass("Hidden KeyInactive", value);
Copy link
Contributor

Choose a reason for hiding this comment

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

This isn't working, I'm always seeing both buttons.

I'd suggest always showing both.

var controlsTr = createRowTable(4,1).appendTo(table.find("td")).find("tr:eq(0)").addClass("Controls");

var replaceInfoText = $("<span>").html("Replace &quot;<span id=\"replacedLabel\"></span>&quot; with").appendTo(replaceInfoTr);
Copy link
Contributor

Choose a reason for hiding this comment

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

This text is always showing.

@brian-brazil
Copy link
Contributor

Ignore that, a 2nd forced refresh got it working.

I'd still suggest always showing both the replace and undo buttons - in a hurry you don't want to have to do the extra click to turn it on

@@ -189,14 +198,17 @@ public void stopJamTO() {
createSnapshot(ACTION_STOP_JAM);
setLabels(ACTION_START_JAM, ACTION_NONE, ACTION_TIMEOUT);
_endJam(false);
finishReplace();
Copy link
Contributor

Choose a reason for hiding this comment

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

We should probably have unittests covering each of these new finishReplace calls

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've extended the unittest that was already there instead of adding new ones.

@brian-brazil
Copy link
Contributor

I've got a better feel for how this works now, I'm wondering if we should just hardcode this as the only way.

@frank-weinberg
Copy link
Contributor Author

The idea is that the operator chooses one mode of operation and uses that all the time. (In replace mode clicking "Undo" and then replace with "no action" has the same effect as straight undo, so there's no need for a straight undo button. (And we are striving to reduce the number of buttons, not increase it.)

@frank-weinberg
Copy link
Contributor Author

And the reason I've not hardcoded it is that there is a good chance operators would discover it the first time they press "undo" on a newer version of the scoreboard. And many operators won't be open to learn about new functionality just as they press undo. I hope we can do it that way once the new mode has become known amongst operators.

@brian-brazil brian-brazil merged commit 960192f into rollerderby:dev Oct 9, 2018
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