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 deployment target to export recipe as json in addition to zip #15384

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

MikeAlhayek
Copy link
Member

@MikeAlhayek MikeAlhayek commented Feb 21, 2024

Fix #15383

I am trying to avoid introducing a breaking change here. But we can cleanup the code if we change the definition of the DeploymentPlanResult class.

@sebastienros if you agree, I like to introduce this low-risk breaking change. The class DeploymentPlanResult should be light and treated as a base class. So it should not depend on IFileBuilder

I like to add another class FileDeploymentPlanResult that inherits from DeploymentPlanResult just like MemoryDeploymentPlanResult. The class FileDeploymentPlanResult will take an instance of the IFileBuilder and write the content to the file.

Are you good with introducing this low risk breaking change?

image

@ns8482e
Copy link
Contributor

ns8482e commented Feb 25, 2024

@MikeAlhayek I would suggest to keep only one Target "File Download" as currently available.
Provide two different button using bootstrap dropdown buttons instead of just "Select".

Html can be changed using shape and alternates - You can move following code to a new shape Template that provides alternates for deployment targets.

e.g.

@MikeAlhayek
Copy link
Member Author

I am trying to avoid using shapes here. I am thinking to just add another option to the deployment source that would allow providing formats. When formats are available, we'll just render drop down menu. Also, I am also considering supporting a single additional option "compressed" true/false. This may be all we need without complicating things

@ns8482e
Copy link
Contributor

ns8482e commented Feb 25, 2024

I don't believe it complicates the things. It's about right approach to a problem. Here "Targets" are kinda mode of delivery of recipes. "File Download" is just one mode of delivery - so adding two Targets for same mode of delivery- is not right solution

@MikeAlhayek
Copy link
Member Author

@ns8482e I don't want to convert to shapes here. However, I added an optional support for Formats. If formats are defined, we'll show a drop down menu with the available formats.


if (format == "json")
{
filename += ".json";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

string.Format or interpolated string

string archiveFileName;
var filename = deploymentPlan.Name.ToSafeName() + ".zip";
filename += ".zip";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here string.Format or use interpolated string

@@ -12,6 +15,8 @@ public DeploymentTarget(LocalizedString name, LocalizedString description, Route
Route = route;
}

public IEnumerable<SelectListItem> Formats { get; set; }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about having common Dictonary/Json like structure here to hold any kind of properties?

e.g. In future if we decide to add blob target, it could save connection string property

@Piedone
Copy link
Member

Piedone commented Mar 22, 2024

I believe this came up at a meeting, but can't remember the conclusion: what about Media files, that require a ZIP file?

@MikeAlhayek
Copy link
Member Author

I have to try and see how it'll work when exporting media. I have not had time to try it out

Copy link

github-actions bot commented May 2, 2024

This pull request has merge conflicts. Please resolve those before requesting a review.

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

Successfully merging this pull request may close these issues.

Add a way to export recipes as JSON
3 participants