Skip to content

Commit

Permalink
VPN-5697 - Allow account deletion on Android (#8279)
Browse files Browse the repository at this point in the history
* VPN-5697 - add account deletion to Android and fix up UI

* add missing android library

* PR feedback
  • Loading branch information
mcleinman authored Oct 13, 2023
1 parent 3206e02 commit bbbaf01
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 12 deletions.
4 changes: 4 additions & 0 deletions nebula/ui/components/inAppAuth/MZInAppAuthenticationBase.qml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import components.forms 0.1
MZFlickable {
property var _menuButtonOnClick
property bool _changeEmailLinkVisible: false
property bool _disclaimersVisible: true
property string _viewObjectName: ""

property alias _menuButtonImageSource: menuButtonImage.source
Expand Down Expand Up @@ -142,6 +143,7 @@ MZFlickable {

MZSubtitle {
id: subtitle
visible: _subtitleText.length > 0
width: undefined
Layout.fillWidth: true
}
Expand All @@ -150,6 +152,7 @@ MZFlickable {

MZBoldLabel {
id: inputLabel
visible: inputLabel.text.length > 0
}

ColumnLayout {
Expand All @@ -160,6 +163,7 @@ MZFlickable {

ColumnLayout {
id: disclaimers
visible: _disclaimersVisible
Layout.maximumWidth: col.width - MZTheme.theme.vSpacing * 2
Layout.leftMargin: MZTheme.theme.vSpacing
Layout.rightMargin: MZTheme.theme.vSpacing
Expand Down
1 change: 1 addition & 0 deletions src/cmake/android.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ set_property(TARGET mozillavpn PROPERTY QT_ANDROID_EXTRA_LIBS
${Qt6_DIR}/../../libQt6Widgets_${ANDROID_ABI}.so
${Qt6_DIR}/../../libQt6Xml_${ANDROID_ABI}.so
${Qt6_DIR}/../../libQt6Test_${ANDROID_ABI}.so
${Qt6_DIR}/../../libQt6Svg_${ANDROID_ABI}.so
## --- END PILE OF SHAME --- ##

${OPENSSL_LIBS_DIR}/libcrypto.so
Expand Down
2 changes: 1 addition & 1 deletion src/featurelist.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ FEATURE(accountDeletion, // Feature ID
FeatureCallback_true, // Can be flipped on
FeatureCallback_false, // Can be flipped off
QStringList(), // feature dependencies
FeatureCallback_accountDeletion)
FeatureCallback_iosOrAndroid)

FEATURE(addon, // Feature ID
"Addon support", // Feature name
Expand Down
8 changes: 0 additions & 8 deletions src/featurelistcallback.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,6 @@ bool FeatureCallback_sentry() {
#endif
}

bool FeatureCallback_accountDeletion() {
#if defined(MZ_IOS)
return true;
#else
return false;
#endif
}

bool FeatureCallback_captivePortal() {
#if defined(MZ_LINUX) || defined(MZ_MACOS) || defined(MZ_WINDOWS) || \
defined(MZ_DUMMY) || defined(MZ_WASM)
Expand Down
7 changes: 4 additions & 3 deletions src/ui/deleteAccount/ViewDeleteAccountRequest.qml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ MZInAppAuthenticationBase {
property bool allowAccountDeletion: false

_changeEmailLinkVisible: false
_disclaimersVisible: false
_viewObjectName: "authDeleteAccountRequest"
_menuButtonAccessibleName: MZI18n.GlobalGoBack
_menuButtonImageSource: "qrc:/nebula/resources/back.svg"
Expand All @@ -51,6 +52,7 @@ MZInAppAuthenticationBase {

_inputs: ColumnLayout {
objectName: "accountDeletionLayout"
spacing: MZTheme.theme.vSpacingSmall
MZTextBlock {
objectName: "accountDeletionLabel"
color: MZTheme.theme.fontColor
Expand All @@ -59,9 +61,10 @@ MZInAppAuthenticationBase {
.arg("<b style='color:" + MZTheme.theme.fontColorDark + ";'>"
+ MZAuthInApp.emailAddress + "</b>")
textFormat: Text.RichText
font.pixelSize: MZTheme.theme.fontSize

Layout.fillWidth: true
Layout.bottomMargin: MZTheme.theme.vSpacing
Layout.bottomMargin: MZTheme.theme.listSpacing
}

Repeater {
Expand Down Expand Up @@ -100,10 +103,8 @@ MZInAppAuthenticationBase {
MZLinkButton {
Layout.fillWidth: true

fontName: MZTheme.theme.fontBoldFamily
// Cancel
labelText: MZI18n.InAppSupportWorkflowSupportSecondaryActionText
linkColor: MZTheme.theme.redLinkButton
onClicked: {
cancelAuthenticationFlow();
}
Expand Down

0 comments on commit bbbaf01

Please sign in to comment.