Refactor: eliminate "special" entity type and use DID-based logic
Replace string-based entity type matching with DID-based logic for "You" and "Unnamed" entities. Treat these as regular person entities instead of special types. - Remove "special" type from EntitySelectionEvent interface - Update EntityGrid to emit "You" and "Unnamed" as person entities - Simplify SpecialEntityCard emit structure (remove entityType parameter) - Refactor GiftedDialog to process all person entities with DID-based logic - Update ContactGiftingView and HomeView to use DID-based entity creation - Remove string literals "You" and "Unnamed" from method signatures
This commit is contained in:
@@ -310,16 +310,13 @@ export default class EntityGrid extends Vue {
|
||||
|
||||
/**
|
||||
* Handle special entity selection from SpecialEntityCard
|
||||
* Treat "You" and "Unnamed" as person entities
|
||||
*/
|
||||
handleEntitySelected(event: {
|
||||
type: string;
|
||||
entityType: string;
|
||||
data: { did?: string; name: string };
|
||||
}): void {
|
||||
handleEntitySelected(event: { data: { did?: string; name: string } }): void {
|
||||
// Convert special entities to person entities since they represent people
|
||||
this.emitEntitySelected({
|
||||
type: "special",
|
||||
entityType: event.entityType,
|
||||
data: event.data,
|
||||
type: "person",
|
||||
data: event.data as Contact,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -327,13 +324,11 @@ export default class EntityGrid extends Vue {
|
||||
|
||||
@Emit("entity-selected")
|
||||
emitEntitySelected(data: {
|
||||
type: "person" | "project" | "special";
|
||||
entityType?: string;
|
||||
data: Contact | PlanData | { did?: string; name: string };
|
||||
type: "person" | "project";
|
||||
data: Contact | PlanData;
|
||||
}): {
|
||||
type: "person" | "project" | "special";
|
||||
entityType?: string;
|
||||
data: Contact | PlanData | { did?: string; name: string };
|
||||
type: "person" | "project";
|
||||
data: Contact | PlanData;
|
||||
} {
|
||||
return data;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user