mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 12:54:30 +02:00
Fully integrate cert properties
This commit is contained in:
parent
1c0a564155
commit
702528a8cc
2 changed files with 33 additions and 5 deletions
|
@ -30,7 +30,7 @@ Rectangle {
|
||||||
property string itemName: "--";
|
property string itemName: "--";
|
||||||
property string itemOwner: "--";
|
property string itemOwner: "--";
|
||||||
property string itemEdition: "--";
|
property string itemEdition: "--";
|
||||||
property string dateOfPurchase: "";
|
property string dateOfPurchase: "--";
|
||||||
property bool isLightbox: false;
|
property bool isLightbox: false;
|
||||||
// Style
|
// Style
|
||||||
color: hifi.colors.faintGray;
|
color: hifi.colors.faintGray;
|
||||||
|
@ -45,17 +45,43 @@ Rectangle {
|
||||||
root.itemOwner = "\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022";
|
root.itemOwner = "\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022";
|
||||||
root.itemEdition = result.data.edition_number + "/" + (result.data.limited_run === -1 ? "\u221e" : result.data.limited_run);
|
root.itemEdition = result.data.edition_number + "/" + (result.data.limited_run === -1 ? "\u221e" : result.data.limited_run);
|
||||||
root.dateOfPurchase = getFormattedDate(result.data.transfer_created_at * 1000);
|
root.dateOfPurchase = getFormattedDate(result.data.transfer_created_at * 1000);
|
||||||
|
root.itemName = result.data.marketplace_item_name;
|
||||||
|
|
||||||
if (result.data.invalid_reason) {
|
if (result.data.invalid_reason || result.data.transfer_status[0] === "failed") {
|
||||||
errorText.text = "Here we will display some text if there's an <b>error</b> with the certificate " +
|
titleBarText.text = "Invalid Certificate";
|
||||||
"(DMCA takedown, invalid cert, location of item updated)";
|
titleBarText.color = hifi.colors.redHighlight;
|
||||||
|
popText.text = "";
|
||||||
|
if (result.data.invalid_reason) {
|
||||||
|
errorText.text = result.data.invalid_reason;
|
||||||
|
}
|
||||||
|
} else if (result.data.transfer_status[0] === "pending") {
|
||||||
|
titleBarText.text = "Certificate Pending";
|
||||||
|
errorText.text = "The status of this item is still pending confirmation. If the purchase is not confirmed, " +
|
||||||
|
"this entity will be cleaned up by the domain.";
|
||||||
|
errorText.color = hifi.colors.baseGray;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onCertificateIdChanged: {
|
onCertificateIdChanged: {
|
||||||
commerce.certificateInfo(certificateId);
|
if (certificateId !== "") {
|
||||||
|
commerce.certificateInfo(certificateId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
onVisibleChanged: {
|
||||||
|
if (!visible) {
|
||||||
|
titleBarText.text = "Certificate";
|
||||||
|
popText.text = "PROOF OF PURCHASE";
|
||||||
|
root.certificateId = "";
|
||||||
|
root.itemName = "--";
|
||||||
|
root.itemOwner = "--";
|
||||||
|
root.itemEdition = "--";
|
||||||
|
root.dateOfPurchase = "--";
|
||||||
|
root.marketplaceUrl = "";
|
||||||
|
errorText.text = "";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// This object is always used in a popup.
|
// This object is always used in a popup.
|
||||||
|
@ -298,6 +324,7 @@ Rectangle {
|
||||||
// "Show In Marketplace" button
|
// "Show In Marketplace" button
|
||||||
HifiControlsUit.Button {
|
HifiControlsUit.Button {
|
||||||
id: showInMarketplaceButton;
|
id: showInMarketplaceButton;
|
||||||
|
enabled: root.marketplaceUrl;
|
||||||
color: hifi.buttons.blue;
|
color: hifi.buttons.blue;
|
||||||
colorScheme: hifi.colorSchemes.light;
|
colorScheme: hifi.colorSchemes.light;
|
||||||
anchors.top: parent.top;
|
anchors.top: parent.top;
|
||||||
|
|
|
@ -427,6 +427,7 @@ Rectangle {
|
||||||
itemId: id;
|
itemId: id;
|
||||||
itemPreviewImageUrl: preview;
|
itemPreviewImageUrl: preview;
|
||||||
itemHref: download_url;
|
itemHref: download_url;
|
||||||
|
certificateId: certificate_id;
|
||||||
purchaseStatus: status;
|
purchaseStatus: status;
|
||||||
purchaseStatusChanged: statusChanged;
|
purchaseStatusChanged: statusChanged;
|
||||||
itemEdition: model.edition_number;
|
itemEdition: model.edition_number;
|
||||||
|
|
Loading…
Reference in a new issue