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

Sync production branch with main #671

Merged
merged 67 commits into from
Jun 26, 2024
Merged

Sync production branch with main #671

merged 67 commits into from
Jun 26, 2024

Conversation

marc-aurele-besner and others added 30 commits June 17, 2024 20:52
Co-authored-by: Emil Fattakhov <66026548+EmilFattakhov@users.noreply.github.com>
…n-staking-section' of https://github.com/subspace/astral into 588-add-proof-of-ownership-for-register_operator-flow-in-staking-section
A few route and title changes to operators section
…ame-wallet-to-give-verified-roles-to-multiple-users
…to-give-verified-roles-to-multiple-users' of https://github.com/subspace/astral into 636-create-permanent-relation-to-avoid-the-same-wallet-to-give-verified-roles-to-multiple-users
…o-avoid-the-same-wallet-to-give-verified-roles-to-multiple-users

Create permanent relation to avoid the same wallet to give verified roles to multiple users
…backlink

Add footer component to MainLayout
…r-the-autonomys-logo

Change the subspace logo for the autonomys logo
…ield-description-in-modal-form

Add the type next to each field description in modal form
…n-staking-section' of https://github.com/subspace/astral into 588-add-proof-of-ownership-for-register_operator-flow-in-staking-section
…register_operator-flow-in-staking-section

Add proof of ownership for register operator flow in the staking section
…ors-section

Fix sorting errors by only showing sorting option on sortable column
…to-automatically-generate-cardlist-for-mobile

Improve newtable component to automatically generate cardlist for mobile
fix small bug that creped in during merge conflict
Copy link

netlify bot commented Jun 25, 2024

Deploy Preview for astral-prod ready!

Name Link
🔨 Latest commit 661a9bd
🔍 Latest deploy log https://app.netlify.com/sites/astral-prod/deploys/667b2a9af447990008e7f82a
😎 Deploy Preview https://deploy-preview-671--astral-prod.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Jun 25, 2024

Deploy Preview for dev-astral ready!

Name Link
🔨 Latest commit 661a9bd
🔍 Latest deploy log https://app.netlify.com/sites/dev-astral/deploys/667b2a9aa6c53c0008d048f9
😎 Deploy Preview https://deploy-preview-671--dev-astral.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

New and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/@apollo/client@3.9.6 network Transitive: eval +10 7.46 MB apollo-bot
npm/@apollo/experimental-nextjs-app-support@0.8.0 None +3 231 kB apollo-bot
npm/@babel/code-frame@7.23.5 Transitive: environment +8 174 kB nicolo-ribaudo
npm/@babel/compat-data@7.23.5 None 0 64.6 kB nicolo-ribaudo
npm/@babel/core@7.24.0 environment, filesystem, unsafe +9 1.79 MB nicolo-ribaudo
npm/@babel/generator@7.23.6 None +1 524 kB nicolo-ribaudo
npm/@babel/helper-compilation-targets@7.23.6 None +2 82.5 kB nicolo-ribaudo
npm/@babel/helper-create-class-features-plugin@7.24.0 None +6 457 kB nicolo-ribaudo
npm/@babel/helper-create-regexp-features-plugin@7.22.15 None +2 84.8 kB nicolo-ribaudo
npm/@babel/helper-function-name@7.23.0 None 0 21.6 kB nicolo-ribaudo
npm/@babel/helper-member-expression-to-functions@7.23.0 None 0 55 kB nicolo-ribaudo
npm/@babel/helper-module-imports@7.22.15 None 0 54.4 kB nicolo-ribaudo
npm/@babel/helper-plugin-utils@7.24.0 None 0 11.7 kB nicolo-ribaudo
npm/@babel/helper-validator-option@7.23.5 None 0 11.7 kB nicolo-ribaudo
npm/@babel/parser@7.24.0 None 0 1.88 MB nicolo-ribaudo
npm/@babel/plugin-syntax-class-properties@7.12.13 None 0 2.68 kB nicolo-ribaudo
npm/@babel/plugin-syntax-flow@7.23.3 None 0 5.49 kB nicolo-ribaudo
npm/@babel/plugin-syntax-import-assertions@7.23.3 None 0 3.71 kB nicolo-ribaudo
npm/@babel/plugin-syntax-jsx@7.23.3 None 0 4.21 kB nicolo-ribaudo
npm/@babel/plugin-syntax-object-rest-spread@7.8.3 None 0 2.53 kB nicolo-ribaudo
npm/@babel/plugin-transform-arrow-functions@7.23.3 None 0 5.62 kB nicolo-ribaudo
npm/@babel/plugin-transform-block-scoped-functions@7.23.3 None 0 6.62 kB nicolo-ribaudo
npm/@babel/plugin-transform-block-scoping@7.23.4 None 0 88.5 kB nicolo-ribaudo
npm/@babel/plugin-transform-classes@7.23.8 None +6 185 kB nicolo-ribaudo
npm/@babel/plugin-transform-computed-properties@7.23.3 None 0 22.8 kB nicolo-ribaudo
npm/@babel/plugin-transform-destructuring@7.23.3 None 0 82 kB nicolo-ribaudo
npm/@babel/plugin-transform-for-of@7.23.6 None +1 50.7 kB nicolo-ribaudo
npm/@babel/plugin-transform-function-name@7.23.3 None 0 6.27 kB nicolo-ribaudo
npm/@babel/plugin-transform-literals@7.23.3 None 0 4.7 kB nicolo-ribaudo
npm/@babel/plugin-transform-member-expression-literals@7.23.3 None 0 5.01 kB nicolo-ribaudo
npm/@babel/plugin-transform-modules-commonjs@7.23.3 None +5 281 kB nicolo-ribaudo
npm/@babel/plugin-transform-object-super@7.23.3 None +3 54.4 kB nicolo-ribaudo
npm/@babel/plugin-transform-optional-chaining@7.23.4 None +2 46.4 kB nicolo-ribaudo
npm/@babel/plugin-transform-parameters@7.23.3 None 0 65 kB nicolo-ribaudo
npm/@babel/plugin-transform-property-literals@7.23.3 None 0 4.79 kB nicolo-ribaudo
npm/@babel/plugin-transform-react-display-name@7.23.3 None 0 12.5 kB nicolo-ribaudo
npm/@babel/plugin-transform-react-jsx@7.23.4 None +1 84 kB nicolo-ribaudo
npm/@babel/plugin-transform-shorthand-properties@7.23.3 None 0 7.18 kB nicolo-ribaudo
npm/@babel/plugin-transform-spread@7.23.3 None +1 27.2 kB nicolo-ribaudo
npm/@babel/plugin-transform-template-literals@7.23.3 None 0 15.9 kB nicolo-ribaudo
npm/@babel/preset-env@7.24.0 environment Transitive: unsafe +69 1.88 MB nicolo-ribaudo
npm/@babel/runtime@7.24.0 None +1 290 kB nicolo-ribaudo
npm/@babel/template@7.24.0 None 0 68.9 kB nicolo-ribaudo
npm/@babel/traverse@7.24.0 None +4 675 kB nicolo-ribaudo
npm/@babel/types@7.24.0 environment +3 2.5 MB nicolo-ribaudo
npm/@discordjs/rest@2.2.0 Transitive: environment, network, unsafe +8 5.19 MB crawl
npm/@eslint-community/eslint-utils@4.4.0 None 0 379 kB eslint-community-bot
npm/@eslint-community/regexpp@4.10.0 None 0 431 kB eslint-community-bot
npm/@graphql-codegen/cli@4.0.1 environment, filesystem, network, shell, unsafe +95 11.7 MB dotansimha
npm/@graphql-codegen/client-preset@4.0.0 Transitive: environment, eval, filesystem, network, shell +60 6.46 MB dotansimha
npm/@graphql-codegen/plugin-helpers@5.0.3 unsafe +23 393 kB dotansimha
npm/@graphql-codegen/typescript@4.0.6 Transitive: environment, eval, filesystem, network, shell +53 5.72 MB dotansimha
npm/@graphql-tools/graphql-tag-pluck@8.3.0 None 0 63.1 kB ardatan
npm/@graphql-tools/merge@9.0.3 None 0 95.5 kB ardatan
npm/@graphql-tools/schema@10.0.3 None 0 67.9 kB ardatan
npm/@graphql-tools/url-loader@8.0.2 network Transitive: environment, filesystem, shell +21 1.69 MB ardatan
npm/@graphql-tools/utils@10.1.0 None +2 517 kB ardatan
npm/@headlessui/react@1.7.18 environment +2 2.25 MB malfaitrobin
npm/@headlessui/tailwindcss@0.2.0 environment 0 10.7 kB malfaitrobin
npm/@heroicons/react@2.1.1 None 0 3.33 MB malfaitrobin
npm/@jridgewell/gen-mapping@0.3.5 None +1 99.5 kB jridgewell
npm/@jridgewell/sourcemap-codec@1.4.15 None 0 45.9 kB jridgewell
npm/@jridgewell/trace-mapping@0.3.25 None +1 222 kB jridgewell
npm/@next/eslint-plugin-next@14.1.3 filesystem Transitive: environment, shell +21 1.65 MB vercel-release-bot
npm/@next/third-parties@14.2.3 None +1 65.8 kB vercel-release-bot
npm/@nivo/core@0.84.0 Transitive: environment +17 3.93 MB plouc
npm/@nivo/line@0.84.0 Transitive: environment +30 4.9 MB plouc
npm/@nivo/pie@0.84.0 Transitive: environment +22 4.77 MB plouc
npm/@polkadot/api@10.12.1 None +10 6.24 MB polkadotjs
npm/@polkadot/extension-dapp@0.46.7 None 0 49.1 kB polkadotjs
npm/@polkadot/extension-inject@0.46.7 None 0 23.9 kB polkadotjs
npm/@polkadot/react-identicon@3.6.5 Transitive: environment, filesystem +14 4.8 MB polkadotjs
npm/@polkadot/rpc-provider@10.12.1 network Transitive: environment, filesystem +22 52.3 MB polkadotjs
npm/@polkadot/types@10.12.1 None +3 4.57 MB polkadotjs
npm/@subwallet/wallet-connect@0.2.7 Transitive: environment, filesystem +20 1.33 MB anhmtv
npm/@svgr/webpack@8.1.0 Transitive: environment, filesystem, shell +30 2.07 MB neoziro
npm/@tailwindcss/forms@0.5.7 None +1 60.6 kB thecrypticace
npm/@tanstack/match-sorter-utils@8.11.8 None +1 281 kB tannerlinsley
npm/@tanstack/react-table@8.13.2 Transitive: environment +1 3.99 MB tannerlinsley
npm/@testing-library/jest-dom@6.4.2 None +7 795 kB testing-library-bot
npm/@testing-library/react@14.2.1 environment Transitive: eval +19 9.49 MB testing-library-bot
npm/@testing-library/user-event@14.5.2 Transitive: environment, eval +19 4.52 MB testing-library-bot
npm/@types/jest@29.5.12 Transitive: environment, eval +12 936 kB types
npm/@types/js-cookie@3.0.6 None 0 7.43 kB types
npm/@types/json-schema@7.0.15 None 0 31.7 kB types
npm/@types/jsonwebtoken@9.0.6 None 0 13.5 kB types
npm/@types/node@20.11.25 None +1 4.07 MB types
npm/@types/prop-types@15.7.11 None 0 6.16 kB types
npm/@types/react-dom@18.2.21 None 0 34 kB types
npm/@types/react@18.2.64 None +2 1.68 MB types
npm/@typescript-eslint/eslint-plugin@7.1.1 Transitive: environment +22 8.11 MB jameshenry
npm/@vercel/og@0.6.2 environment, filesystem, network +3 11.8 MB vercel-release-bot
npm/acorn@8.11.3 None 0 531 kB marijn
npm/agent-base@7.1.0 network 0 23.5 kB tootallnate
npm/ansi-escapes@4.3.2 None +1 135 kB sindresorhus
npm/aria-query@5.3.0 None +1 206 kB jessebeach
npm/array-includes@3.1.7 None 0 25.4 kB ljharb
npm/array.prototype.flat@1.3.2 None 0 18.7 kB ljharb
npm/asn1js@3.0.5 None +1 321 kB microshine
npm/async@3.2.5 None 0 808 kB aearly
npm/autoprefixer@10.4.18 environment +3 299 kB ai
npm/available-typed-arrays@1.0.7 None +1 31.3 kB ljharb
npm/browserslist@4.23.0 environment, filesystem Transitive: shell +4 395 kB ai
npm/caniuse-lite@1.0.30001596 None 0 1.99 MB caniuse-lite
npm/client-only@0.0.1 None 0 611 B sebmarkbage
npm/common-tags@1.8.2 None 0 228 kB fatfisz
npm/core-js-compat@3.36.0 None 0 715 kB zloirock
npm/cosmiconfig@8.3.6 filesystem +2 89.3 kB d-fischer
npm/d3-array@2.12.1 None +1 146 kB mbostock
npm/d3-color@3.1.0 None 0 61.2 kB mbostock
npm/d3-format@1.4.5 None 0 58.7 kB mbostock
npm/d3-interpolate@3.0.1 None 0 69.7 kB mbostock
npm/d3-time-format@3.0.0 None 0 84.2 kB recifs
npm/d3-time@1.1.0 None 0 58.4 kB mbostock
npm/deepmerge@4.3.1 None 0 31.2 kB tehshrike
npm/discord-api-types@0.37.77 None 0 2.64 MB crawl
npm/end-of-stream@1.4.4 None 0 6.23 kB mafintosh
npm/entities@4.5.0 None 0 413 kB feedic
npm/es-abstract@1.22.5 None +25 2.54 MB ljharb
npm/es-iterator-helpers@1.0.17 None +7 268 kB ljharb
npm/es-set-tostringtag@2.0.3 None 0 13.9 kB ljharb
npm/es-shim-unscopables@1.0.2 None 0 11 kB ljharb
npm/escape-string-regexp@1.0.5 None 0 2.69 kB jbnicolai
npm/eslint-config-prettier@9.1.0 None 0 20.8 kB lydell
npm/eslint-config-standard-with-typescript@43.0.1 None +14 6.11 MB mightyiam
npm/eslint-plugin-import@2.29.1 filesystem, unsafe Transitive: environment +11 1.68 MB ljharb
npm/eslint-plugin-jsx-a11y@6.8.0 None +12 3.39 MB ljharb
npm/eslint-plugin-prettier@5.1.3 Transitive: environment +2 98 kB jounqin
npm/eslint-plugin-promise@6.1.1 None 0 67.1 kB eslint-community-bot
npm/eslint-plugin-react-hooks@4.6.0 environment 0 118 kB gnoff
npm/eslint-plugin-react@7.34.0 filesystem Transitive: environment +14 1.28 MB ljharb
npm/eslint-plugin-tailwindcss@3.14.3 None 0 189 kB francoismassart
npm/eslint-visitor-keys@3.4.3 None 0 32.3 kB eslintbot
npm/eslint@8.57.0 environment, filesystem Transitive: unsafe +38 6.58 MB eslintbot
npm/espree@9.6.1 None +1 98 kB eslintbot
npm/ethers@6.11.1 network +7 19.6 MB ricmoo
npm/fast-glob@3.3.2 filesystem 0 96.7 kB mrmlnc
npm/faunadb@4.8.0 environment, network Transitive: filesystem +13 895 kB fauna-bot
npm/fbjs@3.0.5 Transitive: eval, network +5 732 kB bigfootjon
npm/find-up@4.1.0 Transitive: filesystem +3 29.4 kB sindresorhus
npm/formik@2.4.5 environment Transitive: eval +5 1.27 MB jaredpalmer
npm/function.prototype.name@1.1.6 None +1 42.2 kB ljharb
npm/gh-pages@6.1.1 filesystem, shell Transitive: environment +16 474 kB tschaub
npm/graceful-fs@4.2.11 environment, filesystem 0 32.5 kB isaacs
npm/graphql@16.8.1 None 0 1.34 MB i1g
npm/has-proto@1.0.3 None 0 12 kB ljharb
npm/hoist-non-react-statics@3.3.2 None 0 38.9 kB mridgway
npm/ignore@5.3.1 None 0 51.5 kB kael
npm/is-core-module@2.13.1 None 0 30.2 kB ljharb
npm/is-map@2.0.3 None 0 20.4 kB ljharb
npm/is-set@2.0.3 None 0 19.7 kB ljharb
npm/is-shared-array-buffer@1.0.3 None 0 18.7 kB ljharb
npm/jest-canvas-mock@2.5.2 None +3 358 kB atool
npm/jiti@1.21.0 environment, filesystem, unsafe 0 1.91 MB pi0
npm/js-cookie@3.0.5 None 0 26.2 kB carhartl
npm/js-tokens@4.0.0 None 0 15.1 kB lydell
npm/json5@2.2.3 None 0 235 kB jordanbtucker
npm/jsonwebtoken@9.0.2 None 0 43.5 kB charlesrea
npm/jsx-ast-utils@3.3.5 None 0 236 kB ljharb
npm/lodash@4.17.21 None 0 1.41 MB bnjmnt4n
npm/log-symbols@4.1.0 None 0 4.58 kB sindresorhus
npm/loose-envify@1.4.0 environment 0 5.81 kB zertosh
npm/lottie-react@2.4.0 None 0 234 kB gamote
npm/make-dir@3.1.0 filesystem 0 10 kB sindresorhus
npm/next-auth@4.24.7 environment, network +1 1.33 MB thvu
npm/next-pwa@5.6.0 filesystem 0 51.2 kB shadowwalker1117
npm/next@14.1.3 environment, filesystem, network, shell, unsafe 0 86.4 MB vercel-release-bot
npm/object.values@1.1.7 None 0 30.9 kB ljharb
npm/postcss-value-parser@4.2.0 None 0 27.2 kB evilebottnawi
npm/postcss@8.4.35 environment, filesystem +1 203 kB ai
npm/prettier-plugin-tailwindcss@0.5.12 None 0 2.55 MB thecrypticace
npm/prettier@3.2.5 environment, filesystem, unsafe 0 8.39 MB prettier-bot
npm/prop-types@15.8.1 environment +1 118 kB ljharb
npm/pvtsutils@1.3.5 None 0 40.8 kB microshine
npm/qrcode.react@3.1.0 None 0 72.3 kB zpao
npm/rc-slider@10.6.2 environment 0 156 kB afc163
npm/react-dom@18.2.0 environment 0 4.5 MB gnoff
npm/react-error-boundary@3.1.4 None 0 56.4 kB kentcdodds
npm/react-ga4@2.1.0 None 0 84.4 kB codler
npm/react-hot-toast@2.4.1 None 0 173 kB timolins
npm/react-is@18.3.1 environment 0 24 kB react-bot
npm/react-json-view@1.21.3 eval +1 169 kB mac-s-g
npm/react-paginate@8.2.0 None 0 115 kB adele
npm/react@18.2.0 environment 0 316 kB gnoff
npm/resolve@1.22.8 environment, filesystem +2 159 kB ljharb
npm/semver@6.3.1 None 0 68.3 kB lukekarrys
npm/set-function-name@2.0.2 None +1 33.4 kB ljharb
npm/siwe@2.1.4 None 0 80.2 kB w4ll3
npm/string.prototype.matchall@4.0.10 None +2 157 kB ljharb
npm/tailwind-datepicker-react@1.4.3 None 0 63.8 kB omikkel
npm/tailwindcss@3.4.1 environment, filesystem +2 5.6 MB adamwathan
npm/through@2.3.8 None 0 12.5 kB dominictarr
npm/tsconfig-paths-webpack-plugin@4.1.0 Transitive: environment, filesystem, unsafe +1 490 kB jonaskello
npm/typescript@5.4.2 None 0 32.4 MB typescript-bot
npm/util-deprecate@1.0.2 None 0 5.48 kB tootallnate
npm/web-streams-polyfill@3.3.3 None 0 9.04 MB mattiasbuelens
npm/web-vitals@3.5.2 None 0 386 kB tunetheweb
npm/webextension-polyfill@0.10.0 None 0 198 kB addons-robot
npm/wrap-ansi@6.2.0 None +1 36.7 kB sindresorhus
npm/xlsx@0.18.5 filesystem 0 7.5 MB sheetjs
npm/yoga-wasm-web@0.3.3 None 0 290 kB quietshu
npm/yup@0.32.11 Transitive: eval +1 956 kB monastic.panic
npm/zod@3.22.4 None 0 628 kB colinmcd94

🚮 Removed packages: npm/@belopash/typeorm-store@1.3.0, npm/@polkadot/api@10.11.2, npm/@subsquid/archive-registry@3.3.0, npm/@subsquid/graphql-server@4.5.0, npm/@subsquid/ss58@2.0.2, npm/@subsquid/substrate-metadata-explorer@3.1.2, npm/@subsquid/substrate-processor@8.1.1, npm/@subsquid/substrate-typegen@8.0.2, npm/@subsquid/typeorm-codegen@1.3.3, npm/@subsquid/typeorm-migration@1.3.0, npm/@types/node@18.14.0, npm/@types/node@20.11.17, npm/@typescript-eslint/eslint-plugin@5.53.0, npm/@typescript-eslint/parser@5.53.0, npm/dotenv@16.0.3, npm/dotenv@16.4.4, npm/eslint-plugin-eslint-plugin@5.0.8, npm/eslint@8.34.0, npm/pg@8.11.3, npm/prom-client@14.2.0, npm/typeorm@0.3.20, npm/typescript@4.9.5, npm/typescript@5.3.3, npm/undici@5.21.0

View full report↗︎

Copy link

🚨 Potential security issues detected. Learn more about Socket for GitHub ↗︎

To accept the risk, merge this PR and you will not be notified again.

Alert Package NoteSourceCI
Install scripts npm/faunadb@4.8.0
  • Install script: postinstall
  • Source: node ./tools/printReleaseNotes
🚫
Telemetry npm/next@14.1.3
  • Note: Can be disabled by setting the environment variable NEXT_TELEMETRY_DISABLED=1 . See https://nextjs.org/telemetry for more information
🚫

View full report↗︎

Next steps

What is an install script?

Install scripts are run when the package is installed. The majority of malware in npm is hidden in install scripts.

Packages should not be running non-essential scripts during install and there are often solutions to problems people solve with install scripts that can be run at publish time instead.

What is telemetry?

This package contains telemetry which tracks how it is used.

Most telemetry comes with settings to disable it. Consider disabling telemetry if you do not want to be tracked.

Take a deeper look at the dependency

Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support [AT] socket [DOT] dev.

Remove the package

If you happen to install a dependency that Socket reports as Known Malware you should immediately remove it and select a different dependency. For other alert types, you may may wish to investigate alternative packages or consider if there are other ways to mitigate the specific risk posed by the dependency.

Mark a package as acceptable risk

To ignore an alert, reply with a comment starting with @SocketSecurity ignore followed by a space separated list of ecosystem/package-name@version specifiers. e.g. @SocketSecurity ignore npm/foo@1.0.0 or ignore all packages with @SocketSecurity ignore-all

  • @SocketSecurity ignore npm/faunadb@4.8.0
  • @SocketSecurity ignore npm/next@14.1.3

@github-actions github-actions bot added documentation Improvements or additions to documentation enhancement New feature or request Bug fix Review effort [1-5]: 4 labels Jun 25, 2024
Copy link

PR Reviewer Guide 🔍

⏱️ Estimated effort to review [1-5] 4
🧪 Relevant tests No
🔒 Security concerns No
⚡ Key issues to review Possible Bug:
The PR introduces checks for subspaceAccount in various methods in ActionsModal.tsx but does not handle the case where subspaceAccount might be undefined or null. This could lead to runtime errors if subspaceAccount is not set.
Code Duplication:
There is repeated code for checking subspaceAccount across different methods in ActionsModal.tsx. Consider refactoring this into a single method or utility function to check account validity.
Inconsistent Error Handling:
The error handling across different files is inconsistent. For example, GetDiscordRoles.tsx throws an error for no connected account or signer, but similar checks in other components like StakingSummary.tsx do not throw errors, potentially leading to inconsistent user experiences.
Performance Concern:
The loadWalletBalance function in WalletSideKick/index.tsx is called multiple times which might lead to performance issues. Consider optimizing the number of calls to this function, especially in a production environment.

Copy link

PR Code Suggestions ✨

CategorySuggestion                                                                                                                                    Score
Possible bug
Add null checks for chainMatch and chainMatch.token to prevent runtime errors

Ensure that chainMatch and chainMatch.token are defined before accessing
chainMatch.token.symbol to avoid runtime errors due to potential null or undefined values.

explorer/src/app/[chain]/consensus/accounts/[accountId]/image/route.tsx [128]

-Total {numberWithCommas(bigNumberToNumber(account.total))} ({chainMatch.token.symbol})
+Total {numberWithCommas(bigNumberToNumber(account.total))} ({chainMatch?.token?.symbol ?? 'Unknown'})
 
Suggestion importance[1-10]: 9

Why: This suggestion addresses a critical potential runtime error by adding null checks, which is a significant improvement for code robustness and reliability.

9
Add a safeguard against undefined values in the token symbol

To avoid potential runtime errors, ensure that selectedChain.token.symbol is not undefined
before rendering it. You can use optional chaining (?.) and provide a default value.

explorer/src/components/Account/AccountLatestRewards.tsx [76]

-{bigNumberToNumber(amount)} {selectedChain.token.symbol}
+{bigNumberToNumber(amount)} {selectedChain.token?.symbol ?? 'Unknown Token'}
 
Suggestion importance[1-10]: 9

Why: This suggestion addresses a potential runtime error by ensuring selectedChain.token.symbol is defined, which is important for preventing bugs.

9
Add a null check for selectedChain.token to prevent potential runtime errors

Consider adding a null check for selectedChain.token before accessing
selectedChain.token.symbol to prevent runtime errors if selectedChain.token is undefined.

explorer/src/components/Operator/NominationManagement.tsx [136]

-{selectedChain.token.symbol}
+{selectedChain.token?.symbol}
 
Suggestion importance[1-10]: 9

Why: This suggestion addresses a potential runtime error by adding a null check, which is crucial for preventing crashes if selectedChain.token is undefined.

9
Ensure safe handling of potentially null or undefined total

It's a good practice to handle potential null or undefined values for total before
converting it with bigNumberToNumber to prevent runtime errors.

explorer/src/components/Account/AccountRewardGraph.tsx [76]

-{total ? numberWithCommas(bigNumberToNumber(total)) : 0}
+{numberWithCommas(total ? bigNumberToNumber(total) : 0)}
 
Suggestion importance[1-10]: 8

Why: The suggestion ensures safe handling of total before conversion, preventing potential runtime errors, which is important for robustness.

8
Refine the data types for createdAt and updatedAt to prevent potential runtime errors

Consider using a more specific type for the createdAt and updatedAt fields in the
SavedUser interface to ensure they are compatible with the expected usage in FaunaDB
queries. The current use of Expr might be too generic and could lead to runtime errors if
not handled properly.

explorer/next-auth.d.ts [21-24]

 export interface SavedUser extends User {
-  createdAt: Expr
-  updatedAt: Expr
+  createdAt: Date | string
+  updatedAt: Date | string
 }
 
Suggestion importance[1-10]: 7

Why: The suggestion correctly identifies a potential issue with using a generic type that could lead to runtime errors. However, changing the type to Date | string might not fully address the compatibility with FaunaDB queries, which could still require Expr types.

7
Maintainability
Refactor repeated condition checks into a separate function

Refactor the repeated condition checks for !api || !actingAccount || !injector into a
separate function to reduce redundancy and improve code clarity.

explorer/src/components/Operator/ActionsModal.tsx [155-156]

-if (!api || !actingAccount || !injector)
-  return setFormError('We are not able to connect to the blockchain')
+if (checkWalletConnectionError()) return;
 
Suggestion importance[1-10]: 9

Why: This suggestion significantly improves code clarity and maintainability by reducing redundancy. It addresses a common pattern and makes the code easier to manage and understand.

9
Use a common function to format and display currency values

To ensure consistent UI, consider using a common component or function for formatting and
displaying currency values. This will reduce redundancy and centralize formatting logic.

explorer/src/components/Leaderboard/VoteBlockRewardList.tsx [108]

-? `${numberWithCommas(bigNumberToNumber(row.original.vote))} ${selectedChain.token.symbol}`
+? formatCurrency(row.original.vote, selectedChain.token.symbol)
 
Suggestion importance[1-10]: 8

Why: This suggestion enhances maintainability by centralizing the formatting logic, reducing redundancy, and ensuring consistency across the codebase. It is a valuable improvement but not critical.

8
Improve class naming for better readability and maintainability

Consider using a more descriptive class name for the div elements to improve
maintainability and readability of the code. For example, instead of using
'text-purpleShade2' for multiple elements, use specific class names that describe the
content or purpose of each div.

explorer/src/components/Account/AccountLatestRewards.tsx [28-34]

-<div className='text-purpleShade2 flex-1 grow text-[13px] font-normal dark:text-white/75'>
+<div className='block-number flex-1 grow text-[13px] font-normal dark:text-white/75'>
   Block Number
 </div>
-<div className='text-purpleShade2 flex-1 grow text-center text-[13px] font-normal dark:text-white/75'>
+<div className='type-info flex-1 grow text-center text-[13px] font-normal dark:text-white/75'>
   Type
 </div>
-<div className='text-purpleShade2 flex-1 grow text-end text-[13px] font-normal dark:text-white/75'>
+<div className='amount-info flex-1 grow text-end text-[13px] font-normal dark:text-white/75'>
   Amount
 </div>
 
Suggestion importance[1-10]: 7

Why: The suggestion improves code readability and maintainability by using more descriptive class names. However, it is not crucial for functionality.

7
Refactor repeated code into a helper function for formatting amounts with symbols

To improve code readability and reduce redundancy, consider creating a helper function to
format the amount and symbol display, as this pattern is repeated across multiple
components.

explorer/src/components/Account/AccountRewardTable.tsx [104-105]

