Skip to content

Commit

Permalink
fix: sonar scanner
Browse files Browse the repository at this point in the history
  • Loading branch information
wkylin committed Nov 7, 2024
1 parent e539666 commit 196bf03
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 17 deletions.
6 changes: 3 additions & 3 deletions .scannerwork/report-task.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
projectKey=pro-react-admin
serverUrl=http://localhost:9000
serverVersion=9.9.0.65466
serverVersion=10.7.0.96327
dashboardUrl=http://localhost:9000/dashboard?id=pro-react-admin
ceTaskId=AYb_3hPyWpAQAZNXFhho
ceTaskUrl=http://localhost:9000/api/ce/task?id=AYb_3hPyWpAQAZNXFhho
ceTaskId=22109086-7690-4db8-bfa6-ec9a25157b56
ceTaskUrl=http://localhost:9000/api/ce/task?id=22109086-7690-4db8-bfa6-ec9a25157b56
4 changes: 3 additions & 1 deletion src/components/container/musicPlayer/Player.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ const Player = ({ activeSong, isPlaying, volume, seekTime, onEnded, onTimeUpdate
onEnded={onEnded}
onTimeUpdate={onTimeUpdate}
onLoadedData={onLoadedData}
/>
>
<track src="aaaa" kind="subtitles" srcLang="en" label="English" />
</audio>
)
}

Expand Down
8 changes: 4 additions & 4 deletions src/components/stateless/StarRating/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,22 @@ const StarRating = ({ value }) => {

const hoverOver = (event) => {
let val = 0
if (event && event.target && event.target.getAttribute('data-star-id'))
val = event.target.getAttribute('data-star-id')
if (event?.target?.getAttribute('data-star-id')) val = event.target.getAttribute('data-star-id')
setSelection(val)
}
return (
<div
<span
onMouseOut={() => hoverOver(null)}
onClick={(e) => setRating(e.target.getAttribute('data-star-id') || rating)}
onMouseOver={hoverOver}
role="button"
tabIndex="0"
>
{Array.from({ length: 5 }, (v, i) => (
<Star starId={i + 1} key={`star_${i + 1}`} marked={selection ? selection >= i + 1 : rating >= i + 1} />
))}
<span>{rating}</span>
</div>
</span>
)
}

Expand Down
6 changes: 3 additions & 3 deletions src/pages/home/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -158,11 +158,11 @@ const Home = () => {

return (
<FixTabPanel>
<h2 style={{ marginBottom: 15 }}>
<section style={{ marginBottom: 15 }}>
<TypedText>Cool! Hi, React & Ant Design!</TypedText>
</h2>
</section>

<h2 className={styles.avatar}>React version: {version}</h2>
<section className={styles.avatar}>React version: {version}</section>

<section>
I love coding in <AlternatingText alternateText={['javascript', 'typescript', 'rect', 'vue']} />.
Expand Down
3 changes: 1 addition & 2 deletions src/pages/postmessage/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ const PostMessage = () => {
border: 'none',
width: '100%',
}}
frameborder="0"
src={childOrigin}
ref={ref}
width="800px"
Expand All @@ -47,7 +46,7 @@ const PostMessage = () => {
loading="lazy"
allowfullscreen
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
referrerpolicy="no-referrer-when-downgrade"
referrerPolicy="no-referrer-when-downgrade"
sandbox="allow-scripts allow-same-origin"
/>
</>
Expand Down
10 changes: 6 additions & 4 deletions src/pages/print/test/toPrint.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react'

import image from './px4T-test_image.png'
import imagePng from './px4T-test_image.png'

const ComponentToPrint = React.forwardRef((props, ref) => {
const { text } = props
Expand Down Expand Up @@ -89,7 +89,7 @@ const ComponentToPrint = React.forwardRef((props, ref) => {
<tr>
<td>Image: Local Import</td>
<td>
<img alt="A test image" src={image} width="200" />
<img alt="A test" src={imagePng} width="200" />
</td>
</tr>
<tr>
Expand Down Expand Up @@ -123,8 +123,10 @@ const ComponentToPrint = React.forwardRef((props, ref) => {
<tr>
<td>Input: Radio</td>
<td>
Blue <input type="radio" id="blue" name="color" value="blue" />
Red <input type="radio" id="red" name="color" value="red" />
<span>Blue</span>
<input type="radio" id="blue" name="color" value="blue" />
<span>Red</span>
<input type="radio" id="red" name="color" value="red" />
</td>
</tr>
<tr>
Expand Down

0 comments on commit 196bf03

Please sign in to comment.