Skip to content

Commit

Permalink
feat: #174 As a 'Developer', I want to see a graph on my analytics pa…
Browse files Browse the repository at this point in the history
…ge showing API calls (#221)

* feat: #174 - Add AppUsageStats apis + redux store
- Update market place api schema
- Add AppUsageStats component

* feat: #174 - Add AppUsageStats apis + redux store
- Update market place api schema
- Add AppUsageStats component

* feat: #173 create traffic table

* feat: #174 - Build app usages graph

* Revert package.json

* feat: #174 - Update test for developer traffic chart

* feat: #174 - Add util test, fix created date format in traffic table

* feat: #174 - Remove developerId param from appUsageStatsRequest

* feat: #174 Remove unused logs - Update appId params

* feat: #174 - Update usage stats test for multiple apps

* feat: #174 - Fix app usage stats test issues

* feat: #174 - Update analytic page rendering flow while loading

* feat: #174 - Add type for app trafic tooltip label

* feat: #174 - Update marketplace-api-schema.ts file
  • Loading branch information
nphivu414 authored Feb 11, 2020
1 parent 2b88221 commit ac38dcf
Show file tree
Hide file tree
Showing 41 changed files with 1,344 additions and 79 deletions.
2 changes: 1 addition & 1 deletion packages/marketplace/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@
"last 2 versions",
"not ie <= 10"
]
}
}
17 changes: 17 additions & 0 deletions packages/marketplace/src/actions/__tests__/app-usage-stats.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { appUsageStatsReceiveData, appUsageStatsRequestData, appUsageStatsRequestDataFailure } from '../app-usage-stats'
import ActionTypes from '@/constants/action-types'
import { usageStatsDataStub } from '@/sagas/__stubs__/app-usage-stats'

describe('app-usage-stats actions', () => {
it('should create a appUsageStatsRequestData action', () => {
expect(appUsageStatsRequestData.type).toEqual(ActionTypes.APP_USAGE_STATS_REQUEST_DATA)
expect(appUsageStatsRequestData({ appId: ['1'] }).data).toEqual({ appId: ['1'] })
})
it('should create a appUsageStatsReceiveData action', () => {
expect(appUsageStatsReceiveData.type).toEqual(ActionTypes.APP_USAGE_STATS_RECEIVE_DATA)
expect(appUsageStatsReceiveData(usageStatsDataStub).data).toEqual(usageStatsDataStub)
})
it('should create a appUsageStatsRequestDataFailure action', () => {
expect(appUsageStatsRequestDataFailure.type).toEqual(ActionTypes.APP_USAGE_STATS_REQUEST_DATA_FAILURE)
})
})
14 changes: 14 additions & 0 deletions packages/marketplace/src/actions/app-usage-stats.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { actionCreator } from '../utils/actions'
import ActionTypes from '../constants/action-types'

const { APP_USAGE_STATS_REQUEST_DATA, APP_USAGE_STATS_RECEIVE_DATA, APP_USAGE_STATS_REQUEST_DATA_FAILURE } = ActionTypes

export interface AppUsageStatsParams {
appId?: string[]
dateFrom?: string
dateTo?: string
}

export const appUsageStatsRequestData = actionCreator<AppUsageStatsParams>(APP_USAGE_STATS_REQUEST_DATA)
export const appUsageStatsReceiveData = actionCreator<AppUsageStatsParams>(APP_USAGE_STATS_RECEIVE_DATA)
export const appUsageStatsRequestDataFailure = actionCreator<void>(APP_USAGE_STATS_REQUEST_DATA_FAILURE)
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ exports[`AdminApps should match a snapshot when LOADING false 1`] = `
data={
Array [
Object {
"created": "2020-02-02T10:45:57",
"developer": "Pete's Proptech World Ltd",
"developerId": "28c9ea52-7f73-4814-9e00-4e3714b8adeb",
"homePage": "http://google.com/abc",
Expand All @@ -147,6 +148,7 @@ exports[`AdminApps should match a snapshot when LOADING false 1`] = `
"summary": "nXXT2zaK807ysWgy8F0WEhIYRP3TgosAtfuiLtQCImoSx0kynxbIF0nkGHU36Oz13kM3DG0Bcsicr8L6eWFKLBg4axlmiOEWcvwHAbBP9LRvoFkCl58k1wjhOExnpaZItEyOT1AXVKv8PE44aMGtVz",
},
Object {
"created": "2020-02-02T10:45:57",
"developer": "Pete's Proptech World Ltd",
"developerId": "28c9ea52-7f73-4814-9e00-4e3714b8adeb",
"homePage": "http://www.contoso.com/path",
Expand Down Expand Up @@ -266,6 +268,7 @@ exports[`AdminApps should match a snapshot when LOADING true 1`] = `
data={
Array [
Object {
"created": "2020-02-02T10:45:57",
"developer": "Pete's Proptech World Ltd",
"developerId": "28c9ea52-7f73-4814-9e00-4e3714b8adeb",
"homePage": "http://google.com/abc",
Expand All @@ -287,6 +290,7 @@ exports[`AdminApps should match a snapshot when LOADING true 1`] = `
"summary": "nXXT2zaK807ysWgy8F0WEhIYRP3TgosAtfuiLtQCImoSx0kynxbIF0nkGHU36Oz13kM3DG0Bcsicr8L6eWFKLBg4axlmiOEWcvwHAbBP9LRvoFkCl58k1wjhOExnpaZItEyOT1AXVKv8PE44aMGtVz",
},
Object {
"created": "2020-02-02T10:45:57",
"developer": "Pete's Proptech World Ltd",
"developerId": "28c9ea52-7f73-4814-9e00-4e3714b8adeb",
"homePage": "http://www.contoso.com/path",
Expand Down
Loading

0 comments on commit ac38dcf

Please sign in to comment.