-
Notifications
You must be signed in to change notification settings - Fork 224
Consume EditorBrowsableAttribute
on TagHelper
s.
#448
Conversation
@@ -38,13 +39,20 @@ public static TagHelperDesignTimeDescriptor CreateDescriptor([NotNull] Type type | |||
?.OfType<OutputElementHintAttribute>() | |||
.FirstOrDefault(); | |||
var outputElementHint = outputElementHintAttribute?.OutputElement; | |||
var editorBrowsableAttribute = type | |||
.GetCustomAttributes(inherit: false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not looking down the inheritance chain here because TargetElement
isn't inherited. However, the default inheritance behavior of EditorBrowsableAttribute
is true
. I'm open to opinions 😄
140bb31
to
50d798b
Compare
Changed behavior to not create |
public int Property { get; set; } | ||
} | ||
|
||
private class MultiHiddenPropertyEditorBrowsableTagHelper : TagHelper |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This class has more than one property but how does "MultiHidden" make sense?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More than 1 property on the class.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will remove the "Hidden" part of the name.
Implementation looks fine but please test end-to-end behaviour with |
⌚ |
@dougbu manually tested the comment here: #448 (comment). As for end-to-end testing of this behavior. Can't really validate the design time portion of that; however, the runtime portion will be validated via aspnet/Mvc#2807 since it will be |
Not a fan of the ambiguous "Multi" test class names... |
- Changed `TagHelperDescriptorFactory` to not create individual descriptors when `EditorBrowsableAttribute` is present and set to `EditorBrowsableState.Never`. - Added tests to validate the `TagHelperDescriptorFactory` creates the attribute correctly. - Did not look down the inheritance chain for `EditorBrowsableAttribute` because `TargetElement` is not inherited. #447
50d798b
to
b762830
Compare
TagHelperDescriptorFactory
to not create individual descriptors whenEditorBrowsableAttribute
is present and set toEditorBrowsableState.Never
.TagHelperDescriptorFactory
creates the attribute correctly.EditorBrowsableAttribute
becauseTargetElement
is not inherited.Consume EditorBrowsableAttribute on TagHelpers. #447