Skip to content

Commit

Permalink
fix: format does not work in TopN
Browse files Browse the repository at this point in the history
  • Loading branch information
yaojiping committed Jan 23, 2025
1 parent b761823 commit 3523da0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion web/src/pages/DataManagement/Discover.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ const Discover = (props) => {
columns: record.filter?.columns || ["_source"],
}
if (record.time_field) {
newState.sort = [{[record.time_field]: {order: "desc"}}]
newState.sort = [[record.time_field, 'desc']]
}
setState(newState);
if (record.filter?.filters?.length > 0) {
Expand Down
6 changes: 4 additions & 2 deletions web/src/pages/Platform/Overview/components/TopN/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ export default (props) => {
return {
...item,
format: fieldFormatMap[item.name]?.id || 'number',
pattern: fieldFormatMap[item.name]?.pattern,
pattern: fieldFormatMap[item.name]?.params?.pattern,
}
}).concat(complexFields.filter((item) =>
!!item.metric_config &&
Expand All @@ -119,7 +119,7 @@ export default (props) => {
return {
...item,
format: fieldFormatMap[item.name]?.id || 'number',
pattern: fieldFormatMap[item.name]?.pattern,
pattern: fieldFormatMap[item.name]?.params?.pattern,
isComplex: true,
}
})).filter((item) =>
Expand Down Expand Up @@ -301,6 +301,7 @@ export default (props) => {
name: newConfig.sourceArea.metric_config.name,
formula: areaFormula,
format: newConfig.sourceArea.format,
pattern: newConfig.sourceArea.pattern,
unit: newConfig.sourceArea.metric_config.unit
}
}
Expand All @@ -310,6 +311,7 @@ export default (props) => {
name: newConfig.sourceColor.metric_config.name,
formula: colorFormula,
format: newConfig.sourceColor.format,
pattern: newConfig.sourceColor.pattern,
unit: newConfig.sourceColor.metric_config.unit
}
}
Expand Down

0 comments on commit 3523da0

Please sign in to comment.