chore(dapps) update foundation for DApps work

Remove unused and de-scoped elements

Updates #14317
This commit is contained in:
Stefan 2024-04-30 15:21:19 +02:00 committed by Stefan Dunca
parent 913041d5d9
commit 8d6d9c3d7c
14 changed files with 15 additions and 358 deletions

View File

@ -1,3 +0,0 @@
#################################################
# Async
#################################################

View File

@ -1,2 +0,0 @@
import json
import core, response_type

View File

@ -1,6 +1,8 @@
import QtQuick 2.15 import QtQuick 2.15
import QtTest 1.15 import QtTest 1.15
import StatusQ 0.1 // See #10218
import QtQuick.Controls 2.15 import QtQuick.Controls 2.15
import Storybook 1.0 import Storybook 1.0
@ -15,7 +17,6 @@ Item {
Component { Component {
id: componentUnderTest id: componentUnderTest
ConnectedDappsButton { ConnectedDappsButton {
id: control
} }
} }

View File

@ -1,27 +0,0 @@
import QtQuick 2.15
import QtQuick.Controls 2.15
import QtQuick.Layouts 1.15
// Stub for Controller QObject defined in src/app/modules/main/wallet_section/wallet_connect/controller.nim
Item {
id: root
// function sessionProposal(/*string*/ sessionProposalJson)
required property var sessionProposal
// function pairSessionRequest(/*string*/ sessionRequestJson)
required property var recordSuccessfulPairing
// function deletePairing(/*string*/ topic)
required property var deletePairing
signal respondSessionProposal(string sessionProposalJson, string supportedNamespacesJson, string error)
signal respondSessionRequest(string sessionRequestJson, string signedJson, bool error)
signal requestOpenWalletConnectPopup(string uri)
signal respondAuthRequest(string signature, string error)
// function sessionRequest(/*string*/ sessionRequestJson, /*string*/ password)
required property var sessionRequest
required property bool hasActivePairings
required property string projectId
}

View File

@ -1 +0,0 @@
WalletConnectController 1.0 WalletConnectController.qml

View File

@ -65,9 +65,6 @@ StatusSectionLayout {
case Constants.settingsSubsection.keycard: case Constants.settingsSubsection.keycard:
keycardView.item.handleBackAction() keycardView.item.handleBackAction()
break; break;
case Constants.settingsSubsection.dapps:
dappsView.item.handleBackAction()
break;
} }
Global.settingsSubSubsection = -1 Global.settingsSubSubsection = -1
} }
@ -133,8 +130,6 @@ StatusSectionLayout {
walletView.item.resetStack() walletView.item.resetStack()
} else if (currentIndex === Constants.settingsSubsection.keycard) { } else if (currentIndex === Constants.settingsSubsection.keycard) {
keycardView.item.handleBackAction() keycardView.item.handleBackAction()
} else if (currentIndex === Constants.settingsSubsection.dapps) {
dappsView.item.handleBackAction()
} }
} }
@ -262,21 +257,6 @@ StatusSectionLayout {
onLoaded: root.store.backButtonName = "" onLoaded: root.store.backButtonName = ""
} }
Loader {
id: dappsView
active: false
asynchronous: true
sourceComponent: DappsView {
implicitWidth: parent.width
implicitHeight: parent.height
profileSectionStore: root.store
sectionTitle: root.store.getNameForSubsection(Constants.settingsSubsection.dapps)
mainSectionTitle: root.store.getNameForSubsection(Constants.settingsSubsection.dapps)
contentWidth: d.contentWidth
}
onLoaded: root.store.backButtonName = ""
}
Loader { Loader {
active: false active: false
asynchronous: true asynchronous: true

View File

@ -122,9 +122,6 @@ QtObject {
append({subsection: Constants.settingsSubsection.wallet, append({subsection: Constants.settingsSubsection.wallet,
text: qsTr("Wallet"), text: qsTr("Wallet"),
icon: "wallet"}) icon: "wallet"})
append({subsection: Constants.settingsSubsection.dapps,
text: qsTr("dApps"),
icon: "dapp"})
append({subsection: Constants.settingsSubsection.browserSettings, append({subsection: Constants.settingsSubsection.browserSettings,
text: qsTr("Browser"), text: qsTr("Browser"),
icon: "browser"}) icon: "browser"})

View File

@ -1,88 +0,0 @@
import QtQuick 2.14
import QtQuick.Controls 2.14
import QtQuick.Layouts 1.14
import QtQml.Models 2.14
import StatusQ.Core 0.1
import StatusQ.Controls 0.1
import StatusQ.Core.Theme 0.1
import utils 1.0
import "../stores"
import "./dapps"
SettingsContentBase {
id: root
required property ProfileSectionStore profileSectionStore
required property string mainSectionTitle
titleRowComponentLoader.sourceComponent: stackLayout.currentIndex === d.mainViewIndex ||
stackLayout.currentIndex === d.connectedDappsIndex?
d.headerButton : undefined
function handleBackAction() {
if (stackLayout.currentIndex !== d.mainViewIndex) {
root.profileSectionStore.backButtonName = ""
root.sectionTitle = root.mainSectionTitle
stackLayout.currentIndex = d.mainViewIndex
}
}
StackLayout {
id: stackLayout
currentIndex: d.mainViewIndex
QtObject {
id: d
readonly property int mainViewIndex: 0
readonly property int connectedDappsIndex: 1
readonly property int approvalsIndex: 2
readonly property int trustLevelsIndex: 3
readonly property int securityIndex: 4
function changeSubsection(title, index) {
root.profileSectionStore.backButtonName = root.mainSectionTitle
root.sectionTitle = title
stackLayout.currentIndex = index
}
property Component headerButton: Component {
StatusButton {
text: qsTr("Connect a dApp via WalletConnect")
onClicked: {
console.warn("TODO: run wallet connect popup...")
}
}
}
}
Main {
Layout.preferredWidth: root.contentWidth
onDisplayConnectedDapps: d.changeSubsection(title, d.connectedDappsIndex)
onDisplayApprovals: d.changeSubsection(title, d.approvalsIndex)
onDisplayTrustLevels: d.changeSubsection(title, d.trustLevelsIndex)
onDisplaySecurity: d.changeSubsection(title, d.securityIndex)
}
ConnectedDapps {
Layout.preferredWidth: root.contentWidth
}
Approvals {
Layout.preferredWidth: root.contentWidth
}
TrustLevels {
Layout.preferredWidth: root.contentWidth
}
Security {
Layout.preferredWidth: root.contentWidth
}
}
}

View File

@ -1,44 +0,0 @@
import QtQuick 2.14
import QtQuick.Layouts 1.14
import StatusQ.Controls 0.1
import utils 1.0
import shared.controls 1.0
ColumnLayout {
id: root
spacing: Constants.settingsSection.itemSpacing
QtObject {
id: d
}
StatusTabBar {
id: walletTabBar
Layout.fillWidth: true
StatusTabButton {
leftPadding: 0
width: implicitWidth
text: qsTr("By dApp")
}
StatusTabButton {
width: implicitWidth
text: qsTr("By token")
}
StatusTabButton {
width: implicitWidth
text: qsTr("By account")
}
}
ShapeRectangle {
Layout.fillWidth: true
Layout.preferredHeight: implicitHeight
text: qsTr("Your dApp approvals will appear here")
}
}

View File

@ -1,39 +0,0 @@
import QtQuick 2.14
import QtQuick.Layouts 1.14
import StatusQ.Controls 0.1
import utils 1.0
import shared.controls 1.0
ColumnLayout {
id: root
spacing: Constants.settingsSection.itemSpacing
QtObject {
id: d
}
StatusTabBar {
id: walletTabBar
Layout.fillWidth: true
StatusTabButton {
leftPadding: 0
width: implicitWidth
text: qsTr("By dApp")
}
StatusTabButton {
width: implicitWidth
text: qsTr("By account")
}
}
ShapeRectangle {
Layout.fillWidth: true
Layout.preferredHeight: implicitHeight
text: qsTr("Your connected dApps will appear here")
}
}

View File

@ -1,79 +0,0 @@
import QtQuick 2.14
import QtQuick.Layouts 1.14
import StatusQ.Core 0.1
import StatusQ.Core.Theme 0.1
import StatusQ.Components 0.1
import utils 1.0
ColumnLayout {
id: root
signal displayConnectedDapps(string title)
signal displayApprovals(string title)
signal displayTrustLevels(string title)
signal displaySecurity(string title)
spacing: Constants.settingsSection.itemSpacing
QtObject {
id: d
}
StatusListItem {
Layout.fillWidth: true
title: qsTr("Connected")
components: [
StatusIcon {
icon: "next"
color: Theme.palette.baseColor1
}
]
onClicked: {
root.displayConnectedDapps(title)
}
}
StatusListItem {
Layout.fillWidth: true
title: qsTr("Approvals")
components: [
StatusIcon {
icon: "next"
color: Theme.palette.baseColor1
}
]
onClicked: {
root.displayApprovals(title)
}
}
StatusListItem {
Layout.fillWidth: true
title: qsTr("Trust levels")
components: [
StatusIcon {
icon: "next"
color: Theme.palette.baseColor1
}
]
onClicked: {
root.displayTrustLevels(title)
}
}
StatusListItem {
Layout.fillWidth: true
title: qsTr("Security")
components: [
StatusIcon {
icon: "next"
color: Theme.palette.baseColor1
}
]
onClicked: {
root.displaySecurity(title)
}
}
}

View File

@ -1,14 +0,0 @@
import QtQuick 2.14
import QtQuick.Layouts 1.14
import utils 1.0
ColumnLayout {
id: root
spacing: Constants.settingsSection.itemSpacing
QtObject {
id: d
}
}

View File

@ -1,23 +0,0 @@
import QtQuick 2.14
import QtQuick.Layouts 1.14
import StatusQ.Controls 0.1
import utils 1.0
import shared.controls 1.0
ColumnLayout {
id: root
spacing: Constants.settingsSection.itemSpacing
QtObject {
id: d
}
ShapeRectangle {
Layout.fillWidth: true
Layout.preferredHeight: implicitHeight
text: qsTr("Your trust level for dApps you have interacted with will appear here")
}
}

View File

@ -337,22 +337,21 @@ QtObject {
readonly property int ensUsernames: 3 readonly property int ensUsernames: 3
readonly property int messaging: 4 readonly property int messaging: 4
readonly property int wallet:5 readonly property int wallet:5
readonly property int dapps: 6 readonly property int appearance: 6
readonly property int appearance: 7 readonly property int language: 7
readonly property int language: 8 readonly property int notifications: 8
readonly property int notifications: 9 readonly property int syncingSettings: 9
readonly property int syncingSettings: 10 readonly property int browserSettings: 10
readonly property int browserSettings: 11 readonly property int advanced: 11
readonly property int advanced: 12 readonly property int about: 12
readonly property int about: 13 readonly property int communitiesSettings: 13
readonly property int communitiesSettings: 14 readonly property int keycard: 14
readonly property int keycard: 15 readonly property int about_terms: 15 // a subpage under "About"
readonly property int about_terms: 16 // a subpage under "About" readonly property int about_privacy: 16 // a subpage under "About"
readonly property int about_privacy: 17 // a subpage under "About"
// special treatment; these do not participate in the main settings' StackLayout // special treatment; these do not participate in the main settings' StackLayout
readonly property int signout: 18 readonly property int signout: 17
readonly property int backUpSeed: 19 readonly property int backUpSeed: 18
} }
readonly property QtObject walletSettingsSubsection: QtObject { readonly property QtObject walletSettingsSubsection: QtObject {