Skip to content

Commit

Permalink
#82 Display invalid analyzers an allow removing them
Browse files Browse the repository at this point in the history
  • Loading branch information
nadouani committed Apr 4, 2018
1 parent c81438e commit b6476cc
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ export default class OrganizationAnalyzersController {
$onInit() {
this.activeAnalyzers = _.keyBy(this.analyzers, 'analyzerDefinitionId');
this.definitionsIds = _.keys(this.analyzerDefinitions).sort();
this.invalidAnalyzers = _.filter(this.analyzers, a =>
_.isEmpty(a.dataTypeList)
);
}

openModal(mode, definition, analyzer) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,27 @@
<section>

<div class="mb-s" ng-if="$ctrl.invalidAnalyzers.length > 0">
<div class="callout callout-warning">
<h4>You have {{$ctrl.invalidAnalyzers.length}} invalid <ng-pluralize count="$ctrl.invalidAnalyzers.length" when="{'1': 'analyzer', 'other': 'analyzers'}"></ng-pluralize></h4>
<p>Invalid analyzers have no definition and cannot be run on any observable. You have to remove them.</p>
</div>
<div class="row">
<div class="col-sm-12 flex-table">
<div class="flex-row media" ng-repeat="a in $ctrl.invalidAnalyzers">
<div class="flex-col flex-1">
<h4 class="media-heading">
<span class="mr-m text-primary">{{a.name}}</span>
</h4>
</div>
<div class="flex-col flex-icon flex-w-100 text-center" ng-click="$ctrl.disable(a.id)">
<a href class="text-danger">
<i class="fa fa-ban"></i>Disable</a>
</div>
</div>
</div>
</div>
</div>

<p class="lead">Available analyzers ({{$ctrl.definitionsIds.length || 0}}) <a href class="pull-right btn btn-primary" ng-click="$ctrl.refreshAnalyzers()"><i class="fa fa-refresh"></i> Refresh analyzers</a></p>

<div class="row mv-s" ng-if="$ctrl.definitionsIds.length === 0">
Expand Down

0 comments on commit b6476cc

Please sign in to comment.