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 Jun 20, 2020
2 parents c1e056f + 471a1c8 commit 0d3322d
Show file tree
Hide file tree
Showing 14 changed files with 675 additions and 382 deletions.
1 change: 1 addition & 0 deletions .idea/dictionaries/m.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

402 changes: 337 additions & 65 deletions package-lock.json

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
"cordova-plugin-appsettings": "1.0.2",
"cordova-plugin-datepicker": "0.9.3",
"cordova-plugin-device": "2.0.3",
"cordova-plugin-inappbrowser": "3.2.0",
"cordova-plugin-inappbrowser": "4.0.0",
"cordova-plugin-inapppurchase": "1.2.0",
"cordova-plugin-splashscreen": "5.0.3",
"cordova-plugin-splashscreen": "5.0.4",
"cordova-plugin-statusbar": "2.4.3",
"cordova-plugin-whitelist": "1.3.4",
"cordova-plugin-x-socialsharing": "5.6.8",
Expand All @@ -36,7 +36,7 @@
"bugsnag": "2.4.3",
"bugsnag-sourcemaps": "1.3.0",
"cordova-android": "8.1.0",
"cordova-ios": "5.1.1",
"cordova-ios": "6.0.0",
"cordova-plugin-compat": "1.2.0",
"cordova-plugin-drawoverapps": "git+https://github.com/mikepsinn/cordova-plugin-drawoverapps.git#37813e845f8309edc339d847b0ea653032b8f748",
"cordova-plugin-googleplus": "8.4.0",
Expand Down Expand Up @@ -83,7 +83,7 @@
"gulp-util": "3.0.8",
"gulp-watch": "5.0.1",
"gulp-zip": "5.0.1",
"inquirer": "7.1.0",
"inquirer": "7.2.0",
"ionic": "2.2.3",
"jshint": "2.11.0",
"lazypipe": "1.0.2",
Expand Down
5 changes: 1 addition & 4 deletions src/js/controllers/appCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -317,10 +317,7 @@ angular.module('starter')// Parent Controller - This controller runs before ever
});
}
if(index === 3){
qmService.goToState('app.historyAllVariable', {
variableObject: variableObject,
variableName: variableObject.name
});
qmService.goToState('app.historyAllVariable', {variableObject: variableObject});
}
if(index === 4){
qmService.goToVariableSettingsByName(favorite.variableName);
Expand Down
15 changes: 3 additions & 12 deletions src/js/controllers/historyAllMeasurementsCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -311,22 +311,13 @@ angular.module('starter').controller('historyAllMeasurementsCtrl', ["$scope", "$
$scope.editMeasurement($scope.state.measurement);
}
if(index === 1){
qmService.goToState('app.reminderAdd', {
variableObject: variableObject,
variableName: variableObject.name
});
qmService.goToState('app.reminderAdd', {variableObject: variableObject});
}
if(index === 2){
qmService.goToState('app.charts', {
variableObject: variableObject,
variableName: variableObject.name
});
qmService.goToState('app.charts', {variableObject: variableObject});
}
if(index === 3){
qmService.goToState('app.historyAllVariable', {
variableObject: variableObject,
variableName: variableObject.name
});
qmService.goToState('app.historyAllVariable', {variableObject: variableObject});
}
if(index === 4){
qmService.goToVariableSettingsByName($scope.state.measurement.variableName);
Expand Down
3 changes: 2 additions & 1 deletion src/js/controllers/reminderAddCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,8 @@ angular.module('starter').controller('ReminderAddCtrl', ["$scope", "$state", "$s
if($scope.state.variableCategoryObject.defaultValuePlaceholderText){
$scope.state.defaultValuePlaceholderText = $scope.state.variableCategoryObject.defaultValuePlaceholderText;
}
r = $scope.state.trackingReminder = qmService.addVariableCategoryImagePaths(r);
qm.api.addVariableCategoryAndUnit(r)
$scope.state.trackingReminder = r;
showMoreUnitsIfNecessary();
setHideDefaultValueField();
};
Expand Down
64 changes: 40 additions & 24 deletions src/js/controllers/remindersInboxCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ angular.module('starter').controller('RemindersInboxCtrl', ["$scope", "$state",
qmLog.debug('Loading ' + $scope.controller_name);
qmService.navBar.setFilterBarSearchIcon(false);
$scope.state = {
maximumNotificationsToDisplay: 20,
maximumNotificationsToDisplay: 10, // I think more might slow it down?
showMeasurementBox: false,
selectedReminder: false,
reminderDefaultValue: "",
Expand Down Expand Up @@ -186,8 +186,9 @@ angular.module('starter').controller('RemindersInboxCtrl', ["$scope", "$state",
trackingReminderNotification.modifiedValue = trackingReminderNotification.total;
var lastAction = 'Recorded ' + trackingReminderNotification.modifiedValue + ' ' + trackingReminderNotification.unitAbbreviatedName;
qm.notifications.lastAction = qm.stringHelper.formatValueUnitDisplayText(lastAction) + ' for '+trackingReminderNotification.variableName;
notificationAction(trackingReminderNotification);
qm.notifications.trackNotification(trackingReminderNotification);
notificationAction(trackingReminderNotification, function (params) {
qm.notifications.trackNotification(params);
});
refreshIfRunningOutOfNotifications();
};
function getFavorites(){
Expand Down Expand Up @@ -235,18 +236,31 @@ angular.module('starter').controller('RemindersInboxCtrl', ["$scope", "$state",
});
}
};
var notificationAction = function(trackingReminderNotification){
trackingReminderNotification = qmService.notifications.handleNotificationAction(trackingReminderNotification,
getTrackingReminderNotifications);
var notificationAction = function(n, cb){
qmLog.info("Clicked " + qm.notifications.lastAction + " for " + n.variableName);
n.hide = true;
qm.notifications.numberOfPendingNotifications--;
qmService.notifications.undo = false
qmService.showToastWithButton(qm.notifications.lastAction, 'UNDO', function(){
qmService.notifications.undo = true
});
if(!n.trackingReminderNotificationId){n.trackingReminderNotificationId = n.id;}
$scope.state.numberOfDisplayedNotifications--;
if($state.current.name === "app.remindersInboxCompact"){
if(!$scope.state.numberOfDisplayedNotifications){
window.close();
}
if(!$scope.state.numberOfDisplayedNotifications){window.close();}
$scope.trackingReminderNotifications.shift();
}
setTimeout(function () {
if(qmService.notifications.undo){
n.hide = false;
getTrackingReminderNotifications();
qmService.notifications.undo = false;
} else{
cb(n);
}
}, 5000)
closeWindowIfNecessary();
return trackingReminderNotification;
return n;
};
$scope.track = function(notification, value, $event){
if(isGhostClick($event)){return false;}
Expand All @@ -255,9 +269,10 @@ angular.module('starter').controller('RemindersInboxCtrl', ["$scope", "$state",
var variableName = notification.variableName;
valueUnit = qm.stringHelper.formatValueUnitDisplayText(valueUnit);
qm.notifications.lastAction = 'Recorded ' + valueUnit + ' for '+ variableName;
var body = notificationAction(notification);
if(value !== null){body.modifiedValue = value;}
qm.notifications.trackNotification(body);
notificationAction(notification, function (params) {
if(value !== null){params.modifiedValue = value;}
qm.notifications.trackNotification(params);
});
refreshIfRunningOutOfNotifications();
if($scope.state.showTrackAllButtons){
qm.toast.showQuestionToast('Want to record ' + valueUnit + " for ALL remaining " + variableName + " notifications?",
Expand All @@ -270,9 +285,10 @@ angular.module('starter').controller('RemindersInboxCtrl', ["$scope", "$state",
notification.modifiedValue = value;
var lastAction = 'Recorded ' + value + ' ' + notification.unitAbbreviatedName;
qm.notifications.lastAction = qm.stringHelper.formatValueUnitDisplayText(lastAction) + ' for all '+notification.variableName;
var body = notificationAction(notification);
qmService.notifications.trackAll(body, value, ev);
getTrackingReminderNotifications();
notificationAction(notification, function (params) {
qmService.notifications.trackAll(params, value, ev);
getTrackingReminderNotifications();
});
}
$scope.trackAllWithConfirmation = function(trackingReminderNotification, modifiedReminderValue, ev){
qm.ui.preventDragAfterAlert(ev);
Expand All @@ -291,18 +307,18 @@ angular.module('starter').controller('RemindersInboxCtrl', ["$scope", "$state",
return;
}
qm.notifications.lastAction = 'Skipped '+trackingReminderNotification.variableName;
var params = notificationAction(trackingReminderNotification);
qm.notifications.skip(params);
qmService.logEventToGA(qm.analytics.eventCategories.inbox, "skip");
notificationAction(trackingReminderNotification, function (params) {
qm.notifications.skip(params);
qmService.logEventToGA(qm.analytics.eventCategories.inbox, "skip");
});
refreshIfRunningOutOfNotifications();
};
$scope.snooze = function(trackingReminderNotification, $event){
if(isGhostClick($event)){
return;
}
if(isGhostClick($event)){return;}
qm.notifications.lastAction = 'Snoozed '+trackingReminderNotification.variableName;
var params = notificationAction(trackingReminderNotification);
qm.notifications.snoozeNotification(params);
notificationAction(trackingReminderNotification, function (params) {
qm.notifications.snoozeNotification(params);
});
qmService.logEventToGA(qm.analytics.eventCategories.inbox, "snooze");
refreshIfRunningOutOfNotifications();
};
Expand Down
Loading

1 comment on commit 0d3322d

@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_variables_spec.js
Cypress Dashboard

ionic_variables-ionic

BUILD LOG

Please sign in to comment.