-{row.original.amount ? bigNumberToNumber(row.original.amount) : 0}{' '}
-{selectedChain.token.symbol}
+{formatAmountWithSymbol(row.original.amount, selectedChain.token.symbol)}
 
Suggestion importance[1-10]: 6

Why: This suggestion improves code readability and maintainability by reducing redundancy, but it is not critical for functionality.

6
Refactor inline styles into a separate CSS class or styled component for better maintainability

To improve the readability and maintainability of the JSX code, consider breaking down
complex inline styles into a separate CSS class or using a styled component.

explorer/src/components/Operator/NominationManagement.tsx [337]

-<div className="dark:from-gradientTwilight dark:via-gradientDusk dark:to-gradientSunset mt-4 flex items-center rounded-lg bg-white p-4 font-['Montserrat'] text-sm dark:border-none dark:bg-gradient-to-r">
+<div className="customGradientStyle">
 
Suggestion importance[1-10]: 6

Why: While this suggestion improves code maintainability and readability, it is not crucial for functionality. It is a good practice for long-term maintenance.

6
Error handling
Centralize error handling for blockchain connection issues

Ensure that the error handling for blockchain connection issues is centralized by creating
a dedicated error handling function. This function can manage various types of errors and
improve the manageability of error states.

explorer/src/components/Operator/ActionsModal.tsx [155-156]

-if (!api || !actingAccount || !injector)
-  return setFormError('We are not able to connect to the blockchain')
+if (!handleBlockchainConnectionError()) return;
 
Suggestion importance[1-10]: 9

Why: Centralizing error handling improves manageability and consistency of error states. This is a crucial improvement for maintainability and ensures that error handling is handled uniformly across the codebase.

9
Possible issue
Verify that all dependencies are included in the useMemo dependency array to ensure correct re-computation

Ensure that the dependency array for useMemo is complete by verifying that all variables
used inside the memoized function are included. This helps avoid bugs where the memoized
value does not update when it should.

explorer/src/components/Operator/NominationManagement.tsx [232]

-}, [selectedChain.urls.page, selectedChain.token.symbol, selectedDomain, action, handleAction])
+}, [selectedChain.urls.page, selectedChain.token.symbol, selectedDomain, action, handleAction, sorting])
 
Suggestion importance[1-10]: 8

Why: Including sorting in the dependency array ensures that the memoized value updates correctly, preventing potential bugs related to stale values.

8
Enhancement
Simplify code by destructuring selectedChain.token in function parameters

Consider destructuring selectedChain.token directly in the function parameters to simplify
the code and improve readability. This change can be applied to all instances where
selectedChain.token.symbol is used.

explorer/src/components/Leaderboard/VoteBlockRewardList.tsx [92]

-? `${numberWithCommas(bigNumberToNumber(row.original.block))} ${selectedChain.token.symbol}`
+? `${numberWithCommas(bigNumberToNumber(row.original.block))} ${tokenSymbol}`
 
Suggestion importance[1-10]: 7

Why: This suggestion improves code readability and maintainability by reducing repetitive access to selectedChain.token.symbol. However, it is not a critical change and does not address any major bugs or issues.

7
Simplify the usage of useDomains by destructuring symbol directly

Consider destructuring selectedChain directly from the useDomains hook to simplify the
code and improve readability.

explorer/src/components/Account/AccountBalanceStats.tsx [14]

-const { selectedChain } = useDomains()
+const { token: { symbol } } = useDomains()
 
Suggestion importance[1-10]: 6

Why: The suggestion improves code readability and simplicity, but it is a minor enhancement and does not address any critical issues.

6

Copy link
Contributor

@EmilFattakhov EmilFattakhov left a comment

Choose a reason for hiding this comment

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

Looks good Marc, thank you for working on the suggestions!

I will drop the list of smallish changes that are required, but given that this PR is enormous already, feel free to address them separately:

  • Subspace Logo when choosing the gemini testnets is left
Screenshot 2024-06-25 at 9 43 47 PM
  • Copyright is outdated, the correct legal name now is "Autonomys Labs Inc".
Screenshot 2024-06-25 at 9 43 53 PM
  • In the footer - link to the website should lead to autonomys.net

  • On Nominators table, there is an extra $ sign for one column
    Screenshot 2024-06-25 at 9 44 31 PM

@marc-aurele-besner marc-aurele-besner merged commit 34ad08a into production Jun 26, 2024
33 of 34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug fix documentation Improvements or additions to documentation enhancement New feature or request Review effort [1-5]: 4
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants