mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-22 09:45:41 +00:00
Bug 1166494 - part3: Correctly handle marker definition fields that are described via function rather than array. r=vp
This commit is contained in:
parent
af6a90041d
commit
bd27262286
@ -66,6 +66,16 @@ exports.getMarkerClassName = getMarkerClassName;
|
||||
*/
|
||||
function getMarkerFields (marker) {
|
||||
let blueprint = TIMELINE_BLUEPRINT[marker.name];
|
||||
|
||||
if (typeof blueprint.fields === "function") {
|
||||
let fields = blueprint.fields(marker);
|
||||
// Add a ":" to the label since the localization files contain the ":"
|
||||
// if not present. This should be changed, ugh.
|
||||
return Object.keys(fields || []).map(label => {
|
||||
let normalizedLabel = label.indexOf(":") !== -1 ? label : (label + ":");
|
||||
return { label: normalizedLabel, value: fields[label] };
|
||||
});
|
||||
}
|
||||
return (blueprint.fields || []).reduce((fields, field) => {
|
||||
// Ensure this marker has this field present
|
||||
if (field.property in marker) {
|
||||
|
Loading…
Reference in New Issue
Block a user