-
Notifications
You must be signed in to change notification settings - Fork 560
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
Add target view utilities to operators #4076
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## release/v0.23.5 #4076 +/- ##
==================================================
Coverage ? 15.99%
==================================================
Files ? 732
Lines ? 82060
Branches ? 1110
==================================================
Hits ? 13123
Misses ? 68937
Partials ? 0
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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.
Tested. LGTM
@@ -501,6 +504,30 @@ def view(self): | |||
|
|||
return self._view | |||
|
|||
def target_view(self, param_name="view_target"): |
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.
Should we call it param_name="CURRENT_VIEW"
for consistency?
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.
Thats the value - this is choosing which param name - ctx.params[param_name]
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.
Ohh, yah true. Never mind 🙈
@@ -723,7 +757,11 @@ class Choices(View): | |||
|
|||
def __init__(self, **kwargs): | |||
super().__init__(**kwargs) | |||
self.choices = kwargs.get("choices", []) |
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 wonder if this is a breaking change
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 tried to make this entirely backwards compatible - a choice is only included now if it has a include = True
- which is the default.
self._choices = kwargs.get("choices", []) | ||
|
||
@property | ||
def choices(self): |
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.
This replaces the old choices
attribute
Enables this usage for adding the ability to select the source of the "target view`. This is a pattern that exists in many plugins.
Tested via this example operator.