From 9a3409c29f9b6e0390070134cb30b77ff220ba73 Mon Sep 17 00:00:00 2001 From: Jose Olarte III Date: Fri, 7 Nov 2025 17:43:44 +0800 Subject: [PATCH] refactor: remove unused code from ProjectRepresentativeDialog - Remove conflictChecker prop (always passed as no-op function) - Remove unused emitCancel method and cancel event handling - Simplify handleEntitySelected by removing unnecessary type check - Update NewEditProjectView to remove conflict-checker binding and empty cancel handler The conflictChecker prop was not needed since representative selection doesn't require conflict detection. The cancel event was never emitted and the parent handler was empty, so both were removed. --- .../ProjectRepresentativeDialog.vue | 19 ++++--------------- src/views/NewEditProjectView.vue | 9 --------- 2 files changed, 4 insertions(+), 24 deletions(-) diff --git a/src/components/ProjectRepresentativeDialog.vue b/src/components/ProjectRepresentativeDialog.vue index c15b2dcd..51afcb5f 100644 --- a/src/components/ProjectRepresentativeDialog.vue +++ b/src/components/ProjectRepresentativeDialog.vue @@ -13,7 +13,7 @@ :active-did="activeDid" :all-my-dids="allMyDids" :all-contacts="allContacts" - :conflict-checker="conflictChecker" + :conflict-checker="() => false" :show-you-entity="false" :show-unnamed-entity="false" :notify="notify" @@ -70,10 +70,6 @@ export default class ProjectRepresentativeDialog extends Vue { @Prop({ required: true }) allMyDids!: string[]; - /** Function to check if a person DID would create a conflict */ - @Prop({ required: true }) - conflictChecker!: (did: string) => boolean; - /** Notification function from parent component */ @Prop() notify?: (notification: NotificationIface, timeout?: number) => void; @@ -83,11 +79,9 @@ export default class ProjectRepresentativeDialog extends Vue { * Immediately assigns the selected contact and closes the dialog */ handleEntitySelected(event: { type: "person" | "project"; data: Contact }) { - if (event.type === "person") { - const contact = event.data as Contact; - this.emitAssign(contact); - this.close(); - } + const contact = event.data as Contact; + this.emitAssign(contact); + this.close(); } /** @@ -117,11 +111,6 @@ export default class ProjectRepresentativeDialog extends Vue { emitAssign(contact: Contact): Contact { return contact; } - - @Emit("cancel") - emitCancel(): void { - // No return value needed - } } diff --git a/src/views/NewEditProjectView.vue b/src/views/NewEditProjectView.vue index 29362324..1d006d48 100644 --- a/src/views/NewEditProjectView.vue +++ b/src/views/NewEditProjectView.vue @@ -110,10 +110,8 @@ :all-contacts="allContacts" :active-did="activeDid" :all-my-dids="allMyDids" - :conflict-checker="() => false" :notify="$notify" @assign="handleRepresentativeAssigned" - @cancel="handleRepresentativeCancel" />
@@ -1062,13 +1060,6 @@ export default class NewEditProjectView extends Vue { this.agentDid = contact.did; } - /** - * Handle representative dialog cancel - */ - handleRepresentativeCancel(): void { - // Dialog closes itself, nothing to do here - } - /** * Unset the representative and revert to initial state */