Skip to content

Commit

Permalink
1.43.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
baumandm committed Nov 22, 2016
1 parent b56e43a commit 6ce2eb0
Show file tree
Hide file tree
Showing 13 changed files with 134 additions and 17 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# 1.43.0 (11/24/2016)

## Features

- Linked Widget: a new Widget which references and displays another Widget from the Dashboard

- Table Widget: Added an "onSort" event property, allowing custom code to be run when changing the current sort order

# 1.42.0 (11/10/2016)

## Features
Expand Down
4 changes: 2 additions & 2 deletions cyclotron-site/app/partials/editor/dataSource.jade
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

.form-group
label(title='{{ dashboardProperties.dataSources.properties.type.description }}') Type
select.form-control(ng-model='dataSource.type', title='{{ dashboardProperties.dataSources.properties.type.description }}')
option(ng-repeat='(optionKey, optionValue) in dashboardProperties.dataSources.options') {{ optionValue.value }}
select.form-control(ng-model='dataSource.type', title='{{ dashboardProperties.dataSources.properties.type.description }}',
ng-options='optionKey as (optionValue.label || optionKey) for (optionKey, optionValue) in dashboardProperties.dataSources.options')

.bg-info(ng-if='dataSourceMessage()', ng-bind-html='dataSourceMessage()')

Expand Down
2 changes: 1 addition & 1 deletion cyclotron-site/app/partials/editor/propertySet.jade
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
span(ng-if='value.options', ng-switch='value.type')
editor-view-string-array(model='model[value.name]', label='{{ value.label }}', definition='value', ng-switch-when='string[]')

select.form-control(ng-model='model[value.name]', ng-switch-default, title='{{ value.description }}'
select.form-control(ng-model='model[value.name]', ng-switch-default, title='{{ value.description }}',
ng-options='optionValue.value as (optionValue.label || optionKey) for (optionKey, optionValue) in getOptions(value.name, value.options)')
option(value='')

Expand Down
4 changes: 2 additions & 2 deletions cyclotron-site/app/partials/editor/widget.jade
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

select.form-control(ng-model='editor.selectedItem.widget',
ng-change='selectWidget()'
title='{{ dashboardProperties.pages.properties.widgets.properties.widget }}')
option(ng-repeat='(optionKey, optionValue) in widgets') {{ optionKey }}
title='{{ dashboardProperties.pages.properties.widgets.properties.widget }}',
ng-options='optionKey as (optionValue.label || optionKey) for (optionKey, optionValue) in widgets')

.editor-property-set(dashboard='editor.dashboard', model='editor.selectedItem', definition='combinedWidgetProperties(editor.selectedItem)')
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,19 @@
# Common Config File - all default or shared configs
cyclotronServices.factory 'commonConfigService', ->

linkedWidgetOptions = (dashboard) ->
linkedWidgets = {}
_.each dashboard.pages, (page, pageIndex) ->
_.each page.widgets, (widget, widgetIndex) ->
return if widget.widget == 'linkedWidget'

widgetName = _.titleCase(widget.widget)
if widget.name?.length > 0 or widget.title?.length > 0
widgetName += ': ' + (widget.name || widget.title)
linkedWidgets['Page ' + (pageIndex + 1) + ': ' + widgetName] = { value: pageIndex + ',' + widgetIndex }

linkedWidgets

datasourceOptions = (dashboard) ->
dataSources = {}
_.each dashboard.dataSources, (dataSource) ->
Expand All @@ -26,7 +39,7 @@ cyclotronServices.factory 'commonConfigService', ->

exports = {

version: '1.42.0'
version: '1.43.0'

logging:
enableDebug: false
Expand Down Expand Up @@ -628,6 +641,7 @@ cyclotronServices.factory 'commonConfigService', ->
options:
cloudwatch:
value: 'cloudwatch'
label: 'CloudWatch'
message: 'Amazon CloudWatch monitors operational and performance metrics for your AWS cloud resources and applications. Refer to the <a href="http://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/Welcome.html" target="_blank">API Documentation</a> for information on configuring the available options.'
icon: 'fa-cloud-download'
properties:
Expand Down Expand Up @@ -826,6 +840,7 @@ cyclotronServices.factory 'commonConfigService', ->

elasticsearch:
value: 'elasticsearch'
label: 'Elasticsearch'
icon: 'fa-cloud-download'
properties:
url:
Expand Down Expand Up @@ -941,6 +956,7 @@ cyclotronServices.factory 'commonConfigService', ->

graphite:
value: 'graphite'
label: 'Graphite'
icon: 'fa-cloud-download'
message: 'The Graphite Data Source connects to any <a href="http://graphite.readthedocs.org/" target="_blank">Graphite<a> server to load time-series metrics via the Render api. For more details on usage, refer to the Graphite <a href="http://graphite.readthedocs.org/en/latest/render_api.html" target="_blank">documentation</a>.'
properties:
Expand Down Expand Up @@ -1011,8 +1027,10 @@ cyclotronServices.factory 'commonConfigService', ->
required: false
defaultHidden: true
order: 11

javascript:
value: 'javascript'
label: 'JavaScript'
icon: 'fa-cloud-download'
message: 'The JavaScript Data Source allows custom JavaScript to be used to load or generate a Data Source.'
properties:
Expand Down Expand Up @@ -1052,6 +1070,7 @@ cyclotronServices.factory 'commonConfigService', ->

json:
value: 'json'
label: 'JSON'
icon: 'fa-cloud-download'
properties:
url:
Expand Down Expand Up @@ -1141,6 +1160,7 @@ cyclotronServices.factory 'commonConfigService', ->

mock:
value: 'mock'
label: 'Mock'
icon: 'fa-cloud-download'
message: 'The Mock Data Source generates sample data for testing a dashboard.'
properties:
Expand Down Expand Up @@ -1170,6 +1190,7 @@ cyclotronServices.factory 'commonConfigService', ->

splunk:
value: 'splunk'
label: 'Splunk'
icon: 'fa-cloud-download'
properties:
query:
Expand Down Expand Up @@ -1602,6 +1623,7 @@ cyclotronServices.factory 'commonConfigService', ->
widgets:
annotationChart:
name: 'annotationChart'
label: 'Annotation Chart'
icon: 'fa-bar-chart-o'
properties:
dataSource:
Expand Down Expand Up @@ -1909,6 +1931,7 @@ cyclotronServices.factory 'commonConfigService', ->

chart:
name: 'chart'
label: 'Chart'
icon: 'fa-bar-chart-o'
properties:
dataSource:
Expand Down Expand Up @@ -2945,6 +2968,7 @@ cyclotronServices.factory 'commonConfigService', ->

clock:
name: 'clock'
label: 'Clock'
icon: 'fa-clock-o'
properties:
format:
Expand All @@ -2957,6 +2981,7 @@ cyclotronServices.factory 'commonConfigService', ->

header:
name: 'header'
label: 'Header'
icon: 'fa-header'
properties:
headerTitle:
Expand Down Expand Up @@ -3074,6 +3099,7 @@ cyclotronServices.factory 'commonConfigService', ->

html:
name: 'html'
label: 'HTML'
icon: 'fa-html5'
properties:
dataSource:
Expand Down Expand Up @@ -3127,6 +3153,7 @@ cyclotronServices.factory 'commonConfigService', ->

iframe:
name: 'iframe'
label: 'iFrame'
icon: 'fa-desktop'
properties:
url:
Expand All @@ -3147,6 +3174,7 @@ cyclotronServices.factory 'commonConfigService', ->

image:
name: 'image'
label: 'Image'
icon: 'fa-image-o'
properties:
images:
Expand Down Expand Up @@ -3269,6 +3297,7 @@ cyclotronServices.factory 'commonConfigService', ->

javascript:
name: 'javascript'
label: 'JavaScript'
icon: 'fa-cogs'
properties:
dataSource:
Expand Down Expand Up @@ -3310,8 +3339,22 @@ cyclotronServices.factory 'commonConfigService', ->
required: false
order: 14

linkedWidget:
name: 'linkedWidget'
label: 'Linked Widget'
icon: 'fa-link'
properties:
linkedWidget:
label: 'Linked Widget'
description: 'Selects another Widget in this Dashboard to link.'
type: 'string'
required: true
options: linkedWidgetOptions
order: 10

number:
name: 'number'
label: 'Number'
icon: 'fa-cog'
properties:
dataSource:
Expand Down Expand Up @@ -3448,6 +3491,7 @@ cyclotronServices.factory 'commonConfigService', ->

qrcode:
name: 'qrcode'
label: 'QRcode'
icon: 'fa-cogs'
properties:
text:
Expand Down Expand Up @@ -3520,6 +3564,7 @@ cyclotronServices.factory 'commonConfigService', ->

stoplight:
name: 'stoplight'
label: 'Stoplight'
icon: 'fa-cog'
properties:
dataSource:
Expand Down Expand Up @@ -3586,6 +3631,7 @@ cyclotronServices.factory 'commonConfigService', ->

table:
name: 'table'
label: 'Table'
icon: 'fa-table'
properties:
dataSource:
Expand Down Expand Up @@ -3856,9 +3902,18 @@ cyclotronServices.factory 'commonConfigService', ->
required: false
defaultHidden: true
order: 19
onSort:
label: 'Sort Event'
description: 'This event occurs when the user changes the sort order of a column. If this property is set with a JavaScript function, the function will be called as an event handler. Return false from the function to prevent the default sort implementation from being applied.'
type: 'editor'
editorMode: 'javascript'
required: false
defaultHidden: true
order: 20

tableau:
name: 'tableau'
label: 'Tableau'
icon: 'fa-cog'
properties:
params:
Expand All @@ -3871,6 +3926,7 @@ cyclotronServices.factory 'commonConfigService', ->

treemap:
name: 'treemap'
label: 'Treemap'
icon: 'fa-tree'
properties:
dataSource:
Expand Down Expand Up @@ -4001,6 +4057,7 @@ cyclotronServices.factory 'commonConfigService', ->

youtube:
name: 'youtube'
label: 'YouTube'
icon: 'fa-youtube'
properties:
videoId:
Expand Down Expand Up @@ -4102,14 +4159,14 @@ cyclotronServices.factory 'commonConfigService', ->
# Add Widget and Data Source help pages
helpDataSources.children = _.map _.sortBy(exports.dashboard.properties.dataSources.options, 'name'), (dataSource) ->
{
name: dataSource.value
name: dataSource.label || dataSource.value
path: '/partials/help/datasources/' + dataSource.value + '.html'
tags: _.map dataSource.properties, propertyMapHelper
}

helpWidgets.children = _.map _.sortBy(exports.widgets, 'name'), (widget) ->
{
name: widget.name
name: widget.label || widget.name
path: '/widgets/' + widget.name + '/help.html'
tags: _.map widget.properties, propertyMapHelper
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,16 +79,32 @@ cyclotronDirectives.directive 'dashboardPage', ($compile, $window, $timeout, con
scope.sortedWidgets = _.sortBy sortedWidgets, '_index'
else
# No overrides, so take the Widgets as-is
scope.sortedWidgets = scope.page?.widgets || []
scope.sortedWidgets = scope.page.widgets


updatePage = ->
scope.page.widgets = scope.page?.widgets || []

# Assign uids to Widgets -- use for tracking if widgets are rearranged
_.each scope.page.widgets, (widget) ->
widget.uid ?= uuid.v4()
return

# Merge Linked Widgets
scope.page.widgets = _.map scope.page.widgets, (widget) ->
if widget.widget == 'linkedWidget'
indices = widget.linkedWidget.split ','
pageIndex = parseInt indices[0]
widgetIndex = parseInt indices[1]

linkedWidget = scope.dashboard.pages[pageIndex]?.widgets[widgetIndex]

widget = _.defaults widget, linkedWidget
widget.widget = linkedWidget.widget
widget
else
widget

# Sort Widgets per overrides
resortWidgets()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,7 @@ cyclotronApp.controller 'GuiEditorController', ($scope, $state, $stateParams, $l

if !$scope.editor.dashboard.name? or $scope.editor.dashboard.name == ''
alertify.error('Dashboard Name property is missing', 10000)
$scope.isSaving = false
return

dashboardName = _.slugify($scope.editor.dashboard.name)
Expand Down
2 changes: 1 addition & 1 deletion cyclotron-site/app/styles/common/variables.less
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
/* Dashboard Sidebar */
@sidebar-width: 300px;
@sidebar-expander-height: 20px;
@sidebar-expander-width: 16px;
@sidebar-expander-width: 12px;
@sidebar-header-height: 100px;
@sidebar-footer-height: 67px;
@sidebar-transition-duration: 0.5s;
Expand Down
22 changes: 22 additions & 0 deletions cyclotron-site/app/widgets/linkedWidget/help.jade
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
h3 Linked Widget
p.
The Linked Widget allows a Widget to be re-used within the same Dashboard. A typical use-case is displaying the same Header on multiple pages. Using a Linked Widget allows the Header configuration to be defined once, but used multiple times.

p.
Any instances of a Linked Widget are isolated from each other and the source Widget. Functionally, it is identical to copy/pasting the JSON configuration of a Widget.

h4 Widget Overrides

p.
It is possible to override any of the properties of the source Widget. The source Widget's properties are merged with those of the Linked Widget, with any properties of the Linked Widget taking precedence.

p.
All of the possible properties are not available in the Dashboard Editor, but they can be set via JSON.

h4 Properties
p.
These are the properties specific to this widget.
General Cyclotron widget properties are not repeated here (e.g. layout properties).

property-table(properties='config.widgets.linkedWidget.properties')

Loading

0 comments on commit 6ce2eb0

Please sign in to comment.