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

Trim scalar card title if it matches prefix #1399

Merged
merged 1 commit into from
Sep 4, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,19 @@ <h3>No scalar data was found.</h3>
// All new-style scalar tags include the `/scalar_summary`
// suffix. We can trim that from the display name.
const defaultDisplayName = tag.replace(/\/scalar_summary$/, '');
return tf_utils.aggregateTagInfo(runToTagInfo, defaultDisplayName);
let {description, displayName} = tf_utils.aggregateTagInfo(
runToTagInfo,
defaultDisplayName);

// If category name is a prefix group, strip the prefix from the name
// of the scalar-card if name != prefix.
if (category.metadata.type ==
tf_categorization_utils.CategoryType.PREFIX_GROUP &&
displayName.startsWith(category.name + '/')) {
// + 1 to strip off the separator.
displayName = displayName.slice(category.name.length + 1);
}
return {description, displayName};
},

_getMultiExperiments() {
Expand Down