Skip to content

Commit

Permalink
Merge pull request #901 from Infomaniak/missing-matomo-and-accessibility
Browse files Browse the repository at this point in the history
feat: Add missing matomo and accessibility
  • Loading branch information
valentinperignon committed Jul 27, 2023
2 parents 118573e + 2086142 commit 1c09b0e
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 6 deletions.
4 changes: 4 additions & 0 deletions Mail/Views/Menu Drawer/Folders/FolderCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ struct FolderCellContent: View {
ChevronIcon(style: folder.isExpanded ? .up : .down, color: .secondary)
}
.opacity(level == 0 && !folder.children.isEmpty ? 1 : 0)
.accessibilityLabel(MailResourcesStrings.Localizable.contentDescriptionButtonExpandFolder(folder.name))
}

folder.icon
Expand Down Expand Up @@ -202,6 +203,9 @@ struct FolderCellContent: View {
}

private func collapseFolder() {
@InjectService var matomo: MatomoUtils
matomo.track(eventWithCategory: .menuDrawer, name: "collapseFolder", value: !folder.isExpanded)

guard let liveFolder = folder.thaw() else { return }
try? liveFolder.realm?.write {
liveFolder.isExpanded = !folder.isExpanded
Expand Down
6 changes: 6 additions & 0 deletions Mail/Views/New Message/Header Cells/SenderMenuCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

import InfomaniakCoreUI
import InfomaniakDI
import MailCore
import MailResources
import SwiftUI
Expand All @@ -29,6 +31,9 @@ struct SenderMenuCell: View {

var body: some View {
Button {
@InjectService var matomo: MatomoUtils
matomo.track(eventWithCategory: .newMessage, name: "switchIdentity")

withAnimation {
self.currentSignature = signature
}
Expand All @@ -41,6 +46,7 @@ struct SenderMenuCell: View {
MailResourcesAsset.check.swiftUIImage
}
}
.accessibilityHint(MailResourcesStrings.Localizable.contentDescriptionButtonSelectSignature)

Text(signature.senderEmailIdn)
}
Expand Down
5 changes: 5 additions & 0 deletions Mail/Views/New Message/Recipients/FullRecipientsList.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ import MailCore
import RealmSwift
import SwiftUI
import WrappingHStack
import InfomaniakDI
import InfomaniakCoreUI

struct FullRecipientsList: View {
@EnvironmentObject private var mailboxManager: MailboxManager
Expand All @@ -42,6 +44,9 @@ struct FullRecipientsList: View {
}

@MainActor private func remove(recipientAt: Int) {
@InjectService var matomo: MatomoUtils
matomo.track(eventWithCategory: .newMessage, name: "deleteRecipient")

withAnimation {
$recipients.remove(at: recipientAt)
}
Expand Down
12 changes: 6 additions & 6 deletions Mail/Views/Switch User/AddMailboxView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ struct AddMailboxView: View {

var body: some View {
VStack(alignment: .leading) {
Text(MailResourcesStrings.Localizable.attachAddressDescription)
Text(MailResourcesStrings.Localizable.attachMailboxDescription1)
.textStyle(.bodySecondary)
.padding(.bottom, 32)

TextField(MailResourcesStrings.Localizable.attachAddressInputHint, text: $newAddress)
TextField(MailResourcesStrings.Localizable.attachMailboxInputHint, text: $newAddress)
.textContentType(.emailAddress)
.keyboardType(.emailAddress)
.autocorrectionDisabled()
Expand All @@ -53,11 +53,11 @@ struct AddMailboxView: View {
}
.padding(.bottom, 4)

Text(MailResourcesStrings.Localizable.attachAddressInputHelper)
Text(MailResourcesStrings.Localizable.attachMailboxDescription2)
.textStyle(showError ? .labelError : .labelSecondary)
.padding(.bottom, 8)

SecureField(MailResourcesStrings.Localizable.attachAddressPasswordInputHint, text: $password)
SecureField(MailResourcesStrings.Localizable.attachMailboxPasswordInputHint, text: $password)
.textContentType(.password)
.padding([.vertical, .leading], 12)
.padding(.trailing, 16)
Expand All @@ -76,13 +76,13 @@ struct AddMailboxView: View {

Spacer()

MailButton(label: MailResourcesStrings.Localizable.buttonAttachEmailAddress) {
MailButton(label: MailResourcesStrings.Localizable.buttonAttachMailbox) {
addMailbox()
}
.disabled(buttonDisabled)
.mailButtonFullWidth(true)
}
.navigationBarTitle(MailResourcesStrings.Localizable.attachAddressTitle, displayMode: .inline)
.navigationBarTitle(MailResourcesStrings.Localizable.attachMailboxTitle, displayMode: .inline)
.padding(.horizontal, 16)
.padding(.vertical, 32)
}
Expand Down
Binary file modified MailResources/Localizable/de.lproj/Localizable.strings
Binary file not shown.
Binary file modified MailResources/Localizable/en.lproj/Localizable.strings
Binary file not shown.
Binary file modified MailResources/Localizable/es.lproj/Localizable.strings
Binary file not shown.
Binary file modified MailResources/Localizable/fr.lproj/Localizable.strings
Binary file not shown.
Binary file modified MailResources/Localizable/it.lproj/Localizable.strings
Binary file not shown.

0 comments on commit 1c09b0e

Please sign in to comment.