Skip to content

Commit

Permalink
WIP feat(Onboarding) Implement new Login screen
Browse files Browse the repository at this point in the history
- password flow roughly done
- keycard/biometrics TODO

Fixes #17049
  • Loading branch information
caybro committed Jan 10, 2025
1 parent 80f4bca commit 544dd34
Showing 147 changed files with 1,722 additions and 1,292 deletions.
5 changes: 4 additions & 1 deletion config.nims
Original file line number Diff line number Diff line change
@@ -38,9 +38,12 @@ else:
# don't link libraries we're not actually using
switch("passL", "-Wl,-as-needed")

--define:chronicles_line_numbers # useful when debugging=
--define:chronicles_line_numbers # useful when debugging
switch("define", "chronicles_timestamps=RfcUtcTime")

when findExe("mold").len > 0 and defined(linux):
switch("passL", "-fuse-ld=mold")

# The compiler doth protest too much, methinks, about all these cases where it can't
# do its (N)RVO pass: https://github.com/nim-lang/RFCs/issues/230
switch("warning", "ObservableStores:off")
1 change: 0 additions & 1 deletion nim-status.desktop
Original file line number Diff line number Diff line change
@@ -4,5 +4,4 @@ Name=Status Desktop
Exec=nim_status_client
Icon=status
Comment=Desktop client for the Status Network
Terminal=true
Categories=Network;
3 changes: 2 additions & 1 deletion scripts/password-hash.py
Original file line number Diff line number Diff line change
@@ -4,6 +4,7 @@
print("Type your password...")
password = input()
hash = PasswordFunctions.hash_password(password)
pyperclip.copy(hash)
#pyperclip.copy(hash)
print(f"{hash}")
print(f'Hash: {hash} is copied to clipboard')

6 changes: 3 additions & 3 deletions src/app/global/app_translatable_constants.nim
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## All app's labels/terms/warnings which need to be used/created on the backed side and displayed on the UI later
## should be stated here and translated via translations map in `Constants.qml` to be displayed well in user's language
## All app's labels/terms/warnings which need to be used/created on the backend side and displayed on the UI later
## should be stated here and translated via translations map in `Constants.qml` and `Utils.qml` to be displayed well in user's language
const LOGIN_ACCOUNTS_LIST_ADD_NEW_USER* = "LOGIN-ACCOUNTS-LIST-ADD-NEW-USER"
const LOGIN_ACCOUNTS_LIST_ADD_EXISTING_USER* = "LOGIN-ACCOUNTS-LIST-ADD-EXISTING-USER"
const LOGIN_ACCOUNTS_LIST_LOST_KEYCARD* = "LOGIN-ACCOUNTS-LIST-LOST-KEYCARD"
const KEYCARD_ACCOUNT_NAME_OF_UNKNOWN_WALLET_ACCOUNT* = "KEYCARD-ACCOUNT-NAME-OF-UNKNOWN-WALLET-ACCOUNT"
const KEYCARD_ACCOUNT_NAME_OF_UNKNOWN_WALLET_ACCOUNT* = "KEYCARD-ACCOUNT-NAME-OF-UNKNOWN-WALLET-ACCOUNT"
Original file line number Diff line number Diff line change
@@ -89,20 +89,20 @@ QtObject:
return false
case role.ModelRole:
of ModelRole.FilePath:
self.items[index.row].filePath = value.stringVal()
self.items[row].filePath = value.stringVal()
self.dataChanged(index, index, @[ModelRole.FilePath.int])
of ModelRole.ErrorMessage:
self.items[index.row].errorMessage = value.stringVal()
self.items[row].errorMessage = value.stringVal()
self.dataChanged(index, index, @[ModelRole.ErrorMessage.int])
of ModelRole.ErrorCode:
self.items[index.row].errorCode = value.intVal()
self.items[row].errorCode = value.intVal()
self.dataChanged(index, index, @[ModelRole.ErrorCode.int])
of ModelRole.Selected:
self.items[index.row].selected = value.boolVal()
self.items[row].selected = value.boolVal()
self.dataChanged(index, index, @[ModelRole.Selected.int])
self.selectedCountChanged()
of ModelRole.Validated:
self.items[index.row].validated = value.boolVal()
self.items[row].validated = value.boolVal()
self.dataChanged(index, index, @[ModelRole.Validated.int])
self.selectedFilesValidChanged()
return true
4 changes: 2 additions & 2 deletions storybook/figmalinksmodel.cpp
Original file line number Diff line number Diff line change
@@ -21,8 +21,8 @@ QVariant FigmaLinksModel::data(const QModelIndex &index, int role) const

QHash<int, QByteArray> FigmaLinksModel::roleNames() const
{
static QHash<int, QByteArray> roles(
{{LinkRole, QByteArrayLiteral("link")}});
static const QHash<int, QByteArray> roles(
{{LinkRole, QByteArrayLiteral("link")}});
return roles;
}

