Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add groupLabel FieldName #941

Merged
merged 8 commits into from May 17, 2023

Conversation

@vercel
Copy link

vercel bot commented May 16, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
select ❌ Failed (Inspect) May 17, 2023 3:49am

src/Select.tsx Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented May 16, 2023

Codecov Report

Merging #941 (49b4a29) into master (0c8db0c) will increase coverage by 0.00%.
The diff coverage is 100.00%.

❗ Current head 49b4a29 differs from pull request most recent head c9a7a2e. Consider uploading reports for the commit c9a7a2e to get more accurate results

@@           Coverage Diff           @@
##           master     #941   +/-   ##
=======================================
  Coverage   99.63%   99.63%           
=======================================
  Files          37       37           
  Lines        1352     1353    +1     
  Branches      381      366   -15     
=======================================
+ Hits         1347     1348    +1     
  Misses          4        4           
  Partials        1        1           
Impacted Files Coverage Δ
src/Select.tsx 100.00% <100.00%> (ø)
src/utils/valueUtil.ts 100.00% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

src/utils/valueUtil.ts Outdated Show resolved Hide resolved
src/utils/valueUtil.ts Outdated Show resolved Hide resolved
Comment on lines 55 to 60
let label;
if (isGroupOption) {
label = data[groupLabel]
} else {
label = data[fieldLabel]
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
let label;
if (isGroupOption) {
label = data[groupLabel]
} else {
label = data[fieldLabel]
}
const label = isGroupOption ? data[groupLabel] : data[fieldLabel];

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

糟糕的code水平被发现了😭

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
let label;
if (isGroupOption) {
label = data[groupLabel]
} else {
label = data[fieldLabel]
}
const label = data[isGroupOption ? groupLabel : fieldLabel];

src/utils/valueUtil.ts Outdated Show resolved Hide resolved
src/utils/valueUtil.ts Outdated Show resolved Hide resolved
@MadCcc MadCcc merged commit 9eed16b into react-component:master May 17, 2023
8 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[select] 开启OptGroup ,并自定义fieldNames时,分组label不显示
4 participants