-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: register passive view of dashboards [DHIS2-7016] (#1572)
log when a passive view of the dashboard occurs (user opens dashboard without specifically requesting the specific dashboard) This implementation posts to data statistics when the dashboard app renders a dashboard in view mode for the first time (a passive view); any subsequent passive views, regardless of dashboard, are not registered. In line with the back-end implementation by @jimgrace, the dashboard app has been modified to always make these posts for passive views, whereas api/dataStatistics will count these passive views only if the newly added system setting keyCountPassiveDashboardViewsInUsageAnalytics=true. This change is requested by PEPFAR to allow better oversight over which dashboards are being accessed by users. This change will not affect statistics unless a system admin chooses to set keyCountPassiveDashboardViewsInUsageAnalytics=true, so this PR does not change default behaviour for existing instances (https://jira.dhis2.org/browse/DHIS2-7016) Co-authored-by: Thomas Zemp <[email protected]>
- Loading branch information
1 parent
efea939
commit ddbf65d
Showing
5 changed files
with
57 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { REGISTER_PASSIVE_VIEW } from '../reducers/passiveViewRegistered' | ||
|
||
export const acSetPassiveViewRegistered = () => ({ | ||
type: REGISTER_PASSIVE_VIEW, | ||
}) |
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
export const REGISTER_PASSIVE_VIEW = 'REGISTER_PASSIVE_VIEW' | ||
|
||
export default (state = false, action) => { | ||
switch (action.type) { | ||
case REGISTER_PASSIVE_VIEW: { | ||
return true | ||
} | ||
default: | ||
return state | ||
} | ||
} | ||
|
||
export const sGetPassiveViewRegistered = state => state.passiveViewRegistered |