Canvas: Remove null data links (#91859)

This commit is contained in:
Adela Almasan 2024-08-14 14:58:39 -06:00 committed by GitHub
parent 38957b32ab
commit f6b55ced6f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 4 additions and 2 deletions

View File

@ -112,7 +112,7 @@ export const DataLinksInlineEditor = ({
const key = `${link.title}/${idx}`;
const linkJSX = (
<div className={styles.itemWrapper}>
<div className={styles.itemWrapper} key={key}>
<DataLinksListItem
key={key}
index={idx}

View File

@ -373,6 +373,8 @@ export class ElementState implements LayerElement {
const scene = this.getScene();
const frames = scene?.data?.series;
this.options.links = this.options.links?.filter((link) => link !== null);
if (frames) {
const defaultField = {
name: 'Default field',

View File

@ -54,7 +54,7 @@ export const canvasMigrationHandler = (panel: PanelModel): Partial<Options> => {
// append override links to elements with dimensions mapped to same field name
for (const prop of override.properties) {
if (prop.id === 'links') {
addLinks(panel.options.root.elements, prop.value, override.matcher.options);
addLinks(panel.options.root.elements, prop.value ?? [], override.matcher.options);
} else {
props.push(prop);
}