diff --git a/packages/phoenix-event-display/src/loaders/phoenix-loader.ts b/packages/phoenix-event-display/src/loaders/phoenix-loader.ts index 78114c52..c6ece63d 100644 --- a/packages/phoenix-event-display/src/loaders/phoenix-loader.ts +++ b/packages/phoenix-event-display/src/loaders/phoenix-loader.ts @@ -736,7 +736,9 @@ export class PhoenixLoader implements EventDataLoader { this.labelsObject[eventDataType][collection] || {}; this.labelsObject[eventDataType][collection][indexInCollection] = label; - + const tmp = + this.eventData[eventDataType][collection][indexInCollection]; + tmp.labelText = label; return getLabelTitle(eventDataType, collection, indexInCollection); } } diff --git a/packages/phoenix-event-display/src/managers/ui-manager/index.ts b/packages/phoenix-event-display/src/managers/ui-manager/index.ts index dd2207ea..d11585d8 100644 --- a/packages/phoenix-event-display/src/managers/ui-manager/index.ts +++ b/packages/phoenix-event-display/src/managers/ui-manager/index.ts @@ -566,10 +566,20 @@ export class UIManager { const labelsObject = eventDataLoader?.getLabelsObject(); if (eventDataLoader && labelsObject) { loadFile((data) => { + console.log('UIManager: loading Labels'); const labelsObject = JSON.parse(data); + // This contains the names of the labels, but not their colours. for (const eventDataType of Object.keys(labelsObject)) { for (const collection of Object.keys(labelsObject[eventDataType])) { const collectionObject = eventDataLoader.getCollection(collection); + if (!collectionObject) { + console.log( + 'WARNING - cannot find ', + collection, + ' in eventDataLoader. Skipping.', + ); + continue; + } for (const labelIndex of Object.keys( labelsObject[eventDataType][collection], )) { diff --git a/packages/phoenix-ng/projects/phoenix-ui-components/lib/components/ui-menu/collections-info/collections-info-overlay/collections-info-overlay.component.html b/packages/phoenix-ng/projects/phoenix-ui-components/lib/components/ui-menu/collections-info/collections-info-overlay/collections-info-overlay.component.html index e101e280..6d35341b 100644 --- a/packages/phoenix-ng/projects/phoenix-ui-components/lib/components/ui-menu/collections-info/collections-info-overlay/collections-info-overlay.component.html +++ b/packages/phoenix-ng/projects/phoenix-ui-components/lib/components/ui-menu/collections-info/collections-info-overlay/collections-info-overlay.component.html @@ -116,6 +116,7 @@ diff --git a/packages/phoenix-ng/projects/phoenix-ui-components/lib/components/ui-menu/collections-info/collections-info-overlay/collections-info-overlay.component.ts b/packages/phoenix-ng/projects/phoenix-ui-components/lib/components/ui-menu/collections-info/collections-info-overlay/collections-info-overlay.component.ts index 9548d560..c1c0b064 100644 --- a/packages/phoenix-ng/projects/phoenix-ui-components/lib/components/ui-menu/collections-info/collections-info-overlay/collections-info-overlay.component.ts +++ b/packages/phoenix-ng/projects/phoenix-ui-components/lib/components/ui-menu/collections-info/collections-info-overlay/collections-info-overlay.component.ts @@ -51,7 +51,7 @@ export class CollectionsInfoOverlayComponent implements OnInit { })); this.collectionColumns = Object.keys(this.showingCollection[0]).filter( - (column) => !['uuid', 'hits', 'isCut'].includes(column), // FIXME - this is an ugly hack. But currently hits from tracks make track collections unusable. Better to have exlusion list passed in. + (column) => !['uuid', 'hits', 'isCut', 'labelText'].includes(column), // FIXME - this is an ugly hack. But currently hits from tracks make track collections unusable. Better to have exlusion list passed in. ); }