mirror of
https://github.com/apache/superset.git
synced 2026-05-12 19:35:17 +00:00
feat: add a tooltip to clarify metric_name in the DatasetEditor (#24348)
This commit is contained in:
committed by
GitHub
parent
2b364898a5
commit
dd77aacc51
@@ -182,10 +182,10 @@ function ColumnCollectionTable({
|
||||
allowAddItem,
|
||||
allowEditDataType,
|
||||
itemGenerator,
|
||||
columnLabelTooltips,
|
||||
}) {
|
||||
return (
|
||||
<CollectionTable
|
||||
collection={columns}
|
||||
tableColumns={
|
||||
isFeatureEnabled(FeatureFlag.ENABLE_ADVANCED_DATA_TYPES)
|
||||
? [
|
||||
@@ -229,6 +229,8 @@ function ColumnCollectionTable({
|
||||
allowDeletes
|
||||
allowAddItem={allowAddItem}
|
||||
itemGenerator={itemGenerator}
|
||||
collection={columns}
|
||||
columnLabelTooltips={columnLabelTooltips}
|
||||
stickyHeader
|
||||
expandFieldset={
|
||||
<FormContainer>
|
||||
@@ -1194,10 +1196,17 @@ class DatasourceEditor extends React.PureComponent {
|
||||
tableColumns={['metric_name', 'verbose_name', 'expression']}
|
||||
sortColumns={['metric_name', 'verbose_name', 'expression']}
|
||||
columnLabels={{
|
||||
metric_name: t('Metric'),
|
||||
metric_name: t('Metric Key'),
|
||||
verbose_name: t('Label'),
|
||||
expression: t('SQL expression'),
|
||||
}}
|
||||
columnLabelTooltips={{
|
||||
metric_name: t(
|
||||
'This field is used as a unique identifier to attach ' +
|
||||
'the metric to charts. It is also used as the alias in the ' +
|
||||
'SQL query.',
|
||||
),
|
||||
}}
|
||||
expandFieldset={
|
||||
<FormContainer>
|
||||
<Fieldset compact>
|
||||
@@ -1417,6 +1426,13 @@ class DatasourceEditor extends React.PureComponent {
|
||||
onColumnsChange={calculatedColumns =>
|
||||
this.setColumns({ calculatedColumns })
|
||||
}
|
||||
columnLabelTooltips={{
|
||||
column_name: t(
|
||||
'This field is used as a unique identifier to attach ' +
|
||||
'the calculated dimension to charts. It is also used ' +
|
||||
'as the alias in the SQL query.',
|
||||
),
|
||||
}}
|
||||
onDatasourceChange={this.onDatasourceChange}
|
||||
datasource={datasource}
|
||||
editableColumnName
|
||||
|
||||
Reference in New Issue
Block a user