[ 
https://issues.apache.org/jira/browse/AMBARI-24975?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16704890#comment-16704890
 ] 

ASF GitHub Bot commented on AMBARI-24975:
-----------------------------------------

tobias-istvan closed pull request #50: [AMBARI-24975] Log Search UI: if there 
are multiple clusters - selecting one of it does not do anything
URL: https://github.com/apache/ambari-logsearch/pull/50
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git 
a/ambari-logsearch-web/src/app/modules/shared/components/dropdown-list/dropdown-list.component.html
 
b/ambari-logsearch-web/src/app/modules/shared/components/dropdown-list/dropdown-list.component.html
index 6cea2a114a..cc790aba03 100644
--- 
a/ambari-logsearch-web/src/app/modules/shared/components/dropdown-list/dropdown-list.component.html
+++ 
b/ambari-logsearch-web/src/app/modules/shared/components/dropdown-list/dropdown-list.component.html
@@ -19,7 +19,7 @@
       [attr.role]="item.isDivider ? 'separator' : null" 
[ngClass]="(item.cssClass || '')" (click)="onItemClick($event)">
     <ng-container *ngIf="!item.isDivider">
       <span class="list-item-label" *ngIf="isMultipleChoice">
-        <input type="checkbox" [attr.id]="(instanceId) + '-' + (item.id || 
item.value)" [(ngModel)]="item.isChecked"
+        <input type="checkbox" [attr.id]="(instanceId) + '-' + (item.id || 
item.value)" [ngModel]="item.isChecked"
                (change)="changeSelectedItem({value: item.value, isChecked: 
$event.currentTarget.checked}, $event)">
         <label [attr.for]="(instanceId) + '-' + (item.id || item.value)" 
class="label-container">
           <span *ngIf="item.iconClass" [ngClass]="item.iconClass"></span>
diff --git 
a/ambari-logsearch-web/src/app/modules/shared/components/dropdown-list/dropdown-list.component.ts
 
b/ambari-logsearch-web/src/app/modules/shared/components/dropdown-list/dropdown-list.component.ts
index 8be7e648ae..4db1bc58e1 100644
--- 
a/ambari-logsearch-web/src/app/modules/shared/components/dropdown-list/dropdown-list.component.ts
+++ 
b/ambari-logsearch-web/src/app/modules/shared/components/dropdown-list/dropdown-list.component.ts
@@ -175,20 +175,17 @@ export class DropdownListComponent implements OnInit, 
OnChanges, AfterViewChecke
   }
 
   selectAll() {
-    this.items.forEach((item: ListItem) => {
-      item.isChecked = true;
-      if (item.onSelect) {
-        item.onSelect(...this.actionArguments);
-      }
-    });
-    this.selectedItemChange.emit(this.items);
+    this.changeSelectedItem(this.items.map((item: ListItem) => ({
+      ...item,
+      isChecked: true
+    })));
   }
 
   unSelectAll() {
-    this.items.forEach((item: ListItem) => {
-      item.isChecked = false;
-    });
-    this.selectedItemChange.emit(this.items);
+    this.changeSelectedItem(this.items.map((item: ListItem) => ({
+      ...item,
+      isChecked: false
+    })));
   }
 
   private onFilterInputKeyUp(event) {
@@ -223,10 +220,12 @@ export class DropdownListComponent implements OnInit, 
OnChanges, AfterViewChecke
     }
   }
 
-  changeSelectedItem(item: ListItem, event?: MouseEvent): void {
-    if (item.onSelect) {
-      item.onSelect(...this.actionArguments);
-    }
+  changeSelectedItem(item: ListItem | ListItem[], event?: MouseEvent): void {
+    (Array.isArray(item) ? item : [item]).forEach((currentItem: ListItem) => {
+      if (currentItem.onSelect) {
+        currentItem.onSelect(...this.actionArguments)
+      }
+    });
     this.selectedItemChange.emit(item);
   }
 


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


> Log Search UI: if there are multiple clusters - selecting one of it does not 
> do anything
> ----------------------------------------------------------------------------------------
>
>                 Key: AMBARI-24975
>                 URL: https://issues.apache.org/jira/browse/AMBARI-24975
>             Project: Ambari
>          Issue Type: Bug
>          Components: ambari-logsearch, logsearch
>    Affects Versions: 2.7.3
>            Reporter: Istvan Tobias
>            Assignee: Istvan Tobias
>            Priority: Blocker
>              Labels: pull-request-available
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> When there is more then one clusters, if im selecting one, service log tabs / 
> graphs are not changing at all. also im not seeing cluster field in the url 
> hash
> expectation: it should resend the queries



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to