-
Notifications
You must be signed in to change notification settings - Fork 39
move to production #2976
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
move to production #2976
Conversation
…eta; avoid leaking page into DeviceRegistry calls.
Update sites and devices to use Cohorts APIs in data download in analytics
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Pull Request Overview
This PR implements production deployment changes by adding environment-specific group ID configuration and consolidating device/site data fetching to use cohort-based APIs instead of separate category-specific endpoints.
- Added production/staging group ID constants with environment-based selection
- Replaced category-specific device hooks with unified cohort-based fetching
- Added new gas device category support and API endpoints for cohort-based data
Reviewed Changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 5 comments.
Show a summary per file
File | Description |
---|---|
src/platform/src/lib/constants.js | Added environment-based AirQo group ID configuration |
src/platform/src/core/utils/loginSetup.js | Simplified user group fallback logic using environment-specific group ID |
src/platform/src/core/urls/deviceRegistry.js | Added new cohort-based API endpoints for devices and sites |
src/platform/src/core/urls/authentication.js | Added group cohorts URL helper function |
src/platform/src/core/hooks/usePaginatedData.js | Major refactor: replaced device category hooks with unified cohort-based fetching |
src/platform/src/core/hooks/analyticHooks.js | Removed exports for deprecated device category hooks |
src/platform/src/core/apis/DeviceRegistry.js | Added cohort-based API functions for devices and sites |
src/platform/src/core/apis/Analytics.js | Added category parameter support to device summary API |
src/platform/src/core/apis/Account.js | Added group cohorts API function |
src/platform/src/common/features/download-insights-locations/more-insights/hooks/useDownload.js | Added device category parameter support |
src/platform/src/common/features/download-insights-locations/data-download/hooks/useDataDownloadLogic.js | Added 'gas' to valid device categories |
src/platform/src/common/features/download-insights-locations/data-download/constants.js | Added gas device category option |
src/platform/src/common/features/download-insights-locations/data-download/components/DataContent.js | Extended device category support to include gas sensors |
src/platform/src/common/features/download-insights-locations/data-download/DataDownload.jsx | Major refactor: consolidated device category hooks into unified approach |
src/platform/src/common/features/download-insights-locations/components/DataTable.jsx | Added activeFilterKey prop support for filter synchronization |
src/platform/src/common/features/analytics-overview/hooks/useAnalyticsDownload.js | Added device category parameter to download function |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
cohort_ids = [], | ||
skip = 0, | ||
limit = 30, | ||
search='', |
Copilot
AI
Oct 16, 2025
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.
Missing space after the default value assignment. Should be search = '',
for consistency with other parameters.
Copilot uses AI. Check for mistakes.
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.
@Codebmk ..... please note in your next PRs...
cohort_ids = [], | ||
skip = 0, | ||
limit = 30, | ||
search='', |
Copilot
AI
Oct 16, 2025
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.
Missing space after the default value assignment. Should be search = '',
for consistency with other parameters.
Copilot uses AI. Check for mistakes.
const cohortIds = extractCohortIds(cohortsResponse); | ||
|
||
if (cohortIds.length === 0) { | ||
return { sites: [], meta: { total: 0, totalPages: 0, page: 1, limit: params.limit || 20, hasNextPage: false, hasPreviousPage: false } }; |
Copilot
AI
Oct 16, 2025
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.
This long object literal should be extracted to a helper function or constant to improve readability and reduce duplication (appears on lines 362 and 426).
Copilot uses AI. Check for mistakes.
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.
@Codebmk ..... please note in your next PRs...
const cohortIds = extractCohortIds(cohortsResponse); | ||
|
||
if (cohortIds.length === 0) { | ||
return { devices: [], meta: { total: 0, totalPages: 0, page: 1, limit: params.limit || 20, hasNextPage: false, hasPreviousPage: false } }; |
Copilot
AI
Oct 16, 2025
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.
This duplicated empty response structure should be extracted to a helper function to reduce code duplication.
Copilot uses AI. Check for mistakes.
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.
@Codebmk ..... please note in your next PRs...
setColumnFilters({}); | ||
setCurrentPage(1); |
Copilot
AI
Oct 16, 2025
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.
Inconsistent trailing whitespace on these lines. Remove the extra spaces for clean formatting.
Copilot uses AI. Check for mistakes.
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.
@Codebmk ..... please note in your next PRs...
Fix reset password in analytics
Uh oh!
There was an error while loading. Please reload this page.