templating
templating copied to clipboard
Improve UX for creating a Blazor Web App when selecting None for the interactivity type
When creating a Blazor Web App, if you select None for the interactivity type then you can still select an interactivity location, which doesn't make any sense. Is there some way to disable the interactivity location option when the interactivity type is None? On the CLI should we make this an error?
@vlada-shubina this is a templating engine issue I believe. We've already setup the template to allow only one of these options but it seems the CLI ignores those. Where should I transfer this issue to for you to investigate?
To clarify further, the behavior that would make most sense is:
- On CLI, setting an option that's not enabled according to
isEnabledshould ideally be an error. The option shouldn't simply be ignored. - In VS, when an option isn't available according to
isEnabled, it should be greyed out in the UI or even removed from the UI completely
If you don't want to add these behaviors to the existing isEnabled option, would you consider adding a new option called something like isAllowed with these behaviors?
This is a request for the template engine
We have an additional similar need in an upcoming Blazor Hybrid + Web project template scenario.
I want to have a UI in VS like this:
Create new Blazor Hybrid project
- ✅ Include Blazor Web project with shared Razor UI
- ✅ Configure for HTTPS (but ONLY enabled if previous checkbox is checked!)
- ... and more options
In VS it would look like this when the top checkbox is checked:
And when it's unchecked:
As far as template.json syntax, I think it already exists, but apparently isn't supported in VS? See: https://github.com/dotnet/templating/issues/5648#issuecomment-1322400549, https://github.com/dotnet/templating/issues/3341
And it seems Blazor already uses isEnabled in its templates for this scenario: https://github.com/dotnet/aspnetcore/blob/d7109b13bcc87601227ab4d643638dbeb6a87295/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/.template.config/template.json
cc @phenning for the VS template engine host request - conditional symbols would be the solution here but they are only supported in the CLI at the moment.
Yup I just chatted with @phenning earlier today about this. We have workarounds for now but I think the best customer UI for our scenarios would require this new feature.
I also need this VS feature. I have a custom template and I want to hide or disable certain parameters based on a checkbox. It's a really bad user experience without this ability.
@baronfel is there a different team we need to complain to for the VS pieces?
Submitting feedback via the VS Developer Community would be the way to go. That'll get routed to @phenning and the rest of the team and can be used to help prioritize their backlog.
@baronfel I found this one. I am assuming this covers this scenario and we should just go vote for it> https://developercommunity.visualstudio.com/t/conditional-parameter--hideshow-fields-/10254783
@sayedihashimi @vijayrkn What's the best way for us to make progress on this issue? Are you already tracking https://developercommunity.visualstudio.com/t/conditional-parameter--hideshow-fields-/10254783 on the VS side?
@danroth27 we have move the item to our team. We will investigate. Hopefully this will be easy to implement, otherwise we may need to wait on adding this support. We will take a look to see how much effort this will take and then go from there.
Should we consider this an ask from the ASP.NET team to get this support added?
Should we consider this an ask from the ASP.NET team to get this support added?
Yes, this is needed to improve the user experience for both the Blazor Web App template and the upcoming Blazor Hybrid + Web template.
@danroth27 thanks, we are investigating.
@danroth27 thanks, we are investigating.
How far with the investigation?