awslabs / iot-app-kit

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

fix(dashboard-dynamic-asset): asset name should be shown on refresh in dropdown #2982

Closed ssjagad closed 2 months ago

ssjagad commented 2 months ago

Overview

When a page is refreshed, the asset selection dropdown would show the asset id instead of the name. To get the name, we are currently filtering based on ID after calling a describe asset model call. Initially, the call returns undefined.

Added a useEffect call to update selected asset once API call provides data.

Verifying Changes

https://github.com/user-attachments/assets/2572a051-8b63-44d2-aa4b-9dea8864ace9

Legal

This project is available under the Apache 2.0 License.