Skip to content

menus in blocks #175

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

Open
djaus2 opened this issue Mar 5, 2025 · 6 comments
Open

menus in blocks #175

djaus2 opened this issue Mar 5, 2025 · 6 comments

Comments

@djaus2
Copy link

djaus2 commented Mar 5, 2025

Is it possible to have a block where an input is a selection from a menu that data for which is a list or even a CSV list.
That is the list is generated by code not from blocks. For eaxample from a database query.

I can implement that (CSV list) at runtime but I'd like to have a Generic block with which I can specify its functionality by selecting from a menu at setup time, when the block is added to the canvas?
Thx

@djaus2
Copy link
Author

djaus2 commented Mar 5, 2025

Further to this, a complication:
A block as above with 2 such inputs where the second list is filtered by the first.
ie Where the first is the list of identities. The second has entries have an instance of the identity which gets filtered when the identity is selected. (Yes a SQL table backing this.)

@ignatandrei
Copy link
Owner

Do you want to upload a CSV file ?

@djaus2
Copy link
Author

djaus2 commented Mar 6, 2025

I can get the functionality I want by making the block input parameter, that is the controller parameter, an enum. In which case you can get a menu for selecting the enum. I'd like to extend this to where the parameter is to be selected from a list and it's index is selected, or even better a selection is made from a dictionary int,string with string displayed and int selected.
Thx

@ignatandrei
Copy link
Owner

Ah, ok. Let me see if the OpenAPI has such functionality . Alternatively, we can think it to an Enum that has a Description attribute

@djaus2
Copy link
Author

djaus2 commented Mar 6, 2025

OK I'll look at OpenAPI. I want it determinable at ASP.NET runtime. Not compile time.

@djaus2
Copy link
Author

djaus2 commented Mar 9, 2025

In the mean time, I have done a partial workaround.
The first entity has a limited number of entries so using that as an enum. These don't change.
The second enity has the first enitity as a property and the sublist of entries for each value of the first property have a common set of values. So using enum for those, along with its first entry value.
For the rest there is a string query for them.
I'll blog about this.

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

No branches or pull requests

2 participants