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

feat: add multiline support for input #174

Closed
JaeAeich opened this issue Nov 13, 2023 · 4 comments · Fixed by #222 · May be fixed by #320
Closed

feat: add multiline support for input #174

JaeAeich opened this issue Nov 13, 2023 · 4 comments · Fixed by #222 · May be fixed by #320
Labels
status: new Has not been triaged by admin

Comments

@JaeAeich
Copy link
Contributor

Description

It would be nice if the "Workflow Parameters" and "Workflow Engine Parameters" would also accept YAML (which would then be converted to JSON), as it is easier for humans to manipulate YAML. For example, {"input":{"class":"File","path":"https://is.muni.cz/pics/design/r/znak_MU.png"}} is much harder to type/construct than:

input:
  class: File
  path: https://is.muni.cz/pics/design/r/znak_MU.png

Possible solution(s)

Maybe we support multiline inputs to the form so that package-author can specifically parse that input from YAML to JSON.

@JaeAeich JaeAeich added the status: new Has not been triaged by admin label Nov 13, 2023
@anuragxxd
Copy link
Member

Yeah this is something that needs to be abstracted in the design package. We can provide the yaml as the additional type in the fields prop that can render the yaml editor. One can use the external package for the same like this https://www.npmjs.com/package/monaco-yaml#installation.

@SalihuDickson
Copy link
Contributor

I think we can combine this feature with #178, and plan it for an updated version of the package. I've looked into integrating an editor into our package and I'm working on an implementation but to achieve a smooth roll out it still needs to be refined and as there are a number of build problems and potential instability.

@JaeAeich
Copy link
Contributor Author

Yeah one PR should fix both, we would need props which specify the input typo ig. Maybe when the input field opens we can have a toggle where in user can select JSON or YAML, and on submit this can be sent to package wherein the package can convert it into suitable format.

But this issue talks about one specific input of the WES form while #178 talks about the whole form. In #178 when user clicks on submit there won't be shouldn't be parsing as either way the data sent is in JSON which the API accepts. But this is only one field so we will parse it with other data from the form which is plain text..

@SalihuDickson
Copy link
Contributor

SalihuDickson commented Nov 19, 2023

Yeah @JaeAeich, we could implement something as simple as a textbox and simply parse the data on the design package side. But I think @git-anurag-hub is suggesting integrating an editor to implement features like syntax highlighting and simple formatting. But I assume this isn't a high priority issue that's why I'm suggesting we defer implementation. But if it is then we can go with a simple solution now and only improve on it in subsequent versions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: new Has not been triaged by admin
Projects
None yet
3 participants