From 669fcf0e50459b765d9364f3d16f8a1b2fd5d3bc Mon Sep 17 00:00:00 2001 From: Johannes Millan Date: Sun, 4 Mar 2018 17:48:34 +0100 Subject: [PATCH] feat(focusMode): better edge case handling --- .../pomodoro-focus/_pomodoro-focus-c.scss | 5 + .../pomodoro-focus/pomodoro-focus-c.html | 93 +++++++++++-------- .../pomodoro-focus/pomodoro-focus-c.js | 7 +- 3 files changed, 64 insertions(+), 41 deletions(-) diff --git a/app-src/scripts/dialogs/pomodoro-focus/_pomodoro-focus-c.scss b/app-src/scripts/dialogs/pomodoro-focus/_pomodoro-focus-c.scss index 6398ba3812..e37e7db99a 100644 --- a/app-src/scripts/dialogs/pomodoro-focus/_pomodoro-focus-c.scss +++ b/app-src/scripts/dialogs/pomodoro-focus/_pomodoro-focus-c.scss @@ -31,6 +31,11 @@ input { text-align: center; } + + &.is-done{ + text-decoration: line-through; + color: #aaaaaa; + } } md-progress-linear { diff --git a/app-src/scripts/dialogs/pomodoro-focus/pomodoro-focus-c.html b/app-src/scripts/dialogs/pomodoro-focus/pomodoro-focus-c.html index 93a08816e0..0affbc6a76 100644 --- a/app-src/scripts/dialogs/pomodoro-focus/pomodoro-focus-c.html +++ b/app-src/scripts/dialogs/pomodoro-focus/pomodoro-focus-c.html @@ -28,53 +28,66 @@

-
- - - - - Start/Pause working - - - - - - - - - - - Go to issue page - - - - Mark as done and start next task - +
+
+ + + +
+
+ + + + + + Start/Pause working + + + + + + + + + + + Go to issue page + + + + Mark as done and start next task + +
diff --git a/app-src/scripts/dialogs/pomodoro-focus/pomodoro-focus-c.js b/app-src/scripts/dialogs/pomodoro-focus/pomodoro-focus-c.js index 194c5407e5..512e09a29b 100644 --- a/app-src/scripts/dialogs/pomodoro-focus/pomodoro-focus-c.js +++ b/app-src/scripts/dialogs/pomodoro-focus/pomodoro-focus-c.js @@ -14,7 +14,7 @@ .controller('PomodoroFocusCtrl', PomodoroFocusCtrl); /* @ngInject */ - function PomodoroFocusCtrl($mdDialog, $rootScope, theme, pomodoroData, pomodoroConfig, $scope, $timeout, IS_ELECTRON, PomodoroButton, Notifier, Tasks) { + function PomodoroFocusCtrl($mdDialog, $rootScope, theme, pomodoroData, pomodoroConfig, $scope, $timeout, IS_ELECTRON, PomodoroButton, Notifier, Tasks, SimpleToast) { this.r = $rootScope.r; this.theme = theme; this.pomodoroData = pomodoroData; @@ -27,6 +27,11 @@ this.markAsDone = () => { Tasks.markAsDone(this.task); + this.task = Tasks.getCurrent() || Tasks.getLastCurrent(); + if (this.task.isDone) { + SimpleToast('SUCCESS', 'All tasks done for today, create some new if you have to!') + $mdDialog.hide(); + } }; this.cancel = () => {