forked from jsnbuchanan/crowd-funder-for-time-pwa
Refactor EntitySummaryButton to use function props instead of events
Replace @Emit decorator with function prop pattern for better parent control over edit behavior. EntitySummaryButton now accepts onEditRequested function prop that parent components can use to handle edit requests with custom validation logic. Updated GiftDetailsStep to use new function prop interface with proper parameter handling.
This commit is contained in:
@@ -17,7 +17,7 @@ control over updates and validation * * @author Matthew Raymer */
|
||||
:entity-type="giverEntityType"
|
||||
:label="giverLabel"
|
||||
:editable="canEditGiver"
|
||||
@edit-requested="handleEditGiver"
|
||||
:on-edit-requested="handleEditGiver"
|
||||
/>
|
||||
|
||||
<!-- Recipient Button -->
|
||||
@@ -26,7 +26,7 @@ control over updates and validation * * @author Matthew Raymer */
|
||||
:entity-type="recipientEntityType"
|
||||
:label="recipientLabel"
|
||||
:editable="canEditRecipient"
|
||||
@edit-requested="handleEditRecipient"
|
||||
:on-edit-requested="handleEditRecipient"
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -362,8 +362,12 @@ export default class GiftDetailsStep extends Vue {
|
||||
|
||||
/**
|
||||
* Handle giver edit request
|
||||
* Called by EntitySummaryButton function prop
|
||||
*/
|
||||
handleEditGiver(): void {
|
||||
handleEditGiver(_data: {
|
||||
entityType: string;
|
||||
entity: EntityData | null;
|
||||
}): void {
|
||||
this.emitEditEntity({
|
||||
entityType: "giver",
|
||||
currentEntity: this.giver,
|
||||
@@ -372,8 +376,12 @@ export default class GiftDetailsStep extends Vue {
|
||||
|
||||
/**
|
||||
* Handle recipient edit request
|
||||
* Called by EntitySummaryButton function prop
|
||||
*/
|
||||
handleEditRecipient(): void {
|
||||
handleEditRecipient(_data: {
|
||||
entityType: string;
|
||||
entity: EntityData | null;
|
||||
}): void {
|
||||
this.emitEditEntity({
|
||||
entityType: "recipient",
|
||||
currentEntity: this.receiver,
|
||||
|
||||
Reference in New Issue
Block a user