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

fix(components): data testid #1661

Merged
merged 1 commit into from
Dec 10, 2021
Merged

fix(components): data testid #1661

merged 1 commit into from
Dec 10, 2021

Conversation

berber1016
Copy link
Contributor

No description provided.

@vercel
Copy link

vercel bot commented Dec 10, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/growingio/gio-design/9KdQWuiSKpdiqhcsvRYWvBqRhFhF
✅ Preview: https://gio-design-git-fix-data-testid-growingio.vercel.app

Comment on lines +84 to 91
<Button.IconButton
data-testid="filter-picker"
{...rest}
size="small"
type={!localVisible ? 'text' : 'secondary'}
>
<FilterOutlined size="14px" />
</Button.IconButton>
Copy link

Choose a reason for hiding this comment

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

It is a good practice to avoid spreading for JSX attributes. This forces the code to be explicit about which props are given to the component. This avoids situations where warnings are caused by invalid HTML props passed to HTML elements, and further, it avoids passing unintentional extra props by malicious actors. Instead, consider explicitly passing props to the component.

Click a link below to tell your Security Team if this comment was:
👍 useful
👎 not useful (false positive)
🤔 confusing

This comment is advisory. You do not need to address it before merging this pull request.
(typescript.react.best-practice.react-props-spreading.react-props-spreading from Rule board)

@semgrep-app
Copy link

semgrep-app bot commented Dec 10, 2021

Semgrep was unable to comment inline on the following findings:

In src/select/Select.tsx:116-127

It is a good practice to avoid spreading for JSX attributes. This forces the code to be explicit about which props are given to the component. This avoids situations where warnings are caused by invalid HTML props passed to HTML elements, and further, it avoids passing unintentional extra props by malicious actors. Instead, consider explicitly passing props to the component.

Click a link below to tell your Security Team if this comment was:
👍 useful
👎 not useful (false positive)
🤔 confusing


In src/select/Select.tsx:95-112

ref usage found, refs give direct DOM access and may create a possibility for XSS

Click a link below to tell your Security Team if this comment was:
👍 useful
👎 not useful (false positive)
🤔 confusing


In src/past-time-picker/PastTimePicker.tsx:169-180

It is a good practice to avoid spreading for JSX attributes. This forces the code to be explicit about which props are given to the component. This avoids situations where warnings are caused by invalid HTML props passed to HTML elements, and further, it avoids passing unintentional extra props by malicious actors. Instead, consider explicitly passing props to the component.

Click a link below to tell your Security Team if this comment was:
👍 useful
👎 not useful (false positive)
🤔 confusing

How do I suppress this?

data-testid="filter-picker"
{...rest}
size="small"
type={!localVisible ? 'text' : 'secondary'}
Copy link
Contributor

Choose a reason for hiding this comment

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

Button 有一个 active 属性

@sonarcloud
Copy link

sonarcloud bot commented Dec 10, 2021

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 2 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@berber1016 berber1016 merged commit d4f0c15 into master Dec 10, 2021
@berber1016 berber1016 deleted the fix-data-testid branch December 10, 2021 07:40
jack0pan pushed a commit that referenced this pull request Dec 13, 2021
## [22.5.2](v22.5.1...v22.5.2) (2021-12-13)

### Bug Fixes

* **components:** data testid ([#1661](#1661)) ([d4f0c15](d4f0c15))
* **filter-picker:** fix container ([#1667](#1667)) ([366c3be](366c3be))
* **panel:** the title should be vertically centered with the icon when there is no description ([#1665](#1665)) ([12c98d5](12c98d5))
* **switch, modal:** fix style ([#1664](#1664)) ([6de60fe](6de60fe))
* **tab-nav:** 修复当tab文字超出时,折行溢出 ([#1662](#1662)) ([1ab5bf5](1ab5bf5))
* **table:** fix scroll-bar of table ([#1666](#1666)) ([fc27a58](fc27a58))
* **textarea:** update the style of textarea ([#1663](#1663)) ([ada7e49](ada7e49))
* **tree:** fix tree not ellipsis ([#1660](#1660)) ([83fdc80](83fdc80))
@jack0pan
Copy link
Member

🎉 This PR is included in version 22.5.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants