Skip to content

Conversation

@adityashibu
Copy link
Member

This pull request includes several significant updates to the backend and frontend of the application, focusing on device allocation functionality, error handling, and user management. The most important changes include the addition of new functions for device allocation, updates to existing functions to handle the new allocation logic, and the introduction of a new frontend component for device allocation.

Backend Changes

  • Device Allocation Logic:

    • Added allocate_devices function in backend/users.py to allocate devices to a user based on their User ID.
    • Updated backend/devices_json.py to create and manage selected_user_devices.json based on the allocated devices of the selected user.
  • Function Updates:

    • Modified loadJSON to load user and device data and filter allocated devices.
    • Updated functions such as changeDeviceStatus, updateDevices, and changeConnection to use the new loadDevicesJSON function. [1] [2]
  • API Enhancements:

    • Added new endpoint /allocate_devices in backend/fastAPI.py to handle device allocation requests.
    • Updated existing endpoints to use the new device loading logic.
  • Configuration and Dependencies:

    • Updated .gitignore to include selected_user_devices.json.
    • Updated requirements.txt to include new dependencies such as exceptiongroup and PyYAML.

Frontend Changes

  • New Device Allocation Component:
    • Added AllocateDevicesDialog component in frontend/src/app/ui/allocateDevices.jsx to provide a UI for allocating devices to users.
    • Integrated the new component into the account menu in frontend/src/app/ui/dashboard/accountMenu.jsx. [1] [2]

Testing Updates

  • Test Adjustments:
    • Commented out non-working tests in backend/tests/test_devices_json.py to focus on the new allocation logic. [1] [2] [3]

adityashibu and others added 26 commits March 10, 2025 09:52
…ices.json and update requirements.txt with new dependencies
…nd update devices accordingly; modify add_user endpoint to accept JSON payload
@adityashibu adityashibu requested a review from david-g-f March 11, 2025 20:59
Copy link
Contributor

@david-g-f david-g-f left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great stuff

@adityashibu adityashibu merged commit 24675c9 into PowerHouse-Project:main Mar 12, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants