feat(MintTokens): Add mint failure flow
- It updates `CommunityCollectibleView` to display minting failure state. - It updates `CommunityMintedTokensView` to display minting failure state. - It exposes subtitle color property in `CollectibleView`. - It updates `storybook` with more options to display minting failure state. Closes #10620
This commit is contained in:
parent
6e2d552220
commit
92f77e5fd9
|
@ -7,6 +7,8 @@ import AppLayouts.Chat.views.communities 1.0
|
||||||
import Storybook 1.0
|
import Storybook 1.0
|
||||||
import Models 1.0
|
import Models 1.0
|
||||||
|
|
||||||
|
import utils 1.0
|
||||||
|
|
||||||
SplitView {
|
SplitView {
|
||||||
|
|
||||||
Logs { id: logs }
|
Logs { id: logs }
|
||||||
|
@ -26,7 +28,6 @@ SplitView {
|
||||||
anchors.margins: 50
|
anchors.margins: 50
|
||||||
artworkSource: ModelsData.icons.superRare
|
artworkSource: ModelsData.icons.superRare
|
||||||
preview: previewBox.checked
|
preview: previewBox.checked
|
||||||
deployState: mintingStateBox.checked ? 1 /*Completed*/ : 0 /*Failed*/
|
|
||||||
remotelyDestructState: remotelyDestructStateBox.checked ? 1 /*In progress*/ : 2 /*Completed*/
|
remotelyDestructState: remotelyDestructStateBox.checked ? 1 /*In progress*/ : 2 /*Completed*/
|
||||||
burnState: burnDestructStateBox.checked ? 1 /*In progress*/ : 2 /*Completed*/
|
burnState: burnDestructStateBox.checked ? 1 /*In progress*/ : 2 /*Completed*/
|
||||||
name: nameText.text
|
name: nameText.text
|
||||||
|
@ -77,10 +78,29 @@ SplitView {
|
||||||
checked: true
|
checked: true
|
||||||
}
|
}
|
||||||
|
|
||||||
CheckBox {
|
ColumnLayout {
|
||||||
id: mintingStateBox
|
Label {
|
||||||
text: "Minting in progress"
|
text: "Minting state:"
|
||||||
checked: true
|
}
|
||||||
|
|
||||||
|
RadioButton {
|
||||||
|
id: mintingInProgress
|
||||||
|
text: "In progress"
|
||||||
|
onCheckedChanged: if(checked) view.deployState = Constants.BackendProcessState.InProgress
|
||||||
|
}
|
||||||
|
|
||||||
|
RadioButton {
|
||||||
|
id: mintingFailed
|
||||||
|
text: "Failed"
|
||||||
|
onCheckedChanged: if(checked) view.deployState = Constants.BackendProcessState.Failed
|
||||||
|
}
|
||||||
|
|
||||||
|
RadioButton {
|
||||||
|
id: mintingCompleted
|
||||||
|
text: "Completed"
|
||||||
|
checked: true
|
||||||
|
onCheckedChanged: if(checked) view.deployState = Constants.BackendProcessState.Completed
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CheckBox {
|
CheckBox {
|
||||||
|
|
|
@ -21,7 +21,7 @@ QtObject {
|
||||||
{
|
{
|
||||||
name: "SuperRare artwork",
|
name: "SuperRare artwork",
|
||||||
image: ModelsData.banners.superRare,
|
image: ModelsData.banners.superRare,
|
||||||
deployState: 1,
|
deployState: 0,
|
||||||
symbol: "SRW",
|
symbol: "SRW",
|
||||||
description: "Desc",
|
description: "Desc",
|
||||||
supply: 1,
|
supply: 1,
|
||||||
|
|
|
@ -79,15 +79,27 @@ StatusScrollView {
|
||||||
spacing: Style.current.padding
|
spacing: Style.current.padding
|
||||||
|
|
||||||
RowLayout {
|
RowLayout {
|
||||||
visible: !root.preview && (root.deployState === Constants.BackendProcessState.InProgress)
|
visible: !root.preview && ((root.deployState === Constants.BackendProcessState.InProgress) ||
|
||||||
|
(root.deployState === Constants.BackendProcessState.Failed))
|
||||||
spacing: Style.current.halfPadding
|
spacing: Style.current.halfPadding
|
||||||
|
|
||||||
StatusDotsLoadingIndicator {}
|
StatusDotsLoadingIndicator {
|
||||||
|
visible: (root.deployState === Constants.BackendProcessState.InProgress)
|
||||||
|
}
|
||||||
|
|
||||||
|
StatusIcon {
|
||||||
|
visible: (root.deployState === Constants.BackendProcessState.Failed)
|
||||||
|
icon: "warning"
|
||||||
|
color: Theme.palette.dangerColor1
|
||||||
|
}
|
||||||
|
|
||||||
StatusBaseText {
|
StatusBaseText {
|
||||||
elide: Text.ElideRight
|
elide: Text.ElideRight
|
||||||
font.pixelSize: Theme.primaryTextFontSize
|
font.pixelSize: Theme.primaryTextFontSize
|
||||||
text: qsTr("Collectible is being minted")
|
text: (root.deployState === Constants.BackendProcessState.InProgress) ?
|
||||||
|
qsTr("Collectible is being minted") :
|
||||||
|
(root.deployState === Constants.BackendProcessState.Failed) ? qsTr("Collectible minting failed") : ""
|
||||||
|
color: (root.deployState === Constants.BackendProcessState.Failed) ? Theme.palette.dangerColor1 : Theme.palette.directColor1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@ StatusScrollView {
|
||||||
|
|
||||||
function getSubtitle(deployState, remainingTokens, supply) {
|
function getSubtitle(deployState, remainingTokens, supply) {
|
||||||
if(deployState === Constants.BackendProcessState.Failed) {
|
if(deployState === Constants.BackendProcessState.Failed) {
|
||||||
return qsTr("Failed")
|
return qsTr("Minting failed")
|
||||||
}
|
}
|
||||||
|
|
||||||
if(deployState === Constants.BackendProcessState.InProgress) {
|
if(deployState === Constants.BackendProcessState.InProgress) {
|
||||||
|
@ -71,6 +71,7 @@ StatusScrollView {
|
||||||
width: gridView.cellWidth
|
width: gridView.cellWidth
|
||||||
title: model.name ? model.name : "..."
|
title: model.name ? model.name : "..."
|
||||||
subTitle: d.getSubtitle(model.deployState, model.remainingTokens, model.supply)
|
subTitle: d.getSubtitle(model.deployState, model.remainingTokens, model.supply)
|
||||||
|
subTitleColor: (model.deployState === Constants.BackendProcessState.Failed) ? Theme.palette.dangerColor1 : Theme.palette.baseColor1
|
||||||
fallbackImageUrl: model.image ? model.image : ""
|
fallbackImageUrl: model.image ? model.image : ""
|
||||||
backgroundColor: model.backgroundColor ? model.backgroundColor : "transparent" // TODO BACKEND
|
backgroundColor: model.backgroundColor ? model.backgroundColor : "transparent" // TODO BACKEND
|
||||||
isLoading: false
|
isLoading: false
|
||||||
|
|
|
@ -14,6 +14,7 @@ Control {
|
||||||
|
|
||||||
property string title: ""
|
property string title: ""
|
||||||
property string subTitle: ""
|
property string subTitle: ""
|
||||||
|
property alias subTitleColor: subTitleItem.customColor
|
||||||
property string backgroundColor: "transparent"
|
property string backgroundColor: "transparent"
|
||||||
property url mediaUrl : ""
|
property url mediaUrl : ""
|
||||||
property string mediaType: ""
|
property string mediaType: ""
|
||||||
|
@ -86,6 +87,8 @@ Control {
|
||||||
}
|
}
|
||||||
|
|
||||||
StatusTextWithLoadingState {
|
StatusTextWithLoadingState {
|
||||||
|
id: subTitleItem
|
||||||
|
|
||||||
Layout.alignment: Qt.AlignLeft
|
Layout.alignment: Qt.AlignLeft
|
||||||
Layout.leftMargin: Style.current.halfPadding
|
Layout.leftMargin: Style.current.halfPadding
|
||||||
Layout.rightMargin: Layout.leftMargin
|
Layout.rightMargin: Layout.leftMargin
|
||||||
|
|
Loading…
Reference in New Issue