Skip to content
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

Web/portfolio page #504

Merged
merged 21 commits into from
Dec 13, 2024
Merged

Web/portfolio page #504

merged 21 commits into from
Dec 13, 2024

Conversation

TheRealLowyer
Copy link
Contributor

@TheRealLowyer TheRealLowyer commented Dec 13, 2024

Enhance Portfolio Page with Asset Management and Visualization Features

Description

This PR introduces several enhancements and features to the Portfolio page, enabling users to better manage their assets and visualize their portfolio. Below is a summary of the key changes:


Key Features Added

  1. Portfolio Visualization

    • Added a Doughnut Chart to visually represent the user's portfolio distribution based on asset values.
    • Integrated a diverse color palette for the chart to enhance readability.
  2. Asset Management

    • Implemented a "Add Asset" modal:
      • Fetches all available assets from the /api/asset/all endpoint.
      • Users can select an asset from a dropdown, specify the amount, and add it to their portfolio.
    • Integrated the /api/portfolio/add-asset endpoint to handle asset addition with proper error handling and feedback.
  3. Asset Details Modal

    • Clicking on an asset card opens a modal displaying a TradingView widget with real-time asset information.
    • Blurred the background for better modal focus.
  4. Improved Styling

    • Enhanced the overall layout of the Portfolio page for a cleaner user interface:
      • Positioned the chart and asset list for better alignment.
      • Styled key data points (Amount, Last Price, Total Value) for better visual emphasis.
    • Improved styling for modals, forms, and buttons:
      • Add Asset modal now features distinct, themed styling for dropdowns, input fields, and buttons.

APIs Integrated

  • Portfolio Data:
    • /api/portfolio/get-portfolio: Fetch user portfolio details.
  • Asset Details:
    • /api/asset/details: Retrieve detailed information for each asset.
  • All Assets:
    • /api/asset/all: Fetch a list of all available assets for dropdown selection.
  • Add Asset:
    • /api/portfolio/add-asset: Add a new asset to the user's portfolio with proper payload handling.

Bug Fixes

  • Resolved issues with retrieving and passing the correct assetId when adding an asset.
  • Fixed errors with data handling for the Add Asset modal.

Screenshots

Portfolio Page with Chart and Asset List:

  • Screenshot showcasing the new layout and styling.

Add Asset Modal:

  • Screenshot demonstrating the dropdown, input fields, and updated styling.

Asset Details Modal:

  • Screenshot showing the TradingView widget within a modal.

Testing Instructions

  1. Login to the application and navigate to the Portfolio page.
  2. Verify the portfolio visualization chart and asset list.
  3. Click on an asset card to open the Asset Details modal.
  4. Click "Add Asset," select an asset, specify the amount, and add it to the portfolio.
  5. Ensure the new asset appears in the portfolio list and chart updates accordingly.

Future Enhancements

  • Include additional asset metrics in the chart for more detailed analysis.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Action Item A specific task requiring attention Frontend Priority: High Requires taking action ASAP
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Posts and Subforum Link Enhancements Portfolio Page Enhancements with Asset Management and Visualization
2 participants