2 changes: 1 addition & 1 deletion storybook/figmalinksmodel.h
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@ class FigmaLinksModel : public QAbstractListModel
Q_PROPERTY(int count READ rowCount NOTIFY countChanged)

public:
static constexpr auto LinkRole = 0;
static constexpr auto LinkRole = Qt::UserRole + 1;

explicit FigmaLinksModel(const QStringList &links,
QObject *parent = nullptr);
2 changes: 1 addition & 1 deletion storybook/main.cpp
Original file line number Diff line number Diff line change
@@ -122,7 +122,7 @@ int main(int argc, char *argv[])
QObject::connect(&engine, &QQmlApplicationEngine::objectCreated,
&app, [url](QObject *obj, const QUrl &objUrl) {
if (!obj && url == objUrl)
QCoreApplication::exit(-1);
QCoreApplication::exit(EXIT_FAILURE);
}, Qt::QueuedConnection);

const auto args = cmdParser.positionalArguments();
87 changes: 40 additions & 47 deletions storybook/main.qml
Original file line number Diff line number Diff line change
@@ -120,6 +120,45 @@ ApplicationWindow {
}
}

footer: PageToolBar {
id: pageToolBar

componentName: root.currentPage
figmaPagesCount: currentPageModelItem.object
? currentPageModelItem.object.figma.count : 0

testRunnerController: testRunnerController

Instantiator {
id: currentPageModelItem

model: SingleItemProxyModel {
sourceModel: pagesModel
roleName: "title"
value: root.currentPage
}

delegate: QtObject {
readonly property string title: model.title
readonly property var figma: model.figma
}
}

onFigmaPreviewClicked: {
if (!settingsLayout.figmaToken) {
noFigmaTokenDialog.open()
return
}

figmaWindow.createObject(root, {
figmaModel: currentPageModelItem.object.figma,
pageTitle: currentPageModelItem.object.title
})
}

onInspectClicked: d.performInspection()
}

SplitView {
anchors.fill: parent

@@ -148,7 +187,7 @@ ApplicationWindow {
Layout.fillWidth: true

text: "Always on top"
onCheckedChanged: {
onToggled: {
if (checked)
root.flags |= Qt.WindowStaysOnTopHint
else
@@ -189,13 +228,6 @@ ApplicationWindow {
}
}
}

Button {
Layout.fillWidth: true
text: "Open pages directory"

onClicked: Qt.openUrlExternally(Qt.resolvedUrl(pagesFolder))
}
}

Page {
@@ -228,45 +260,6 @@ ApplicationWindow {
visible: viewLoader.status === Loader.Error
text: "Loading page failed"
}

footer: PageToolBar {
id: pageToolBar

componentName: root.currentPage
figmaPagesCount: currentPageModelItem.object
? currentPageModelItem.object.figma.count : 0

testRunnerController: testRunnerController

Instantiator {
id: currentPageModelItem

model: SingleItemProxyModel {
sourceModel: pagesModel
roleName: "title"
value: root.currentPage
}

delegate: QtObject {
readonly property string title: model.title
readonly property var figma: model.figma
}
}

onFigmaPreviewClicked: {
if (!settingsLayout.figmaToken) {
noFigmaTokenDialog.open()
return
}

figmaWindow.createObject(root, {
figmaModel: currentPageModelItem.object.figma,
pageTitle: currentPageModelItem.object.title
})
}

onInspectClicked: d.performInspection()
}
}
}

2 changes: 0 additions & 2 deletions storybook/pages/AccountSelectorPage.qml
Original file line number Diff line number Diff line change
@@ -29,7 +29,6 @@ SplitView {
plainTokensBySymbolModel: TokensBySymbolModel {}
}
readonly property var baseGroupedAccountAssetModel: GroupedAccountsAssetsModel {}
assetsWithFilteredBalances: thisWalletAssetStore.groupedAccountsAssetsModel
}

readonly property var currencyStore: CurrenciesStore{}
@@ -178,7 +177,6 @@ SplitView {
}
}
}

}

