Skip to content

Commit eaffc31

Browse files
author
Tim Geyssens
committed
Fixes dropdown selection on settings view
1 parent 58fb77d commit eaffc31

File tree

7 files changed

+361
-4
lines changed

7 files changed

+361
-4
lines changed

Analytics.Site/App_Data/Logs/UmbracoTraceLog.txt

Lines changed: 314 additions & 0 deletions
Large diffs are not rendered by default.

Analytics.Site/App_Data/Umbraco.sdf

0 Bytes
Binary file not shown.
Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,6 @@
1-

1+
{
2+
"Id": "4113171",
3+
"Name": "www.nibble.be",
4+
"Created": "2008-04-13T14:26:12+02:00",
5+
"Updated": "2011-07-20T00:58:59.981+02:00"
6+
}

Analytics.Site/App_Plugins/Analytics/backOffice/AnalyticsTree/controllers/Settings.Controller.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,24 @@
4545
//Only load/fetch if showAuth is true
4646
if (hasUserAuthd === true) {
4747

48+
console.log("get accounts");
4849
//Get all accounts via settingsResource - does WebAPI GET call
4950
settingsResource.getaccounts().then(function (response) {
5051
$scope.accounts = response.data;
52+
53+
if ($scope.selectedaccount != null) {
54+
$scope.selectedaccount = _.where($scope.accounts, { Id: $scope.selectedaccount.Id })[0];
55+
56+
settingsResource.getprofiles($scope.selectedaccount.Id).then(function (response) {
57+
$scope.profiles = response.data;
58+
if ($scope.selectedprofile != null) {
59+
$scope.selectedprofile = _.where($scope.profiles, { Id: $scope.selectedprofile.Id })[0];
60+
}
61+
});
62+
}
5163
});
5264

65+
5366
//When an account is selected
5467
$scope.accountSelected = function (selectedAccount) {
5568
console.log(selectedAccount);
Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,13 @@
1-

1+
{
2+
"Id": "8245037",
3+
"AccountId": "4113171",
4+
"WebPropertyId": "UA-4113171-1",
5+
"InternalWebPropertyId": "7923617",
6+
"Name": "www.nibble.be",
7+
"Currency": "USD",
8+
"Timezone": "Europe/Brussels",
9+
"WebsiteUrl": "www.nibble.be",
10+
"Type": "WEB",
11+
"Created": "2008-04-13T14:26:12+02:00",
12+
"Updated": "2011-09-20T09:34:04.996+02:00"
13+
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
<?xml version="1.0" encoding="utf-8" ?>
1+
<?xml version="1.0" encoding="utf-8"?>
22
<Analytics>
33
<ClientId label="Client ID" description="This is the Client ID key from the Google API">206456221167-1a6npdlit92260gfaekomgon8cm0ratg</ClientId>
44
<ClientSecret label="Client Secret" description="This is the Client Secret from the Google API">_LklwvmJC0EIkEprcRB4keQ_</ClientSecret>
5-
<RefreshToken label="Refresh Token" description="The refresh token used to acquire new access tokens. This is sensitive information."></RefreshToken>
5+
<RefreshToken label="Refresh Token" description="The refresh token used to acquire new access tokens. This is sensitive information.">1/8T0O1zrI2lVG7exZzmvUMlhNQPbN7NL2Tp6ijimsCvo</RefreshToken>
66
</Analytics>

Analytics/App_Plugins/Analytics/backOffice/AnalyticsTree/controllers/Settings.Controller.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,24 @@
4545
//Only load/fetch if showAuth is true
4646
if (hasUserAuthd === true) {
4747

48+
console.log("get accounts");
4849
//Get all accounts via settingsResource - does WebAPI GET call
4950
settingsResource.getaccounts().then(function (response) {
5051
$scope.accounts = response.data;
52+
53+
if ($scope.selectedaccount != null) {
54+
$scope.selectedaccount = _.where($scope.accounts, { Id: $scope.selectedaccount.Id })[0];
55+
56+
settingsResource.getprofiles($scope.selectedaccount.Id).then(function (response) {
57+
$scope.profiles = response.data;
58+
if ($scope.selectedprofile != null) {
59+
$scope.selectedprofile = _.where($scope.profiles, { Id: $scope.selectedprofile.Id })[0];
60+
}
61+
});
62+
}
5163
});
5264

65+
5366
//When an account is selected
5467
$scope.accountSelected = function (selectedAccount) {
5568
console.log(selectedAccount);

0 commit comments

Comments
 (0)