reworking the pr based on new design spec. see pr comments

This commit is contained in:
Shelby Sturgis 2016-03-28 14:46:09 -07:00
parent 07817ba71e
commit 02bef30783
3 changed files with 11 additions and 7 deletions

View file

@ -19,10 +19,10 @@
class="vis-editor-agg-wide-btn">
<div ng-if="!add.form">
<div class="btn btn-sm btn-primary" ng-if="groupName !== 'buckets' || !stats.count">
<div class="btn btn-sm btn-primary" ng-if="groupName !== 'buckets' || !stats.count && !stats.deprecate">
Add {{ groupName }}
</div>
<div class="btn btn-sm btn-primary" ng-if="groupName === 'buckets' && stats.count - stats.numDeprecated > 0">
<div class="btn btn-sm btn-primary" ng-if="groupName === 'buckets' && stats.count > 0 && !stats.deprecate">
Add sub-{{ groupName }}
</div>
</div>

View file

@ -25,10 +25,7 @@ uiModules
const stats = $scope.stats = {
min: 0,
max: 0,
count: $scope.group ? $scope.group.length : 0,
numDeprecated: $scope.schemas.raw.filter(function (o) {
return o.deprecate;
}).length
count: $scope.group ? $scope.group.length : 0
};
if (!$scope.schemas) return;
@ -36,6 +33,7 @@ uiModules
$scope.schemas.forEach(function (schema) {
stats.min += schema.min;
stats.max += schema.max;
stats.deprecate = schema.deprecate;
});
$scope.availableSchema = $scope.schemas.filter(function (schema) {

View file

@ -10,4 +10,10 @@
style="display: none;">
</div>
<!-- schema editors get added down here: aggSelect.html, agg_types/controls/*.html -->
<div ng-if="agg.schema.deprecate" class="form-group">
<p class="vis-editor-agg-error">
"{{ agg.schema.title }}" has been deprecated.
</p>
</div>
<!-- schema editors get added down here: aggSelect.html, agg_types/controls/*.html -->