Skip to content

Commit

Permalink
Add link to missing vis variable
Browse files Browse the repository at this point in the history
  • Loading branch information
Tim Roes committed Jun 15, 2018
1 parent 30d46ee commit 7617563
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,12 @@ describe('editor', function () {
]
});

const $el = $('<vis-editor-agg-params agg="agg" group-name="groupName"></vis-editor-agg-params>');
const $el = $('<vis-editor-agg-params agg="agg" vis="vis" group-name="groupName"></vis-editor-agg-params>');
const $parentScope = $injector.get('$rootScope').$new();

agg = $parentScope.agg = vis.aggs.bySchemaName.segment[0];
$parentScope.groupName = 'buckets';
$parentScope.vis = vis;

$compile($el)($parentScope);
$scope = $el.scope();
Expand Down
1 change: 1 addition & 0 deletions src/ui/public/agg_types/controls/order_agg.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
</div>
<div ng-show="agg.params.orderAgg" class="vis-editor-agg-order-agg">
<vis-editor-agg-params
vis="vis"
agg="agg.params.orderAgg"
ng-if="agg.params.orderAgg"
group-name="'metrics'">
Expand Down
1 change: 1 addition & 0 deletions src/ui/public/agg_types/controls/sub_agg.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
<div ng-if="agg.params.metricAgg === 'custom'" class="vis-editor-agg-order-agg">
<ng-form name="customMetricForm">
<vis-editor-agg-params
vis="vis"
agg="agg.params.customMetric"
group-name="'metrics'">
</vis-editor-agg-params>
Expand Down
1 change: 1 addition & 0 deletions src/ui/public/agg_types/controls/sub_metric.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<ng-form name="{{aggType}}Form">
<vis-editor-agg-params
agg="agg.params[aggType]"
vis="vis"
group-name="'{{aggGroup}}'">
</vis-editor-agg-params>
</ng-form>
Expand Down
4 changes: 2 additions & 2 deletions src/ui/public/agg_types/filter/agg_type_filters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ class AggTypeFilters {
* A new filtered list will always be emitted when the {@link AggTypeFilter}
* registered with this registry will change.
*
* @param aggTypes A list of aggTypes that will be filtered down by this registry.
* @param aggTypes A list of aggTypes that will be filtered down by this registry.
* @param vis The vis for which this list should be filtered down.
* @param aggConfig The aggConfig for which the returning list will be used.
* @return A filtered list of the passed aggTypes.
* @return A filtered list of the passed aggTypes.
*/
public filter$(aggTypes: AggType[], vis: Vis, aggConfig: AggConfig) {
return this.subject.map(filters => {
Expand Down
3 changes: 2 additions & 1 deletion src/ui/public/vis/editors/default/__tests__/agg_params.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,11 @@ describe('Vis-Editor-Agg-Params plugin directive', function () {
});

$parentScope.agg = new AggConfig(vis, state);
$parentScope.vis = vis;

// make the element
$elem = angular.element(
`<vis-editor-agg-params agg="agg" group-name="groupName"></vis-editor-agg-params>`
`<vis-editor-agg-params vis="vis" agg="agg" group-name="groupName"></vis-editor-agg-params>`
);

// compile the html
Expand Down
1 change: 1 addition & 0 deletions src/ui/public/vis/editors/default/agg.html
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@
agg="agg"
group-name="groupName"
ng-show="editorOpen"
vis="vis"
class="vis-editor-agg-editor">
</vis-editor-agg-params>

Expand Down
1 change: 1 addition & 0 deletions src/ui/public/vis/editors/default/agg_params.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ uiModules
link: function ($scope, $el, attr) {
$scope.$bind('agg', attr.agg);
$scope.$bind('groupName', attr.groupName);
$scope.$bind('vis', attr.vis);

const aggTypeSubscription = aggTypeFilters
.filter$(aggTypes.byType[$scope.groupName], $scope.vis, $scope.agg)
Expand Down

0 comments on commit 7617563

Please sign in to comment.