-
Notifications
You must be signed in to change notification settings - Fork 60
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
fix(dashboard): state fixes for dynamic assets tab #3009
Conversation
@@ -19,6 +19,7 @@ export interface AssetExplorerProps { | |||
selectedWidgets: DashboardWidget[]; | |||
timeZone?: string; | |||
significantDigits?: number; | |||
correctSelectionMode: 'single' | 'multi'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this a public API update or just internal?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one is internal. Its the props for all the RE tables in dashboard to manage dashboard state changes (ie selected widget/clicking Add or Reset). Just forgot to add in this one to the dynamic asset tab when I was doing the RE work.
...yEditor/iotSiteWiseQueryEditor/assetModelDataStreamExplorer/assetModelDataStreamExplorer.tsx
Outdated
Show resolved
Hide resolved
...yEditor/iotSiteWiseQueryEditor/assetModelDataStreamExplorer/assetModelDataStreamExplorer.tsx
Show resolved
Hide resolved
...yEditor/iotSiteWiseQueryEditor/assetModelDataStreamExplorer/getAssetModelQueryInformation.ts
Outdated
Show resolved
Hide resolved
fetchAll: true, | ||
}); | ||
|
||
const currentSelectedAsset = assetSummaries.find( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will assetSummaries ever be undefined?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no, but in case there is no assets retrieved, currentSelectedAsset will be undefined which has handling in the query editors.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unless the query errors out
bbf4926
to
6eb0071
Compare
6eb0071
to
9b58848
Compare
Overview
Fix for screen jumping to top when selecting dashboard model properties. To fix, removed useState call and moved selectedAsset state up to parent QueryEditor component.
In doing so found the following bugs and fixed them as well.
Asset Model RE keeps state of old selected asset properties after changing asset
Asset Properties table does not change selection mode based on widget type
Asset Model Tab breaks if you add duplicate properties after edit/preview change
Verifying Changes
Screen.Recording.2024-09-25.at.6.37.25.PM.mov
Legal
This project is available under the Apache 2.0 License.