Customize Preference Leaf Node Names #14892
-
Hi, at the moment, we only support specifying custom (or internationalized) names for non-leaf nodes in preferences using the The label is computed with the However, the Is there a particular reason for that? Or would you be in favor of the following change in the protected createLeafNode(property: string, preferencesGroup: Preference.CompositeTreeNode, data: PreferenceDataProperty): Preference.LeafNode {
const { group } = Preference.TreeNode.getGroupAndIdFromNodeId(preferencesGroup.id);
const newNode: Preference.LeafNode = {
id: `${group}@${property}`,
preferenceId: property,
parent: preferencesGroup,
preference: { data },
label: data.label, // <- transfer the label to enable nls'ing and customizing the leaf preference nodes?
depth: Preference.TreeNode.isTopLevel(preferencesGroup) ? 1 : 2
};
this._idCache.set(property, newNode.id);
CompositeTreeNode.addChild(preferencesGroup, newNode);
return newNode;
} Happy to open a PR if you agree! Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hey @planger, at first glance this sounds pretty reasonable. I don't think that should break anything, so please go ahead and file a PR :) |
Beta Was this translation helpful? Give feedback.
Hey @planger,
at first glance this sounds pretty reasonable. I don't think that should break anything, so please go ahead and file a PR :)