|
@ -42,13 +42,13 @@ |
|
|
icon="circle-question" |
|
|
icon="circle-question" |
|
|
class="text-slate-400 text-4xl shrink-0" |
|
|
class="text-slate-400 text-4xl shrink-0" |
|
|
/> |
|
|
/> |
|
|
<span class="text-ellipsis overflow-hidden italic text-slate-500">(Unnamed/Unknown)</span> |
|
|
<span class="text-ellipsis overflow-hidden italic text-slate-500">{{ unnamedEntityName }}</span> |
|
|
</span> |
|
|
</span> |
|
|
<span class="text-right"> |
|
|
<span class="text-right"> |
|
|
<button |
|
|
<button |
|
|
type="button" |
|
|
type="button" |
|
|
class="block w-full text-center text-sm uppercase bg-gradient-to-b from-blue-400 to-blue-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-3 py-1.5 rounded-md" |
|
|
class="block w-full text-center text-sm uppercase bg-gradient-to-b from-blue-400 to-blue-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-3 py-1.5 rounded-md" |
|
|
@click="openDialog({ did: '', name: 'Unnamed' })" |
|
|
@click="openDialog({ did: '', name: unnamedEntityName })" |
|
|
> |
|
|
> |
|
|
<font-awesome icon="gift" class="fa-fw"></font-awesome> |
|
|
<font-awesome icon="gift" class="fa-fw"></font-awesome> |
|
|
</button> |
|
|
</button> |
|
@ -108,6 +108,7 @@ import { GiverReceiverInputInfo } from "../libs/util"; |
|
|
import { logger } from "../utils/logger"; |
|
|
import { logger } from "../utils/logger"; |
|
|
import { PlatformServiceMixin } from "@/utils/PlatformServiceMixin"; |
|
|
import { PlatformServiceMixin } from "@/utils/PlatformServiceMixin"; |
|
|
import { createNotifyHelpers, TIMEOUTS } from "@/utils/notify"; |
|
|
import { createNotifyHelpers, TIMEOUTS } from "@/utils/notify"; |
|
|
|
|
|
import { UNNAMED_ENTITY_NAME } from "@/constants/entities"; |
|
|
@Component({ |
|
|
@Component({ |
|
|
components: { GiftedDialog, QuickNav, EntityIcon }, |
|
|
components: { GiftedDialog, QuickNav, EntityIcon }, |
|
|
mixins: [PlatformServiceMixin], |
|
|
mixins: [PlatformServiceMixin], |
|
@ -246,7 +247,7 @@ export default class ContactGiftingView extends Vue { |
|
|
return { did: this.activeDid, name: "You" }; |
|
|
return { did: this.activeDid, name: "You" }; |
|
|
} else if (!contact.did || contact.did === "") { |
|
|
} else if (!contact.did || contact.did === "") { |
|
|
// If DID is empty/null, create "Unnamed" entity |
|
|
// If DID is empty/null, create "Unnamed" entity |
|
|
return { did: "", name: "Unnamed" }; |
|
|
return { did: "", name: UNNAMED_ENTITY_NAME }; |
|
|
} else { |
|
|
} else { |
|
|
// Create a copy of the contact to avoid modifying the original |
|
|
// Create a copy of the contact to avoid modifying the original |
|
|
return { ...contact }; |
|
|
return { ...contact }; |
|
@ -267,7 +268,7 @@ export default class ContactGiftingView extends Vue { |
|
|
return { giver, recipient }; |
|
|
return { giver, recipient }; |
|
|
} else { |
|
|
} else { |
|
|
// We're selecting a recipient, so the selected entity becomes the recipient |
|
|
// We're selecting a recipient, so the selected entity becomes the recipient |
|
|
const recipient = selectedEntity || { did: "", name: "Unnamed" }; |
|
|
const recipient = selectedEntity || { did: "", name: UNNAMED_ENTITY_NAME }; |
|
|
const giver = this.createGiverFromContext(); |
|
|
const giver = this.createGiverFromContext(); |
|
|
return { giver, recipient }; |
|
|
return { giver, recipient }; |
|
|
} |
|
|
} |
|
@ -292,7 +293,7 @@ export default class ContactGiftingView extends Vue { |
|
|
name: this.recipientProjectName, |
|
|
name: this.recipientProjectName, |
|
|
}; |
|
|
}; |
|
|
} else { |
|
|
} else { |
|
|
return { did: "", name: "Unnamed" }; |
|
|
return { did: "", name: UNNAMED_ENTITY_NAME }; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -316,11 +317,20 @@ export default class ContactGiftingView extends Vue { |
|
|
name: this.giverProjectName, |
|
|
name: this.giverProjectName, |
|
|
}; |
|
|
}; |
|
|
} else { |
|
|
} else { |
|
|
return { did: "", name: "Unnamed" }; |
|
|
return { did: "", name: UNNAMED_ENTITY_NAME }; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* Get the unnamed entity name constant |
|
|
|
|
|
*/ |
|
|
|
|
|
get unnamedEntityName(): string { |
|
|
|
|
|
return UNNAMED_ENTITY_NAME; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
get shouldShowYouEntity(): boolean { |
|
|
get shouldShowYouEntity(): boolean { |
|
|
if (this.stepType === "giver") { |
|
|
if (this.stepType === "giver") { |
|
|
// When selecting a giver, show "You" if the current recipient is not "You" |
|
|
// When selecting a giver, show "You" if the current recipient is not "You" |
|
@ -346,3 +356,4 @@ export default class ContactGiftingView extends Vue { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
</script> |
|
|
</script> |
|
|
|
|
|
|
|
|