Skip to content

Commit 6ce2eb0

Browse files
committed
1.43.0 release
1 parent b56e43a commit 6ce2eb0

File tree

13 files changed

+134
-17
lines changed

13 files changed

+134
-17
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
# 1.43.0 (11/24/2016)
2+
3+
## Features
4+
5+
- Linked Widget: a new Widget which references and displays another Widget from the Dashboard
6+
7+
- Table Widget: Added an "onSort" event property, allowing custom code to be run when changing the current sort order
8+
19
# 1.42.0 (11/10/2016)
210

311
## Features

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99

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

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

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
span(ng-if='value.options', ng-switch='value.type')
5858
editor-view-string-array(model='model[value.name]', label='{{ value.label }}', definition='value', ng-switch-when='string[]')
5959

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

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

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

1717
.editor-property-set(dashboard='editor.dashboard', model='editor.selectedItem', definition='combinedWidgetProperties(editor.selectedItem)')

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

Lines changed: 60 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,19 @@
1717
# Common Config File - all default or shared configs
1818
cyclotronServices.factory 'commonConfigService', ->
1919

20+
linkedWidgetOptions = (dashboard) ->
21+
linkedWidgets = {}
22+
_.each dashboard.pages, (page, pageIndex) ->
23+
_.each page.widgets, (widget, widgetIndex) ->
24+
return if widget.widget == 'linkedWidget'
25+
26+
widgetName = _.titleCase(widget.widget)
27+
if widget.name?.length > 0 or widget.title?.length > 0
28+
widgetName += ': ' + (widget.name || widget.title)
29+
linkedWidgets['Page ' + (pageIndex + 1) + ': ' + widgetName] = { value: pageIndex + ',' + widgetIndex }
30+
31+
linkedWidgets
32+
2033
datasourceOptions = (dashboard) ->
2134
dataSources = {}
2235
_.each dashboard.dataSources, (dataSource) ->
@@ -26,7 +39,7 @@ cyclotronServices.factory 'commonConfigService', ->
2639

