Skip to content

Commit

Permalink
Merge branch 'develop' into feature/getVariableCategoryName
Browse files Browse the repository at this point in the history
  • Loading branch information
mikepsinn authored Sep 21, 2020
2 parents a74f307 + d5b09dc commit 5965da4
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions src/js/controllers/reminderAddCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ angular.module('starter').controller('ReminderAddCtrl', ["$scope", "$state", "$s
setupEditReminder($scope.state.trackingReminder);
} // Needed to set dates
qmLog.info("tracking reminder after setup: ", $scope.state.trackingReminder);
setTitle();
});
$scope.showMoreOptions = function(){
$scope.state.showMoreOptions = true;
Expand Down Expand Up @@ -136,17 +137,22 @@ angular.module('starter').controller('ReminderAddCtrl', ["$scope", "$state", "$s
}
}
$scope.oldOpenReminderStartTimePicker = function(order){
var defaultStartTimeInSecondsSinceMidnightLocal = qmService.getSecondsSinceMidnightLocalFromLocalString($rootScope.user.earliestReminderTime);
var defaultStartTimeInSecondsSinceMidnightLocal =
qmService.getSecondsSinceMidnightLocalFromLocalString($rootScope.user.earliestReminderTime);
if(order === 'first' && $scope.state.firstReminderStartTimeLocal){
defaultStartTimeInSecondsSinceMidnightLocal = qmService.getSecondsSinceMidnightLocalFromLocalString($scope.state.firstReminderStartTimeLocal);
defaultStartTimeInSecondsSinceMidnightLocal =
qmService.getSecondsSinceMidnightLocalFromLocalString($scope.state.firstReminderStartTimeLocal);
}
if(order === 'second' && $scope.state.secondReminderStartTimeLocal){
defaultStartTimeInSecondsSinceMidnightLocal = qmService.getSecondsSinceMidnightLocalFromLocalString($scope.state.secondReminderStartTimeLocal);
defaultStartTimeInSecondsSinceMidnightLocal =
qmService.getSecondsSinceMidnightLocalFromLocalString($scope.state.secondReminderStartTimeLocal);
}
if(order === 'third' && $scope.state.thirdReminderStartTimeLocal){
defaultStartTimeInSecondsSinceMidnightLocal = qmService.getSecondsSinceMidnightLocalFromLocalString($scope.state.thirdReminderStartTimeLocal);
defaultStartTimeInSecondsSinceMidnightLocal =
qmService.getSecondsSinceMidnightLocalFromLocalString($scope.state.thirdReminderStartTimeLocal);
}
defaultStartTimeInSecondsSinceMidnightLocal = qmService.getSecondsSinceMidnightLocalRoundedToNearestFifteen(defaultStartTimeInSecondsSinceMidnightLocal);
defaultStartTimeInSecondsSinceMidnightLocal =
qmService.getSecondsSinceMidnightLocalRoundedToNearestFifteen(defaultStartTimeInSecondsSinceMidnightLocal);
$scope.state.timePickerConfiguration = {
callback: function(val){
if(typeof (val) === 'undefined'){
Expand Down Expand Up @@ -356,7 +362,11 @@ angular.module('starter').controller('ReminderAddCtrl', ["$scope", "$state", "$s
var toastMessage = getVariableName($scope) + ' saved';
qmService.showInfoToast(toastMessage);
qmService.hideLoader();
$scope.goBack(); // We can't go back until we get new notifications
if($stateParams.doneState){
qmService.goToState($stateParams.doneState, $stateParams);
} else {
$scope.goBack(); // We can't go back until we get new notifications
}
};
function getFrequencyNameFromFrequencySeconds(frequencyName){
var reverseFrequencyChart = {
Expand Down Expand Up @@ -476,7 +486,7 @@ angular.module('starter').controller('ReminderAddCtrl', ["$scope", "$state", "$s
});
}
var setTitle = function(){
if($stateParams.favorite){
if($stateParams.favorite || $state.current.name === qm.stateNames.favoriteAdd){
$scope.state.selectedFrequencyName = 'As-Needed';
if($stateParams.reminder){
if(getVariableCategoryName() === 'Treatments'){
Expand Down

2 comments on commit 5965da4

@mikepsinn
Copy link
Contributor Author

Choose a reason for hiding this comment

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

View recording of ionic_spec.js
Cypress Dashboard

ionic-ionic

BUILD LOG

@mikepsinn
Copy link
Contributor Author

Choose a reason for hiding this comment

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

View recording of ionic_spec.js
Cypress Dashboard

ionic-ionic

BUILD LOG

Please sign in to comment.