Patryk Osmaczko aeb64e2029 test(settings/profile): test bio and social links
Note: interaction between clients is not tested here to avoid dependency
on mailserver. When mailserver is mocked more comprehensive tests should
be provided, that is: verify if identity properties are propagated
and read correctly between two different clients.

closes: #6950
2022-08-17 13:18:32 +02:00

115 lines
3.9 KiB
QML

import QtQuick 2.13
import QtQuick.Layouts 1.13
import StatusQ.Components 0.1
import shared 1.0
import utils 1.0
Column {
id: root
spacing: 4
property var privacyStore
property var contactsStore
property alias mainMenuItems: mainMenuItems.model
property alias settingsMenuItems: settingsMenuItems.model
property alias extraMenuItems: extraMenuItems.model
property alias appsMenuItems: appsMenuItems.model
property bool browserMenuItemEnabled: false
property bool walletMenuItemEnabled: false
signal menuItemClicked(var menu_item)
Repeater {
id: mainMenuItems
delegate: StatusNavigationListItem {
objectName: model.text + "-MainMenu"
itemId: model.subsection
title: model.text
icon.name: model.icon
selected: Global.settingsSubsection === model.subsection
onClicked: root.menuItemClicked(model)
badge.value: {
switch (model.subsection) {
case Constants.settingsSubsection.backUpSeed:
return !root.privacyStore.mnemonicBackedUp
default: return "";
}
}
visible: {
switch (model.subsection) {
case Constants.settingsSubsection.ensUsernames:
return root.walletMenuItemEnabled;
case Constants.settingsSubsection.backUpSeed:
return !root.privacyStore.mnemonicBackedUp;
default: return true;
}
}
}
}
StatusListSectionHeadline {
text: qsTr("Apps")
}
Repeater {
id: appsMenuItems
delegate: StatusNavigationListItem {
id: appsMenuDelegate
objectName: model.text + "-AppMenu"
itemId: model.subsection
title: model.text
icon.name: model.icon
selected: Global.settingsSubsection === model.subsection
onClicked: root.menuItemClicked(model)
visible: {
(model.subsection !== Constants.settingsSubsection.browserSettings && model.subsection !== Constants.settingsSubsection.wallet) ||
(model.subsection === Constants.settingsSubsection.browserSettings && root.browserMenuItemEnabled) ||
(model.subsection === Constants.settingsSubsection.communitiesSettings) ||
(model.subsection === Constants.settingsSubsection.wallet && root.walletMenuItemEnabled)
}
badge.value: {
switch (model.subsection) {
case Constants.settingsSubsection.messaging:
return root.contactsStore.receivedContactRequestsModel.count
default: return ""
}
}
}
}
StatusListSectionHeadline { text: qsTr("Settings") }
Repeater {
id: settingsMenuItems
delegate: StatusNavigationListItem {
id: settingsMenuDelegate
objectName: model.text + "-SettingsMenu"
itemId: model.subsection
title: model.text
icon.name: model.icon
selected: Global.settingsSubsection === model.subsection
onClicked: root.menuItemClicked(model)
visible: model.subsection !== Constants.settingsSubsection.browserSettings || root.browserMenuItemEnabled
}
}
StatusListSectionHeadline { text: qsTr("About & Help") }
Repeater {
id: extraMenuItems
delegate: StatusNavigationListItem {
objectName: model.text + "-ExtraMenu"
itemId: model.subsection
title: model.text
icon.name: model.icon
selected: Global.settingsSubsection === model.subsection
visible: model.subsection !== Constants.settingsSubsection.browserSettings || root.browserMenuItemEnabled
onClicked: root.menuItemClicked(model)
}
}
}