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

Add label to parameters #486

Closed
spapas opened this issue Aug 30, 2022 · 6 comments
Closed

Add label to parameters #486

spapas opened this issue Aug 30, 2022 · 6 comments

Comments

@spapas
Copy link
Contributor

spapas commented Aug 30, 2022

I embedded a query with parameters using the procedure described in #485. The problem with this is that there is no way to add an optional "label" to the parameters so as to have better control on what to disply to the users.

I tried to change the parameter name to be used as a labe but for reasons unknown to me this doesn't work. For example take a peek at this query:

select aa.id, aa.created_on,
aa.dynamic_data->>'date' as "Ημερμηνία",
aa.dynamic_data->>'authority' as "Υπηρεσία",
aa.dynamic_data->>'mail' as "Email",
aa.dynamic_data
from apps_app aa 
left join apptypes_apptype aat on 
aa.app_type_id = aat.id
where aat.id = 8
and aa.dynamic_data->>'mail' like "%$$email$$%"
and aa.dynamic_data->>'authority' like "%$$Υπηρεσία$$%"

Notice that I use a unicode name for the parameter in the last line; this parameter is not displayed at all (notice I'm using the normal process explorer view not any custom ones). Also, if I wanted to write Email as the name of the parameter instead of email I'd still get email (all lowercase) in the form field label.

One way this could be implemented (this is only for UX purposes, I haven't read the code to understand if it's possible) is to add an optional label in the field similar to the optional default value. I.e right now we can do: $$paramName:defaultValue$$, this can be changed to $$paramName:defaultValue:Label$$ (and let's suppose we don't allow : in the label).

Is this the correct way to go? Also is this a feature we'd like to add ? If yes I'd be happy to take a look at it.

@lawson89
Copy link
Contributor

lawson89 commented Dec 16, 2022

I really like the idea but I'd prefer a different syntax to group the label closer to the param name and avoid using : as the separator

Maybe $$paramName[label]:defaultValue$$
or
$$paramName|label:defaultValue$$

where label is optional of course

Thoughts @spapas @marksweb ?

@spapas
Copy link
Contributor Author

spapas commented Dec 16, 2022

I'm fine with the pipe syntax, seems easier to parse :)

@marksweb
Copy link
Collaborator

Yeah, the pipe is easier to read 👍

@lawson89
Copy link
Contributor

@spapas would you want to take crack at implementing this with the pipe syntax for an optional label?

@spapas
Copy link
Contributor Author

spapas commented Dec 22, 2022

@lawson89 yes I'll start implementing this after the Christmas holidays!

@spapas
Copy link
Contributor Author

spapas commented Mar 5, 2023

Done with #519

@spapas spapas closed this as completed Mar 5, 2023
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

3 participants