refactor: combine member processing methods in BulkMembersDialog
Consolidate organizerAdmitAndAddWithVisibility() and
memberAddContactWithVisibility() into a single unified method
processSelectedMembers() that handles both organizer and member
modes based on the isOrganizer prop.
- Remove redundant handleMainAction() wrapper method
- Update template to call processSelectedMembers directly
- Reduce code duplication by ~30% (140 lines → 98 lines)
- Maintain identical functionality for both modes
This simplifies the component structure and makes the processing
logic easier to maintain.
text:`${admittedCount} member${admittedCount===1?"":"s"} admitted and registered${contactAddedCount===0?"":admittedCount===contactAddedCount?" and":`, ${contactAddedCount}`}${contactAddedCount===0?"":` added as contact${contactAddedCount===1?"":"s"}`}.`,
},
10000,
);
}
if(errors>0){
this.$notify(
{
group:"alert",
type:"danger",
title:"Error",
text:"Failed to fully admit some members. Work with them individually below.",
console.error(`Error processing member ${member.did}:`,error);
//Continuewithothermembersevenifonefails
if(this.isOrganizer){
if(admittedCount>0){
this.$notify(
{
group:"alert",
type:"success",
title:"Members Admitted Successfully",
text:`${admittedCount} member${admittedCount===1?"":"s"} admitted and registered${contactAddedCount===0?"":admittedCount===contactAddedCount?" and":`, ${contactAddedCount}`}${contactAddedCount===0?"":` added as contact${contactAddedCount===1?"":"s"}`}.`,
},
5000,
);
}
if(errors>0){
this.$notify(
{
group:"alert",
type:"danger",
title:"Error",
text:"Failed to fully admit some members. Work with them individually below.",
},
5000,
);
}
}else{
//Membermode:showcontactsaddednotification
if(contactAddedCount>0){
this.$notify(
{
group:"alert",
type:"success",
title:"Contacts Added Successfully",
text:`${contactAddedCount} member${contactAddedCount===1?"":"s"} added as contact${contactAddedCount===1?"":"s"}.`,
},
5000,
);
}
}
//Showsuccessnotification
this.$notify(
{
group:"alert",
type:"success",
title:"Contacts Added Successfully",
text:`${contactsAddedCount} member${contactsAddedCount===1?"":"s"} added as contact${contactsAddedCount===1?"":"s"}.`,