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

Highlight current tree #36

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,14 @@
app.requires.push('tableSort');

app.controller("Analytics.BrowserController",
function ($scope, $location, statsResource, settingsResource, localizationService) {
function ($scope, $location, $routeParams, statsResource, settingsResource, localizationService, navigationService) {

var profileID = "";

// items list array
$scope.items = [];
$scope.itemSpecs = [];


$scope.loadingViews = true;
$scope.dateFilter = settingsResource.getDateFilter();

Expand Down Expand Up @@ -121,4 +120,6 @@ app.controller("Analytics.BrowserController",
}
});
});

navigationService.syncTree({ tree: 'analyticsTree', path: ["-1", $routeParams.id], forceReload: false });
});
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
angular.module("umbraco").controller("Analytics.CountryController",
function ($scope, $location, statsResource, settingsResource, assetsService) {
function ($scope, $location, $routeParams, statsResource, settingsResource, assetsService, navigationService) {

var profileID = "";

Expand Down Expand Up @@ -68,4 +68,6 @@
});
});
};

navigationService.syncTree({ tree: 'analyticsTree', path: ["-1", $routeParams.id], forceReload: false });
});
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
angular.module("umbraco").controller("Analytics.DeviceController",
function ($scope, $location, statsResource, settingsResource, localizationService) {
function ($scope, $location, $routeParams, statsResource, settingsResource, localizationService, navigationService) {

var profileID = "";

Expand Down Expand Up @@ -114,4 +114,6 @@

});
});

navigationService.syncTree({ tree: 'analyticsTree', path: ["-1", $routeParams.id], forceReload: false });
});
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
angular.module("umbraco").controller("Analytics.EcommerceController",
function ($scope, $location, statsResource, settingsResource) {
function ($scope, $location, $routeParams, statsResource, settingsResource, navigationService) {

var profileID = "";

Expand Down Expand Up @@ -94,4 +94,6 @@

});
});

navigationService.syncTree({ tree: 'analyticsTree', path: ["-1", $routeParams.id], forceReload: false });
});
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
angular.module("umbraco").controller("Analytics.KeywordController",
function ($scope, $location, statsResource, settingsResource) {
function ($scope, $location, $routeParams, statsResource, settingsResource, navigationService) {

var profileID = "";

Expand Down Expand Up @@ -43,4 +43,6 @@

});
});

navigationService.syncTree({ tree: 'analyticsTree', path: ["-1", $routeParams.id], forceReload: false });
});
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
angular.module("umbraco").controller("Analytics.LanguageController",
function ($scope, $location, statsResource, settingsResource) {
function ($scope, $location, $routeParams, statsResource, settingsResource, navigationService) {

var profileID = "";

Expand Down Expand Up @@ -41,4 +41,6 @@

});
});

navigationService.syncTree({ tree: 'analyticsTree', path: ["-1", $routeParams.id], forceReload: false });
});
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
angular.module("umbraco").controller("Analytics.OSController",
function ($scope, $location, statsResource, settingsResource, localizationService) {
function ($scope, $location, $routeParams, statsResource, settingsResource, localizationService, navigationService) {

var profileID = "";

Expand Down Expand Up @@ -113,4 +113,6 @@

});
});

navigationService.syncTree({ tree: 'analyticsTree', path: ["-1", $routeParams.id], forceReload: false });
});
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
angular.module("umbraco").controller("Analytics.PageViewsController",
function ($scope, $location, statsResource, settingsResource, dateRangeService, localizationService) {
function ($scope, $location, $routeParams, statsResource, settingsResource, dateRangeService, localizationService, navigationService) {

var profileID = "";

Expand Down Expand Up @@ -114,4 +114,6 @@

});
});

