mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
[Canvas] Force embeddables to refresh when renderable reevaluated (#67419)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
This commit is contained in:
parent
ab1330df6b
commit
34b56ca7e6
5 changed files with 18 additions and 0 deletions
|
@ -12,9 +12,23 @@ export const EmbeddableExpressionType = 'embeddable';
|
|||
export { EmbeddableTypes, EmbeddableInput };
|
||||
|
||||
export interface EmbeddableExpression<Input extends EmbeddableInput> {
|
||||
/**
|
||||
* The type of the expression result
|
||||
*/
|
||||
type: typeof EmbeddableExpressionType;
|
||||
/**
|
||||
* The input to be passed to the embeddable
|
||||
*/
|
||||
input: Input;
|
||||
/**
|
||||
* The type of embeddable
|
||||
*/
|
||||
embeddableType: string;
|
||||
/**
|
||||
* Timestamp. Needed to get a different result after each time the expression is evaluated
|
||||
* to force a reload of the embeddables internal data
|
||||
*/
|
||||
generatedAt: number;
|
||||
}
|
||||
|
||||
export const embeddableType = (): ExpressionType<
|
||||
|
|
|
@ -116,6 +116,7 @@ export function savedMap(): ExpressionFunction<'savedMap', Filter | null, Argume
|
|||
hiddenLayers: args.hideLayer || [],
|
||||
},
|
||||
embeddableType: EmbeddableTypes.map,
|
||||
generatedAt: Date.now(),
|
||||
};
|
||||
},
|
||||
};
|
||||
|
|
|
@ -45,6 +45,7 @@ export function savedSearch(): ExpressionFunction<'savedSearch', Filter | null,
|
|||
...buildEmbeddableFilters(filters),
|
||||
},
|
||||
embeddableType: EmbeddableTypes.search,
|
||||
generatedAt: Date.now(),
|
||||
};
|
||||
},
|
||||
};
|
||||
|
|
|
@ -50,6 +50,7 @@ export function savedVisualization(): ExpressionFunction<
|
|||
...buildEmbeddableFilters(filters),
|
||||
},
|
||||
embeddableType: EmbeddableTypes.visualization,
|
||||
generatedAt: Date.now(),
|
||||
};
|
||||
},
|
||||
};
|
||||
|
|
|
@ -108,6 +108,7 @@ const embeddable = () => ({
|
|||
});
|
||||
} else {
|
||||
embeddablesRegistry[uniqueId].updateInput(input);
|
||||
embeddablesRegistry[uniqueId].reload();
|
||||
}
|
||||
},
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue