Skip to content

Commit

Permalink
fix: i18n in validating required fields (#57)
Browse files Browse the repository at this point in the history
* fix: modify i18n in validate required fields

* chore: update package.json
  • Loading branch information
sherotree authored Jan 20, 2022
1 parent 65a7eeb commit f3eb5bd
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 4 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
## [2.0.6](https://github.com/Erda-FE/dashboard-configuration/pull/56/commits/a2adaca0778d3c15cc198b03d4a0ad5fbf476644) (2021-12-15)


### Bug Fixes

* fix fetch 'https://geo.datav.aliyun.com/areas_v2/bound' without header to solve CORS problem

### Feat
* export DashboardVersion
* modify tooltip style in chart

## [2.0.5](https://github.com/Erda-FE/dashboard-configuration/compare/v2.0.3...v2.0.5) (2021-12-05)

### Bug Fixes
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@erda-ui/dashboard-configurator",
"version": "2.0.5",
"version": "2.0.7",
"description": "Erda dashboard configurator powered by Echart",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
Expand Down
7 changes: 4 additions & 3 deletions src/common/form-builder/fields.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { has, isBoolean, map, some } from 'lodash';
import type { IContextType } from './form-builder';
import { FormContext } from './form-builder';
import ReadonlyField from './readonly-field';

import DashboardStore from 'src/stores/dash-board';
const { Item } = Form;

/**
Expand Down Expand Up @@ -75,7 +75,8 @@ interface IProps {

export const Fields: React.MemoExoticComponent<
({ fields, isMultiColumn, columnNum, readonly, fid }: IProps) => JSX.Element
> = React.memo(({ fields = [], isMultiColumn, columnNum, readonly, fid }: IProps) => {
> = React.memo(({ fields = [], isMultiColumn, columnNum, readonly, fid }: IProps) => {
const textMap = DashboardStore.getState((s) => s.textMap);
const getColumn = (contextProps: IContextType) => {
if (isMultiColumn || (isMultiColumn === undefined && contextProps.parentIsMultiColumn)) {
if (columnNum) return columnNum;
Expand Down Expand Up @@ -115,7 +116,7 @@ export const Fields: React.MemoExoticComponent<
? [
{
required: true,
message: `${labelStr} 不能为空`,
message: `${labelStr} ${textMap['can not be empty']}`,
},
...rules,
]
Expand Down
2 changes: 2 additions & 0 deletions src/constants/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ export const TEXT_ZH_MAP = {
failed: '失败',
'start time': '开始时间',
'end time': '结束时间',
'can not be empty': '不能为空',
};

export const TEXT_EN_MAP = {
Expand Down Expand Up @@ -299,6 +300,7 @@ export const TEXT_EN_MAP = {
failed: 'failed',
'start time': 'start time',
'end time': 'end time',
'can not be empty': 'can not be empty',
};

export const DEFAULT_VIEW_CONFIG = {
Expand Down

0 comments on commit f3eb5bd

Please sign in to comment.