2740
exports = {
2841

29-
version: '1.42.0'
42+
version: '1.43.0'
3043

3144
logging:
3245
enableDebug: false
@@ -628,6 +641,7 @@ cyclotronServices.factory 'commonConfigService', ->
628641
options:
629642
cloudwatch:
630643
value: 'cloudwatch'
644+
label: 'CloudWatch'
631645
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.'
632646
icon: 'fa-cloud-download'
633647
properties:
@@ -826,6 +840,7 @@ cyclotronServices.factory 'commonConfigService', ->
826840

827841
elasticsearch:
828842
value: 'elasticsearch'
843+
label: 'Elasticsearch'
829844
icon: 'fa-cloud-download'
830845
properties:
831846
url:
@@ -941,6 +956,7 @@ cyclotronServices.factory 'commonConfigService', ->
941956

942957
graphite:
943958
value: 'graphite'
959+
label: 'Graphite'
944960
icon: 'fa-cloud-download'
945961
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>.'
946962
properties:
@@ -1011,8 +1027,10 @@ cyclotronServices.factory 'commonConfigService', ->
10111027
required: false
10121028
defaultHidden: true
10131029
order: 11
1030+
10141031
javascript:
10151032
value: 'javascript'
1033+
label: 'JavaScript'
10161034
icon: 'fa-cloud-download'
10171035
message: 'The JavaScript Data Source allows custom JavaScript to be used to load or generate a Data Source.'
10181036
properties:
@@ -1052,6 +1070,7 @@ cyclotronServices.factory 'commonConfigService', ->
10521070

10531071
json:
10541072
value: 'json'
1073+
label: 'JSON'
10551074
icon: 'fa-cloud-download'
10561075
properties:
10571076
url:
@@ -1141,6 +1160,7 @@ cyclotronServices.factory 'commonConfigService', ->
11411160

11421161
mock:
11431162
value: 'mock'
1163+
label: 'Mock'
11441164
icon: 'fa-cloud-download'
11451165
message: 'The Mock Data Source generates sample data for testing a dashboard.'
11461166
properties:
@@ -1170,6 +1190,7 @@ cyclotronServices.factory 'commonConfigService', ->
11701190

11711191
splunk:
11721192
value: 'splunk'
1193+
label: 'Splunk'
11731194
icon: 'fa-cloud-download'
11741195
properties:
11751196
query:
@@ -1602,6 +1623,7 @@ cyclotronServices.factory 'commonConfigService', ->
16021623
widgets:
16031624
annotationChart:
16041625
name: 'annotationChart'
1626+
label: 'Annotation Chart'
16051627
icon: 'fa-bar-chart-o'
16061628
properties:
16071629
dataSource:
@@ -1909,6 +1931,7 @@ cyclotronServices.factory 'commonConfigService', ->
19091931

19101932
chart:
19111933
name: 'chart'
1934+
label: 'Chart'
19121935
icon: 'fa-bar-chart-o'
19131936
properties:
19141937
dataSource:
@@ -2945,6 +2968,7 @@ cyclotronServices.factory 'commonConfigService', ->
29452968

29462969
clock:
29472970
name: 'clock'
2971+
label: 'Clock'
29482972
icon: 'fa-clock-o'
29492973
properties:
29502974
format:
@@ -2957,6 +2981,7 @@ cyclotronServices.factory 'commonConfigService', ->
29572981

29582982
header:
29592983
name: 'header'
2984+
label: 'Header'
29602985
icon: 'fa-header'
29612986
properties:
29622987
headerTitle:
@@ -3074,6 +3099,7 @@ cyclotronServices.factory 'commonConfigService', ->
30743099

30753100
html:
30763101
name: 'html'
3102+
label: 'HTML'
30773103
icon: 'fa-html5'
30783104
properties:
30793105
dataSource:
@@ -3127,6 +3153,7 @@ cyclotronServices.factory 'commonConfigService', ->
31273153

31283154
iframe:
31293155
name: 'iframe'
3156+
label: 'iFrame'
31303157
icon: 'fa-desktop'
31313158
properties:
31323159
url:
@@ -3147,6 +3174,7 @@ cyclotronServices.factory 'commonConfigService', ->
31473174

31483175
image:
31493176
name: 'image'
3177+
label: 'Image'
31503178
icon: 'fa-image-o'
31513179
properties:
31523180
images:
@@ -3269,6 +3297,7 @@ cyclotronServices.factory 'commonConfigService', ->
32693297

32703298
javascript:
32713299
name: 'javascript'
3300+
label: 'JavaScript'
32723301
icon: 'fa-cogs'
32733302
properties:
32743303
dataSource:
@@ -3310,8 +3339,22 @@ cyclotronServices.factory 'commonConfigService', ->
33103339
required: false
33113340
order: 14
33123341

3342+
linkedWidget:
3343+
name: 'linkedWidget'
3344+
label: 'Linked Widget'
3345+
icon: 'fa-link'
3346+
properties:
3347+
linkedWidget:
3348+
label: 'Linked Widget'
3349+
description: 'Selects another Widget in this Dashboard to link.'
3350+
type: 'string'
3351+
required: true
3352+
options: linkedWidgetOptions
3353+
order: 10
3354+
33133355
number:
33143356
name: 'number'
3357+
label: 'Number'
33153358
icon: 'fa-cog'
33163359
properties:
33173360
dataSource:
@@ -3448,6 +3491,7 @@ cyclotronServices.factory 'commonConfigService', ->
34483491

34493492
qrcode:
34503493
name: 'qrcode'
3494+
label: 'QRcode'
34513495
icon: 'fa-cogs'
34523496
properties:
34533497
text:
@@ -3520,6 +3564,7 @@ cyclotronServices.factory 'commonConfigService', ->
35203564

35213565
stoplight:
35223566
name: 'stoplight'
3567+
label: 'Stoplight'
35233568
icon: 'fa-cog'
35243569
properties:
35253570
dataSource:
@@ -3586,6 +3631,7 @@ cyclotronServices.factory 'commonConfigService', ->
35863631

35873632
table:
35883633
name: 'table'
3634+
label: 'Table'
35893635
icon: 'fa-table'
35903636
properties:
35913637
dataSource:
@@ -3856,9 +3902,18 @@ cyclotronServices.factory 'commonConfigService', ->
38563902
required: false
38573903
defaultHidden: true
38583904
order: 19
3905+
onSort:
3906+
label: 'Sort Event'
3907+
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.'
3908+
type: 'editor'
3909+
editorMode: 'javascript'
3910+
required: false
3911+
defaultHidden: true
3912+
order: 20
38593913

38603914
tableau:
38613915
name: 'tableau'
3916+
label: 'Tableau'
38623917
icon: 'fa-cog'
38633918
properties:
38643919
params:
@@ -3871,6 +3926,7 @@ cyclotronServices.factory 'commonConfigService', ->
38713926

38723927
treemap:
38733928
name: 'treemap'
3929+
label: 'Treemap'
38743930
icon: 'fa-tree'
38753931
properties:
38763932
dataSource:
@@ -4001,6 +4057,7 @@ cyclotronServices.factory 'commonConfigService', ->
40014057

40024058
youtube:
40034059
name: 'youtube'
4060+
label: 'YouTube'
40044061
icon: 'fa-youtube'
40054062
properties:
40064063
videoId:
@@ -4102,14 +4159,14 @@ cyclotronServices.factory 'commonConfigService', ->
41024159
# Add Widget and Data Source help pages
41034160
helpDataSources.children = _.map _.sortBy(exports.dashboard.properties.dataSources.options, 'name'), (dataSource) ->
41044161
{
4105-
name: dataSource.value
4162+
name: dataSource.label || dataSource.value
41064163
path: '/partials/help/datasources/' + dataSource.value + '.html'
41074164
tags: _.map dataSource.properties, propertyMapHelper
41084165
}
41094166

41104167
helpWidgets.children = _.map _.sortBy(exports.widgets, 'name'), (widget) ->
41114168
{
4112-
name: widget.name
4169+
name: widget.label || widget.name
41134170
path: '/widgets/' + widget.name + '/help.html'
41144171
tags: _.map widget.properties, propertyMapHelper
41154172
}

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

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,16 +79,32 @@ cyclotronDirectives.directive 'dashboardPage', ($compile, $window, $timeout, con
7979
scope.sortedWidgets = _.sortBy sortedWidgets, '_index'
8080
else
8181
# No overrides, so take the Widgets as-is
82-
scope.sortedWidgets = scope.page?.widgets || []
82+
scope.sortedWidgets = scope.page.widgets
8383

8484

8585
updatePage = ->
86+
scope.page.widgets = scope.page?.widgets || []
8687

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

93+
# Merge Linked Widgets
94+
scope.page.widgets = _.map scope.page.widgets, (widget) ->
95+
if widget.widget == 'linkedWidget'
96+
indices = widget.linkedWidget.split ','
97+
pageIndex = parseInt indices[0]
98+
widgetIndex = parseInt indices[1]
99+
100+
linkedWidget = scope.dashboard.pages[pageIndex]?.widgets[widgetIndex]
101+
102+
widget = _.defaults widget, linkedWidget
103+
widget.widget = linkedWidget.widget
104+
widget
105+
else
106+
widget
107+
92108
# Sort Widgets per overrides
93109
resortWidgets()
94110

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,7 @@ cyclotronApp.controller 'GuiEditorController', ($scope, $state, $stateParams, $l
341341

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

346347
dashboardName = _.slugify($scope.editor.dashboard.name)

cyclotron-site/app/styles/common/variables.less

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
/* Dashboard Sidebar */
6969
@sidebar-width: 300px;
7070
@sidebar-expander-height: 20px;
71-
@sidebar-expander-width: 16px;
71+
@sidebar-expander-width: 12px;
7272
@sidebar-header-height: 100px;
7373
@sidebar-footer-height: 67px;
7474
@sidebar-transition-duration: 0.5s;
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
h3 Linked Widget
2+
p.
3+
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.
4+
5+
p.
6+
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.
7+
8+
h4 Widget Overrides
9+
10+
p.
11+
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.
12+
13+
p.
14+
All of the possible properties are not available in the Dashboard Editor, but they can be set via JSON.
15+
16+
h4 Properties
17+
p.
18+
These are the properties specific to this widget.
19+
General Cyclotron widget properties are not repeated here (e.g. layout properties).
20+
21+
property-table(properties='config.widgets.linkedWidget.properties')
22+

0 commit comments

Comments
 (0)