Skip to content

Commit df26fc4

Browse files
committed
1.40.0 release
1 parent 6aa99e4 commit df26fc4

20 files changed

+112
-75
lines changed

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
# 1.40.0 (10/12/2016)
2+
3+
## Features
4+
5+
- Analytics: collect new analytics events for: Login, Logout, Create Dashboard, Modify Dashboard, Push Dashboard
6+
7+
- Dashboard Sidebar: Increased width of sidebar; expanded the first section in the sidebar initially.
8+
9+
- Dashboard Editor: Drag-and-drop to reorder Data Sources, Pages, Widgets, etc.
10+
11+
- Dashboard Editor: Added spinner when saving a Dashboard; prevent accidentally double-saving
12+
113
# 1.39.0 (09/28/2016)
214

315
## Features

cyclotron-site/app/partials/dashboardSidebar.jade

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@
2222

2323
.sidebar-accordion
2424

25-
accordion-group(ng-repeat='content in dashboard.sidebar.sidebarContent track by $index', heading='{{ content.heading }}')
25+
accordion-group(ng-repeat='content in sidebarContent track by $index', heading='{{ content.heading }}', is-open='content.isOpen')
2626
div(ng-bind-html='trustHtml(content.html)')
2727

28-
accordion-group.show-hide-widgets(heading='Show/Hide Widgets', ng-if='dashboard.sidebar.showHideWidgets == true')
28+
accordion-group.show-hide-widgets(heading='Show/Hide Widgets', ng-if='dashboard.sidebar.showHideWidgets == true', is-open='isShowHideWidgetsOpen')
2929

