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

VisibilityAffectsDescendants behavior now configurable for XmlSiteMapResult #261

Closed
wants to merge 2 commits into from

Conversation

Webmarco
Copy link

@Webmarco Webmarco commented Jan 5, 2014

Added visibilityAffectsDescendants logic to XmlSiteMapResult (flattenhierarchy). Value for the property can be set through configuration. Html helpers are not (yet) using this property. Default behavior for XmlSiteMapResult (false) is different from the Html helpers (true), what should the default be for both?
A test still needs to be written to confirm current behavior isn't broken but the change wasn't all that complicated after all.

Initialization of the field still hard coded to false to preserve current behaviour
…rfaces and implementations so it can be used through configuration using internal DI or instantation through external DI, default value is false.
@NightOwl888
Copy link
Collaborator

@Webmarco - The rest of this looks good. You may proceed with making the changes to the HTML helpers to read this new setting at your convenience.

@maartenba - If you are following along, we are amidst a breaking change where we have to make a choice because of inconsistent behavior. We either have to break the Menu/SiteMapPath/SiteMap HTML helpers by changing the default visibilityAffectsDescendants from true to false (the way it behaved in v3) or we have to break the XmlSiteMapResult by changing the default from false to true in order to allow this value to be set globally in a consistent way.

I am more inclined to break the XmlSiteMapResult now because it would be less of an impact. However, it is also less likely to be noticed right away. In that regard, breaking the Menu/SiteMapPath/SiteMap helpers would be better so people notice and can fix it. Keep in mind, this only affects people who are using visibility providers.

For the long term (v5) I would say it is better to set this default to false. To me it makes more logical sense for a visibility provider to toggle visibility of a single node rather than the node and all its children (which is how the accessibility behaves). It gives more flexibility. Furthermore, this is how it behaved originally in v3.

But the question remains what exactly to break now to make it consistent. Thoughts?

@maartenba
Copy link
Owner

I would break the HtmlHelpers, as it will be more visible for users. Unfrtunately I guess not everyone will be precompiling views and most will only notice this at runtime... Then again, I think this is probbaly the best one to get the change noticed.

@NightOwl888
Copy link
Collaborator

@Webmarco

I am preparing for a minor release in a few days and would like to roll these changes in. If they are not finished, I will finish them up, but I just wanted to check with you whether you have any finished code that is not yet committed or whether you have plans to finish this up. Thanks.

@Webmarco
Copy link
Author

I'm sorry but I haven't finished this nor do I have the time to finish this in the next 2-3 weeks. I will check after that to see if I can help with anything.

@NightOwl888
Copy link
Collaborator

No problem. I will merge it and finish it up.

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.

3 participants