forked from jsnbuchanan/crowd-funder-for-time-pwa
Fix: stepType was being set to an object
This commit is contained in:
@@ -144,11 +144,14 @@ export default class EntitySelectionStep extends Vue {
|
|||||||
get stepLabel(): string {
|
get stepLabel(): string {
|
||||||
if (this.stepType === "recipient") {
|
if (this.stepType === "recipient") {
|
||||||
return "Choose who received the gift:";
|
return "Choose who received the gift:";
|
||||||
} else if (this.showProjects) {
|
} else if (this.stepType === "giver") {
|
||||||
return "Choose a project benefitted from:";
|
if (this.shouldShowProjects) {
|
||||||
} else {
|
return "Choose a project benefitted from:";
|
||||||
return "Choose a person received from:";
|
} else {
|
||||||
|
return "Choose a person received from:";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
return "Choose entity:";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -166,10 +169,13 @@ export default class EntitySelectionStep extends Vue {
|
|||||||
* Whether to show projects in the grid
|
* Whether to show projects in the grid
|
||||||
*/
|
*/
|
||||||
get shouldShowProjects(): boolean {
|
get shouldShowProjects(): boolean {
|
||||||
return (
|
// When editing an entity, show the appropriate entity type for that entity
|
||||||
(this.stepType === "giver" && this.giverEntityType === "project") ||
|
if (this.stepType === "giver") {
|
||||||
(this.stepType === "recipient" && this.recipientEntityType === "project")
|
return this.giverEntityType === "project";
|
||||||
);
|
} else if (this.stepType === "recipient") {
|
||||||
|
return this.recipientEntityType === "project";
|
||||||
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -564,22 +564,23 @@ export default class GiftedDialog extends Vue {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Handle entity selection from EntitySelectionStep
|
* Handle entity selection from EntitySelectionStep
|
||||||
* @param entity - The selected entity (person or project)
|
* @param entity - The selected entity (person or project) with stepType
|
||||||
*/
|
*/
|
||||||
handleEntitySelected(entity: {
|
handleEntitySelected(entity: {
|
||||||
type: "person" | "project";
|
type: "person" | "project";
|
||||||
data: Contact | PlanData;
|
data: Contact | PlanData;
|
||||||
|
stepType: string;
|
||||||
}) {
|
}) {
|
||||||
if (entity.type === "person") {
|
if (entity.type === "person") {
|
||||||
const contact = entity.data as Contact;
|
const contact = entity.data as Contact;
|
||||||
if (this.stepType === "giver") {
|
if (entity.stepType === "giver") {
|
||||||
this.selectGiver(contact);
|
this.selectGiver(contact);
|
||||||
} else {
|
} else {
|
||||||
this.selectRecipient(contact);
|
this.selectRecipient(contact);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
const project = entity.data as PlanData;
|
const project = entity.data as PlanData;
|
||||||
if (this.stepType === "giver") {
|
if (entity.stepType === "giver") {
|
||||||
this.selectProject(project);
|
this.selectProject(project);
|
||||||
} else {
|
} else {
|
||||||
this.selectRecipientProject(project);
|
this.selectRecipientProject(project);
|
||||||
@@ -589,10 +590,10 @@ export default class GiftedDialog extends Vue {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Handle edit entity request from GiftDetailsStep
|
* Handle edit entity request from GiftDetailsStep
|
||||||
* @param entityType - 'giver' or 'recipient'
|
* @param data - Object containing entityType and currentEntity
|
||||||
*/
|
*/
|
||||||
handleEditEntity(entityType: "giver" | "recipient") {
|
handleEditEntity(data: { entityType: string; currentEntity: any }) {
|
||||||
this.goBackToStep1(entityType);
|
this.goBackToStep1(data.entityType);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
12
src/types/global.d.ts
vendored
12
src/types/global.d.ts
vendored
@@ -67,3 +67,15 @@ declare global {
|
|||||||
electronAPI: ElectronAPI;
|
electronAPI: ElectronAPI;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Vue instance interface extension for global properties.
|
||||||
|
*
|
||||||
|
* This makes global properties available on Vue instances
|
||||||
|
* in TypeScript without type errors.
|
||||||
|
*/
|
||||||
|
declare module 'vue' {
|
||||||
|
interface ComponentCustomProperties {
|
||||||
|
$notify: (notification: any, timeout?: number) => void;
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user