Skip to content

Commit

Permalink
Merge pull request #2248 from scottsut/master
Browse files Browse the repository at this point in the history
Release 1.0.0-RC.3
  • Loading branch information
scottsut authored Sep 22, 2023
2 parents f52621a + 11d5764 commit f39e135
Show file tree
Hide file tree
Showing 72 changed files with 1,118 additions and 507 deletions.
2 changes: 1 addition & 1 deletion core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>datart-parent</artifactId>
<groupId>datart</groupId>
<version>1.0.0-rc.2</version>
<version>1.0.0-rc.3</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion data-providers/data-provider-base/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>datart-data-provider</artifactId>
<groupId>datart</groupId>
<version>1.0.0-rc.2</version>
<version>1.0.0-rc.3</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion data-providers/file-data-provider/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>datart-data-provider</artifactId>
<groupId>datart</groupId>
<version>1.0.0-rc.2</version>
<version>1.0.0-rc.3</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion data-providers/http-data-provider/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>datart-data-provider</artifactId>
<groupId>datart</groupId>
<version>1.0.0-rc.2</version>
<version>1.0.0-rc.3</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion data-providers/jdbc-data-provider/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>datart-data-provider</artifactId>
<groupId>datart</groupId>
<version>1.0.0-rc.2</version>
<version>1.0.0-rc.3</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

package datart.data.provider.jdbc.adapters;

import com.alibaba.fastjson.JSON;
import datart.core.base.PageInfo;
import datart.core.base.consts.ValueType;
import datart.core.base.exception.Exceptions;
Expand Down Expand Up @@ -183,7 +184,7 @@ public Set<Column> readTableColumn(String database, String table) throws SQLExce

public String getQueryKey(QueryScript script, ExecuteParam executeParam) throws SqlParseException {
SqlScriptRender render = new SqlScriptRender(script, executeParam, getSqlDialect(), jdbcProperties.isEnableSpecialSql(), driverInfo.getQuoteIdentifiers());
return "Q" + DigestUtils.md5Hex(render.render(true, supportPaging(), true));
return "Q" + DigestUtils.md5Hex(render.render(true, supportPaging(), true) + ";includeColumns:" + JSON.toJSONString(executeParam.getIncludeColumns()) + ";viewId:" + script.getViewId() + ";pageInfo:" + JSON.toJSONString(executeParam.getPageInfo()));
}

