Skip to content

Commit

Permalink
1.46.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
baumandm committed Feb 1, 2017
1 parent 6c54dc1 commit 6cc73f2
Show file tree
Hide file tree
Showing 8 changed files with 94 additions and 30 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
# 1.46.0

## Features

## Bug Fixes

- Dashboard Analytics: Fixed inability to view analytics for dashboards requiring authentication, even when logged in

- Example example-datasource-json: Fixed broken weather API

- Upgraded two library versions to fix builds in Node v6+

# 1.45.0 (12/21/2016)

## Features
Expand Down
3 changes: 0 additions & 3 deletions cyclotron-site/app/scripts/common/app.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,6 @@ cyclotronApp.config ($stateProvider, $urlRouterProvider, $locationProvider, $con
resolve:
session: loadExistingSession
deps: lazyLoad ['/js/app.mgmt.js'], ['/css/app.mgmt.css']
dashboard: ['$q', '$stateParams', 'dashboardService', ($q, $stateParams, dashboardService) ->
dashboardService.getDashboard $stateParams.dashboardName
]
})
.state('export', {
url: '/export/{dashboardName:.*}'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ cyclotronServices.factory 'commonConfigService', ->

exports = {

version: '1.45.0'
version: '1.46.0'

logging:
enableDebug: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -291,14 +291,23 @@ cyclotronServices.factory 'dashboardService', ($http, $resource, $q, analyticsSe

return deferred.promise

service.getRevision = (dashboardName, rev, callback) ->
revisionResource.get {
service.getRevision = (dashboardName, rev) ->
deferred = $q.defer()

p = revisionResource.get({
name: dashboardName
rev: rev
session: userService.currentSession()?.key
}, (revision) ->
if _.isFunction callback
callback(revision)
}).$promise

p.then (revision) ->
deferred.resolve revision

p.catch (error) ->
alertify.error(error?.data || 'Cannot connect to cyclotron-svc (getRevision)', 2500)
deferred.reject error

return deferred.promise

service.like = (dashboard) ->
p = likesResource.save2({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,9 @@
#
# Analytics controller -- for Dashboard analytics
#
cyclotronApp.controller 'DashboardAnalyticsController', ($scope, dashboard, analyticsService, dashboardService) ->

$scope.dashboard = dashboard
$scope.dashboardId = dashboard._id

$scope.createdDate = '?'
$scope.lastModifiedDate = moment(dashboard.date).format('MM/DD HH:mm:ss')
$scope.longModifiedDate = moment(dashboard.date).format('MM/DD/YYYY HH:mm:ss')
cyclotronApp.controller 'DashboardAnalyticsController', ($scope, $stateParams, $uibModal, analyticsService, dashboardService) ->

$scope.dashboardName = $stateParams.dashboardName

$scope.pageViewsOptions =
x_accessor: 'date'
Expand Down Expand Up @@ -66,7 +60,7 @@ cyclotronApp.controller 'DashboardAnalyticsController', ($scope, dashboard, anal

# Analytics relative to a startDate
$scope.loadTimeseriesData = ->
return unless dashboard.visits > 0
return unless $scope.dashboard.visits > 0

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

# Initialize
dashboardService.getRevision dashboard.name, 1, (rev) ->
$scope.rev1 = rev
$scope.createdDate = moment(rev.date).format('MM/DD HH:mm:ss')
$scope.longCreatedDate = moment(rev.date).format('MM/DD/YYYY HH:mm:ss')

$scope.$watch 'selectedTimespan', (timespan) ->
$scope.loadTimeseriesData()
$scope.initialize = ->
q = dashboardService.getDashboard $scope.dashboardName
q.then (dashboard) ->

$scope.dashboard = dashboard
$scope.dashboardId = dashboard._id

$scope.createdDate = '?'
$scope.lastModifiedDate = moment(dashboard.date).format('MM/DD HH:mm:ss')
$scope.longModifiedDate = moment(dashboard.date).format('MM/DD/YYYY HH:mm:ss')

q2 = dashboardService.getRevision dashboard.name, 1

q2.then (rev) ->
$scope.rev1 = rev
$scope.createdDate = moment(rev.date).format('MM/DD HH:mm:ss')
$scope.longCreatedDate = moment(rev.date).format('MM/DD/YYYY HH:mm:ss')

# Add watcher on the timespan control
$scope.$watch 'selectedTimespan', (timespan) ->
$scope.loadTimeseriesData()

q.catch (error) ->
switch error.status
when 401
$scope.login(true).then ->
$scope.initialize()
return
when 403
$scope.dashboardEditors = error.data.data.editors
$scope.dashboardName = $scope.dashboardName

$uibModal.open {
templateUrl: '/partials/viewPermissionDenied.html'
scope: $scope
controller: 'GenericErrorModalController'
backdrop: 'static'
keyboard: false
}
when 404
$uibModal.open {
templateUrl: '/partials/404.html'
scope: $scope
controller: 'GenericErrorModalController'
backdrop: 'static'
keyboard: false
}
else

$uibModal.open {
templateUrl: '/partials/500.html'
scope: $scope
controller: 'GenericErrorModalController'
backdrop: 'static'
keyboard: false
}

$scope.initialize()

3 changes: 2 additions & 1 deletion cyclotron-site/app/scripts/mgmt/controller.guiEditor.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,8 @@ cyclotronApp.controller 'GuiEditorController', ($scope, $state, $stateParams, $l
$scope.loadDashboard $scope.editor.cleanDashboardWrapper
$location.search('rev', null)
else
dashboardService.getRevision $stateParams.dashboardName, $scope.editor.revision, (dashboardWrapper) ->
q = dashboardService.getRevision $stateParams.dashboardName, $scope.editor.revision
q.then (dashboardWrapper) ->
$scope.loadDashboard dashboardWrapper
$location.search('rev', $scope.editor.revision)

Expand Down
2 changes: 1 addition & 1 deletion cyclotron-site/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "cyclotron-site",
"description": "Cyclotron: website",
"version": "1.45.0",
"version": "1.46.0",
"author": "Dave Bauman <dbauman@expedia.com>",
"license": "MIT",
"private": true,
Expand Down
6 changes: 3 additions & 3 deletions cyclotron-svc/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "cyclotron-svc",
"description": "Cyclotron: REST API",
"version": "1.45.0",
"version": "1.46.0",
"author": "Dave Bauman <dbauman@expedia.com>",
"license": "MIT",
"private": true,
Expand All @@ -28,14 +28,14 @@
"json2csv": "^3.6.3",
"json2xls": "^0.1.2",
"jsondiffpatch": "0.1.41",
"ldapjs": "0.7.1",
"ldapjs": "1.0.1",
"lodash": "~4.14.1",
"moment": "~2.8.3",
"mongoose": "~4.5.1",
"morgan": "~1.5.3",
"node-uuid": "~1.4.3",
"passport": "~0.2.2",
"passport-ldapauth": "~0.3.0",
"passport-ldapauth": "1.0.0",
"request": "~2.39",
"serve-static": "~1.9.3",
"shortid": "2.0.0",
Expand Down

0 comments on commit 6cc73f2

Please sign in to comment.