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

Fixing a naming conflict, settingsResource collides with any plugin t… #57

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
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,7 +5,7 @@
app.requires.push('tableSort');

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

var profileID = "";

Expand All @@ -14,13 +14,13 @@ app.controller("Analytics.BrowserController",
$scope.itemSpecs = [];

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

$scope.$watch('dateFilter', function () {
$scope.loadingViews = true;
settingsResource.setDateFilter($scope.dateFilter.startDate, $scope.dateFilter.endDate);
analyticsSettingsResource.setDateFilter($scope.dateFilter.startDate, $scope.dateFilter.endDate);
//Get Profile
settingsResource.getprofile().then(function (response) {
analyticsSettingsResource.getprofile().then(function (response) {
$scope.profile = response.data;
profileID = response.data.Id;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
angular.module("umbraco").controller("Analytics.CountryController",
function ($scope, $location, $routeParams, statsResource, settingsResource, assetsService, navigationService) {
function ($scope, $location, $routeParams, statsResource, analyticsSettingsResource, assetsService, navigationService) {

var profileID = "";

Expand All @@ -17,18 +17,18 @@
});
});

$scope.dateFilter = settingsResource.getDateFilter();
$scope.dateFilter = analyticsSettingsResource.getDateFilter();

$scope.$watch('dateFilter', function() {

settingsResource.setDateFilter($scope.dateFilter.startDate, $scope.dateFilter.endDate);
analyticsSettingsResource.setDateFilter($scope.dateFilter.startDate, $scope.dateFilter.endDate);
initChart();
});

function initChart() {
$scope.loadingViews = true;
//Get Profile
settingsResource.getprofile().then(function(response) {
analyticsSettingsResource.getprofile().then(function(response) {
$scope.profile = response.data;
profileID = response.data.Id;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
angular.module("umbraco").controller("Analytics.DashboardController",
function ($scope, $location, statsResource, settingsResource, localizationService) {
function ($scope, $location, statsResource, analyticsSettingsResource, localizationService) {

var profileID = "";

Expand All @@ -22,7 +22,7 @@
$scope.dateFilter.startDate = moment().subtract('days', 6).format('YYYY-MM-DD');
$scope.dateFilter.endDate = moment().format('YYYY-MM-DD');

settingsResource.getprofile().then(function(response) {
analyticsSettingsResource.getprofile().then(function(response) {
$scope.profile = response.data;
profileID = response.data.Id;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
angular.module("umbraco").controller("Analytics.DeviceController",
function ($scope, $location, $routeParams, statsResource, settingsResource, localizationService, navigationService) {
function ($scope, $location, $routeParams, statsResource, analyticsSettingsResource, localizationService, navigationService) {

var profileID = "";

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

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

$scope.$watch('dateFilter', function () {
$scope.loadingViews = true;
settingsResource.setDateFilter($scope.dateFilter.startDate, $scope.dateFilter.endDate);
analyticsSettingsResource.setDateFilter($scope.dateFilter.startDate, $scope.dateFilter.endDate);

//Get Profile
settingsResource.getprofile().then(function(response) {
analyticsSettingsResource.getprofile().then(function(response) {
$scope.profile = response.data;
profileID = response.data.Id;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
angular.module("umbraco").controller("Analytics.EcommerceController",
function ($scope, $location, $routeParams, statsResource, settingsResource, navigationService) {
function ($scope, $location, $routeParams, statsResource, analyticsSettingsResource, navigationService) {

var profileID = "";

// items list array
$scope.itemProducts = [];
$scope.itemRevenuePerSource = [];

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

$scope.$watch('dateFilter', function () {
$scope.loadingViews = true;
settingsResource.setDateFilter($scope.dateFilter.startDate, $scope.dateFilter.endDate);
analyticsSettingsResource.setDateFilter($scope.dateFilter.startDate, $scope.dateFilter.endDate);

//Get Profile
settingsResource.getprofile().then(function (response) {
analyticsSettingsResource.getprofile().then(function (response) {
$scope.profile = response.data;
profileID = response.data.Id;
$scope.currencyCode = $scope.profile.Currency;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
angular.module("umbraco").controller("Analytics.KeywordController",
function ($scope, $location, $routeParams, statsResource, settingsResource, navigationService) {
function ($scope, $location, $routeParams, statsResource, analyticsSettingsResource, navigationService) {

var profileID = "";

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

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

$scope.$watch('dateFilter', function () {
$scope.loadingViews = true;
settingsResource.setDateFilter($scope.dateFilter.startDate, $scope.dateFilter.endDate);
analyticsSettingsResource.setDateFilter($scope.dateFilter.startDate, $scope.dateFilter.endDate);

//Get Profile
settingsResource.getprofile().then(function(response) {
analyticsSettingsResource.getprofile().then(function(response) {
$scope.profile = response.data;
profileID = response.data.Id;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
angular.module("umbraco").controller("Analytics.LanguageController",
function ($scope, $location, $routeParams, statsResource, settingsResource, navigationService) {
function ($scope, $location, $routeParams, statsResource, analyticsSettingsResource, navigationService) {

var profileID = "";

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

$scope.dateFilter = settingsResource.getDateFilter();
$scope.dateFilter = analyticsSettingsResource.getDateFilter();

$scope.$watch('dateFilter', function () {

settingsResource.setDateFilter($scope.dateFilter.startDate, $scope.dateFilter.endDate);
analyticsSettingsResource.setDateFilter($scope.dateFilter.startDate, $scope.dateFilter.endDate);
//Get Profile
settingsResource.getprofile().then(function(response) {
analyticsSettingsResource.getprofile().then(function(response) {
$scope.profile = response.data;
profileID = response.data.Id;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
angular.module("umbraco").controller("Analytics.OSController",
function ($scope, $location, $routeParams, statsResource, settingsResource, localizationService, navigationService) {
function ($scope, $location, $routeParams, statsResource, analyticsSettingsResource, localizationService, navigationService) {

var profileID = "";

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

$scope.dateFilter = settingsResource.getDateFilter();
$scope.dateFilter = analyticsSettingsResource.getDateFilter();

$scope.$watch('dateFilter', function () {

settingsResource.setDateFilter($scope.dateFilter.startDate, $scope.dateFilter.endDate);
analyticsSettingsResource.setDateFilter($scope.dateFilter.startDate, $scope.dateFilter.endDate);

//Get Profile
settingsResource.getprofile().then(function(response) {
analyticsSettingsResource.getprofile().then(function(response) {
$scope.profile = response.data;
profileID = response.data.Id;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
angular.module("umbraco").controller("Analytics.PageViewsController",
function ($scope, $location, $routeParams, statsResource, settingsResource, dateRangeService, localizationService, navigationService) {
function ($scope, $location, $routeParams, statsResource, analyticsSettingsResource, dateRangeService, localizationService, navigationService) {

var profileID = "";

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

$scope.dateFilter = settingsResource.getDateFilter();
$scope.dateFilter = analyticsSettingsResource.getDateFilter();

$scope.$watch('dateFilter', function () {

settingsResource.setDateFilter($scope.dateFilter.startDate, $scope.dateFilter.endDate);
analyticsSettingsResource.setDateFilter($scope.dateFilter.startDate, $scope.dateFilter.endDate);

//Get Profile
settingsResource.getprofile().then(function (response) {
analyticsSettingsResource.getprofile().then(function (response) {
$scope.profile = response.data;
profileID = response.data.Id;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
angular.module("umbraco").controller("Analytics.ProductPerformanceController",
function ($scope, $location, $routeParams, statsResource, settingsResource, localizationService, navigationService) {
function ($scope, $location, $routeParams, statsResource, analyticsSettingsResource, localizationService, navigationService) {

var profileID = "";

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

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

$scope.$watch('dateFilter', function () {
$scope.loadingViews = true;
settingsResource.setDateFilter($scope.dateFilter.startDate, $scope.dateFilter.endDate);
analyticsSettingsResource.setDateFilter($scope.dateFilter.startDate, $scope.dateFilter.endDate);

//Get Profile
settingsResource.getprofile().then(function (response) {
analyticsSettingsResource.getprofile().then(function (response) {
$scope.profile = response.data;
profileID = response.data.Id;
$scope.currencyCode = $scope.profile.Currency;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
angular.module("umbraco").controller("Analytics.SalesPerformanceController",
function ($scope, $location, $routeParams, statsResource, settingsResource, localizationService, navigationService) {
function ($scope, $location, $routeParams, statsResource, analyticsSettingsResource, localizationService, navigationService) {

var profileID = "";

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

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

$scope.$watch('dateFilter', function () {
$scope.loadingViews = true;
settingsResource.setDateFilter($scope.dateFilter.startDate, $scope.dateFilter.endDate);
analyticsSettingsResource.setDateFilter($scope.dateFilter.startDate, $scope.dateFilter.endDate);

//Get Profile
settingsResource.getprofile().then(function (response) {
analyticsSettingsResource.getprofile().then(function (response) {
$scope.profile = response.data;
profileID = response.data.Id;
$scope.currencyCode = $scope.profile.Currency;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
angular.module("umbraco").controller("Analytics.ScreenResController",
function ($scope, $location, $routeParams, statsResource, settingsResource, navigationService) {
function ($scope, $location, $routeParams, statsResource, analyticsSettingsResource, navigationService) {

var profileID = "";

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

$scope.dateFilter = settingsResource.getDateFilter();
$scope.dateFilter = analyticsSettingsResource.getDateFilter();

$scope.$watch('dateFilter', function () {

settingsResource.setDateFilter($scope.dateFilter.startDate, $scope.dateFilter.endDate);
analyticsSettingsResource.setDateFilter($scope.dateFilter.startDate, $scope.dateFilter.endDate);

//Get Profile
settingsResource.getprofile().then(function(response) {
analyticsSettingsResource.getprofile().then(function(response) {
$scope.profile = response.data;
profileID = response.data.Id;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
angular.module("umbraco").controller("Analytics.SettingsController",
function ($scope, $routeParams, settingsResource, notificationsService, localizationService, navigationService) {
function ($scope, $routeParams, analyticsSettingsResource, notificationsService, localizationService, navigationService) {

//By default user has not authorised
var hasUserAuthd = false;

//Get all settings via settingsResource - does WebAPI GET call
settingsResource.getall().then(function (response) {
//Get all settings via analyticsSettingsResource - does WebAPI GET call
analyticsSettingsResource.getall().then(function (response) {
$scope.settings = response.data;
});

//Get Account JSON & bind back to dropdown
settingsResource.getaccount().then(function (response) {
analyticsSettingsResource.getaccount().then(function (response) {
if (response.data === "null") {
$scope.selectedaccount = null;
}
Expand All @@ -20,7 +20,7 @@
});

//Get Profile JSON & bind back to dropdown
settingsResource.getprofile().then(function (response) {
analyticsSettingsResource.getprofile().then(function (response) {
if (response.data === "null") {
$scope.selectedprofile = null;
}
Expand All @@ -31,7 +31,7 @@


//Get oAuth Check - WebAPI GET (Basically checks if RefreshToken has a value)
settingsResource.checkauth().then(function (response) {
analyticsSettingsResource.checkauth().then(function (response) {

//Show or hide the auth button (set on scope & local var for if check)
hasUserAuthd = response.data === "true";
Expand All @@ -44,14 +44,14 @@
//Only load/fetch if showAuth is true
if (hasUserAuthd === true) {

//Get all accounts via settingsResource - does WebAPI GET call
settingsResource.getaccounts().then(function (response) {
//Get all accounts via analyticsSettingsResource - does WebAPI GET call
analyticsSettingsResource.getaccounts().then(function (response) {
$scope.accounts = response.data;

if ($scope.selectedaccount != null) {
$scope.selectedaccount = _.where($scope.accounts, { Id: $scope.selectedaccount.Id })[0];

settingsResource.getprofiles($scope.selectedaccount.Id).then(function (response) {
analyticsSettingsResource.getprofiles($scope.selectedaccount.Id).then(function (response) {
$scope.profiles = response.data;
if ($scope.selectedprofile != null) {
$scope.selectedprofile = _.where($scope.profiles, { Id: $scope.selectedprofile.Id })[0];
Expand All @@ -63,7 +63,7 @@

//When an account is selected
$scope.accountSelected = function (selectedAccount) {
settingsResource.getprofiles(selectedAccount.Id).then(function (response) {
analyticsSettingsResource.getprofiles(selectedAccount.Id).then(function (response) {
$scope.profiles = response.data;
});
};
Expand All @@ -83,23 +83,23 @@
$scope.save = function (settings, account, profile) {

//Save settings resource - does a WebAPI POST call
settingsResource.save(settings).then(function (response) {
analyticsSettingsResource.save(settings).then(function (response) {
$scope.settings = response.data;

//Display Success message
notificationsService.success(localizationService.localize("analytics_settingsSaved"));
});

//Save settings resource - does a WebAPI POST call
settingsResource.saveAccount(account).then(function (response) {
analyticsSettingsResource.saveAccount(account).then(function (response) {
//Don't need anything from response.data back

//Display Success message
notificationsService.success(localizationService.localize("analytics_accountDetailsSaved"));
});

//Save settings resource - does a WebAPI POST call
settingsResource.saveProfile(profile).then(function (response) {
analyticsSettingsResource.saveProfile(profile).then(function (response) {
//Don't need anything from response.data back

//Display Success message
Expand Down
Loading