-
Notifications
You must be signed in to change notification settings - Fork 78
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: add analytics module to handle /analytics endpoints #403
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Also remove form count related jasmine tests
karrui
changed the title
wip: add analytics module to handle /analytics endpoints
feat: add analytics module to handle /analytics endpoints
Oct 2, 2020
# Conflicts: # src/config/feature-manager/util/FeatureManager.class.ts
liangyuanruo
reviewed
Oct 6, 2020
liangyuanruo
reviewed
Oct 6, 2020
liangyuanruo
approved these changes
Oct 6, 2020
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm with minor suggestions!
# Conflicts: # src/app/controllers/core.server.controller.js
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🗒 This PR is complete with the exception of integration tests for AnalyticsRouter, see note below in the test section.
Problem
This PR extracts out analytics related functions in various controllers and services and reorganises them into the
modules/analytics
directory.Related to #144
Solution
Features:
findFormsWithSubsAbove
method toSubmissionModel
so it can be easily used by servicesaggregateFormCount
method toFormStatisticsTotalModel
so it can be easily used by servicesAnalyticsService
to retrieve user/submission/form counts from their various models.AnalyticsFactory
to return correct function handler for retrieving form counts depending on whetheraggregate-stats
feature is enabled in the Feature ManagerAnalyticsController
controller handler for/analytics
route/analytics
route with the newAnalyticsRouter
Tests
This will be delayed until #371 is merged in as that contains code for generated an authenticated session (or should I cherry pick the appropriate commits? Scared that will scare ppl off with the commit size again)