Skip to content

Commit 6cc73f2

Browse files
committed
1.46.0 release
1 parent 6c54dc1 commit 6cc73f2

File tree

8 files changed

+94
-30
lines changed

8 files changed

+94
-30
lines changed

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
# 1.46.0
2+
3+
## Features
4+
5+
## Bug Fixes
6+
7+
- Dashboard Analytics: Fixed inability to view analytics for dashboards requiring authentication, even when logged in
8+
9+
- Example example-datasource-json: Fixed broken weather API
10+
11+
- Upgraded two library versions to fix builds in Node v6+
12+
113
# 1.45.0 (12/21/2016)
214

315
## Features

cyclotron-site/app/scripts/common/app.coffee

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -179,9 +179,6 @@ cyclotronApp.config ($stateProvider, $urlRouterProvider, $locationProvider, $con
179179
resolve:
180180
session: loadExistingSession
181181
deps: lazyLoad ['/js/app.mgmt.js'], ['/css/app.mgmt.css']
182-
dashboard: ['$q', '$stateParams', 'dashboardService', ($q, $stateParams, dashboardService) ->
183-
dashboardService.getDashboard $stateParams.dashboardName
184-
]
185182
})
186183
.state('export', {
187184
url: '/export/{dashboardName:.*}'

cyclotron-site/app/scripts/common/services/services.commonConfigService.coffee

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ cyclotronServices.factory 'commonConfigService', ->
3939

4040
exports = {
4141

42-
version: '1.45.0'
42+
version: '1.46.0'
4343

4444
logging:
4545
enableDebug: false

cyclotron-site/app/scripts/common/services/services.dashboardService.coffee

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -291,14 +291,23 @@ cyclotronServices.factory 'dashboardService', ($http, $resource, $q, analyticsSe
291291

292292
return deferred.promise
293293

294-
service.getRevision = (dashboardName, rev, callback) ->
295-
revisionResource.get {
294+
service.getRevision = (dashboardName, rev) ->
295+
deferred = $q.defer()
296+
297+
p = revisionResource.get({
296298
name: dashboardName
297299
rev: rev
298300
session: userService.currentSession()?.key
299-
}, (revision) ->
300-
if _.isFunction callback
301-
callback(revision)
301+
}).$promise
302+
303+
p.then (revision) ->
304+
deferred.resolve revision
305+
306+
p.catch (error) ->
307+
alertify.error(error?.data || 'Cannot connect to cyclotron-svc (getRevision)', 2500)
308+
deferred.reject error
309+
310+
return deferred.promise
302311

303312
service.like = (dashboard) ->
304313
p = likesResource.save2({

cyclotron-site/app/scripts/mgmt/controller.dashboardAnalytics.coffee

Lines changed: 61 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,9 @@
1717
#
1818
# Analytics controller -- for Dashboard analytics
1919
#
20-
cyclotronApp.controller 'DashboardAnalyticsController', ($scope, dashboard, analyticsService, dashboardService) ->
21-
22-
$scope.dashboard = dashboard
23-
$scope.dashboardId = dashboard._id
24-
25-
$scope.createdDate = '?'
26-
$scope.lastModifiedDate = moment(dashboard.date).format('MM/DD HH:mm:ss')
27-
$scope.longModifiedDate = moment(dashboard.date).format('MM/DD/YYYY HH:mm:ss')
20+
cyclotronApp.controller 'DashboardAnalyticsController', ($scope, $stateParams, $uibModal, analyticsService, dashboardService) ->
2821

22+
$scope.dashboardName = $stateParams.dashboardName
2923

3024
$scope.pageViewsOptions =
3125
x_accessor: 'date'
@@ -66,7 +60,7 @@ cyclotronApp.controller 'DashboardAnalyticsController', ($scope, dashboard, anal
6660

6761
# Analytics relative to a startDate
6862
$scope.loadTimeseriesData = ->
69-
return unless dashboard.visits > 0
63+
return unless $scope.dashboard.visits > 0
7064

7165
timeSpan = $scope.selectedTimespan.split('_')
7266
if timeSpan.length == 1 then timeSpan.unshift 1
@@ -112,11 +106,62 @@ cyclotronApp.controller 'DashboardAnalyticsController', ($scope, dashboard, anal
112106
$scope.visits = visits
113107

114108
# Initialize
115-
dashboardService.getRevision dashboard.name, 1, (rev) ->
116-
$scope.rev1 = rev
117-
$scope.createdDate = moment(rev.date).format('MM/DD HH:mm:ss')
118-
$scope.longCreatedDate = moment(rev.date).format('MM/DD/YYYY HH:mm:ss')
119-
120-
$scope.$watch 'selectedTimespan', (timespan) ->
121-
$scope.loadTimeseriesData()
109+
$scope.initialize = ->
110+
q = dashboardService.getDashboard $scope.dashboardName
111+
q.then (dashboard) ->
112+
113+
$scope.dashboard = dashboard
114+
$scope.dashboardId = dashboard._id
115+
116+
$scope.createdDate = '?'
117+
$scope.lastModifiedDate = moment(dashboard.date).format('MM/DD HH:mm:ss')
118+
$scope.longModifiedDate = moment(dashboard.date).format('MM/DD/YYYY HH:mm:ss')
119+
120+
q2 = dashboardService.getRevision dashboard.name, 1
121+
122+
q2.then (rev) ->
123+
$scope.rev1 = rev
124+
$scope.createdDate = moment(rev.date).format('MM/DD HH:mm:ss')
125+
$scope.longCreatedDate = moment(rev.date).format('MM/DD/YYYY HH:mm:ss')
126+
127+
# Add watcher on the timespan control
128+
$scope.$watch 'selectedTimespan', (timespan) ->
129+
$scope.loadTimeseriesData()
130+
131+
q.catch (error) ->
132+
switch error.status
133+
when 401
134+
$scope.login(true).then ->
135+
$scope.initialize()
136+
return
137+
when 403
138+
$scope.dashboardEditors = error.data.data.editors
139+
$scope.dashboardName = $scope.dashboardName
140+
141+
$uibModal.open {
142+
templateUrl: '/partials/viewPermissionDenied.html'
143+
scope: $scope
144+
controller: 'GenericErrorModalController'
145+
backdrop: 'static'
146+
keyboard: false
147+
}
148+
when 404
149+
$uibModal.open {
150+
templateUrl: '/partials/404.html'
151+
scope: $scope
152+
controller: 'GenericErrorModalController'
153+
backdrop: 'static'
154+
keyboard: false
155+
}
156+
else
157+
158+
$uibModal.open {
159+
templateUrl: '/partials/500.html'
160+
scope: $scope
161+
controller: 'GenericErrorModalController'
162+
backdrop: 'static'
163+
keyboard: false
164+
}
165+
166+
$scope.initialize()
122167

cyclotron-site/app/scripts/mgmt/controller.guiEditor.coffee

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,8 @@ cyclotronApp.controller 'GuiEditorController', ($scope, $state, $stateParams, $l
157157
$scope.loadDashboard $scope.editor.cleanDashboardWrapper
158158
$location.search('rev', null)
159159
else
160-
dashboardService.getRevision $stateParams.dashboardName, $scope.editor.revision, (dashboardWrapper) ->
160+
q = dashboardService.getRevision $stateParams.dashboardName, $scope.editor.revision
161+
q.then (dashboardWrapper) ->
161162
$scope.loadDashboard dashboardWrapper
162163
$location.search('rev', $scope.editor.revision)
163164

cyclotron-site/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "cyclotron-site",
33
"description": "Cyclotron: website",
4-
"version": "1.45.0",
4+
"version": "1.46.0",
55
"author": "Dave Bauman <dbauman@expedia.com>",
66
"license": "MIT",
77
"private": true,

cyclotron-svc/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "cyclotron-svc",
33
"description": "Cyclotron: REST API",
4-
"version": "1.45.0",
4+
"version": "1.46.0",
55
"author": "Dave Bauman <dbauman@expedia.com>",
66
"license": "MIT",
77
"private": true,
@@ -28,14 +28,14 @@
2828
"json2csv": "^3.6.3",
2929
"json2xls": "^0.1.2",
3030
"jsondiffpatch": "0.1.41",
31-
"ldapjs": "0.7.1",
31+
"ldapjs": "1.0.1",
3232
"lodash": "~4.14.1",
3333
"moment": "~2.8.3",
3434
"mongoose": "~4.5.1",
3535
"morgan": "~1.5.3",
3636
"node-uuid": "~1.4.3",
3737
"passport": "~0.2.2",
38-
"passport-ldapauth": "~0.3.0",
38+
"passport-ldapauth": "1.0.0",
3939
"request": "~2.39",
4040
"serve-static": "~1.9.3",
4141
"shortid": "2.0.0",

0 commit comments

Comments
 (0)