-
Notifications
You must be signed in to change notification settings - Fork 22
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: #174 As a 'Developer', I want to see a graph on my analytics page showing API calls #221
feat: #174 As a 'Developer', I want to see a graph on my analytics page showing API calls #221
Conversation
- Update market place api schema - Add AppUsageStats component
- Update market place api schema - Add AppUsageStats component
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.
Nice work 👍
@@ -188,7 +198,7 @@ export const AnalyticsPage: React.FC<AnalyticsPageProps> = ({ installations, dev | |||
handleMapAppNameToInstallation(installationAppDataArray, developerDataArray), | |||
[installationAppDataArray, developerDataArray], | |||
) | |||
|
|||
console.log('appUsageStats', appUsageStats) |
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.
Remove console please
...{ | ||
[developerAppId]: { | ||
appName: developerAppName, | ||
requests, | ||
}, | ||
}, |
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.
will this work without ...{}
?
[developerAppId]: {
appName: developerAppName,
requests,
},
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.
It wont work without the spread operator here because I need to merge 2 objects into 1.
For example:
a = {
appId1: {
appName: 'App 1',
request: 5
}
}
b = {
appId2: {
appName: 'App 2',
request: 10
}
}
Expected result:
{
appId1: {
appName: 'App 1',
request: 5
},
appId2: {
appName: 'App 2',
request: 10
}
}
return Object.values(appUsage) | ||
.filter((app: any) => app.appName) | ||
.map((app: any) => { | ||
return `${app.appName}: ${app.requests}` |
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.
it's nice if you can replace any
with a correct type
const { appId, usage } = currentValue || {} | ||
const developerApp = developerApps?.find(app => app.id === appId) | ||
if (developerApp && developerApp.id) { | ||
const { id: developerAppId, name: developerAppName } = developerApp |
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.
Could this be changed to
if (!developerApp?.id){|
return accumulator
}
const { id: developerAppId, name: developerAppName } = developerApp
...
} | ||
|
||
describe('DeveloperTrafficChart', () => { | ||
describe('getAppUsageStatsChartData', () => { |
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.
make sure to test this function with more cases since it looks quite complicated
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.
Hi @vuhuucuong , i've already added another test case for multiple app usages
* [CLD-598] Searching by app name or company name on browse apps * Change auze-pipelines
…-component [CLD-696] change style help guide component
…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
No description provided.