Skip to content

Commit

Permalink
[ACS-8991] Fix sidenav issue when clicking on manage saved searches (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
MichalKinas authored Nov 18, 2024
1 parent 726d9ce commit baaa8ca
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<app-expand-menu *ngIf="item" [item]="item" (actionClicked)="onActionClick()" />
<app-expand-menu *ngIf="item" [item]="item" (actionClicked)="onActionClick($event)" />
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,10 @@ export class SaveSearchSidenavComponent implements OnInit, OnDestroy {
this.destroy$.complete();
}

onActionClick(): void {
this.appService.appNavNarMode$.next('collapsed');
onActionClick(el: NavBarLinkRef): void {
if (el.id !== this.manageSearchesId) {
this.appService.appNavNarMode$.next('collapsed');
}
}

private createNavBarLinkRef(children: SavedSearch[]): NavBarLinkRef {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<button
acaActiveLink="aca-action-button--active"
[action]="child"
(actionClicked)="actionClicked.emit()"
(actionClicked)="actionClicked.emit($event)"
[attr.aria-label]="child.title | translate"
[id]="child.id"
[attr.data-automation-id]="child.id"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export class ExpandMenuComponent implements OnInit {
item: NavBarLinkRef;

@Output()
actionClicked = new EventEmitter<void>();
actionClicked = new EventEmitter<NavBarLinkRef>();

constructor(private cd: ChangeDetectorRef) {}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import { Directive, EventEmitter, HostListener, Input, Output } from '@angular/c
import { Params, PRIMARY_OUTLET, Router } from '@angular/router';
import { Store } from '@ngrx/store';
import { AppStore } from '@alfresco/aca-shared/store';
import { NavBarLinkRef } from '@alfresco/adf-extensions';

@Directive({
standalone: true,
Expand All @@ -36,7 +37,7 @@ import { AppStore } from '@alfresco/aca-shared/store';
export class ActionDirective {
@Input() action;

@Output() actionClicked = new EventEmitter<void>();
@Output() actionClicked = new EventEmitter<NavBarLinkRef>();

@HostListener('click')
onClick() {
Expand All @@ -48,7 +49,7 @@ export class ActionDirective {
payload: this.getNavigationCommands(this.action.click.payload)
});
}
this.actionClicked.next();
this.actionClicked.next(this.action);
}

constructor(private router: Router, private store: Store<AppStore>) {}
Expand Down

0 comments on commit baaa8ca

Please sign in to comment.