mirror of
https://github.com/apache/superset.git
synced 2026-05-30 04:39:20 +00:00
Merge branch 'master' into msyavuz/chore/react-18
This commit is contained in:
@@ -38,6 +38,6 @@
|
||||
"devDependencies": {
|
||||
"@babel/types": "^7.28.0",
|
||||
"@types/jest": "^29.5.12",
|
||||
"jest": "^30.0.4"
|
||||
"jest": "^30.0.5"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -64,12 +64,12 @@ const METRIC_KEY = t('Metric');
|
||||
const vals = ['value'];
|
||||
|
||||
const StyledPlusSquareOutlined = styled(PlusSquareOutlined)`
|
||||
stroke: ${({ theme }) => theme.colors.grayscale.light2};
|
||||
stroke: ${({ theme }) => theme.colorBorderSecondary};
|
||||
stroke-width: 16px;
|
||||
`;
|
||||
|
||||
const StyledMinusSquareOutlined = styled(MinusSquareOutlined)`
|
||||
stroke: ${({ theme }) => theme.colors.grayscale.light2};
|
||||
stroke: ${({ theme }) => theme.colorBorderSecondary};
|
||||
stroke-width: 16px;
|
||||
`;
|
||||
|
||||
|
||||
@@ -413,6 +413,8 @@ const config: ControlPanelConfig = {
|
||||
? (explore?.datasource as Dataset)?.verbose_map
|
||||
: (explore?.datasource?.columns ?? {});
|
||||
const chartStatus = chart?.chartStatus;
|
||||
const { colnames, coltypes } =
|
||||
chart?.queriesResponse?.[0] ?? {};
|
||||
const metricColumn = values.map(value => {
|
||||
if (typeof value === 'string') {
|
||||
return {
|
||||
@@ -420,9 +422,15 @@ const config: ControlPanelConfig = {
|
||||
label: Array.isArray(verboseMap)
|
||||
? value
|
||||
: verboseMap[value],
|
||||
dataType: colnames && coltypes[colnames?.indexOf(value)],
|
||||
};
|
||||
}
|
||||
return { value: value.label, label: value.label };
|
||||
return {
|
||||
value: value.label,
|
||||
label: value.label,
|
||||
dataType:
|
||||
colnames && coltypes[colnames?.indexOf(value.label)],
|
||||
};
|
||||
});
|
||||
return {
|
||||
removeIrrelevantConditions: chartStatus === 'success',
|
||||
|
||||
@@ -62,7 +62,7 @@ export const Styles = styled.div`
|
||||
table.pvtTable thead th.pvtSubtotalLabel,
|
||||
table.pvtTable tbody tr:last-of-type th,
|
||||
table.pvtTable tbody tr:last-of-type td {
|
||||
border-bottom: 1px solid ${theme.colors.grayscale.light2};
|
||||
border-bottom: 1px solid ${theme.colorSplit};
|
||||
}
|
||||
|
||||
table.pvtTable
|
||||
@@ -77,7 +77,7 @@ export const Styles = styled.div`
|
||||
|
||||
table.pvtTable tbody tr td:last-of-type,
|
||||
table.pvtTable thead tr th:last-of-type:not(.pvtSubtotalLabel) {
|
||||
border-right: 1px solid ${theme.colors.grayscale.light2};
|
||||
border-right: 1px solid ${theme.colorSplit};
|
||||
}
|
||||
|
||||
table.pvtTable
|
||||
@@ -104,9 +104,9 @@ export const Styles = styled.div`
|
||||
table.pvtTable tbody tr td {
|
||||
color: ${theme.colorPrimaryText};
|
||||
padding: ${theme.sizeUnit}px;
|
||||
background-color: ${theme.colors.grayscale.light5};
|
||||
border-top: 1px solid ${theme.colors.grayscale.light2};
|
||||
border-left: 1px solid ${theme.colors.grayscale.light2};
|
||||
background-color: ${theme.colorBgBase};
|
||||
border-top: 1px solid ${theme.colorSplit};
|
||||
border-left: 1px solid ${theme.colorSplit};
|
||||
vertical-align: top;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
@@ -34,6 +34,12 @@ const parseLabel = value => {
|
||||
return String(value);
|
||||
};
|
||||
|
||||
function displayCell(value, allowRenderHtml) {
|
||||
if (allowRenderHtml && typeof value === 'string') {
|
||||
return safeHtmlSpan(value);
|
||||
}
|
||||
return parseLabel(value);
|
||||
}
|
||||
function displayHeaderCell(
|
||||
needToggle,
|
||||
ArrowIcon,
|
||||
@@ -742,7 +748,7 @@ export class TableRenderer extends Component {
|
||||
onContextMenu={e => this.props.onContextMenu(e, colKey, rowKey)}
|
||||
style={style}
|
||||
>
|
||||
{agg.format(aggValue)}
|
||||
{displayCell(agg.format(aggValue), allowRenderHtml)}
|
||||
</td>
|
||||
);
|
||||
});
|
||||
@@ -759,7 +765,7 @@ export class TableRenderer extends Component {
|
||||
onClick={rowTotalCallbacks[flatRowKey]}
|
||||
onContextMenu={e => this.props.onContextMenu(e, undefined, rowKey)}
|
||||
>
|
||||
{agg.format(aggValue)}
|
||||
{displayCell(agg.format(aggValue), allowRenderHtml)}
|
||||
</td>
|
||||
);
|
||||
}
|
||||
@@ -823,7 +829,7 @@ export class TableRenderer extends Component {
|
||||
onContextMenu={e => this.props.onContextMenu(e, colKey, undefined)}
|
||||
style={{ padding: '5px' }}
|
||||
>
|
||||
{agg.format(aggValue)}
|
||||
{displayCell(agg.format(aggValue), this.props.allowRenderHtml)}
|
||||
</td>
|
||||
);
|
||||
});
|
||||
@@ -840,7 +846,7 @@ export class TableRenderer extends Component {
|
||||
onClick={grandTotalCallback}
|
||||
onContextMenu={e => this.props.onContextMenu(e, undefined, undefined)}
|
||||
>
|
||||
{agg.format(aggValue)}
|
||||
{displayCell(agg.format(aggValue), this.props.allowRenderHtml)}
|
||||
</td>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user