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

Allow array index on graph widget #1402

Merged
merged 2 commits into from
Jul 14, 2024
Merged

Allow array index on graph widget #1402

merged 2 commits into from
Jul 14, 2024

Conversation

jmthomas
Copy link
Member

closes #1395

@jmthomas jmthomas requested a review from ryanmelt July 13, 2024 21:40
Copy link

codecov bot commented Jul 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 75.40%. Comparing base (c85245c) to head (9627b20).
Report is 5 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1402   +/-   ##
=======================================
  Coverage   75.40%   75.40%           
=======================================
  Files         600      600           
  Lines       44701    44700    -1     
  Branches      777      777           
=======================================
+ Hits        33705    33708    +3     
+ Misses      10908    10905    -3     
+ Partials       88       87    -1     
Flag Coverage Δ
frontend 55.43% <ø> (+0.05%) ⬆️
python 84.01% <ø> (+<0.01%) ⬆️
ruby-api 48.60% <ø> (ø)
ruby-backend 80.20% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -49,6 +49,7 @@ TELEMETRY <%= target_name %> HEALTH_STATUS BIG_ENDIAN "Health and status from th
STATE CONNECTED 1 GREEN
STATE UNAVAILABLE 0 YELLOW
APPEND_ITEM BLOCKTEST 80 BLOCK "Block data"
APPEND_ITEM BRACKET[0] 8 UINT "Regular item with brackets in the name"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know it's unusual to add items to the demo but it was the only way to really test it

LABELSPARKLINE <%= target_name %> HEALTH_STATUS ARY[1]
SETTING HISTORY 60s
LABELSPARKLINE <%= target_name %> HEALTH_STATUS BRACKET[[0]]
SETTING HISTORY 60s
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Getting all these case to work correctly was interesting

)
// Return the mapped values since we may have removed bracket escaping
return item
})
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Key to getting this work was reassigning this.items to the mapped version which returns the escaped bracket names

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't support an array item with a real bracket in the name. That's probably ok.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you're naming an array item with brackets then you're really asking for trouble!

)
// Return the mapped values since we may have removed bracket escaping
return item
})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't support an array item with a real bracket in the name. That's probably ok.

Copy link

@jmthomas jmthomas merged commit 1ee0440 into main Jul 14, 2024
26 checks passed
@jmthomas jmthomas deleted the graph_widget branch July 14, 2024 19:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

LINEGRAPH widget in TlmViewer Should support array indexing
2 participants