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.
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -110,10 +110,8 @@
|
||||
:all-contacts="allContacts"
|
||||
:active-did="activeDid"
|
||||
:all-my-dids="allMyDids"
|
||||
:conflict-checker="() => false"
|
||||
:notify="$notify"
|
||||
@assign="handleRepresentativeAssigned"
|
||||
@cancel="handleRepresentativeCancel"
|
||||
/>
|
||||
|
||||
<div class="mb-4">
|
||||
@@ -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
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user