AirQo-frontend icon indicating copy to clipboard operation
AirQo-frontend copied to clipboard

NetManagerMap Integration

Open AKATWIJUKA-ELIA opened this issue 9 months ago • 2 comments

Summary of Changes (What does this PR do?)

Status of maturity (all need to be checked before merging):

  • [x] I've tested this locally
  • [ ] I consider this code done
  • [ ] This change ready to hit production in its current state
  • [x] The title of the PR states what changed and the related issues number (used for the release note).
  • [ ] I've included issue number in the "Closes #ISSUE-NUMBER" part of the "What are the relevant tickets?" section to link the issue.
  • [ ] I've updated corresponding documentation for the changes in this PR.
  • [ ] I have written unit and/or e2e tests for my change(s).

Screenshot 2025-04-14 105255

  • New Features

    • Enhanced air quality map experience with new interactive modals, sidebars
    • Improved search functionality with dynamic autocomplete and refined location suggestions.
  • Enhancements

    • Extended state management and API integrations for smoother account and device monitoring.

AKATWIJUKA-ELIA avatar Feb 24 '25 17:02 AKATWIJUKA-ELIA

📝 Walkthrough

Walkthrough

This pull request introduces a comprehensive set of new features and enhancements across the NetManager application. Major updates include new React components for mapping, calendars, charts, modals, dropdowns and icons; additions and improvements to API functions, hooks, and utility functions for data fetching, date formatting, and geolocation; and extensive new Redux slices for accounts, device registry, charts, and general state management. A new webpack rule for handling SVGs and an updated web manifest are also included, all aimed at improving data visualization, user interactions, and overall state management.

Changes

File(s) Change Summary
src/netmanager-app/app/(authenticated)/network-map/page.tsx
.../NetManagerMap/page.tsx
New React components “Index” and “NetManagerMap” added to support map integration with Mapbox and air quality data visualization.
src/netmanager-app/components/NetManagerMap/components/*
.../Sidebar/*
Multiple new UI components added (IconButton, CustomZoomControl, CountryList, LayerModal, TabButtons, MapSidebar, Legend, and Sidebar subcomponents) to enhance map interactivity and sidebar functionality.
src/netmanager-app/components/Calendar/* Entire Calendar module introduced (Calendar, CustomCalendar, DatePicker, CalendarHeader, Footer, ShortCuts) for date range selection and scheduling.
src/netmanager-app/components/Charts/*
.../Charts/components/*
New chart components (ChartContainer, MoreInsightsChart, SkeletonLoader, StandardsMenu, and custom chart renderers/utilities) implemented for air quality data analytics.
src/netmanager-app/components/Modal/*
src/netmanager-app/components/Dropdowns/*
New modals, dialogs, and dropdown overlays (AppIntro, DialogWrapper, ConfirmExportModal, ExportModalWrapper, dataDownload modules, CustomDropdown, OrganizationDropdown, and Dropdown) added to manage user interactions and data export.
src/netmanager-app/public/icons/*
src/netmanager-app/components.json
New SVG icon components and updated alias mappings for icons/images introduced across directories (map, alerts, analytics, common, sidebar, topbar, etc.), plus a new web manifest file.
src/netmanager-app/core/apis/*
src/netmanager-app/utils/*
.../next.config.js
New API functions, hooks (e.g., useRefreshMap, useDataDownload, useFetchAnalyticsData, useGetActiveGroup, etc.), and utility functions (dateTime, dateUtils, AutocompleteSuggestions, SetChartDetails, UpdateUserPreferences, generateRandomColors) added; webpack config updated to support SVGs.
src/netmanager-app/core/redux/* Numerous Redux slices and store updates added for account creation, login, device registry, charts, location search, recent measurements, maps, groups, and collocation management.

Sequence Diagram(s)

sequenceDiagram
    participant U as User
    participant L as Layout Component
    participant NM as NetManagerMap Component
    participant R as Redux Store
    participant API as MapData API
    U->>L: Navigate to /network-map
    L->>NM: Render NetManagerMap (hide Topbar if MapActive)
    NM->>R: Dispatch actions to fetch grid and air quality data
    R->>API: Request grid/air quality details
    API-->>R: Return fetched data
    R-->>NM: Update state with data
    NM->>U: Render interactive map with sidebar and dynamic UI

Possibly related PRs

  • airqo-platform/AirQo-frontend#2288: Modifications involve similar state management improvements and removal of unused components in the netmanager app, directly relating to the new mapping and dashboard features.
  • airqo-platform/AirQo-frontend#2114: Updates to visual rendering and interactivity for charts and maps parallel many of the new component and state management enhancements.
  • airqo-platform/AirQo-frontend#2208: Changes in the DataTable component and data handling closely align with the new Redux slices and UI components for air quality data visualization.

Poem

In lines of code so crisp and bright,
New maps and charts now take flight,
Components and hooks, Redux in hand,
Guiding data across our land.
With icons and modals smartly designed,
Our app’s future is clearly defined!
🚀 Happy coding!

[!WARNING]

Review ran into problems

🔥 Problems

Errors were encountered while retrieving linked issues.

Errors (1)
  • JIRA integration encountered authorization issues. Please disconnect and reconnect the integration in the CodeRabbit UI.
✨ Finishing Touches
  • [ ] 📝 Generate Docstrings

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai plan to trigger planning for file edits and PR creation.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai or @coderabbitai title anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

coderabbitai[bot] avatar Feb 24 '25 17:02 coderabbitai[bot]

⚠️ GitGuardian has uncovered 2 secrets following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

Since your pull request originates from a forked repository, GitGuardian is not able to associate the secrets uncovered with secret incidents on your GitGuardian dashboard. Skipping this check run and merging your pull request will create secret incidents on your GitGuardian dashboard.

🔎 Detected hardcoded secrets in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
- - Generic High Entropy Secret 769b61a0af576a407392eba654145a5918a37218 netmanager-app/components/NetManagerMap/page.tsx View secret
- - Bearer Token bfcfcb69f416df42e3b93a638657b9647bc704e6 src/netmanager-app/components/NetManagerMap/components/Sidebar/page.tsx View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secrets safely. Learn here the best practices.
  3. Revoke and rotate these secrets.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

gitguardian[bot] avatar Feb 24 '25 17:02 gitguardian[bot]