Skip to content

Conversation

Baalmart
Copy link
Collaborator

@Baalmart Baalmart commented Oct 16, 2025

Copy link
Contributor

coderabbitai bot commented Oct 16, 2025

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Note

Other AI code review bot(s) detected

CodeRabbit 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)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch staging

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@Copilot Copilot AI left a 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='',
Copy link

Copilot AI Oct 16, 2025

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.

Copy link
Collaborator Author

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='',
Copy link

Copilot AI Oct 16, 2025

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 } };
Copy link

Copilot AI Oct 16, 2025

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.

Copy link
Collaborator Author

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 } };
Copy link

Copilot AI Oct 16, 2025

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.

Copy link
Collaborator Author

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...

Comment on lines +360 to +361
setColumnFilters({});
setCurrentPage(1);
Copy link

Copilot AI Oct 16, 2025

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.

Copy link
Collaborator Author

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...

@Baalmart Baalmart merged commit 82761b9 into master Oct 16, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants