Skip to content

Commit

Permalink
Merge pull request #650 from Infomaniak/MultiSelect-notif-is-broken
Browse files Browse the repository at this point in the history
Fixed Bulk actions broken notification
  • Loading branch information
sirambd authored Mar 16, 2022
2 parents 3a538ca + aaff804 commit bb95fe6
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,4 @@ enum class BulkOperationType(@StringRes val title: Int, @PluralsRes val successM
else -> context.copyOperationProgressNotification()
}
}

override fun toString(): String = name.lowercase().replaceFirstChar { it.titlecase() }
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,7 @@ import com.infomaniak.lib.core.utils.hideProgress
import com.infomaniak.lib.core.utils.initProgress
import com.infomaniak.lib.core.utils.showProgress
import kotlinx.android.synthetic.main.fragment_file_share_link_settings.*
import kotlinx.android.synthetic.main.fragment_file_share_link_settings.expirationDateInput
import kotlinx.android.synthetic.main.fragment_file_share_link_settings.newPasswordButton
import kotlinx.android.synthetic.main.fragment_file_share_link_settings.passwordTextLayout
import kotlinx.android.synthetic.main.item_dropbox_settings.*
import kotlinx.android.synthetic.main.item_dropbox_settings.expirationDateSwitch
import java.util.*

class FileShareLinkSettingsFragment : Fragment() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,10 @@ abstract class MultiSelectFragment(private val matomoCategory: String) : Fragmen
}

private fun Context.trackBulkActionEvent(category: String, action: BulkOperationType, modifiedFileNumber: Int) {
val trackerName = "bulk" + (if (modifiedFileNumber == 1) "Single" else "") + action.toString()

fun BulkOperationType.toMatomoString(): String = name.lowercase().replaceFirstChar { it.titlecase() }

val trackerName = "bulk" + (if (modifiedFileNumber == 1) "Single" else "") + action.toMatomoString()
trackEvent(category, TrackerAction.CLICK, trackerName, modifiedFileNumber.toFloat())
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -520,11 +520,9 @@ class FileInfoActionsView @JvmOverloads constructor(
}
}

companion object {

private fun Context.trackFileActionEvent(trackerName: String, trackerValue: Float? = null) {
private companion object {
fun Context.trackFileActionEvent(trackerName: String, trackerValue: Float? = null) {
trackEvent("fileAction", TrackerAction.CLICK, trackerName, trackerValue)
}

}
}

0 comments on commit bb95fe6

Please sign in to comment.