Skip to content

Commit

Permalink
Merge pull request primefaces#23 from Nanitor/BenchmarkRules+Benchmar…
Browse files Browse the repository at this point in the history
…kReport-ExtractReusableCode

Benchmark rules+benchmark report extract reusable code
  • Loading branch information
Alfred Hall authored Aug 2, 2018
2 parents 0be4780 + fb73a09 commit d9c5961
Show file tree
Hide file tree
Showing 9 changed files with 490 additions and 822 deletions.
11 changes: 1 addition & 10 deletions src/common/filter_pane/text-filter.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ export class TextFilterComponent extends BaseFilter {
private textFilterControl = new FormControl();
private filter: Filter;

// Used to temporarily disable the event emitter.
private temporarilyDisabled: boolean = false;

constructor() {
super();
this.textFilterControl.valueChanges
Expand All @@ -35,19 +32,13 @@ export class TextFilterComponent extends BaseFilter {
textFilter.type = "text";
textFilter.values = [value];
}
if(this.temporarilyDisabled) {
this.temporarilyDisabled = false;
}
else {
this.filterChanged.emit(new FilterChangedEvent(this.filter, textFilter));
}
this.filterChanged.emit(new FilterChangedEvent(this.filter, textFilter));
this.filter = textFilter;
});
}

clear() {
if(this.textFilterControl.value != null && this.textFilterControl.value != "") {
this.temporarilyDisabled = true;
this.textFilterControl.setValue("");
}
}
Expand Down
31 changes: 16 additions & 15 deletions src/organization/benchmark_filter/benchmark-filter.response.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,5 @@
import {BasicListResponse} from '../../common/response';

export class BenchmarkFilterItem {
benchmark_category_id: number;
benchmark_category_name: string;
benchmark_category_description: string;
benchmark_id: number;
benchmark_display_name: string;
benchmark_title: string;
benchmark_version: string;
benchmark_needs_connection_string: boolean;
profile_id: number;
profile_title: string;
in_use: boolean;
in_filter: boolean;
}

export interface BenchmarkListItem {
org_family_id: number;
family_id: number;
Expand All @@ -31,6 +16,22 @@ export interface BenchmarkListResponse extends BasicListResponse {
items_used: BenchmarkListItem[];
}

export class BenchmarkFilterItem {
benchmark_category_id: number;
benchmark_category_name: string;
benchmark_category_description: string;
benchmark_id: number;
benchmark_display_name: string;
benchmark_title: string;
benchmark_version: string;
benchmark_needs_connection_string: boolean;
profile_id: number;
profile_title: string;
in_use: boolean;
in_filter: boolean;
}

export class BenchmarkFilterResponse extends BasicListResponse {
items: Array<BenchmarkFilterItem>;
}

Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ <h3>Benchmark Wide Exclusions</h3>
</div>
</div>
</div>
<div class="white-wrapper" *ngIf="response" style="margin-top: 0">
<div class="white-wrapper" style="margin-top: 0">
<div class="container-fluid">
<ul class="list-group" *ngIf="response" id="rules">
<li *ngFor="let item of getResponseItems(response.items); let i=index" class="list-group-item" [class.active]="i == 0" [class.major-heading]="item.section.indexOf('.') < 0 && !isScapRule(item.type)" [class.minor-heading]="item.section.indexOf('.') > -1 && !isScapRule(item.type)" [class.hasComment]="item.change_at > 0" [class.empty-rule-group]="isEmptyGroup(item)">
Expand Down
Loading

0 comments on commit d9c5961

Please sign in to comment.