navigationService.syncTree({ tree: 'analyticsTree', path: ["-1", $routeParams.id], forceReload: false });
});
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
angular.module("umbraco").controller("Analytics.ProductPerformanceController",
function ($scope, $location, statsResource, settingsResource, localizationService) {
function ($scope, $location, $routeParams, statsResource, settingsResource, localizationService, navigationService) {

var profileID = "";

Expand Down Expand Up @@ -96,4 +96,7 @@

});
});

// todo: possible to find "ecommerce" alias dynamic? "ecommerce" is parent tree alias
navigationService.syncTree({ tree: 'analyticsTree', path: ["-1", "ecommerce", $routeParams.id], forceReload: false });
});
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
angular.module("umbraco").controller("Analytics.SalesPerformanceController",
function ($scope, $location, statsResource, settingsResource, localizationService) {
function ($scope, $location, $routeParams, statsResource, settingsResource, localizationService, navigationService) {

var profileID = "";

Expand Down Expand Up @@ -96,4 +96,7 @@

});
});

// todo: possible to find "ecommerce" alias dynamic? "ecommerce" is parent tree alias
navigationService.syncTree({ tree: 'analyticsTree', path: ["-1", "ecommerce", $routeParams.id], forceReload: false });
});
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
angular.module("umbraco").controller("Analytics.ScreenResController",
function ($scope, $location, statsResource, settingsResource) {
function ($scope, $location, $routeParams, statsResource, settingsResource, navigationService) {

var profileID = "";

Expand Down Expand Up @@ -40,4 +40,6 @@
});
});
});

navigationService.syncTree({ tree: 'analyticsTree', path: ["-1", $routeParams.id], forceReload: false });
});
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
angular.module("umbraco").controller("Analytics.SettingsController",
function ($scope, settingsResource, notificationsService, localizationService, navigationService) {
function ($scope, $routeParams, settingsResource, notificationsService, localizationService, navigationService) {

//By default user has not authorised
var hasUserAuthd = false;
Expand Down Expand Up @@ -43,8 +43,7 @@

//Only load/fetch if showAuth is true
if (hasUserAuthd === true) {

console.log("get accounts");

//Get all accounts via settingsResource - does WebAPI GET call
settingsResource.getaccounts().then(function (response) {
$scope.accounts = response.data;
Expand All @@ -64,8 +63,6 @@

//When an account is selected
$scope.accountSelected = function (selectedAccount) {
console.log(selectedAccount);

settingsResource.getprofiles(selectedAccount.Id).then(function (response) {
$scope.profiles = response.data;
});
Expand Down Expand Up @@ -109,9 +106,10 @@
notificationsService.success(localizationService.localize("analytics_profileDetailsSaved"));

//Sync ('refresh') the tree!
navigationService.syncTree({ tree: 'analyticsTree', path: [-1, -1], forceReload: true, activate: true });
navigationService.syncTree({ tree: 'analyticsTree', path: [-1, $routeParams.id], forceReload: true, activate: true });
});

};

navigationService.syncTree({ tree: 'analyticsTree', path: ["-1", $routeParams.id], forceReload: false });
});
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
angular.module("umbraco").controller("Analytics.SocialController",
function ($scope, $location, statsResource, settingsResource, localizationService) {
function ($scope, $location, $routeParams, statsResource, settingsResource, localizationService, navigationService) {

var profileID = "";

Expand Down Expand Up @@ -92,4 +92,6 @@
});
});
});

navigationService.syncTree({ tree: 'analyticsTree', path: ["-1", $routeParams.id], forceReload: false });
});
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
angular.module("umbraco").controller("Analytics.TransactionController",
function ($scope, $location, statsResource, settingsResource, localizationService) {
function ($scope, $location, $routeParams, statsResource, settingsResource, localizationService, navigationService) {

var profileID = "";

Expand Down Expand Up @@ -93,4 +93,7 @@

});
});

// todo: possible to find "ecommerce" alias dynamic? "ecommerce" is parent tree alias
navigationService.syncTree({ tree: 'analyticsTree', path: ["-1", "ecommerce", $routeParams.id], forceReload: false });
});