-
Notifications
You must be signed in to change notification settings - Fork 10
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
feat: support asset selection by external id #390
base: main
Are you sure you want to change the base?
Conversation
After talking with UX, we agreed that we will keep the label as "Asset ID" but add an info icon to tell users how to enter the ID (UUID format or appending the prefix |
onChange({ ...query, assetIds: undefined }); | ||
} else { | ||
const assetIds = | ||
uuidRegex.test(assetId) || assetId.startsWith('externalId:') ? [assetId] : [`externalId:${assetId}`]; |
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.
I haven't tested this, but I assume that if the user is using a template variable, i.e $myAssetId, then this will append the externalId
to it, which we don't want. The easiest solution to this would probably be to add a check for startsWith($)
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.
➕
What this PR does / why we need it:
Currently, the user is required to input only the asset id in uuid format in order to select the asset in a query. If any user tries to enter an external id, the query will not be able to find timeseries data since the dataplane does not support external ids yet.
This change allows users to select assets by external ids and retrieve the timeseries data.
Screen.Recording.2025-01-15.at.1.16.41.PM.mov
In addition, a tooltip for the asset field teaches users how to enter the asset id. Users can learn more about SiteWise external ids by clicking on the API docs button.
Which issue(s) this PR fixes:
Fixes #351
Testing:
externalId:...
retrieves the correct assetexternalId:
prefix to retrieve the correct asset