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

feat(tag): include properties in query result #42

Merged
merged 4 commits into from
Oct 6, 2023
Merged

Conversation

mure
Copy link
Collaborator

@mure mure commented Oct 4, 2023

Pull Request

🀨 Rationale

https://dev.azure.com/ni/DevCentral/_workitems/edit/2504597

πŸ‘©β€πŸ’» Implementation

Pretty straightforward - TagQueryEditor now has an InlineSwitch component that lets users toggle whether or not to show properties. In TagDataSource, we map the tag's properties to DataFrame fields and conditionally append them to the result. We ignore properties that start with "nitag" because they're used by the historian service and not useful to users. We also now return the tag's last updated timestamp for the "Current" query mode.

πŸ§ͺ Testing

I decided to make the leap to using snapshot testing for some of the tag data source tests. I've been thinking about it for a while, but this change made updating the test assertions tedious enough that I tried it out. It's really nice for testing the data source query method. Instead of manually typing out the expected result, Jest generates a snapshot file for us that stores the results. Then in the future if the snapshot changes, the test will fail.

βœ… Checklist

@mure mure marked this pull request as ready for review October 4, 2023 23:05
src/datasources/tag/components/TagQueryEditor.tsx Outdated Show resolved Hide resolved
src/datasources/tag/types.ts Outdated Show resolved Hide resolved
@mure mure merged commit 0ffc1e2 into main Oct 6, 2023
1 check passed
@mure mure deleted the include-properties branch October 6, 2023 01:14
mure pushed a commit that referenced this pull request Oct 6, 2023
## [3.6.0](v3.5.0...v3.6.0) (2023-10-06)

### Features

* **tag:** include properties in query result ([#42](#42)) ([0ffc1e2](0ffc1e2))
@mure
Copy link
Collaborator Author

mure commented Oct 6, 2023

πŸŽ‰ This PR is included in version 3.6.0 πŸŽ‰

The release is available on:

Your semantic-release bot πŸ“¦πŸš€

@mure mure added the released label Oct 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants