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 a way to export recipes as JSON #15383

Open
MikeAlhayek opened this issue Feb 21, 2024 · 15 comments · May be fixed by #15384
Open

Add a way to export recipes as JSON #15383

MikeAlhayek opened this issue Feb 21, 2024 · 15 comments · May be fixed by #15384

Comments

@MikeAlhayek
Copy link
Member

Many times we export small recipes. We don't really want to download it as compressed then uncompress it.

It would be much easier if we add an option to export recipes as json.

@hishamco
Copy link
Member

This might be useful if the recipe size is too big

@ns8482e
Copy link
Contributor

ns8482e commented Feb 23, 2024

The file download zip file includes recipe json content. It's it possible to read the json from zip - it's just need to be updated in document.

@hishamco
Copy link
Member

The file download zip file includes recipe json content.

I think Mike's intend to simplify the process by downloading the JSON instead of zip then extracting the recipe.json

@ns8482e
Copy link
Contributor

ns8482e commented Feb 23, 2024

Yes but extracting from zip is easy. Downloading zip file vs json could be confusing as both are not different.

Better option to improve existing file download with option to compress the file or not

@MikeAlhayek
Copy link
Member Author

MikeAlhayek commented Feb 24, 2024

@ns8482e check out PR #15384 please. I named them compressed vs uncompressed so it is not confusing.

The deployment UI is build for extension by adding alternative deployment target provider. So I extended based on the existing structure.

image

@hishamco
Copy link
Member

I'm afraid I have to disagree this will let every target be compressed / uncompressed, a good option is to add a checkbox, so when it is checked the file will be compressed regardless of its format JSON, XML .. etc

@MikeAlhayek
Copy link
Member Author

MikeAlhayek commented Feb 24, 2024

@hishamco

First of all, deployment only support JSON format. We do not support XML or any other format. So complicating usage/design just because it not a good idea.

I do not mind the idea of adding a checkbox to compress or not. But this will require to change lots of our existing setup. We'll need to change how we render the target to use shapes, also add new templates for adding the checkbox.

I don't think we need to overhaul our setup just to allow adding a checkbox.

The current structure allow us to extent the UI by adding a new deployment source easily which is the approach I took.

@hishamco
Copy link
Member

First of all, deployment only support JSON format. We do not support XML or any other format.

I know, perhaps some of the clients already have

Better option to improve existing file download with option to compress the file or not

Checkbox could be a good option IMHO regardless of the code change

@MikeAlhayek
Copy link
Member Author

The fact that OC supports only JSON recipes, we don't care about other formats. I don't think it's a valid argument.

Checkbox could be a good option IMHO regardless of the code change

If you have the time, feel free to submit a PR converting deployment rendering to shapes and add the checkbox. My intention with the submitted PR to utilize the structure that already exists "path of least resistance".

Also, changing the structure could also mean possible breaking change people.

Implementing a battleship when we only need a boat is an overkill ;)

@ns8482e
Copy link
Contributor

ns8482e commented Feb 25, 2024

@ns8482e check out PR #15384 please. I named them compressed vs uncompressed so it is not confusing.

The deployment UI is build for extension by adding alternative deployment target provider. So I extended based on the existing structure.

image

Instead of having two targets Can we have single target File Download with two action with drop-down button? Default will be compressed, second will be JSON?

@MikeAlhayek
Copy link
Member Author

MikeAlhayek commented Feb 25, 2024

@ns8482e check out the my last comment

#15383 (comment)

I do not want to reconstruct the entire setup. Deployment sources are open for extension using cards.

I am looking into an option of adding property that would allow us to expose compressed or not.

@ns8482e
Copy link
Contributor

ns8482e commented Feb 25, 2024

I do not want to reconstruct the entire setup. Deployment sources are open for extension using cards.

I don't think you need to reconstruct the entire setup, shape could help here.

@MikeAlhayek thanks IMHO only one target File Download is enough. Here it seems the ask is different file formats - that can easily be achieved by providing different actions buttons that provides additional route data for file format to same controller action. Action buttons can be added/customized using shape alternates for given deployment target

@MikeAlhayek
Copy link
Member Author

@ns8482e okay. How about this?

image

@hishamco
Copy link
Member

Much better, that's why I prefered the checkbox to avoid adding a dropdown on each target

@ns8482e
Copy link
Contributor

ns8482e commented Feb 27, 2024

@ns8482e okay. How about this?

Looks good now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants