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

Milestone Picker #5

Open
wants to merge 21 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
d775202
Initial version of milestone picker
m133225 Feb 3, 2016
d3cc6c4
Removed leftover debug statement.
m133225 Feb 3, 2016
0ed1596
Removed debug statements for testing github's api
m133225 Feb 4, 2016
30229d3
Fixed comparing the milestones based on the description instead of it…
m133225 Feb 4, 2016
148dd7a
Allow user to unselect a label by clicking on it (again). Modified Ch…
m133225 Feb 4, 2016
2717d08
Changed keyboard shortcut M to show the milestone picker instead of u…
m133225 Feb 4, 2016
239fd38
Fixed initial highlight not prioritising an already-selected label. F…
m133225 Feb 5, 2016
29661c2
LEFT and RIGHT arrows are used to move the highlighted on the milesto…
m133225 Feb 5, 2016
1e952cc
Extracted helper functions that involve finding or getting the highli…
m133225 Feb 5, 2016
de1c85e
Added vertical gap in between milestones in a milestone group. Made P…
m133225 Feb 5, 2016
a297933
Refactoring in classes related to milestone picker.
m133225 Feb 5, 2016
cd14bfa
Merge branch 'master' into m133225-milestone-picker
m133225 Feb 5, 2016
7a4d5db
Added milestone picker logic which relies on text input. Clicking of …
m133225 Feb 14, 2016
647031f
Implemented setMilestone method in DummyRepoState. Modified Logic's r…
m133225 Feb 17, 2016
3b8e1a9
Extracted logic and state of MilestonePicker into MilestonePickerStat…
m133225 Feb 17, 2016
b8349eb
Removed dependency on dialog for PickerMilestone for easier testing. …
m133225 Feb 17, 2016
de6a821
Fixed dialog not updated when there is a changed made by mouse clicks.
m133225 Feb 17, 2016
3bd184a
Fixed incorrect handling of unassigning milestones.
m133225 Feb 18, 2016
6374f24
Some method name changes and refactoring. More test cases added.
m133225 Feb 20, 2016
a8b5ede
Minor refactoring in MilestonePickerDialog and MilestonePickerState.
m133225 Feb 23, 2016
4d08c40
Moved processInput into a new MilestonePickerState constructor. Refac…
m133225 Feb 23, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Added milestone picker logic which relies on text input. Clicking of …
…milestones is not working yet. Modified MilestonePickerDialog return type to Pair since we have to know both the button pressed and milestone selection result, which fixes removing milestone when Cancel is pressed.
  • Loading branch information
m133225 committed Feb 14, 2016
commit 7a4d5dba3f923d3002f2856ac0dffa54f03a15df
11 changes: 8 additions & 3 deletions src/main/java/ui/components/pickers/MilestonePicker.java
Original file line number Diff line number Diff line change
@@ -4,7 +4,9 @@
import backend.resource.TurboMilestone;
import backend.resource.TurboUser;
import javafx.application.Platform;
import javafx.scene.control.ButtonType;
import javafx.stage.Stage;
import javafx.util.Pair;
import ui.UI;
import undo.actions.ChangeLabelsAction;
import undo.actions.ChangeMilestoneAction;
@@ -26,10 +28,13 @@ public MilestonePicker(UI ui, Stage mainStage) {
private void showMilestonePicker(TurboIssue issue) {
List<TurboMilestone> milestoneList = ui.logic.getRepo(issue.getRepoId()).getMilestones();
MilestonePickerDialog dialog = new MilestonePickerDialog(stage, issue, milestoneList);
Optional<Integer> assignedMilestone = dialog.showAndWait();;
Optional<Pair<ButtonType, Integer>> assignedMilestone = dialog.showAndWait();

if (!issue.getMilestone().equals(assignedMilestone)) {
ui.undoController.addAction(issue, new ChangeMilestoneAction(ui.logic, issue.getMilestone(), assignedMilestone));
if (!assignedMilestone.isPresent()) return;
if (assignedMilestone.get().getKey().equals(ButtonType.CANCEL)) return;
if (!issue.getMilestone().equals(assignedMilestone.get().getValue())) {
ui.undoController.addAction(issue, new ChangeMilestoneAction(ui.logic, issue.getMilestone(),
Optional.of(assignedMilestone.get().getValue())));
}
}

Loading