3030
ul.widget-list(dnd-list='calculatedWidgets')
3131
li(ng-repeat='widget in calculatedWidgets',

cyclotron-site/app/partials/editor/guiEditor.jade

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
.dashboard-well
66
.button-bar(ng-if='editor.initialized')
77
button.btn(ng-class='{"btn-default": !canSave(), "btn-success": canSave()}', ng-click='save()')
8-
i.fa.fa-check-square-o
8+
i.fa.fa-check-square-o(ng-hide='isSaving')
9+
span(ng-show='isSaving')
10+
i.fa.fa-cog.fa-spin
911
| Save
1012

1113
.btn-group(uib-dropdown, ng-if='canPreview()')

cyclotron-site/app/partials/editor/objectArray.jade

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
div
2-
ul.list-group
3-
li.list-group-item(ng-repeat='item in model')
2+
ul.list-group(dnd-list='model')
3+
li.list-group-item(ng-repeat='item in model',
4+
dnd-draggable='item'
5+
dnd-moved='model.splice($index, 1)'
6+
dnd-effect-allowed='move')
47

58
.clearfix
9+
span.icon
10+
i.fa.fa-bars
11+
612
span.object-array-name(ng-click='goToSubState(substate, item, $index)', title='Edit this {{ label }}')
713
| {{ headingfn({item: item, index: $index, label: label}) }}
814

915
span.button-group.pull-right
10-
button#move-up.btn.btn-default(type='button', ng-click='moveUp($index)', title='Move {{ label }} Up')
11-
i.fa.fa-angle-double-up
12-
13-
button#move-down.btn.btn-default(type='button', ng-click='moveDown($index)', title='Move {{ label }} Down')
14-
i.fa.fa-angle-double-down
1516

1617
button#clone.btn.btn-default(type='button', ng-click='cloneItem($index)', title='Clone {{ label }}')
1718
i.fa.fa-copy

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ cyclotronApp.config ($stateProvider, $urlRouterProvider, $locationProvider, $con
313313
}
314314
$locationProvider.hashPrefix = '!'
315315

316-
cyclotronApp.run ($rootScope, $urlRouter, $location, $state, $stateParams, $uibModal, configService, userService) ->
316+
cyclotronApp.run ($rootScope, $urlRouter, $location, $state, $stateParams, $uibModal, analyticsService, configService, userService) ->
317317

318318
#
319319
# Authentication-related scope variables
@@ -338,6 +338,12 @@ cyclotronApp.run ($rootScope, $urlRouter, $location, $state, $stateParams, $uibM
338338

339339
$rootScope.logout = userService.logout
340340

341+
$rootScope.$on 'login', (event) ->
342+
analyticsService.recordEvent 'login', { }
343+
344+
$rootScope.$on 'logout', (event) ->
345+
analyticsService.recordEvent 'logout', { }
346+
341347
$rootScope.userTooltip = ->
342348
return '' unless userService.authEnabled
343349
'Logged In: ' + userService.currentUser().name

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

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

2727
exports = {
2828

29-
version: '1.39.0'
29+
version: '1.40.0'
3030

3131
logging:
3232
enableDebug: false

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

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -135,11 +135,11 @@ cyclotronServices.factory 'dashboardService', ($http, $resource, $q, analyticsSe
135135
p = dashboardResource.query({ q: query }).$promise
136136

137137
p.then (dashboards) ->
138-
deferred.resolve(dashboards)
138+
deferred.resolve dashboards
139139

140140
p.catch (error) ->
141141
alertify.error(error?.data || 'Cannot connect to cyclotron-svc (getDashboards)', 2500)
142-
deferred.reject(error)
142+
deferred.reject error
143143

144144
return deferred.promise
145145

@@ -160,10 +160,10 @@ cyclotronServices.factory 'dashboardService', ($http, $resource, $q, analyticsSe
160160
).$promise
161161

162162
p.then (dashboard) ->
163-
deferred.resolve(dashboard)
163+
deferred.resolve dashboard
164164

165165
p.catch (error) ->
166-
deferred.reject(error)
166+
deferred.reject error
167167

168168
return deferred.promise
169169

@@ -174,6 +174,7 @@ cyclotronServices.factory 'dashboardService', ($http, $resource, $q, analyticsSe
174174
p = dashboardResource.save({ session: userService.currentSession()?.key }, dashboard).$promise
175175

176176
p.then ->
177+
analyticsService.recordEvent 'createDashboard', { dashboardName: dashboard.name }
177178
alertify.log('Created Dashboard', 2500)
178179
deferred.resolve()
179180

@@ -184,7 +185,7 @@ cyclotronServices.factory 'dashboardService', ($http, $resource, $q, analyticsSe
184185
userService.setLoggedOut()
185186
else
186187
alertify.error(error.data, 2500)
187-
deferred.reject(error)
188+
deferred.reject error
188189

189190
if userService.hasEditPermission(dashboard)
190191
doSave()
@@ -208,7 +209,8 @@ cyclotronServices.factory 'dashboardService', ($http, $resource, $q, analyticsSe
208209
}, dashboard).$promise
209210

210211
p.then ->
211-
alertify.log("Saved Dashboard", 2500)
212+
analyticsService.recordEvent 'modifyDashboard', { dashboardName: dashboard.name, rev: dashboard.rev }
213+
alertify.log 'Saved Dashboard', 2500
212214
deferred.resolve()
213215

214216
p.catch (error) ->
@@ -218,10 +220,10 @@ cyclotronServices.factory 'dashboardService', ($http, $resource, $q, analyticsSe
218220
alertify.error('Dashboard not saved')
219221
userService.setLoggedOut()
220222
when 403
221-
alertify.error("You don't have permission to edit this Dashboard")
223+
alertify.error('You don\'t have permission to edit this Dashboard')
222224
else
223225
alertify.error(error.data, 2500)
224-
deferred.reject(error)
226+
deferred.reject error
225227

226228
if userService.hasEditPermission(dashboard)
227229
doUpdate()
@@ -231,7 +233,7 @@ cyclotronServices.factory 'dashboardService', ($http, $resource, $q, analyticsSe
231233
if e
232234
doUpdate()
233235
else
234-
deferred.reject('Cancelled')
236+
deferred.reject 'Cancelled'
235237

236238
return deferred.promise
237239

@@ -244,8 +246,9 @@ cyclotronServices.factory 'dashboardService', ($http, $resource, $q, analyticsSe
244246
}).$promise
245247

246248
p.then (dashboard) ->
249+
analyticsService.recordEvent 'deleteDashboard', { dashboardName: dashboard.name }
247250
alertify.log('Deleted Dashboard', 2500)
248-
deferred.resolve(dashboard)
251+
deferred.resolve dashboard
249252

250253
p.catch (error) ->
251254
switch error.status
@@ -257,7 +260,7 @@ cyclotronServices.factory 'dashboardService', ($http, $resource, $q, analyticsSe
257260
alertify.error("You don't have permission to delete this Dashboard")
258261
else
259262
alertify.error(error.data, 2500)
260-
deferred.reject(error)
263+
deferred.reject error
261264

262265
return deferred.promise
263266

@@ -267,11 +270,11 @@ cyclotronServices.factory 'dashboardService', ($http, $resource, $q, analyticsSe
267270
p = revisionsResource.query({name: dashboardName}).$promise
268271

269272
p.then (dashboards) ->
270-
deferred.resolve(dashboards)
273+
deferred.resolve dashboards
271274

272275
p.catch (error) ->
273276
alertify.error(error?.data || 'Cannot connect to cyclotron-svc (getRevisions)', 2500)
274-
deferred.reject(error)
277+
deferred.reject error
275278

276279
return deferred.promise
277280

@@ -281,10 +284,10 @@ cyclotronServices.factory 'dashboardService', ($http, $resource, $q, analyticsSe
281284
url = configService.restServiceUrl + '/dashboards/' + dashboardName + '/revisions/' + rev1 + '/diff/' + rev2
282285
$http.get(url).then (response) ->
283286
# Returns formatted HTML diff
284-
deferred.resolve(response.data)
287+
deferred.resolve response.data
285288
.catch (error) ->
286289
alertify.error(error?.data || 'Cannot connect to cyclotron-svc (getRevisionDiff)', 2500)
287-
deferred.reject(error)
290+
deferred.reject error
288291

289292
return deferred.promise
290293

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
# language governing permissions and limitations under the License.
1515
###
1616

17-
cyclotronServices.factory 'userService', ($http, $q, $localForage, configService, logService) ->
17+
cyclotronServices.factory 'userService', ($http, $localForage, $q, $rootScope, configService, logService) ->
1818

1919
loggedIn = false
2020
currentSession = null
@@ -93,6 +93,8 @@ cyclotronServices.factory 'userService', ($http, $q, $localForage, configService
9393
exports.cachedUserId = session.user._id
9494

9595
loggedIn = true
96+
97+
$rootScope.$broadcast 'login', { }
9698
alertify.success('Logged in as <strong>' + session.user.name + '</strong>', 2500)
9799

98100
deferred.resolve(session)
@@ -145,6 +147,7 @@ cyclotronServices.factory 'userService', ($http, $q, $localForage, configService
145147
exports.setLoggedOut()
146148
$localForage.removeItem('session')
147149

150+
$rootScope.$broadcast('logout')
148151
alertify.log('Logged Out', 2500)
149152
deferred.resolve()
150153

cyclotron-site/app/scripts/dashboards/directives/directives.dashboardSidebar.coffee

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ cyclotronDirectives.directive 'dashboardSidebar', ($timeout, layoutService) ->
2020
link: (scope, element, attrs) ->
2121
# Initial position
2222
isSidebarExpanded = false
23+
24+
scope.sidebarContent = _.cloneDeep scope.dashboard.sidebar.sidebarContent
25+
if scope.sidebarContent?.length > 0
26+
scope.sidebarContent[0].isOpen = true
27+
else
28+
scope.isShowHideWidgetsOpen = true
2329

2430
$element = $(element)
2531
$parent = $element.parent()

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#
1818
# Analytics controller
1919
#
20-
cyclotronApp.controller 'AnalyticsController', ($scope, analyticsService) ->
20+
cyclotronApp.controller 'AnalyticsController', ($scope, $uibModal, analyticsService) ->
2121

2222
$scope.smallLimit = 10
2323
$scope.largeLimit = 20

0 commit comments

Comments
 (0)