Skip to content

Commit

Permalink
1.36.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
baumandm committed Aug 3, 2016
1 parent a12c900 commit aa249ea
Show file tree
Hide file tree
Showing 45 changed files with 203 additions and 177 deletions.
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# 1.36.0 (08/04/2016)

## Features

- Dashboard Performance: optimized dashboard and widget performance

- Animations: Enabled assorted animations across Cyclotron, e.g. transitioning accordions, slide-in dialogs.

- Dashboard Sidebar: Show/Hide Widgets: added a master toggle to show or hide all widgets

## Bug Fixes

- Number Widget: improved auto-scaling algorithm to avoid situations with overlapping or truncated text

# 1.35.0 (07/21/2016)

## Features
Expand Down
5 changes: 2 additions & 3 deletions cyclotron-site/app/partials/dashboard.jade
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@

//- Dashboards
div.dashboard.dashboard-page-background(ng-class='{ "has-sidebar": dashboard.sidebar.showDashboardSidebar }')
.dashboard.dashboard-page-background(ng-class='{ "has-sidebar": dashboard.sidebar.showDashboardSidebar }')

.click-cover

Expand All @@ -16,7 +15,7 @@ div.dashboard.dashboard-page-background(ng-class='{ "has-sidebar": dashboard.sid
i.fa.fa-chevron-right(ng-click='moveForward()', ng-class='{ disabled: !canMoveForward() }', title='Go to the next page')

.dashboard-pages
div(dashboard-page, ng-repeat='page in currentPage',
dashboard-page(ng-repeat='page in currentPage',
dashboard='dashboard', page='page', page-number='{{ currentPageIndex }}',
page-overrides='dashboardOverrides.pages[currentPageIndex]')

15 changes: 11 additions & 4 deletions cyclotron-site/app/partials/dashboardSidebar.jade
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,25 @@
accordion-group(ng-repeat='content in dashboard.sidebar.sidebarContent track by $index', heading='{{ content.heading }}')
div(ng-bind-html='trustHtml(content.html)')

accordion-group(heading='Show/Hide Widgets', ng-if='dashboard.sidebar.showHideWidgets == true')
accordion-group.show-hide-widgets(heading='Show/Hide Widgets', ng-if='dashboard.sidebar.showHideWidgets == true')
table.table
tr(ng-repeat='widget in widgetVisibilities track by $index')
td {{ widget.label }}
td
switch(ng-model='widget.visible', ng-change='changeVisibility(widget, $index)')
tr
td(colspan='2')
hr
tr
td All Widgets
td
switch(ng-model='allWidgetsVisible', ng-change='toggleAllWidgets()')
p.centered
a(ng-click='resetDashboardOverrides()', title='Reset to default')
i.fa.fa-refresh
| Reset to default
.sidebar-footer
.logos
a.logo(ng-repeat='logo in footerLogos', title='{{ logo.title }}',
ng-href='{{ logo.href }}', target='_self')
img(ng-src='{{ logo.src }}', alt='{{ logo.title }}')
a.logo(ng-repeat='logo in ::footerLogos', title='{{ ::logo.title }}',
ng-href='{{ ::logo.href }}', target='_self')
img(ng-src='{{ ::logo.src }}', alt='{{ ::logo.title }}')
1 change: 1 addition & 0 deletions cyclotron-site/app/scripts/common/app.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ $ ->

# Cyclotron main application
cyclotronApp = angular.module 'cyclotronApp', [
'ngAnimate'
'ngResource'
'ngSanitize'
'ngTranscludeMod'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ cyclotronServices.factory 'commonConfigService', ->

exports = {

version: '1.35.0'
version: '1.36.0'

logging:
enableDebug: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ cyclotronServices.factory 'userService', ($http, $q, $localForage, configService
promise.success (results) ->
deferred.resolve(results)
promise.error (error) ->
console.log('UserService error: ' + error)
logService.error('UserService error: ' + error)
deferred.reject()

return deferred.promise
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ cyclotronDataSources.factory 'cyclotrondataDataSource', ($q, $http, configServic

# Successful Result
successCallback = (result) ->
console.log result
q.resolve
'0':
data: result.data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
# response is not valid JSON. This Data Source fixes the response, parses it into a
# JSON array, and selects the final result. All the preview results are ignored.
#
cyclotronDataSources.factory 'splunkDataSource', ($q, $http, configService, dataSourceFactory) ->
cyclotronDataSources.factory 'splunkDataSource', ($q, $http, configService, dataSourceFactory, logService) ->

getSplunkUrl = (options) ->
# Using 'json_rows' mode since 'json' is not actually valid JSON
Expand All @@ -43,10 +43,8 @@ cyclotronDataSources.factory 'splunkDataSource', ($q, $http, configService, data
.search searchOptions
.toString()

console.log uri
return uri


getProxyRequest = (options) ->
# Format: https://github.com/mikeal/request#requestoptions-callback
{
Expand Down Expand Up @@ -82,7 +80,7 @@ cyclotronDataSources.factory 'splunkDataSource', ($q, $http, configService, data
# Select the final result (non-preview)
splunkResult = _.find results, { preview: false }
catch e
console.log 'Unexpected response from Splunk: ' + proxyResult.body
logService.error 'Unexpected response from Splunk: ' + proxyResult.body
splunkResult = null

return errorCallback 'Error retrieving data from Splunk', -1 unless _.isObject splunkResult
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,15 @@
#
cyclotronDirectives.directive 'dashboard', ($compile, $window, $timeout, configService, layoutService, logService) ->
{
restrict: 'AC'
restrict: 'C'

link: (scope, element, attrs) ->
$element = $(element)
$dashboardSidebar = $element.children '.dashboard-sidebar'
$dashboardControls = $element.children '.dashboard-controls'

scope.controlTimer = null
controlTimer = null
controlTarget = null

calculateMouseTarget = ->
# Get all dimensions and the padding options
Expand All @@ -46,7 +47,7 @@ cyclotronDirectives.directive 'dashboard', ($compile, $window, $timeout, configS

return unless $dashboardControls? and controlOffset?

scope.controlTarget = {
controlTarget = {
top: controlOffset.top - padY
bottom: controlOffset.top + controlHeight + padY
left: controlOffset.left - padX
Expand All @@ -61,18 +62,18 @@ cyclotronDirectives.directive 'dashboard', ($compile, $window, $timeout, configS
$dashboardControls.addClass 'active'

# Set timer to remove the controls after some delay
$timeout.cancel(scope.controlTimer) if scope.controlTimer?
$timeout.cancel(controlTimer) if controlTimer?

scope.controlTimer = $timeout(makeControlsDisappear, configService.dashboard.controls.duration)
controlTimer = $timeout(makeControlsDisappear, configService.dashboard.controls.duration)
, 500, { leading: true })

controlHitTest = (event) ->
return unless scope.controlTarget?
return unless controlTarget?
# Abort if outside the target
if event.pageX < scope.controlTarget.left ||
event.pageX > scope.controlTarget.right ||
event.pageY < scope.controlTarget.top ||
event.pageY > scope.controlTarget.bottom
if event.pageX < controlTarget.left ||
event.pageX > controlTarget.right ||
event.pageY < controlTarget.top ||
event.pageY > controlTarget.bottom
return

makeControlsAppear()
Expand All @@ -89,9 +90,7 @@ cyclotronDirectives.directive 'dashboard', ($compile, $window, $timeout, configS

$(document).on 'scroll', calculateMouseTarget

$(window).on 'resize', _.debounce(->
scope.$apply(calculateMouseTarget)
, 500, { leading: false, maxWait: 1000 })
$(window).on 'resize', _.debounce(calculateMouseTarget, 500, { leading: false })

#
# Cleanup
Expand All @@ -102,7 +101,7 @@ cyclotronDirectives.directive 'dashboard', ($compile, $window, $timeout, configS
$(window).off 'resize', calculateMouseTarget

# Cancel timer
$timeout.cancel(scope.controlTimer) if scope.controlTimer?
$timeout.cancel(controlTimer) if controlTimer?

return
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
cyclotronDirectives.directive 'dashboardPage', ($compile, $window, $timeout, configService, layoutService, logService) ->
{
replace: true
restrict: 'A'
restrict: 'E'

scope:
page: '='
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ cyclotronDirectives.directive 'dashboardSidebar', ($timeout, layoutService) ->
restrict: 'EAC'
link: (scope, element, attrs) ->
# Initial position
scope.sidebarExpanded = false
isSidebarExpanded = false

$element = $(element)
$parent = $element.parent()
Expand All @@ -31,8 +31,8 @@ cyclotronDirectives.directive 'dashboardSidebar', ($timeout, layoutService) ->
$expanderIcon = $expander.children 'i'
$clickCover = $parent.find '.click-cover'

scope.$watch 'sidebarExpanded', (expanded) ->
if expanded
updateExpandedState = ->
if isSidebarExpanded
$element.removeClass 'collapsed'
$clickCover.css 'display', 'block'
$expanderIcon.removeClass 'fa-caret-right'
Expand All @@ -47,21 +47,19 @@ cyclotronDirectives.directive 'dashboardSidebar', ($timeout, layoutService) ->

$hitbox.on 'click', (event) ->
event.preventDefault()
scope.$apply ->
scope.sidebarExpanded = !scope.sidebarExpanded
isSidebarExpanded = !isSidebarExpanded
updateExpandedState()

$clickCover.on 'click', (event) ->
event.preventDefault()
scope.$apply ->
scope.sidebarExpanded = false
isSidebarExpanded = false
updateExpandedState()

# Resize accordion around header/footer
sizer = ->
$accordion.height($element.outerHeight() - $header.outerHeight() - $footer.outerHeight())

$element.on 'resize', _.debounce(->
scope.$apply sizer
, 300, { leading: false, maxWait: 600 })
$element.on 'resize', _.debounce sizer, 300, { leading: false, maxWait: 600 }

# Run in 100ms
timer = $timeout sizer, 100
Expand All @@ -76,8 +74,9 @@ cyclotronDirectives.directive 'dashboardSidebar', ($timeout, layoutService) ->
$scope.footerLogos = configService.dashboardSidebar?.footer?.logos || []
$scope.widgetVisibilities = []
$scope.widgetOverrides = []
$scope.allWidgetsVisible = false

$scope.updateVisibility = ->
updateVisibility = ->
actualWidgets = $scope.currentPage[0]?.widgets
$scope.widgetOverrides = $scope.dashboardOverrides?.pages[$scope.currentPageIndex]?.widgets

Expand All @@ -94,6 +93,9 @@ cyclotronDirectives.directive 'dashboardSidebar', ($timeout, layoutService) ->
label: dashboardService.getWidgetName(widget, index)
visible: visible
}

visibleWidgets = _.filter($scope.widgetVisibilities, { visible: true }).length
$scope.allWidgetsVisible = (visibleWidgets / $scope.widgetVisibilities.length) > 0.5

$scope.changeVisibility = (widget, index) ->

Expand All @@ -103,14 +105,19 @@ cyclotronDirectives.directive 'dashboardSidebar', ($timeout, layoutService) ->
$scope.widgetOverrides[index].hidden = true
return

$scope.$watch 'currentPage', (currentPage) ->
$scope.toggleAllWidgets = ->
_.each $scope.widgetOverrides, (widget) ->
widget.hidden = $scope.allWidgetsVisible
return
return

$scope.$watchCollection 'currentPage', (currentPage) ->
return unless currentPage?.length > 0
$scope.updateVisibility()
, true
updateVisibility()

$scope.$watch 'dashboardOverrides', (dashboardOverrides) ->
return unless dashboardOverrides?
$scope.updateVisibility()
updateVisibility()
, true

}
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,20 @@ cyclotronDirectives.directive 'dashboardWidget', (layoutService) ->

return

scope.$watch('layout', (layout) ->
scope.$watch 'layout', (layout) ->
return unless layout?

# Set the border width if overloaded (otherwise keep theme default)
if layout.borderWidth?
$element.css('border-width', layout.borderWidth + 'px')

, true)
return

controller: ($scope) ->

# Evaluate Title of Widget
$scope.widgetTitle = -> _.jsExec $scope.widget.title

return

}
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ cyclotronDirectives.directive 'sidebarAccordion', ($sce, $timeout) ->
sizer = ->
scope.accordionHeight = scope.getAccordionHeight()

$(element).on 'resize', _.throttle(->
$(element).on 'resize', _.debounce(->
scope.$apply sizer
, 100)

Expand Down
Loading

0 comments on commit aa249ea

Please sign in to comment.