LevisNgigi commented on code in PR #33196:
URL: https://github.com/apache/superset/pull/33196#discussion_r2055476729
##########
superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberViz.tsx:
##########
@@ -209,19 +211,65 @@ class BigNumberVis extends
PureComponent<BigNumberVizProps> {
return (
<div
- className="subtitle-line"
+ className="subheader-line"
style={{
fontSize,
height: maxHeight,
}}
>
- {subtitle}
+ {text}
</div>
);
}
return null;
}
+ renderSubtitle(maxHeight: number) {
+ const { subtitle, width, bigNumber, bigNumberFallback } = this.props;
+ let fontSize = 0;
+
+ const NO_DATA_OR_HASNT_LANDED = t(
+ 'No data after filtering or data is NULL for the latest time record',
+ );
+ const NO_DATA = t(
+ 'Try applying different filters or ensuring your datasource has data',
+ );
+
+ let text = subtitle;
+ if (bigNumber === null) {
+ text =
+ subtitle || (bigNumberFallback ? NO_DATA : NO_DATA_OR_HASNT_LANDED);
+ }
+
+ if (text) {
+ const container = this.createTemporaryContainer();
+ document.body.append(container);
+ fontSize = computeMaxFontSize({
+ text,
+ maxWidth: width * 0.9,
+ maxHeight,
+ className: 'subtitle-line',
+ container,
+ });
+ container.remove();
+
+ return (
+ <>
+ <div
+ className="subtitle-line subheader-line"
Review Comment:
Yes some css customizations were targetting the subheader-line and without
it the customizations did not apply.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]