Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into igor/topic_crash
Browse files Browse the repository at this point in the history
# Conflicts:
#	discussion/src/main/java/org/openedx/discussion/presentation/threads/DiscussionAddThreadViewModel.kt
  • Loading branch information
dixidroid committed Nov 15, 2024
2 parents fcaf563 + af3b8a9 commit b9cf50a
Show file tree
Hide file tree
Showing 336 changed files with 3,324 additions and 2,441 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/detekt.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Detekt

on:
workflow_dispatch:
pull_request: { }

env:
GRADLE_OPTS: -Dorg.gradle.daemon=false
CI_GRADLE_ARG_PROPERTIES: --stacktrace

jobs:
linting:
name: Run Detekt
runs-on: ubuntu-latest

steps:
- name: Checkout Repo
uses: actions/checkout@v4

- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'temurin' # See 'Supported distributions' for available options
java-version: '17'

- name: Run Detekt
run: ./gradlew detektAll

- name: Upload report
uses: github/codeql-action/upload-sarif@v3
if: success() || failure()
with:
sarif_file: build/reports/detekt/detekt.sarif
229 changes: 153 additions & 76 deletions app/src/main/java/org/openedx/app/AnalyticsManager.kt
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,17 @@ import org.openedx.foundation.interfaces.Analytics
import org.openedx.profile.presentation.ProfileAnalytics
import org.openedx.whatsnew.presentation.WhatsNewAnalytics

class AnalyticsManager : AppAnalytics, AppReviewAnalytics, AuthAnalytics, CoreAnalytics,
CourseAnalytics, DashboardAnalytics, DiscoveryAnalytics, DiscussionAnalytics,
ProfileAnalytics, WhatsNewAnalytics {
class AnalyticsManager :
AppAnalytics,
AppReviewAnalytics,
AuthAnalytics,
CoreAnalytics,
CourseAnalytics,
DashboardAnalytics,
DiscoveryAnalytics,
DiscussionAnalytics,
ProfileAnalytics,
WhatsNewAnalytics {

private val analytics: MutableList<Analytics> = mutableListOf()

Expand Down Expand Up @@ -45,17 +53,26 @@ class AnalyticsManager : AppAnalytics, AppReviewAnalytics, AuthAnalytics, CoreAn
}
}

