Skip to content

Commit 81f3488

Browse files
committed
bug fixes in swap UI
1 parent 957eb06 commit 81f3488

File tree

4 files changed

+9
-3
lines changed

4 files changed

+9
-3
lines changed

ShiftOverflow_v0.2.1.jar

2.64 MB
Binary file not shown.

src/ui/AvailabilityStage.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ private void saveButtonPressed(ActionEvent event) {
319319
// need to send to controller to save the current modified Employee
320320
// object
321321
// disable the save button so they can't save again until they make
322-
// another chang
322+
// another change
323323
_saveAvailabilityButton.setDisable(true);
324324
if (_ui.getCurrentEmployee() != null) {
325325
_controller.uiRequestSaveAvailability(_ui.getCurrentEmployee(),

src/ui/PerformSwapStage.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ private void performSwap(ActionEvent event) {
130130
// show a warning that one of the employees is unavailable for the shift
131131
// they are swapping into
132132
_continueToSwap = true;
133-
if (unavailableEmployee != null) {
133+
if (unavailableEmployee != "") {
134134
KarenStage dialogueBox = new KarenStage("Unavailable Employee", null, _ui);
135135
Group root = new Group();
136136
Scene scene = new Scene(root);
@@ -167,6 +167,12 @@ private void performSwap(ActionEvent event) {
167167
dialogueBox.close();
168168
});
169169
Button no = new Button("No");
170+
dialogueBox.setOnCloseRequest((event1) -> {
171+
//assume hitting the close window button is like clicking no
172+
// if not set the flag so we don't swap
173+
_continueToSwap = false;
174+
dialogueBox.close();
175+
});
170176
no.setOnAction((event1) -> {
171177
// if not set the flag so we don't swap
172178
_continueToSwap = false;

src/ui/UI.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ public void displayAvailable(Employee employee) {
119119
if (_availabilityStage != null){
120120
_availabilityStage.close();
121121
}
122-
_availabilityStage = new AvailabilityStage("ShiftOverflow v0.2.0", _controller, this);
122+
_availabilityStage = new AvailabilityStage("ShiftOverflow v0.2.1", _controller, this);
123123
_availabilityStage.show();
124124
}
125125

0 commit comments

Comments
 (0)