You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by to...@apache.org on 2018/08/27 12:36:55 UTC
[ambari] branch trunk updated: [AMBARI-24426] [Log Search UI] Show
user friendly component names in Log Index Filter screen (#2153)
This is an automated email from the ASF dual-hosted git repository.
tobiasistvan pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ambari.git
The following commit(s) were added to refs/heads/trunk by this push:
new 872494e [AMBARI-24426] [Log Search UI] Show user friendly component names in Log Index Filter screen (#2153)
872494e is described below
commit 872494eade848cad09eef7c81997a43bdce9b34c
Author: Istvan Tobias <to...@gmail.com>
AuthorDate: Mon Aug 27 14:36:53 2018 +0200
[AMBARI-24426] [Log Search UI] Show user friendly component names in Log Index Filter screen (#2153)
---
.../log-index-filter/log-index-filter.component.html | 2 +-
.../log-index-filter/log-index-filter.component.spec.ts | 4 +++-
.../log-index-filter/log-index-filter.component.ts | 4 ++--
.../dropdown-button/dropdown-button.component.less | 1 -
.../components/dropdown-list/dropdown-list.component.ts | 17 +++++++++++++----
5 files changed, 19 insertions(+), 9 deletions(-)
diff --git a/ambari-logsearch/ambari-logsearch-web/src/app/components/log-index-filter/log-index-filter.component.html b/ambari-logsearch/ambari-logsearch-web/src/app/components/log-index-filter/log-index-filter.component.html
index 856d4bf..e4acd72 100644
--- a/ambari-logsearch/ambari-logsearch-web/src/app/components/log-index-filter/log-index-filter.component.html
+++ b/ambari-logsearch/ambari-logsearch-web/src/app/components/log-index-filter/log-index-filter.component.html
@@ -41,7 +41,7 @@
<input type="checkbox" attr.id="{{component.name}}"
[attr.checked]="isAllLevelsCheckedForComponent(component.name) ? 'checked' : null"
(change)="processAllLevelsForComponent(component.name, $event.target.checked)">
- <label attr.for="{{component.name}}">{{component.label}}</label>
+ <label attr.for="{{component.name}}">{{component.label | componentLabel | async}}</label>
</td>
<td *ngFor="let levelName of levelNames" class="checkbox-column">
<input type="checkbox" attr.id="{{getCheckBoxId(component.name, levelName)}}"
diff --git a/ambari-logsearch/ambari-logsearch-web/src/app/components/log-index-filter/log-index-filter.component.spec.ts b/ambari-logsearch/ambari-logsearch-web/src/app/components/log-index-filter/log-index-filter.component.spec.ts
index 1cede8c..b363d6f 100644
--- a/ambari-logsearch/ambari-logsearch-web/src/app/components/log-index-filter/log-index-filter.component.spec.ts
+++ b/ambari-logsearch/ambari-logsearch-web/src/app/components/log-index-filter/log-index-filter.component.spec.ts
@@ -51,6 +51,7 @@ import {LogsFilteringUtilsService} from '@app/services/logs-filtering-utils.serv
import {RouterTestingModule} from '@angular/router/testing';
import {NotificationsService} from 'angular2-notifications/src/notifications.service';
import {NotificationService} from '@modules/shared/services/notification.service';
+import {ComponentLabelPipe} from "@app/pipes/component-label";
describe('LogIndexFilterComponent', () => {
let component: LogIndexFilterComponent;
@@ -81,7 +82,8 @@ describe('LogIndexFilterComponent', () => {
declarations: [
LogIndexFilterComponent,
DropdownButtonComponent,
- DropdownListComponent
+ DropdownListComponent,
+ ComponentLabelPipe
],
providers: [
...MockHttpRequestModules,
diff --git a/ambari-logsearch/ambari-logsearch-web/src/app/components/log-index-filter/log-index-filter.component.ts b/ambari-logsearch/ambari-logsearch-web/src/app/components/log-index-filter/log-index-filter.component.ts
index f9153b9..76443cd 100644
--- a/ambari-logsearch/ambari-logsearch-web/src/app/components/log-index-filter/log-index-filter.component.ts
+++ b/ambari-logsearch/ambari-logsearch-web/src/app/components/log-index-filter/log-index-filter.component.ts
@@ -20,6 +20,7 @@ import {Component, OnInit, Output, EventEmitter, forwardRef, OnDestroy} from '@a
import {ControlValueAccessor, NG_VALUE_ACCESSOR} from '@angular/forms';
import {Observable} from 'rxjs/Observable';
import 'rxjs/add/operator/map';
+import {Subscription} from 'rxjs/Subscription';
import {Moment} from 'moment';
import {ListItem} from '@app/classes/list-item';
import {HomogeneousObject, LogLevelObject} from '@app/classes/object';
@@ -30,7 +31,6 @@ import {UserSettingsService} from '@app/services/user-settings.service';
import {UtilsService} from '@app/services/utils.service';
import {ClustersService} from '@app/services/storage/clusters.service';
import {HostsService} from '@app/services/storage/hosts.service';
-import {Subscription} from 'rxjs/Subscription';
@Component({
selector: 'log-index-filter',
@@ -63,7 +63,7 @@ export class LogIndexFilterComponent implements OnInit, OnDestroy, ControlValueA
return clusterNames.map(this.utils.getListItemFromString);
});
- activeClusterName: string = '';
+ activeClusterName = '';
private subscriptions: Subscription[] = [];
diff --git a/ambari-logsearch/ambari-logsearch-web/src/app/modules/shared/components/dropdown-button/dropdown-button.component.less b/ambari-logsearch/ambari-logsearch-web/src/app/modules/shared/components/dropdown-button/dropdown-button.component.less
index d1aa4c9..82645e5 100644
--- a/ambari-logsearch/ambari-logsearch-web/src/app/modules/shared/components/dropdown-button/dropdown-button.component.less
+++ b/ambari-logsearch/ambari-logsearch-web/src/app/modules/shared/components/dropdown-button/dropdown-button.component.less
@@ -18,7 +18,6 @@
@import '../../mixins';
:host {
- .default-flex;
position: relative;
button {
diff --git a/ambari-logsearch/ambari-logsearch-web/src/app/modules/shared/components/dropdown-list/dropdown-list.component.ts b/ambari-logsearch/ambari-logsearch-web/src/app/modules/shared/components/dropdown-list/dropdown-list.component.ts
index 12d5bc2..10ee68c 100644
--- a/ambari-logsearch/ambari-logsearch-web/src/app/modules/shared/components/dropdown-list/dropdown-list.component.ts
+++ b/ambari-logsearch/ambari-logsearch-web/src/app/modules/shared/components/dropdown-list/dropdown-list.component.ts
@@ -17,9 +17,10 @@
*/
import {
- Component, OnChanges, AfterViewChecked, SimpleChanges, Input, Output, EventEmitter, ViewChildren, ViewContainerRef,
- QueryList, ChangeDetectorRef, ElementRef, ViewChild, OnInit
+ Component, OnChanges, AfterViewChecked, OnDestroy, SimpleChanges, Input, Output, EventEmitter,
+ ViewChildren, ViewContainerRef, QueryList, ChangeDetectorRef, ElementRef, ViewChild, OnInit
} from '@angular/core';
+import {Subscription} from 'rxjs/Subscription';
import {ListItem} from '@app/classes/list-item';
import {ComponentGeneratorService} from '@app/services/component-generator.service';
@@ -28,7 +29,7 @@ import {ComponentGeneratorService} from '@app/services/component-generator.servi
templateUrl: './dropdown-list.component.html',
styleUrls: ['./dropdown-list.component.less']
})
-export class DropdownListComponent implements OnInit, OnChanges, AfterViewChecked {
+export class DropdownListComponent implements OnInit, OnChanges, AfterViewChecked, OnDestroy {
private shouldRenderAdditionalComponents = false;
@@ -76,6 +77,8 @@ export class DropdownListComponent implements OnInit, OnChanges, AfterViewChecke
private filterRegExp: RegExp;
+ private subscriptions: Subscription[] = [];
+
constructor(
private componentGenerator: ComponentGeneratorService,
private changeDetector: ChangeDetectorRef
@@ -84,7 +87,13 @@ export class DropdownListComponent implements OnInit, OnChanges, AfterViewChecke
ngOnInit() {
this.separateSelections();
this.setDefaultSelection(this.items);
- this.selectedItemChange.subscribe(this.separateSelections);
+ this.subscriptions.push(
+ this.selectedItemChange.subscribe(this.separateSelections)
+ );
+ }
+
+ ngOnDestroy() {
+ this.subscriptions.forEach((subscription: Subscription) => subscription.unsubscribe());
}
ngOnChanges(changes: SimpleChanges): void {