override fun dashboardCourseClickedEvent(courseId: String, courseName: String) {
logEvent(Event.DASHBOARD_COURSE_CLICKED, buildMap {
put(Key.COURSE_ID.keyName, courseId)
put(Key.COURSE_NAME.keyName, courseName)
})
override fun dashboardCourseClickedEvent(
courseId: String,
courseName: String
) {
logEvent(
Event.DASHBOARD_COURSE_CLICKED,
buildMap {
put(Key.COURSE_ID.keyName, courseId)
put(Key.COURSE_NAME.keyName, courseName)
}
)
}

override fun logoutEvent(force: Boolean) {
logEvent(Event.USER_LOGOUT, buildMap {
put(Key.FORCE.keyName, force)
})
logEvent(
Event.USER_LOGOUT,
buildMap {
put(Key.FORCE.keyName, force)
}
)
}

override fun setUserIdForSession(userId: Long) {
Expand All @@ -67,104 +84,164 @@ class AnalyticsManager : AppAnalytics, AppReviewAnalytics, AuthAnalytics, CoreAn
}

override fun discoveryCourseSearchEvent(label: String, coursesCount: Int) {
logEvent(Event.DISCOVERY_COURSE_SEARCH, buildMap {
put(Key.LABEL.keyName, label)
put(Key.COURSE_COUNT.keyName, coursesCount)
})
logEvent(
Event.DISCOVERY_COURSE_SEARCH,
buildMap {
put(Key.LABEL.keyName, label)
put(Key.COURSE_COUNT.keyName, coursesCount)
}
)
}

override fun discoveryCourseClickedEvent(courseId: String, courseName: String) {
logEvent(Event.DISCOVERY_COURSE_CLICKED, buildMap {
put(Key.COURSE_ID.keyName, courseId)
put(Key.COURSE_NAME.keyName, courseName)
})
logEvent(
Event.DISCOVERY_COURSE_CLICKED,
buildMap {
put(Key.COURSE_ID.keyName, courseId)
put(Key.COURSE_NAME.keyName, courseName)
}
)
}

override fun sequentialClickedEvent(
courseId: String, courseName: String, blockId: String, blockName: String,
courseId: String,
courseName: String,
blockId: String,
blockName: String,
) {
logEvent(Event.SEQUENTIAL_CLICKED, buildMap {
put(Key.COURSE_ID.keyName, courseId)
put(Key.COURSE_NAME.keyName, courseName)
put(Key.BLOCK_ID.keyName, blockId)
put(Key.BLOCK_NAME.keyName, blockName)
})
logEvent(
Event.SEQUENTIAL_CLICKED,
buildMap {
put(Key.COURSE_ID.keyName, courseId)
put(Key.COURSE_NAME.keyName, courseName)
put(Key.BLOCK_ID.keyName, blockId)
put(Key.BLOCK_NAME.keyName, blockName)
}
)
}

override fun nextBlockClickedEvent(
courseId: String, courseName: String, blockId: String, blockName: String,
courseId: String,
courseName: String,
blockId: String,
blockName: String,
) {
logEvent(Event.NEXT_BLOCK_CLICKED, buildMap {
put(Key.COURSE_ID.keyName, courseId)
put(Key.COURSE_NAME.keyName, courseName)
put(Key.BLOCK_ID.keyName, blockId)
put(Key.BLOCK_NAME.keyName, blockName)
})
logEvent(
Event.NEXT_BLOCK_CLICKED,
buildMap {
put(Key.COURSE_ID.keyName, courseId)
put(Key.COURSE_NAME.keyName, courseName)
put(Key.BLOCK_ID.keyName, blockId)
put(Key.BLOCK_NAME.keyName, blockName)
}
)
}

override fun prevBlockClickedEvent(
courseId: String, courseName: String, blockId: String, blockName: String,
courseId: String,
courseName: String,
blockId: String,
blockName: String,
) {
logEvent(Event.PREV_BLOCK_CLICKED, buildMap {
put(Key.COURSE_ID.keyName, courseId)
put(Key.COURSE_NAME.keyName, courseName)
put(Key.BLOCK_ID.keyName, blockId)
put(Key.BLOCK_NAME.keyName, blockName)
})
logEvent(
Event.PREV_BLOCK_CLICKED,
buildMap {
put(Key.COURSE_ID.keyName, courseId)
put(Key.COURSE_NAME.keyName, courseName)
put(Key.BLOCK_ID.keyName, blockId)
put(Key.BLOCK_NAME.keyName, blockName)
}
)
}

override fun finishVerticalClickedEvent(
courseId: String, courseName: String, blockId: String, blockName: String,
courseId: String,
courseName: String,
blockId: String,
blockName: String,
) {
logEvent(Event.FINISH_VERTICAL_CLICKED, buildMap {
put(Key.COURSE_ID.keyName, courseId)
put(Key.COURSE_NAME.keyName, courseName)
put(Key.BLOCK_ID.keyName, blockId)
put(Key.BLOCK_NAME.keyName, blockName)
})
logEvent(
Event.FINISH_VERTICAL_CLICKED,
buildMap {
put(Key.COURSE_ID.keyName, courseId)
put(Key.COURSE_NAME.keyName, courseName)
put(Key.BLOCK_ID.keyName, blockId)
put(Key.BLOCK_NAME.keyName, blockName)
}
)
}

override fun finishVerticalNextClickedEvent(
courseId: String, courseName: String, blockId: String, blockName: String,
courseId: String,
courseName: String,
blockId: String,
blockName: String,
) {
logEvent(Event.FINISH_VERTICAL_NEXT_CLICKED, buildMap {
put(Key.COURSE_ID.keyName, courseId)
put(Key.COURSE_NAME.keyName, courseName)
put(Key.BLOCK_ID.keyName, blockId)
put(Key.BLOCK_NAME.keyName, blockName)
})
logEvent(
Event.FINISH_VERTICAL_NEXT_CLICKED,
buildMap {
put(Key.COURSE_ID.keyName, courseId)
put(Key.COURSE_NAME.keyName, courseName)
put(Key.BLOCK_ID.keyName, blockId)
put(Key.BLOCK_NAME.keyName, blockName)
}
)
}

override fun finishVerticalBackClickedEvent(courseId: String, courseName: String) {
logEvent(Event.FINISH_VERTICAL_BACK_CLICKED, buildMap {
put(Key.COURSE_ID.keyName, courseId)
put(Key.COURSE_NAME.keyName, courseName)
})
override fun finishVerticalBackClickedEvent(
courseId: String,
courseName: String
) {
logEvent(
Event.FINISH_VERTICAL_BACK_CLICKED,
buildMap {
put(Key.COURSE_ID.keyName, courseId)
put(Key.COURSE_NAME.keyName, courseName)
}
)
}

override fun discussionAllPostsClickedEvent(courseId: String, courseName: String) {
logEvent(Event.DISCUSSION_ALL_POSTS_CLICKED, buildMap {
put(Key.COURSE_ID.keyName, courseId)
put(Key.COURSE_NAME.keyName, courseName)
})
override fun discussionAllPostsClickedEvent(
courseId: String,
courseName: String
) {
logEvent(
Event.DISCUSSION_ALL_POSTS_CLICKED,
buildMap {
put(Key.COURSE_ID.keyName, courseId)
put(Key.COURSE_NAME.keyName, courseName)
}
)
}

override fun discussionFollowingClickedEvent(courseId: String, courseName: String) {
logEvent(Event.DISCUSSION_FOLLOWING_CLICKED, buildMap {
put(Key.COURSE_ID.keyName, courseId)
put(Key.COURSE_NAME.keyName, courseName)
})
override fun discussionFollowingClickedEvent(
courseId: String,
courseName: String
) {
logEvent(
Event.DISCUSSION_FOLLOWING_CLICKED,
buildMap {
put(Key.COURSE_ID.keyName, courseId)
put(Key.COURSE_NAME.keyName, courseName)
}
)
}

override fun discussionTopicClickedEvent(
courseId: String, courseName: String, topicId: String, topicName: String,
courseId: String,
courseName: String,
topicId: String,
topicName: String,
) {
logEvent(Event.DISCUSSION_TOPIC_CLICKED, buildMap {
put(Key.COURSE_ID.keyName, courseId)
put(Key.COURSE_NAME.keyName, courseName)
put(Key.TOPIC_ID.keyName, topicId)
put(Key.TOPIC_NAME.keyName, topicName)
})
logEvent(
Event.DISCUSSION_TOPIC_CLICKED,
buildMap {
put(Key.COURSE_ID.keyName, courseId)
put(Key.COURSE_NAME.keyName, courseName)
put(Key.TOPIC_ID.keyName, topicId)
put(Key.TOPIC_NAME.keyName, topicName)
}
)
}
}

Expand Down
Loading

0 comments on commit b9cf50a

Please sign in to comment.