Updates codebase to store tour data for a user in the user table, adds new column to store json and adds migration to create the column

This commit is contained in:
Shannon
2017-11-01 15:11:13 +11:00
parent e8ea7f9d29
commit 8208f8de51
15 changed files with 767 additions and 471 deletions

View File

@@ -22,14 +22,16 @@
scope.model.completeTour = function() {
unbindEvent();
tourService.completeTour(scope.model);
backdropService.close();
tourService.completeTour(scope.model).then(function() {
backdropService.close();
});
};
scope.model.disableTour = function() {
unbindEvent();
tourService.disableTour(scope.model);
backdropService.close();
tourService.disableTour(scope.model).then(function() {
backdropService.close();
});
}
function onInit() {

View File

@@ -10,6 +10,30 @@ function currentUserResource($q, $http, umbRequestHelper, umbDataFormatter) {
//the factory object returned
return {
saveTourStatus: function (tourStatus) {
if (!tourStatus) {
return angularHelper.rejectedPromise({ errorMsg: 'tourStatus cannot be empty' });
}
return umbRequestHelper.resourcePromise(
$http.post(
umbRequestHelper.getApiUrl(
"currentUserApiBaseUrl",
"PostSetUserTour"),
tourStatus),
'Failed to save tour status');
},
getTours: function () {
return umbRequestHelper.resourcePromise(
$http.get(
umbRequestHelper.getApiUrl(
"currentUserApiBaseUrl",
"GetUserTours")), 'Failed to get tours');
},
performSetInvitedUserPassword: function (newPassword) {
if (!newPassword) {

File diff suppressed because it is too large Load Diff

View File

@@ -26,7 +26,9 @@
function oninit() {
vm.tours = tourService.getGroupedTours();
tourService.getGroupedTours().then(function(groupedTours) {
vm.tours = groupedTours;
});
// load custom help dashboard
dashboardResource.getDashboard("user-help").then(function (dashboard) {
@@ -156,9 +158,11 @@
}
evts.push(eventsService.on("appState.tour.complete", function (event, tour) {
vm.tours = tourService.getGroupedTours();
openTourGroup(tour.alias);
getTourGroupCompletedPercentage();
tourService.getGroupedTours().then(function(groupedTours) {
vm.tours = groupedTours;
openTourGroup(tour.alias);
getTourGroupCompletedPercentage();
});
}));
$scope.$on('$destroy', function () {

View File

@@ -30,20 +30,17 @@ function startUpDynamicContentController($timeout, dashboardResource, assetsServ
function onInit() {
// load tours
vm.tours = tourService.getGroupedTours();
tourService.getGroupedTours().then(function(groupedTours) {
vm.tours = groupedTours;
});
// get list of completed tours and disabled tours
var completedTours = tourService.getCompletedTours();
var disabledTours = tourService.getDisabledTours();
// get intro tour
var introTour = tourService.getTourByAlias("umbIntroIntroduction");
// start intro tour if it hasn't been completed or disabled
if(completedTours.indexOf(introTour.alias) === -1 && disabledTours.indexOf(introTour.alias) === -1) {
tourService.startTour(introTour);
}
tourService.getTourByAlias("umbIntroIntroduction").then(function (introTour) {
// start intro tour if it hasn't been completed or disabled
if (introTour.disabled !== true && introTour.completed !== true) {
tourService.startTour(introTour);
}
});
}
function startTour(tour) {