-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- implement the basic Onboarding UI skeleton and the Create Profile flows - adjust the PasswordView and EnterSeedPhrase views to the latest design - add the main OnboardingLayout and StatusPinInput pages to Storybook Fixes #16719
- Loading branch information
Showing
59 changed files
with
2,292 additions
and
120 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,173 @@ | ||
import QtQuick 2.15 | ||
import QtQuick.Controls 2.15 | ||
import QtQuick.Layouts 1.15 | ||
import QtQml 2.15 | ||
|
||
import StatusQ 0.1 | ||
import StatusQ.Core 0.1 | ||
import StatusQ.Core.Utils 0.1 | ||
import StatusQ.Controls 0.1 | ||
import StatusQ.Components 0.1 | ||
import StatusQ.Core.Theme 0.1 | ||
|
||
import Models 1.0 | ||
import Storybook 1.0 | ||
|
||
import utils 1.0 | ||
|
||
import AppLayouts.Onboarding2 1.0 | ||
|
||
import shared.stores 1.0 as SharedStores | ||
|
||
// compat | ||
import AppLayouts.Onboarding.stores 1.0 as OOBS | ||
|
||
SplitView { | ||
id: root | ||
orientation: Qt.Vertical | ||
|
||
Logs { id: logs } | ||
|
||
QtObject { | ||
id: keycardMock | ||
property string stateType: ctrlKeycardState.currentValue | ||
|
||
readonly property var keycardStates: [ | ||
// initial | ||
//Constants.startupState.keycardNoPCSCService, | ||
Constants.startupState.keycardPluginReader, | ||
Constants.startupState.keycardInsertKeycard, | ||
Constants.startupState.keycardInsertedKeycard, Constants.startupState.keycardReadingKeycard, | ||
// initial errors | ||
Constants.startupState.keycardWrongKeycard, Constants.startupState.keycardNotKeycard, | ||
Constants.startupState.keycardMaxPairingSlotsReached, | ||
Constants.startupState.keycardLocked, | ||
Constants.startupState.keycardNotEmpty, | ||
// create keycard profile | ||
Constants.startupState.keycardEmpty | ||
] | ||
} | ||
|
||
OnboardingLayout { | ||
id: onboarding | ||
SplitView.fillWidth: true | ||
SplitView.fillHeight: true | ||
startupStore: OOBS.StartupStore { | ||
property var currentStartupState: QtObject { | ||
property string stateType: keycardMock.stateType | ||
} | ||
|
||
function getPasswordStrengthScore(password) { | ||
return Math.min(password.length-1, 4) | ||
} | ||
function validMnemonic(mnemonic) { | ||
return true | ||
} | ||
function getPin() { | ||
return "" // FIXME make configurable | ||
} | ||
} | ||
metricsStore: SharedStores.MetricsStore { | ||
readonly property var d: QtObject { | ||
id: d | ||
property bool isCentralizedMetricsEnabled | ||
} | ||
|
||
function toggleCentralizedMetrics(enabled) { | ||
d.isCentralizedMetricsEnabled = enabled | ||
} | ||
|
||
function addCentralizedMetricIfEnabled(eventName, eventValue = null) {} | ||
|
||
readonly property bool isCentralizedMetricsEnabled : d.isCentralizedMetricsEnabled | ||
} | ||
splashScreenDurationMs: 3000 | ||
|
||
QtObject { | ||
id: localAppSettings | ||
property bool metricsPopupSeen | ||
} | ||
|
||
onFinished: (success, primaryPath, secondaryPath) => { | ||
console.warn("!!! ONBOARDING FINISHED; success:", success, "; primary path:", primaryPath, "; secondary:", secondaryPath) | ||
logs.logEvent("onFinished", ["success", "primaryPath", "secondaryPath"], arguments) | ||
|
||
console.warn("!!! RESTARTING FLOW") | ||
restartFlow() | ||
ctrlKeycardState.currentIndex = 0 | ||
} | ||
onKeycardFactoryResetRequested: { | ||
logs.logEvent("onKeycardFactoryResetRequested") | ||
console.warn("!!! FACTORY RESET; RESTARTING FLOW") | ||
restartFlow() | ||
ctrlKeycardState.currentIndex = 0 | ||
} | ||
onKeycardReloaded: { | ||
logs.logEvent("onKeycardReloaded") | ||
ctrlKeycardState.currentIndex = 0 | ||
} | ||
} | ||
|
||
Connections { | ||
target: Global | ||
function onOpenLink(link: string) { | ||
console.debug("Opening link in an external web browser:", link) | ||
Qt.openUrlExternally(link) | ||
} | ||
function onOpenLinkWithConfirmation(link: string, domain: string) { | ||
console.debug("Opening link in an external web browser:", link, domain) | ||
Qt.openUrlExternally(link) | ||
} | ||
} | ||
|
||
LogsAndControlsPanel { | ||
id: logsAndControlsPanel | ||
|
||
SplitView.minimumHeight: 150 | ||
SplitView.preferredHeight: 150 | ||
|
||
logsView.logText: logs.logText | ||
|
||
RowLayout { | ||
anchors.fill: parent | ||
ColumnLayout { | ||
Layout.fillWidth: true | ||
Label { | ||
text: "Current page: %1".arg(onboarding.stack.currentItem ? onboarding.stack.currentItem.title : "") | ||
} | ||
Label { | ||
text: `Current path: ${onboarding.primaryPath} -> ${onboarding.secondaryPath}` | ||
} | ||
Label { | ||
text: "Stack depth: %1".arg(onboarding.stack.depth) | ||
} | ||
} | ||
Item { Layout.fillWidth: true } | ||
Button { | ||
text: "Restart" | ||
focusPolicy: Qt.NoFocus | ||
onClicked: onboarding.restartFlow() | ||
} | ||
Button { | ||
text: "Copy password" | ||
focusPolicy: Qt.NoFocus | ||
onClicked: ClipboardUtils.setText("0123456789") | ||
} | ||
Button { | ||
text: "Copy seedphrase" | ||
focusPolicy: Qt.NoFocus | ||
onClicked: ClipboardUtils.setText("dog dog dog dog dog dog dog dog dog dog dog dog") | ||
} | ||
ComboBox { | ||
Layout.preferredWidth: 250 | ||
id: ctrlKeycardState | ||
focusPolicy: Qt.NoFocus | ||
model: keycardMock.keycardStates | ||
} | ||
} | ||
} | ||
} | ||
|
||
// category: Onboarding | ||
// status: good | ||
// https://www.figma.com/design/Lw4nPYQcZOPOwTgETiiIYo/Desktop-Onboarding-Redesign?node-id=1-25&node-type=canvas&m=dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import QtQuick 2.15 | ||
import QtQuick.Controls 2.15 | ||
import QtQuick.Layouts 1.15 | ||
|
||
import StatusQ.Core 0.1 | ||
import StatusQ.Controls 0.1 | ||
import StatusQ.Controls.Validators 0.1 | ||
import StatusQ.Core.Theme 0.1 | ||
|
||
Item { | ||
id: root | ||
|
||
ColumnLayout { | ||
anchors.centerIn: parent | ||
spacing: 16 | ||
StatusBaseText { | ||
Layout.alignment: Qt.AlignHCenter | ||
text: "ENTER NUMERIC PIN, EXPECTED LENGTH: %1".arg(pinInput.pinLen) | ||
} | ||
StatusPinInput { | ||
Layout.alignment: Qt.AlignHCenter | ||
id: pinInput | ||
validator: StatusIntValidator { bottom: 0; top: 999999 } | ||
Component.onCompleted: { | ||
statesInitialization() | ||
forceFocus() | ||
} | ||
} | ||
StatusBaseText { | ||
Layout.alignment: Qt.AlignHCenter | ||
text: "ENTERED PIN: %1".arg(pinInput.pinInput || "[empty]") | ||
} | ||
StatusBaseText { | ||
Layout.alignment: Qt.AlignHCenter | ||
text: "VALID: %1".arg(pinInput.valid ? "true" : "false") | ||
} | ||
} | ||
} | ||
|
||
// category: Controls | ||
// status: good |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import QtQml 2.15 | ||
|
||
QtObject {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
import QtQuick 2.13 | ||
import QtQuick.Window 2.15 | ||
import QtQuick 2.15 | ||
|
||
/*! | ||
\qmltype StatusImage | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
ui/StatusQ/src/StatusQ/Controls/Validators/StatusIntValidator.qml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import QtQuick 2.14 | ||
import QtQuick 2.15 | ||
|
||
import StatusQ.Controls 0.1 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import QtQuick 2.15 | ||
import QtQuick.Controls 2.15 | ||
|
||
import StatusQ.Core 0.1 | ||
import StatusQ.Popups.Dialog 0.1 | ||
|
||
StatusDialog { | ||
width: 600 | ||
padding: 0 | ||
standardButtons: Dialog.Ok | ||
|
||
property alias content: contentText | ||
|
||
StatusScrollView { | ||
id: scrollView | ||
anchors.fill: parent | ||
contentWidth: availableWidth | ||
StatusBaseText { | ||
id: contentText | ||
width: scrollView.availableWidth | ||
wrapMode: Text.Wrap | ||
} | ||
} | ||
} |
Oops, something went wrong.