reworking the pr based on new design spec. see pr comments
This commit is contained in:
parent
07817ba71e
commit
02bef30783
|
@ -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>
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -10,4 +10,10 @@
|
|||
style="display: none;">
|
||||
</div>
|
||||
|
||||
<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 -->
|
Loading…
Reference in a new issue