Merge changes
This commit is contained in:
@@ -125,7 +125,7 @@ export default class ClaimCertificateView extends Vue {
|
||||
);
|
||||
|
||||
if (claimData.claimType === "GiveAction" && claimData.claim.agent) {
|
||||
const presentedText = "Thanks To ";
|
||||
const presentedText = "Thanks To";
|
||||
ctx.font = "14px Arial";
|
||||
const presentedWidth = ctx.measureText(presentedText).width;
|
||||
ctx.fillText(
|
||||
@@ -148,8 +148,36 @@ export default class ClaimCertificateView extends Vue {
|
||||
);
|
||||
}
|
||||
|
||||
// alternatively, show some offer details
|
||||
if (claimData.claimType === "Offer") {
|
||||
const presentedText = "To";
|
||||
ctx.font = "14px Arial";
|
||||
const presentedWidth = ctx.measureText(presentedText).width;
|
||||
ctx.fillText(
|
||||
presentedText,
|
||||
(CANVAS_WIDTH - presentedWidth) / 2, // Center horizontally
|
||||
CANVAS_HEIGHT * 0.37,
|
||||
);
|
||||
// fulfills
|
||||
const agentDid =
|
||||
claimData.claim.agent.identifier || claimData.claim.agent;
|
||||
const agentText = serverUtil.didInfoForCertificate(
|
||||
agentDid,
|
||||
allContacts,
|
||||
);
|
||||
ctx.font = "bold 20px Arial";
|
||||
const agentWidth = ctx.measureText(agentText).width;
|
||||
ctx.fillText(
|
||||
agentText,
|
||||
(CANVAS_WIDTH - agentWidth) / 2, // Center horizontally
|
||||
CANVAS_HEIGHT * 0.41,
|
||||
);
|
||||
}
|
||||
|
||||
const descriptionText =
|
||||
claimData.claim.name || claimData.claim.description;
|
||||
claimData.claim.name ||
|
||||
claimData.claim.description ||
|
||||
claimData.claim.itemOffered?.description; // for Offers
|
||||
if (descriptionText) {
|
||||
const descriptionLine =
|
||||
descriptionText.length > 50
|
||||
@@ -164,12 +192,12 @@ export default class ClaimCertificateView extends Vue {
|
||||
);
|
||||
}
|
||||
|
||||
if (
|
||||
claimData.claim.object?.amountOfThisGood &&
|
||||
claimData.claim.object?.unitCode
|
||||
) {
|
||||
const amount = claimData.claim.object.amountOfThisGood;
|
||||
const unit = claimData.claim.object.unitCode;
|
||||
const possibleObject =
|
||||
claimData.claim.object || // for GiveActions
|
||||
claimData.claim.includesObject; // for Offers
|
||||
if (possibleObject?.amountOfThisGood && possibleObject?.unitCode) {
|
||||
const amount = possibleObject.amountOfThisGood;
|
||||
const unit = possibleObject.unitCode;
|
||||
const amountText = serverUtil.displayAmount(unit, amount);
|
||||
const amountWidth = ctx.measureText(amountText).width;
|
||||
// if there was no description then put this in that spot, otherwise put it below the description
|
||||
|
||||
Reference in New Issue
Block a user