Skip to content

Commit 2ec3535

Browse files
fix(committees): use MenuItem.url for mailto with dynamic member rebuild
Rebuild memberActionMenuItems in toggleMemberActionMenu with the selected member so MenuItem.url is set to the correct mailto: at click time. PrimeNG renders this as a native <a href> — SSR-safe, accessible, no window reference. LFXV2-1190 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Manish Dixit <mdixit@linuxfoundation.org>
1 parent 048deff commit 2ec3535

1 file changed

Lines changed: 4 additions & 7 deletions

File tree

apps/lfx-one/src/app/modules/committees/components/committee-members/committee-members.component.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,8 @@ export class CommitteeMembersComponent implements OnInit {
109109
public toggleMemberActionMenu(event: Event, member: CommitteeMember, menuComponent: MenuComponent): void {
110110
event.stopPropagation();
111111
this.selectedMember.set(member);
112+
// Rebuild menu items so MenuItem.url reflects the selected member's email
113+
this.memberActionMenuItems = this.initializeMemberActionMenuItems(member);
112114
menuComponent.toggle(event);
113115
}
114116

@@ -252,17 +254,12 @@ export class CommitteeMembersComponent implements OnInit {
252254
return toSignal(this.filterForm.get('organization')!.valueChanges.pipe(startWith(null), distinctUntilChanged()), { initialValue: null });
253255
}
254256

255-
private initializeMemberActionMenuItems(): MenuItem[] {
257+
private initializeMemberActionMenuItems(member?: CommitteeMember): MenuItem[] {
256258
return [
257259
{
258260
label: 'Send Message',
259261
icon: 'fa-light fa-envelope',
260-
command: () => {
261-
const email = this.selectedMember()?.email;
262-
if (email) {
263-
window.location.href = `mailto:${email}`;
264-
}
265-
},
262+
url: member?.email ? `mailto:${member.email}` : undefined,
266263
},
267264
{
268265
separator: true,

0 commit comments

Comments
 (0)