protected Column readTableColumn(ResultSet columnMetadata) throws SQLException {
Expand Down Expand Up @@ -484,4 +485,4 @@ protected Object getObjFromResultSet(ResultSet rs, int columnIndex) throws SQLEx
}
return obj;
}
}
}
2 changes: 1 addition & 1 deletion data-providers/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>datart-parent</artifactId>
<groupId>datart</groupId>
<version>1.0.0-rc.2</version>
<version>1.0.0-rc.3</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion frontend/craco.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ module.exports = {
chunkFilename: 'static/js/[name].[contenthash:8].js',
},
// path: path.resolve(__dirname, 'dist'), // 修改输出文件目录
publicPath: '/',
publicPath: `${process.env.PUBLIC_URL || ''}/`,
};
/**
* webpack split chunks
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/app/AppRouter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import { ConfigProvider, message } from 'antd';
import echartsDefaultTheme from 'app/assets/theme/echarts_default_theme.json';
import { registerTheme } from 'echarts';
import { StorageKeys } from 'globalConstants';
import { PUBLIC_URL, StorageKeys } from 'globalConstants';
import { antdLocales } from 'locales/i18n';
import { useEffect, useLayoutEffect } from 'react';
import { Helmet } from 'react-helmet-async';
Expand Down Expand Up @@ -65,7 +65,7 @@ export function AppRouter() {

return (
<ConfigProvider locale={antdLocales[i18n.language]}>
<BrowserRouter>
<BrowserRouter basename={PUBLIC_URL}>
<Helmet
titleTemplate="%s - Datart"
defaultTitle="Datart"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ const ChartDrillContextMenu: FC<{
} else {
rows = groupSection?.rows?.filter(v => v.uid === allFields[0].uid);
}
rows = rows?.filter(row => row.type === DataViewFieldType.DATE);
return getRuntimeDateLevelFields(rows);
}, [drillOption, chartConfig?.datas, currentFields]);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ class BasicBarChart extends Chart implements IChartLifecycle {
return {
tooltip: {
trigger: 'item',
confine: true,
formatter: this.getTooltipFormatterFunc(
chartDataSet,
groupConfigs,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ class BasicDoubleYChart extends Chart {
axisPointer: {
type: 'cross',
},
confine: true,
formatter: this.getTooltipFormmaterFunc(
styleConfigs,
groupConfigs,
Expand Down Expand Up @@ -365,10 +366,10 @@ class BasicDoubleYChart extends Chart {
);

const _yAxisTemplate = (position, name): DoubleYChartYAxis => {
const [showAxis, inverse, font, showLabel] = getStyles(
const [showAxis, inverse, font, showLabel, showTitleAndUnit] = getStyles(
styles,
[`${position}Y`],
['showAxis', 'inverseAxis', 'font', 'showLabel'],
['showAxis', 'inverseAxis', 'font', 'showLabel', 'showTitleAndUnit'],
);
const [format] = getStyles(
styles,
Expand All @@ -379,7 +380,7 @@ class BasicDoubleYChart extends Chart {
type: 'value',
position,
showTitleAndUnit: true,
name,
name: showTitleAndUnit ? name : null,
nameLocation: 'middle',
nameGap: 50,
nameRotate: 90,
Expand Down
12 changes: 12 additions & 0 deletions frontend/src/app/components/ChartGraph/BasicDoubleYChart/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,12 @@ const config: ChartConfig = {
color: '#495057',
},
},
{
label: 'common.showTitleAndUnit',
key: 'showTitleAndUnit',
default: true,
comType: 'checkbox',
},
{
label: 'yAxis.open',
key: 'modal',
Expand Down Expand Up @@ -331,6 +337,12 @@ const config: ChartConfig = {
color: '#495057',
},
},
{
label: 'common.showTitleAndUnit',
key: 'showTitleAndUnit',
default: true,
comType: 'checkbox',
},
{
label: 'yAxis.open',
key: 'modal',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ class BasicLineChart extends Chart {
return {
tooltip: {
trigger: 'item',
confine: true,
formatter: this.getTooltipFormmaterFunc(
chartDataSet,
groupConfigs,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -291,14 +291,22 @@ class BasicOutlineMapChart extends Chart {
areaEmphasisColor,
enableFocus,
borderStyle,
roam,
] = getStyles(
styleConfigs,
['map'],
['level', 'areaColor', 'areaEmphasisColor', 'focusArea', 'borderStyle'],
[
'level',
'areaColor',
'areaEmphasisColor',
'focusArea',
'borderStyle',
'roam',
],
);
return {
map: mapLevelName,
roam: 'move',
roam: roam && 'move',
emphasis: {
focus: enableFocus ? 'self' : 'none',
itemStyle: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,10 +243,11 @@ class BasicPieChart extends Chart {
}

private getPieSeriesImpl(styleConfigs: ChartStyleConfig[]): PieSeriesImpl {
const [avoidOverlap] = getStyles(styleConfigs, ['label'], ['avoidOverlap']);
return {
type: 'pie',
sampling: 'average',
avoidLabelOverlap: false,
avoidLabelOverlap: avoidOverlap,
...this.getLabelStyle(styleConfigs),
...this.getSeriesStyle(styleConfigs),
...getGridStyle(styleConfigs),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,12 @@ const config: ChartConfig = {
default: true,
comType: 'checkbox',
},
{
label: 'label.avoidOverlap',
key: 'avoidOverlap',
default: false,
comType: 'checkbox',
},
],
},
{
Expand Down Expand Up @@ -284,6 +290,7 @@ const config: ChartConfig = {
showName: '维度值',
showPercent: '百分比',
showValue: '指标值',
avoidOverlap: '强制显示所有标签',
},
legend: {
title: '图例',
Expand Down Expand Up @@ -333,6 +340,7 @@ const config: ChartConfig = {
showName: 'Show Name',
showPercent: 'Show Percentage',
showValue: 'Show Value',
avoidOverlap: 'Force display of all labels',
},
legend: {
title: 'Legend',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@
* limitations under the License.
*/

import { Table } from 'antd';
import { ConfigProvider, Table } from 'antd';
import { antdLocales } from 'locales/i18n';
import { FC, memo } from 'react';
import { useTranslation } from 'react-i18next';
import styled from 'styled-components/macro';

interface TableStyleConfigProps {
Expand Down Expand Up @@ -47,6 +49,8 @@ const AntdTableWrapper: FC<{
summaryFn?: (data) => { total: number; summarys: [] };
}> = memo(
({ dataSource, columns, children, summaryFn, tableStyleConfig, ...rest }) => {
const { i18n } = useTranslation();

const getTableSummaryRow = pageData => {
if (!summaryFn) {
return undefined;
Expand All @@ -68,13 +72,15 @@ const AntdTableWrapper: FC<{
};

return (
<StyledTable
{...rest}
tableStyleConfig={tableStyleConfig}
dataSource={dataSource}
columns={columns}
summary={getTableSummaryRow}
/>
<ConfigProvider locale={antdLocales[i18n.language]}>
<StyledTable
{...rest}
tableStyleConfig={tableStyleConfig}
dataSource={dataSource}
columns={columns}
summary={getTableSummaryRow}
/>
</ConfigProvider>
);
},
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,12 @@ const config: ChartConfig = {
color: '#ced4da',
},
},
{
label: 'map.roam',
key: 'roam',
default: true,
comType: 'checkbox',
},
],
},
{
Expand Down Expand Up @@ -310,6 +316,7 @@ const config: ChartConfig = {
focusArea: '聚焦选中区域',
areaColor: '区域颜色',
areaEmphasisColor: '选中区域高亮颜色',
roam: '鼠标平移',
},
levelType: {
china: '中国-省级地图',
Expand Down Expand Up @@ -362,6 +369,7 @@ const config: ChartConfig = {
focusArea: 'Focus Area',
areaColor: 'Area Color',
areaEmphasisColor: 'Area Emphasis Color',
roam: 'Mouse translating',
},
levelType: {
china: 'China',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,12 @@ const config: ChartConfig = {
color: '#ced4da',
},
},
{
label: 'map.roam',
key: 'roam',
default: true,
comType: 'checkbox',
},
{
label: 'map.cycleRatio',
key: 'cycleRatio',
Expand Down Expand Up @@ -319,6 +325,7 @@ const config: ChartConfig = {
cycleRatio: '气泡大像素比',
areaColor: '区域颜色',
areaEmphasisColor: '选中区域高亮颜色',
roam: '鼠标平移',
},
levelType: {
china: '中国-省级地图',
Expand Down Expand Up @@ -369,6 +376,7 @@ const config: ChartConfig = {
areaColor: 'Area Color',
areaEmphasisColor: 'Area Emphasis Color',
cycleRatio: 'Cycle Ratio',
roam: 'Mouse translating',
},
levelType: {
china: 'China',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@ class ChartIFrameEventBroker {

private registerListener(c: IChart): void {
this.subscribe(ChartLifecycle.Mounted, c?.onMount);
this.subscribe(ChartLifecycle.Updated, c?.onUpdated);
this.subscribe(ChartLifecycle.Resize, c?.onResize);
this.subscribe(ChartLifecycle.Updated, c?.onUpdated);
this.subscribe(ChartLifecycle.UnMount, c?.onUnMount);
}

Expand Down
Loading

0 comments on commit f39e135

Please sign in to comment.