Skip to content

Commit

Permalink
bug: correct dropdown menu issue and modal tester config.
Browse files Browse the repository at this point in the history
In a menu, when a dropdown entry was clicked, the page was reloaded. It
caused by an empty `href` tag. Using an `href` tag  without any value
and a 'click' event property binding (as mentioned in the official doc :
https://valor-software.com/ngx-bootstrap/#/dropdowns#anchor-trigger),
all seems work much better.

In the app tester, the button configuration for the modal actions was
missing. Additionally, add default values for modal button if
configuration doesn't provide any values.

Co-Authored-by: Renaud Michotte <renaud.michotte@gmail.com>
  • Loading branch information
zannkukai committed Jan 19, 2021
1 parent 864ef88 commit f92e393
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
4 changes: 3 additions & 1 deletion projects/ng-core-tester/src/app/home/home.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,9 @@ export class HomeComponent implements OnInit {
initialState: {
title: 'Confirmation',
body: 'Exit without saving changes?',
confirmButton: true
confirmButton: true,
cancelTitleButton: 'Abort',
confirmTitleButton: 'Confirm'
}
};

Expand Down
4 changes: 2 additions & 2 deletions projects/rero/ng-core/src/lib/dialog/dialog.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ export class DialogComponent implements OnInit {
confirmButton = true;

// Label of cancel button.
cancelTitleButton: string;
cancelTitleButton = 'Cancel';

// Label of confirmation button.
confirmTitleButton: string;
confirmTitleButton = 'OK';

// Event triggered when modal is closed.
onClose: Subject<boolean>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@
<li class="nav-item dropdown" dropdown placement="bottom right">
<a class="nav-link dropdown-toggle"
dropdownToggle
href=""
href
(click)="false"
[attr.aria-controls]="item.getAttribute('id')"
>
<ng-container [ngTemplateOutlet]="childMenuEntry" [ngTemplateOutletContext]="{item:item}"></ng-container>
Expand Down

0 comments on commit f92e393

Please sign in to comment.