-
Notifications
You must be signed in to change notification settings - Fork 39
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
Clarify purpose of available_methods
in beamline_config.yml
#1485
Comments
The idea is that a method needs to be set to |
Thanks, okay, so basically:
I'd also argue that we don't actually need to expose |
Thanks @axelboc thats a good and clear summary :). It also a good idea to not expose |
I'm trying to refactor the
ContextMenu
component and some of the code relies on the beamline configuration below, so I'd like to understand its purpose a bit better:This
available_methods
configuration is first made available to the front-end through thebeamline.availableMethod
global state, which is used to hide options from the sample view's context menu.The code that does this is unnecessarily convoluted, but basically it removes any option with a matching key in
available_methods
that is set tofalse
. So if we have:... then the context menu action with key
datacollection
doesn't get displayed. The current logic cares only about "methods" that are set tofalse
and ignores the others (i.e. it's an opt-out mechanism).Now the
available_methods
configuration is also used inQueue#get_available_tasks()
. In this case, it's an opt-in mechanism: each task is made available only if its corresponding key is defined and set totrue
inavailable_methods
.Available tasks are made available to the front-end through the
taskForm.defaultParameters
global state:When a "method" is set to
false
(or not set all) inavailable_methods
, the corresponding task no longer appears in thedefaultParameters
object.Okay, so with all this in mind, I'm curious to know how the
available_methods
is actually used in practice:datacollection
tofalse
, for instance, it removes the Data Collection option from the sample view's context menu, but not from the drop-downs and context menus on the Samples page (e.g. Add Task to Samples button) ... in fact it makes those remaining Data Collection options inoperable (error in the console).true
inavailable_methods
for it to be exposed to the UI, then isn't this simply incompatible with the opt-out mechanism of the sample view's context menu? Is there a way that I'm not seeing to expose a task but also hide it from the context menu? Is this even a need in practice?The text was updated successfully, but these errors were encountered: