Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions src/components/widgets-layouts/figure/figure.directive.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
module = angular.module('impac.components.widgets-layouts.figure',[])

module.controller('FigureLayoutCtrl', ($scope, ChartFormatterSvc) ->

$scope.getColorByIndex = (index) ->
ChartFormatterSvc.getColor(index)

)

module.directive('impacFigureLayout', ($templateCache) ->
return {
restrict: 'E',
scope: {
content: '='
timePeriodEnabled: '=?'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

timePeriodEnabled, selectorList, and selectorUid isn't used anywhere.

selectorList: '=?'
selectorUid: '=?'
},
template: $templateCache.get('widgets-layouts/figure.tmpl.html'),
controller: 'FigureLayoutCtrl'
}
)
10 changes: 10 additions & 0 deletions src/components/widgets-layouts/figure/figure.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.analytics .layouts.figure {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No styles are being applied to indicate this is a column or scrollable as specified in the JIRA.
In screenshot below I have added entries and they just extend the height of the widget.
screen shot 2018-03-19 at 11 23 56

h3 {
text-align: center;
}

.value {
.center-bold(0px);
margin-bottom: 3px;
}
}
7 changes: 7 additions & 0 deletions src/components/widgets-layouts/figure/figure.tmpl.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<div class="layouts figure">
<div ng-repeat="figure in content">
<h3>{{figure.label}}</h3>
<div class="value" ng-style="{'color': getColorByIndex($index)}">{{figure.value}}</div>
<div ng-show="figure.unit">{{figure.unit}}></div>
</div>
</div>
6 changes: 6 additions & 0 deletions src/impac-angular.module.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ angular.module('impac.components',
'impac.components.widget',
'impac.components.widgets',
'impac.components.widgets-settings',
'impac.components.widgets-layouts',
'impac.components.widgets-common',
'impac.components.common',
'impac.components.templates'
Expand Down Expand Up @@ -118,6 +119,11 @@ angular.module('impac.components.widgets-settings',
'impac.components.widgets-settings.offsets'
]
);
angular.module('impac.components.widgets-layouts',
[
'impac.components.widgets-layouts.figure'
]
);
angular.module('impac.components.dashboard-settings',
[
'impac.components.dashboard-settings.currency',
Expand Down