Skip to content

Conversation

@ameliahsu
Copy link
Member

adding the option to show a connect/disconnect column to the connected automations list, which will be used for the monitor creation page

Screenshot 2025-05-09 at 4 50 33 PM

refactored the useConnectedMonitors() hook so that it could be shared between the connected monitors and automations lists

@ameliahsu ameliahsu requested a review from a team as a code owner May 9, 2025 23:54
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label May 9, 2025
@ameliahsu ameliahsu requested a review from natemoo-re May 12, 2025 18:13
Copy link
Member

@natemoo-re natemoo-re left a comment

Choose a reason for hiding this comment

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

Few things to clean up, but looks good otherwise!

} else {
newSet.add(id);
}
localStorage.setItem('connectedIds', JSON.stringify(Array.from(newSet)));
Copy link
Member

Choose a reason for hiding this comment

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

I'd consider either accepting a required key parameter to use as the localStorage key or leveraging the useId() hook to generate one. Currently, interacting with multiple components that use this hook would overwrite earlier states.

Copy link
Member Author

Choose a reason for hiding this comment

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

ah yep, i forgot i was still brainstorming solutions for this. i didn't know useId existed, thanks! fixed in f048ee6

Copy link
Member Author

Choose a reason for hiding this comment

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

update: i realized we can't just generate a unique key for every use, since we want step 1 and 2 of automation creation to maintain the same list of connectedIds. i've updated this hook to take a key parameter, but made a const key for steps 1 and 2 of automation creation to share (see ee135ba). let me know if there is a better way for 2 views to share a key!

@codecov
Copy link

codecov bot commented May 13, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@             Coverage Diff             @@
##           master   #91408       +/-   ##
===========================================
+ Coverage   29.61%   75.94%   +46.32%     
===========================================
  Files        8728    10322     +1594     
  Lines      487191   585475    +98284     
  Branches    22549    22527       -22     
===========================================
+ Hits       144282   444634   +300352     
+ Misses     342227   140420   -201807     
+ Partials      682      421      -261     

@ameliahsu ameliahsu force-pushed the mia/aci/ref-connected-automations-list branch from ee135ba to 406cc52 Compare May 13, 2025 15:24
@ameliahsu ameliahsu requested a review from natemoo-re May 13, 2025 15:25
@ameliahsu ameliahsu merged commit c4d0b5e into master May 14, 2025
41 checks passed
@ameliahsu ameliahsu deleted the mia/aci/ref-connected-automations-list branch May 14, 2025 17:57
@github-actions github-actions bot locked and limited conversation to collaborators May 30, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants