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

Action Builder Deactivate & Reactivate Connections #965

Merged
merged 12 commits into from
Jan 18, 2024

Conversation

ydamit
Copy link
Contributor

@ydamit ydamit commented Jan 2, 2024

Connection records in Action Builder cannot be deleted. Instead, there's an "Inactive" flag that determines whether they appear in the UI or not on either of the two Entity records they connect. This PR introduces a new method, deactivate_connection(), which deactivates an existing Connection.

The method requires the "interact ID" for one of the two Entities as a positional argument. One of two additional (keyword) arguments is required to make the change: either the interact ID for the other Entity (POST request to the connection helper endpoint), or the interact ID of the connection itself (PUT request to the specific connection endpoint).

This PR also updates the existing upsert_connection() method to include by default an explicit False value for the inactive flag when upserting Connection data, under the assumption that upserting to a given Connection implies that the user wants that Connection to be active. The reactivate argument can be set to False to prevent this and make changes to inactive Connections without reactivating them.

Tests were written and adapted for these additions and changes, and are running successfully. Furthermore, these changes were successful in live tests done by defining the two methods locally and overriding the Class definitions before instantiation.

A good future PR might be to adapt the existing upsert_connection() method to accept the Connection ID as an optional keyword arg, to trigger a PUT request directly to the specific Connection endpoint. Argument validation could be updated such that a single-item list (or even a string) could be accepted for the positional identifiers arg if the Connection ID is provided.

@ydamit ydamit added the enhancement Impact - something should be added to or changed about Parsons that isn't causing a current breakage label Jan 2, 2024
@ydamit ydamit self-assigned this Jan 2, 2024
@ydamit ydamit requested a review from IanRFerguson January 11, 2024 13:40
Copy link
Contributor

@IanRFerguson IanRFerguson left a comment

Choose a reason for hiding this comment

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

Looks great!

@ydamit ydamit merged commit e84ac1c into main Jan 18, 2024
@ydamit ydamit deleted the yotam-actionbuilder-deactivate_connection branch January 18, 2024 16:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Impact - something should be added to or changed about Parsons that isn't causing a current breakage
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants