Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Matomo added for my kSuite #1455

Merged
merged 1 commit into from
Feb 26, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,7 @@ extension FileActionsFloatingPanelViewController {
driveFloatingPanelController.dismiss(animated: true) {
guard let self else { return }
self.router.presentUpSaleSheet()
MatomoUtils.track(eventWithCategory: .myKSuiteUpgradeBottomSheet, name: "dropboxQuotaExceeded")
}
}
present(driveFloatingPanelController, animated: true)
Expand All @@ -300,6 +301,7 @@ extension FileActionsFloatingPanelViewController {

if packId == .myKSuite, driveFileManager.drive.dropboxQuotaExceeded {
router.presentUpSaleSheet()
MatomoUtils.track(eventWithCategory: .myKSuiteUpgradeBottomSheet, name: "dropboxQuotaExceeded")
return
}

Expand Down
1 change: 1 addition & 0 deletions kDrive/UI/Controller/Files/FileDetailViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -924,6 +924,7 @@ extension FileDetailViewController: ShareLinkTableViewCellDelegate {
func shareLinkSettingsButtonPressed() {
if packId == .myKSuite, driveFileManager.drive.sharedLinkQuotaExceeded {
router.presentUpSaleSheet()
MatomoUtils.track(eventWithCategory: .myKSuiteUpgradeBottomSheet, name: "shareLinkQuotaExceeded")
return
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ extension ShareAndRightsViewController: UITableViewDelegate, UITableViewDataSour
case .link:
guard !showMykSuiteRestriction(fileHasShareLink: file.hasSharelink) else {
router.presentUpSaleSheet()
MatomoUtils.track(eventWithCategory: .myKSuiteUpgradeBottomSheet, name: "shareLinkQuotaExceeded")
return
}

Expand Down Expand Up @@ -327,6 +328,7 @@ extension ShareAndRightsViewController: ShareLinkTableViewCellDelegate {
func shareLinkSettingsButtonPressed() {
if packId == .myKSuite, driveFileManager.drive.sharedLinkQuotaExceeded {
router.presentUpSaleSheet()
MatomoUtils.track(eventWithCategory: .myKSuiteUpgradeBottomSheet, name: "shareLinkQuotaExceeded")
return
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,11 @@ extension ShareLinkSettingsViewController: UITableViewDelegate, UITableViewDataS
if !option.isEnabled(drive: driveFileManager.drive) {
cell.actionHandler = { [weak self] _ in
self?.router.presentUpSaleSheet()
if option == .optionPassword {
MatomoUtils.track(eventWithCategory: .myKSuiteUpgradeBottomSheet, name: "shareLinkPassword")
} else if option == .optionDate {
MatomoUtils.track(eventWithCategory: .myKSuiteUpgradeBottomSheet, name: "shareLinkExpiryDate")
}
}
}

Expand Down
1 change: 1 addition & 0 deletions kDrive/UI/Controller/Home/HomeViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,7 @@ extension HomeViewController {
cell.actionHandler = { [weak self] _ in
guard let self else { return }
router.presentUpSaleSheet()
MatomoUtils.track(eventWithCategory: .myKSuiteUpgradeBottomSheet, name: "notEnoughStorageUpgrade")
}
cell.closeHandler = { [weak self] _ in
guard let self else { return }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,7 @@ class ParameterTableViewController: BaseGroupedTableViewController {
apiFetcher: driveFileManager.apiFetcher,
currentAccount: currentAccount
)
MatomoUtils.track(eventWithCategory: .myKSuite, name: "openDashboard")
navigationController?.present(dashboardViewController, animated: true)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ class NewFolderTypeTableViewController: UITableViewController {
if content[indexPath.row] == .dropbox {
if packId == .myKSuite, driveFileManager.drive.dropboxQuotaExceeded {
router.presentUpSaleSheet()
MatomoUtils.track(eventWithCategory: .myKSuiteUpgradeBottomSheet, name: "dropboxQuotaExceeded")
} else if !driveFileManager.drive.pack.capabilities.useDropbox {
let driveFloatingPanelController = DropBoxFloatingPanelViewController.instantiatePanel()
let floatingPanelViewController = driveFloatingPanelController
Expand All @@ -125,6 +126,7 @@ class NewFolderTypeTableViewController: UITableViewController {
driveFloatingPanelController.dismiss(animated: true) { [weak self] in
guard let self else { return }
router.presentUpSaleSheet()
MatomoUtils.track(eventWithCategory: .myKSuiteUpgradeBottomSheet, name: "manageDropbox")
}
}
present(driveFloatingPanelController, animated: true)
Expand Down
1 change: 1 addition & 0 deletions kDrive/UI/View/Header view/FilesHeaderView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ class FilesHeaderView: UICollectionReusableView {

@objc func didTapOnTrashHeaderView() {
router.presentUpSaleSheet()
MatomoUtils.track(eventWithCategory: .myKSuiteUpgradeBottomSheet, name: "trashStorageLimit")
}

@objc private func didTapOnCard() {
Expand Down
1 change: 1 addition & 0 deletions kDrive/Utils/FileActionsHelper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,7 @@ public final class FileActionsHelper {
public static func upsaleFolderColor() {
@InjectService var router: AppNavigable
router.presentUpSaleSheet()
MatomoUtils.track(eventWithCategory: .myKSuiteUpgradeBottomSheet, name: "colorFolder")
}
#endif
}
3 changes: 2 additions & 1 deletion kDriveCore/Utils/MatomoUtils.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ public enum MatomoUtils {
public enum EventCategory: String {
case newElement, fileListFileAction, picturesFileAction, fileInfo, shareAndRights, colorFolder, categories, search,
fileList, comment, drive, account, settings, photoSync, home, displayList, inApp, trash,
dropbox, preview, mediaPlayer, shortcuts, appReview, deeplink, publicShareAction, publicSharePasswordAction
dropbox, preview, mediaPlayer, shortcuts, appReview, deeplink, publicShareAction, publicSharePasswordAction,
myKSuite, myKSuiteUpgradeBottomSheet
}

public enum UserAction: String {
Expand Down
Loading