Skip to content

Commit 15ea21f

Browse files
committed
Modified InheritedAttributes to only display inherited attributes
Previously, a bug was introduced in which inherited attributes were set to the _current_ topic's attributes—which may be inherited, but may not be. It's not entirely clear _why_ that change was made, but it causes confusion because the inherited value is used as the placeholder on attribute fields. As such, if you remove an existing value from a field, that value appears to reappear as theplaceholder text. We can fix this by simply going back to using the `DerivedTopic` version, which is how we handled this in the previous version of the editor. We'll need to be on the lookout for off-target impacts in case there was a good reason to introduce this, though. If so, we'll need to find a workaround, and carefully comment it for future versions of me.
1 parent c56c188 commit 15ea21f

2 files changed

Lines changed: 4 additions & 5 deletions

File tree

OnTopic.Editor.AspNetCore/Controllers/EditorController.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,10 @@ bool isModal
176176
}
177177

178178
//Set inherited attribute value, if available
179-
topicViewModel.InheritedAttributes.Add(attribute.Key, isNew? null : CurrentTopic.Attributes.GetValue(attribute.Key));
179+
topicViewModel.InheritedAttributes.Add(
180+
attribute.Key,
181+
isNew? null : CurrentTopic.DerivedTopic?.Attributes.GetValue(attribute.Key)
182+
);
180183

181184
}
182185

OnTopic.Editor.Models/AttributeViewModel.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,6 @@ AttributeDescriptorTopicViewModel attributeDescriptor
7474
/// <summary>
7575
/// Provides the inherited value, as defined on either parent or derived topics.
7676
/// </summary>
77-
/// <remarks>
78-
/// If the <see cref="Value"/> is set, then the <see cref="InhertedValue"/> will always be equal to the
79-
/// <see cref="Value"/>.
80-
/// </remarks>
8177
public virtual string InheritedValue { get; set; }
8278

8379
} // Class

0 commit comments

Comments
 (0)