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

SHARD-2019 - Prettier monitor-client #34

Merged
merged 4 commits into from
Mar 20, 2025

Conversation

mhanson-github
Copy link
Contributor

@mhanson-github mhanson-github commented Mar 19, 2025

PR Type

enhancement, formatting, tests


Description

  • Applied Prettier formatting to multiple JavaScript files.

  • Enhanced code readability and consistency.

  • Added tests for navigation components.

  • Improved code comments and structure.


Changes walkthrough 📝

Relevant files
Formatting
8 files
popmotion.min.js
Reformat minified JavaScript file                                               
+921/-1 
large-network.js
Apply Prettier formatting to JavaScript                                   
+81/-60 
app-versions.js
Apply Prettier formatting to JavaScript                                   
+121/-111
myChart.js
Apply Prettier formatting to JavaScript                                   
+60/-47 
node-loads.js
Apply Prettier formatting to JavaScript                                   
+124/-119
history.js
Apply Prettier formatting to JavaScript                                   
+37/-36 
sync-detail.js
Apply Prettier formatting to JavaScript                                   
+14/-14 
auth.js
Apply Prettier formatting to JavaScript                                   
+4/-4     
Tests
1 files
navigation.test.js
Add tests for navigation components                                           
+43/-31 
Additional files
15 files
.prettierrc.js +0/-7     
babel.config.js +2/-4     
jest.config.js +6/-6     
package.json +57/-57 
prettier.config.js +4/-5     
NoOp.ts +1/-1     
app.js +29/-26 
axios.min.js +1567/-1
chart.min.js +9916/-9
fabric.js +14059/-1
history-log.js +22/-22 
log.js +28/-28 
signin.js +5/-5     
sync.js +15/-14 
version.js +5/-6     

Need help?
  • Type /help how to ... in the comments thread for any questions about PR-Agent usage.
  • Check out the documentation for more information.
  • Copy link

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

    ⏱️ Estimated effort to review: 4 🔵🔵🔵🔵⚪
    🏅 Score: 85
    🧪 No relevant tests
    🔒 No security concerns identified
    ⚡ Recommended focus areas for review

    Possible Issue

    The condition activeNodes + joiningNodes === undefined || NaN seems incorrect. The use of NaN in a logical OR with undefined might not work as intended. Consider using isNaN() to check for NaN.

    G.Y = 0
    G.MAX_EDGES_FOR_NODE = 1
    Logging Redundancy

    There are multiple console.log statements for debugging purposes. Consider removing or commenting them out before deploying to production to avoid cluttering the console.

    console.log('response.data.totalRejected', response.data.totalRejected)
    console.log('currentTotalRejected', this.currentTotalRejected)
    let increment = response.data.totalRejected - this.currentTotalRejected
    console.log('increment', increment)

    public/signin.js Outdated
    Comment on lines 21 to 25
    const res = await request.post(`${monitorServerUrl}/signin`, payload)
    if (res.data && res.data.token) {
    console.log('SingIn Successful', res.data.token)
    localStorage.setItem('token', res.data.token)
    location.href = "/"
    location.href = '/'

    Choose a reason for hiding this comment

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

    Suggestion: Correct the typo in the console log message from "SingIn Successful" to "SignIn Successful" to ensure accurate logging. [general, importance: 3]

    Suggested change
    const res = await request.post(`${monitorServerUrl}/signin`, payload)
    if (res.data && res.data.token) {
    console.log('SingIn Successful', res.data.token)
    localStorage.setItem('token', res.data.token)
    location.href = "/"
    location.href = '/'
    const res = await request.post(`${monitorServerUrl}/signin`, payload)
    if (res.data && res.data.token) {
    console.log('SignIn Successful', res.data.token)
    localStorage.setItem('token', res.data.token)
    location.href = '/'
    } else {
    alert('Incorrect username or password')
    this.username = ''
    this.password = ''
    }

    @mhanson-github mhanson-github merged commit 5aee2ab into mainnet-launch Mar 20, 2025
    5 checks passed
    @mhanson-github mhanson-github deleted the SHARD-2019-prettier branch March 20, 2025 01:03
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    2 participants