awslabs / iot-app-kit

A development library for creating web applications to visualize industrial data
Apache License 2.0
119 stars 61 forks source link

feat(dashboard): add new RE components to dynamic assets tab #2951

Closed ssjagad closed 3 months ago

ssjagad commented 3 months ago

Overview

Dynamic Assets tab now uses new RE components since we want to be able to move RE into grafana and other platforms. Hence the RE components are now standalone in the react-components folder. We should remove duplication and use these components in the the dashboard.

Major decision: Because the asset drop down state is split between the preview and edit mode, we need to ensure that the state is synced. To do so we kept old API calls to update state for the selected asset Model and asset.

  1. uses useModeledBasedQuery hook to get the current assetModelId on the query,
  2. filter through a describe assetModel call to get assets and then find asset with same ID
  3. Populate that as current selected asset

Added e2e tests for dropdowns and all existing tests for RE's are made to pass with new components.

Verifying Changes

https://github.com/user-attachments/assets/bbae6fc6-1085-4904-a424-1d0b67e86b4a

Legal

This project is available under the Apache 2.0 License.