Skip to content

Commit

Permalink
♻️ (LekaApp): Display alert saying to contact Leka mail
Browse files Browse the repository at this point in the history
  • Loading branch information
HPezz committed Feb 5, 2024
1 parent 796c8b5 commit 87796d0
Show file tree
Hide file tree
Showing 5 changed files with 73 additions and 40 deletions.
66 changes: 42 additions & 24 deletions Apps/LekaApp/Resources/Localizable.xcstrings
Original file line number Diff line number Diff line change
Expand Up @@ -1028,38 +1028,20 @@
}
}
},
"settings_view.account_section.delete_account.alert_buton_label": {
"comment": "Delete account alert button label",
"extractionState": "extracted_with_value",
"localizations": {
"en": {
"stringUnit": {
"state": "new",
"value": "Delete"
}
},
"fr": {
"stringUnit": {
"state": "translated",
"value": "Supprimer"
}
}
}
},
"settings_view.account_section.delete_account.alert_message": {
"comment": "Delete account alert message",
"extractionState": "extracted_with_value",
"localizations": {
"en": {
"stringUnit": {
"state": "new",
"value": "You are about to delete your account and all its data.\nThis action is irreversible.\nDo you want to continue ?"
"value": "Please send an email to [email protected]\nto delete your account."
}
},
"fr": {
"stringUnit": {
"state": "translated",
"value": "Vous \u00eates sur le point de supprimer votre compte et toutes les donn\u00e9es qu'il contient.\nCette action est irr\u00e9versible.\nVoulez-vous continuer ?"
"state": "needs_review",
"value": "Veuillez envoyer un mail \u00e0 [email protected] pour supprimer votre compte"
}
}
}
Expand Down Expand Up @@ -1244,20 +1226,56 @@
}
}
},
"settings_view.credentials_section.change_credentials_button_label": {
"settings_view.credentials_section.change_credentials.alert_message": {
"comment": "Change credentials alert message",
"extractionState": "extracted_with_value",
"localizations": {
"en": {
"stringUnit": {
"state": "new",
"value": "Please send an email to [email protected]\nto modify your credentials."
}
},
"fr": {
"stringUnit": {
"state": "needs_review",
"value": "Veuillez envoyer un mail \u00e0 [email protected] pour modifier vos identifiants."
}
}
}
},
"settings_view.credentials_section.change_credentials.alert_title": {
"comment": "Change credentials alert title",
"extractionState": "extracted_with_value",
"localizations": {
"en": {
"stringUnit": {
"state": "new",
"value": "It is not yet possible to modify your email or password from the application."
}
},
"fr": {
"stringUnit": {
"state": "needs_review",
"value": "Il n'est pas encore possible de modifier son mot de passe depuis l'application Leka."
}
}
}
},
"settings_view.credentials_section.change_credentials.button_label": {
"comment": "Change credentials button label",
"extractionState": "extracted_with_value",
"localizations": {
"en": {
"stringUnit": {
"state": "new",
"value": "[Change email and password](https://leka.io)"
"value": "Change email and password"
}
},
"fr": {
"stringUnit": {
"state": "translated",
"value": "[Modifier l'email et le mot de passe](https://leka.io)"
"value": "Modifier l'email et le mot de passe"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class RootOwnerViewModel: ObservableObject {
@Published var isWelcomeViewPresented = true
@Published var isSettingsViewPresented = false

@Published var showConfirmCredentialsChange: Bool = false
@Published var showConfirmDisconnection: Bool = false
@Published var showConfirmDeleteAccount: Bool = false

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,11 @@ extension SettingsView {
Text(l10n.SettingsView.AccountSection.LogOut.alertMessage)
}
.alert(String(l10n.SettingsView.AccountSection.DeleteAccount.alertTitle.characters), isPresented: self.$rootOwnerViewModel.showConfirmDeleteAccount) {
Button(role: .destructive) {
// TODO: (@team) - Replace w/ real implementation
self.rootOwnerViewModel.isSettingsViewPresented = false
self.rootOwnerViewModel.disconnect()
} label: {
Text(l10n.SettingsView.AccountSection.DeleteAccount.alertButtonLabel)
}
// Nothing to do
} message: {
Text(l10n.SettingsView.AccountSection.DeleteAccount.alertMessage)
}
.textCase(nil)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,18 @@ extension SettingsView {
Text(l10n.SettingsView.CredentialsSection.emailLabel)
}

Text(l10n.SettingsView.CredentialsSection.changeCredentialsButtonLabel)
.foregroundColor(.accentColor)
Button {
self.rootOwnerViewModel.showConfirmCredentialsChange = true
} label: {
Text(l10n.SettingsView.CredentialsSection.ChangeCredentials.buttonLabel)
.foregroundColor(.accentColor)
}
}
.alert(String(l10n.SettingsView.CredentialsSection.ChangeCredentials.alertTitle.characters),
isPresented: self.$rootOwnerViewModel.showConfirmCredentialsChange) {} message: {
Text(l10n.SettingsView.CredentialsSection.ChangeCredentials.alertMessage)
}
.textCase(nil)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,24 @@ extension l10n {
}

enum CredentialsSection {
enum ChangeCredentials {
static let buttonLabel = LocalizedString("settings_view.credentials_section.change_credentials.button_label", value: "Change email and password", comment: "Change credentials button label")

static let alertTitle = LocalizedString("settings_view.credentials_section.change_credentials.alert_title",
value: "It is not yet possible to modify your email or password from the application.",
comment: "Change credentials alert title")

static let alertMessage = LocalizedString("settings_view.credentials_section.change_credentials.alert_message",
value: """
Please send an email to [email protected]
to modify your credentials.
""",
comment: "Change credentials alert message")
}

static let header = LocalizedString("settings_view.credentials_section.header", value: "Credentials", comment: "Credentials section header")

static let emailLabel = LocalizedString("settings_view.credentials_section.email_label", value: "Account email adress", comment: "Account email address label")

static let changeCredentialsButtonLabel = LocalizedString("settings_view.credentials_section.change_credentials_button_label", value: "[Change email and password](https://leka.io)", comment: "Change credentials button label")
}

enum AccountSection {
Expand All @@ -46,13 +59,10 @@ extension l10n {

static let alertMessage = LocalizedString("settings_view.account_section.delete_account.alert_message",
value: """
You are about to delete your account and all its data.
This action is irreversible.
Do you want to continue ?
Please send an email to [email protected]
to delete your account.
""",
comment: "Delete account alert message")

static let alertButtonLabel = LocalizedString("settings_view.account_section.delete_account.alert_buton_label", value: "Delete", comment: "Delete account alert button label")
}
}

Expand Down

0 comments on commit 87796d0

Please sign in to comment.