Item {
4 changes: 2 additions & 2 deletions storybook/pages/AssetSelectorPage.qml
Original file line number Diff line number Diff line change
@@ -45,7 +45,7 @@ Pane {
tokensKey: "dai_key",
communityId: "",
name: "Dai Stablecoin",
currencyBalanceAsString: "45,92 USD",
currencyBalanceAsString: "",
symbol: "DAI",
iconSource: Constants.tokenIcon("DAI"),
balances: [],
@@ -56,7 +56,7 @@ Pane {
tokensKey: "zrx_key",
communityId: "",
name: "0x",
currencyBalanceAsString: "41,22 USD",
currencyBalanceAsString: "",
symbol: "ZRX",
iconSource: Constants.tokenIcon("ZRX"),
balances: [],
2 changes: 1 addition & 1 deletion storybook/pages/BuyCryptoModalPage.qml
Original file line number Diff line number Diff line change
@@ -62,7 +62,7 @@ SplitView {
readonly property BuyCryptoParamsForm buyCryptoInputParamsForm: BuyCryptoParamsForm{
selectedWalletAddress: "0x7F47C2e18a4BBf5487E6fb082eC2D9Ab0E6d7240"
selectedNetworkChainId: 11155111
selectedTokenKey: "ETH"
selectedTokenKey: "STT"
}

}
32 changes: 3 additions & 29 deletions storybook/pages/JoinCommunityPermissionsEditor.qml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import QtQuick 2.14
import QtQuick.Controls 2.14
import QtQuick.Layouts 1.14
import QtQuick 2.15
import QtQuick.Controls 2.15
import QtQuick.Layouts 1.15

import Models 1.0

@@ -20,7 +20,6 @@ ColumnLayout {
property var communityHoldingsModel: PermissionsModel.shortPermissionsModel
property var viewOnlyHoldingsModel: PermissionsModel.shortPermissionsModel
property var viewAndPostHoldingsModel: PermissionsModel.shortPermissionsModel
property var moderateHoldingsModel: PermissionsModel.shortPermissionsModel

spacing: 16

@@ -202,29 +201,4 @@ ColumnLayout {
onCheckedChanged: if(checked) root.viewAndPostHoldingsModel = undefined
}
}

ColumnLayout {
visible: !root.joinCommunity

Label {
Layout.fillWidth: true
text: "Moderate holdings model type:"
}

RadioButton {
checked: true
text: "Short model"
onCheckedChanged: if(checked) root.moderateHoldingsModel = PermissionsModel.shortPermissionsModel
}

RadioButton {
text: "Long model"
onCheckedChanged: if(checked) root.moderateHoldingsModel = PermissionsModel.longPermissionsModel
}

RadioButton {
text: "None"
onCheckedChanged: if(checked) root.moderateHoldingsModel = undefined
}
}
}
3 changes: 0 additions & 3 deletions storybook/pages/JoinCommunityViewPage.qml
Original file line number Diff line number Diff line change
@@ -47,7 +47,6 @@ Nemo enim 😋 ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit,
property var communityHoldingsModel: PermissionsModel.shortPermissionsModel
property var viewOnlyHoldingsModel: PermissionsModel.shortPermissionsModel
property var viewAndPostHoldingsModel: PermissionsModel.shortPermissionsModel
property var moderateHoldingsModel: PermissionsModel.shortPermissionsModel
property var assetsModel: AssetsModel {}
property var collectiblesModel: CollectiblesModel {}

@@ -137,7 +136,6 @@ Nemo enim 😋 ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit,
communityHoldingsModel: d.communityHoldingsModel
viewOnlyHoldingsModel: d.viewOnlyHoldingsModel
viewAndPostHoldingsModel: d.viewAndPostHoldingsModel
moderateHoldingsModel: d.moderateHoldingsModel
assetsModel: d.assetsModel
collectiblesModel: d.collectiblesModel

@@ -278,7 +276,6 @@ Nemo enim 😋 ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit,
onCommunityHoldingsModelChanged: d.communityHoldingsModel = communityHoldingsModel
onViewOnlyHoldingsModelChanged: d.viewOnlyHoldingsModel = viewOnlyHoldingsModel
onViewAndPostHoldingsModelChanged: d.viewAndPostHoldingsModel = viewAndPostHoldingsModel
onModerateHoldingsModelChanged: d.moderateHoldingsModel = moderateHoldingsModel
}
}
}
3 changes: 0 additions & 3 deletions storybook/pages/JoinPermissionsOverlayPanelPage.qml
Original file line number Diff line number Diff line change
@@ -29,7 +29,6 @@ SplitView {
property var communityHoldingsModel: PermissionsModel.shortPermissionsModel
property var viewOnlyHoldingsModel: PermissionsModel.shortPermissionsModel
property var viewAndPostHoldingsModel: PermissionsModel.shortPermissionsModel
property var moderateHoldingsModel: PermissionsModel.shortPermissionsModel

property var assetsModel: AssetsModel {}
property var collectiblesModel: CollectiblesModel {}
@@ -84,7 +83,6 @@ SplitView {
channelName: d.channelName
viewOnlyHoldingsModel: d.viewOnlyHoldingsModel
viewAndPostHoldingsModel: d.viewAndPostHoldingsModel
moderateHoldingsModel: d.moderateHoldingsModel

onRequestToJoinClicked: logs.logEvent("JoinPermissionsOverlayPanel::onRequestToJoinClicked()")
onInvitationPendingClicked: logs.logEvent("JoinPermissionsOverlayPanel::onInvitationPendingClicked()")
@@ -168,7 +166,6 @@ SplitView {
onCommunityHoldingsModelChanged: d.communityHoldingsModel = communityHoldingsModel
onViewOnlyHoldingsModelChanged: d.viewOnlyHoldingsModel = viewOnlyHoldingsModel
onViewAndPostHoldingsModelChanged: d.viewAndPostHoldingsModel = viewAndPostHoldingsModel
onModerateHoldingsModelChanged: d.moderateHoldingsModel = moderateHoldingsModel
}
}
}
Loading

0 comments on commit 544dd34

Please sign in to comment.