diff --git a/.github/workflows/test_storybook.yml b/.github/workflows/test_storybook.yml index 45c4ca641..88b58a879 100644 --- a/.github/workflows/test_storybook.yml +++ b/.github/workflows/test_storybook.yml @@ -27,7 +27,7 @@ jobs: - name: Install Playwright run: npx playwright install --with-deps - name: Build Storybook - run: NODE_OPTIONS="--max-old-space-size=8046" npm run build-storybook --quiet + run: NODE_OPTIONS="--max-old-space-size=8046" npm run build:storybook --quiet - name: Serve Storybook and run tests run: | npx concurrently -k -s first -n "SB,TEST" -c "magenta,blue" \ diff --git a/CHANGELOG.md b/CHANGELOG.md index e18791a97..10cf8e329 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ changes. ## [Unreleased] +- Added 'sentryenv' field in backend config file [Issue 1401](https://github.com/IntersectMBO/govtool/issues/1401) - Add wallet connector package [Issue 898](https://github.com/IntersectMBO/govtool/issues/898) - Change DRep without metadata name from "Sole Voter" to "Direct Voter" [Issue 880](https://github.com/IntersectMBO/govtool/issues/880) - Inicialize Usersnap into App [Issue 546](https://github.com/IntersectMBO/govtool/issues/546) @@ -65,9 +66,14 @@ changes. - Add PDF pillar [Issue 1090](https://github.com/IntersectMBO/govtool/issues/1090) - Replace govtool-wrapper governance action creation in favor of pdf-pillar [Issue 1284](https://github.com/IntersectMBO/govtool/issues/1284) - Add sentry environment config [Issue 1324](https://github.com/IntersectMBO/govtool/issues/1324) +- Add proposal discussion pillar to home page [Issue 1431](https://github.com/IntersectMBO/govtool/issues/1431) ### Fixed +- silenced `Thread killed by timeout manager` sentry log [Issue 1417](https://github.com/IntersectMBO/govtool/issues/1417) +- silenced `Warp: Client closed connection prematurely` error [Issue 1422](https://github.com/IntersectMBO/govtool/issues/1422) +- backend is now compiled with -threaded [Issue 1148](https://github.com/IntersectMBO/govtool/issues/1148) +- drep/get-voting-power no longer throws 500 for non-existing dreps. Instead it returns 0 [Issue 1093](https://github.com/IntersectMBO/govtool/issues/1093) - proposal/list no longer throws 500 error when proposal's url is incorrect [Issue 1073](https://github.com/IntersectMBO/govtool/issues/1073) - drep/list sql fix (now the drep type is correct) [Issue 957](https://github.com/IntersectMBO/govtool/issues/957) - drep/list sql fix (now the latest tx date is correct) [Issue 826](https://github.com/IntersectMBO/govtool/issues/826) @@ -99,6 +105,7 @@ changes. - Fix validation of the GAs with missing references [Issue 1282](https://github.com/IntersectMBO/govtool/issues/1282) - Fix displaying the GA Markdowns [Issue 1244](https://github.com/IntersectMBO/govtool/issues/1244) - Fix app crash on voting on the GA without the connected wallet before [Issue 1313](https://github.com/IntersectMBO/govtool/issues/1313) +- Fix the navigation to Home from Proposal pillar on disconnected wallet [Issue 1355](https://github.com/IntersectMBO/govtool/issues/1355) ### Changed @@ -131,6 +138,7 @@ changes. - Changed documents to prepare for open source [Issue 737](https://github.com/IntersectMBO/govtool/issues/737) - Changed copy on maintenance page [Issue 753](https://github.com/IntersectMBO/govtool/issues/753) - Update link to docs [Issue 1246](https://github.com/IntersectMBO/govtool/issues/1246) +- Change label of Proposal Discussion nav item [Issue 1349](https://github.com/IntersectMBO/govtool/issues/1349) ### Removed diff --git a/docs/GOVERNANCE_ACTION_SUBMISSION.md b/docs/GOVERNANCE_ACTION_SUBMISSION.md index 1f41a31fd..2262d5ddd 100644 --- a/docs/GOVERNANCE_ACTION_SUBMISSION.md +++ b/docs/GOVERNANCE_ACTION_SUBMISSION.md @@ -144,3 +144,46 @@ await buildSignSubmitConwayCertTx({ ### Step 6: Verify the Governance Action `buildSignSubmitConwayCertTx` logs the transaction CBOR making it able to be tracked on the transactions tools such as cexplorer. + +## Additional steps for using the GovTool metadata validation on the imported Pillar component + +```tsx +enum MetadataValidationStatus { + URL_NOT_FOUND = "URL_NOT_FOUND", + INVALID_JSONLD = "INVALID_JSONLD", + INVALID_HASH = "INVALID_HASH", + INCORRECT_FORMAT = "INCORRECT_FORMAT", +} +// Using the props passed to the component +type Props = { + validateMetadata: ({ + url, + hash, + standard, + }: { + url: string; + hash: string; + standard: "CIP108"; + }) => Promise<{ + metadata?: any; + status?: MetadataValidationStatus; + valid: boolean; + }>; +}; + +import React, { Suspense } from "react"; + +const SomeImportedPillar: React.FC = React.lazy( + () => import("path/to/SomeImportedPillar") +); + +const SomeWrapperComponent = () => { + const { validateMetadata } = useValidateMutation(); + + return ( + I am lazy loading...}> + + + ); +}; +``` diff --git a/govtool/backend/app/Main.hs b/govtool/backend/app/Main.hs index 1385ae1f1..a9f3cc65b 100644 --- a/govtool/backend/app/Main.hs +++ b/govtool/backend/app/Main.hs @@ -143,6 +143,9 @@ exceptionHandler :: VVAConfig -> Maybe Request -> SomeException -> IO () exceptionHandler vvaConfig mRequest exception = do print mRequest print exception + guard (show exception /= "Thread killed by timeout manager") + guard (show exception /= "Warp: Client closed connection prematurely") + let env = sentryEnv vvaConfig sentryService <- initRaven (sentryDSN vvaConfig) @@ -154,7 +157,7 @@ exceptionHandler vvaConfig mRequest exception = do "vva.be" Error (formatMessage mRequest exception) - (recordUpdate mRequest exception) + (recordUpdate env mRequest exception) @@ -162,12 +165,13 @@ formatMessage :: Maybe Request -> SomeException -> String formatMessage Nothing exception = "Exception before request could be parsed: " ++ show exception formatMessage (Just request) exception = "Exception " ++ show exception ++ " while handling request " ++ show request -recordUpdate :: Maybe Request -> SomeException -> SentryRecord -> SentryRecord -recordUpdate Nothing exception record = record -recordUpdate (Just request) exception record = +recordUpdate :: String -> Maybe Request -> SomeException -> SentryRecord -> SentryRecord +recordUpdate env Nothing exception record = record { srEnvironment = Just env } +recordUpdate env (Just request) exception record = record { srCulprit = Just $ unpack $ rawPathInfo request, - srServerName = unpack <$> requestHeaderHost request + srServerName = unpack <$> requestHeaderHost request, + srEnvironment = Just env } shouldDisplayException :: SomeException -> Bool diff --git a/govtool/backend/example-config.json b/govtool/backend/example-config.json index 417afb3c9..d406c8727 100644 --- a/govtool/backend/example-config.json +++ b/govtool/backend/example-config.json @@ -10,6 +10,7 @@ "host" : "localhost", "cachedurationseconds": 20, "sentrydsn": "https://username:password@senty.host/id", + "sentryenv": "dev", "metadatavalidationhost": "localhost", "metadatavalidationport": 3001, "metadatavalidationmaxconcurrentrequests": 10 diff --git a/govtool/backend/src/VVA/Config.hs b/govtool/backend/src/VVA/Config.hs index bb2ba48d1..557e1b319 100644 --- a/govtool/backend/src/VVA/Config.hs +++ b/govtool/backend/src/VVA/Config.hs @@ -80,6 +80,8 @@ data VVAConfigInternal , vVaConfigInternalCacheDurationSeconds :: Int -- | Sentry DSN , vVAConfigInternalSentrydsn :: String + -- | Sentry environment + , vVAConfigInternalSentryEnv :: String -- | Metadata validation service host , vVAConfigInternalMetadataValidationHost :: Text -- | Metadata validation service port @@ -97,6 +99,7 @@ instance DefaultConfig VVAConfigInternal where vVAConfigInternalHost = "localhost", vVaConfigInternalCacheDurationSeconds = 20, vVAConfigInternalSentrydsn = "https://username:password@senty.host/id", + vVAConfigInternalSentryEnv = "development", vVAConfigInternalMetadataValidationHost = "localhost", vVAConfigInternalMetadataValidationPort = 3001, vVAConfigInternalMetadataValidationMaxConcurrentRequests = 10 @@ -115,6 +118,8 @@ data VVAConfig , cacheDurationSeconds :: Int -- | Sentry DSN , sentryDSN :: String + -- | Sentry environment + , sentryEnv :: String -- | Metadata validation service host , metadataValidationHost :: Text -- | Metadata validation service port @@ -161,6 +166,7 @@ convertConfig VVAConfigInternal {..} = serverHost = vVAConfigInternalHost, cacheDurationSeconds = vVaConfigInternalCacheDurationSeconds, sentryDSN = vVAConfigInternalSentrydsn, + sentryEnv = vVAConfigInternalSentryEnv, metadataValidationHost = vVAConfigInternalMetadataValidationHost, metadataValidationPort = vVAConfigInternalMetadataValidationPort, metadataValidationMaxConcurrentRequests = vVAConfigInternalMetadataValidationMaxConcurrentRequests diff --git a/govtool/backend/src/VVA/DRep.hs b/govtool/backend/src/VVA/DRep.hs index 347527337..ce0b031ba 100644 --- a/govtool/backend/src/VVA/DRep.hs +++ b/govtool/backend/src/VVA/DRep.hs @@ -46,10 +46,12 @@ getVotingPower :: Text -> m Integer getVotingPower drepId = withPool $ \conn -> do - [SQL.Only votingPower] <- + result <- liftIO (SQL.query @_ @(SQL.Only Scientific) conn getVotingPowerSql $ SQL.Only drepId) - return $ floor votingPower + case result of + [SQL.Only votingPower] -> return $ floor votingPower + [] -> return 0 listDRepsSql :: SQL.Query listDRepsSql = sqlFrom $(embedFile "sql/list-dreps.sql") diff --git a/govtool/backend/vva-be.cabal b/govtool/backend/vva-be.cabal index 1cea27716..a69b43acb 100644 --- a/govtool/backend/vva-be.cabal +++ b/govtool/backend/vva-be.cabal @@ -70,6 +70,7 @@ executable vva-be hs-source-dirs: app default-language: Haskell2010 + ghc-options: -threaded library hs-source-dirs: src @@ -118,3 +119,4 @@ library , VVA.Types , VVA.Network , VVA.Metadata + ghc-options: -threaded diff --git a/govtool/frontend/package-lock.json b/govtool/frontend/package-lock.json index 3d53d63ab..5a589d515 100644 --- a/govtool/frontend/package-lock.json +++ b/govtool/frontend/package-lock.json @@ -1,12 +1,12 @@ { - "name": "voltaire-voting-app", - "version": "0.0.0", + "name": "govtool", + "version": "1.0.6", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "voltaire-voting-app", - "version": "0.0.0", + "name": "govtool", + "version": "1.0.6", "hasInstallScript": true, "dependencies": { "@emotion/react": "^11.11.1", @@ -14,15 +14,12 @@ "@emurgo/cardano-serialization-lib-asmjs": "12.0.0-alpha.29", "@hookform/resolvers": "^3.3.1", "@intersect.mbo/intersectmbo.org-icons-set": "^1.0.8", - "@intersect.mbo/pdf-ui": "^0.1.9", + "@intersect.mbo/pdf-ui": "^0.2.1", "@mui/icons-material": "^5.14.3", "@mui/material": "^5.14.4", "@rollup/plugin-babel": "^6.0.4", "@rollup/pluginutils": "^5.1.0", "@sentry/react": "^7.77.0", - "@types/jsonld": "^1.5.13", - "@types/react": "^18.2.12", - "@types/react-gtm-module": "^2.0.2", "@usersnap/browser": "^0.0.5", "axios": "^1.4.0", "bech32": "^2.0.0", @@ -64,7 +61,9 @@ "@testing-library/user-event": "^14.5.2", "@types/jsonld": "^1.5.13", "@types/node": "^20.4.8", + "@types/react": "^18.2.12", "@types/react-dom": "^18.0.11", + "@types/react-gtm-module": "^2.0.2", "@typescript-eslint/eslint-plugin": "^7.3.1", "@typescript-eslint/parser": "^7.3.1", "@vitejs/plugin-react": "^4.3.0", @@ -3346,14 +3345,15 @@ "integrity": "sha512-Y+5vYGlF3Smg/QscQT/4ZwsKTNm2C0GCs2czzYWrE4O4RV2YAAg9MZkQ52u8uZp3cEW0h9vr+f9W9ihhwsNHGQ==" }, "node_modules/@intersect.mbo/pdf-ui": { - "version": "0.1.9", - "resolved": "https://registry.npmjs.org/@intersect.mbo/pdf-ui/-/pdf-ui-0.1.9.tgz", - "integrity": "sha512-bP235xVVycjqKQRvECJNvTDYHJ9Lo0CHr+6T1kD0GRHzDEx8tBXAxewv0bMmg/tzVYApWeGvLNaQXR6xJfxl/g==", + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/@intersect.mbo/pdf-ui/-/pdf-ui-0.2.1.tgz", + "integrity": "sha512-I4VWKlZC/VGcxsoqlWA3/9S2h3LuqGs5vR0cTy8t1r6LJbUnbt+wq+d+aC5w7bxFTE/yeMSSylJlGtDHs/VYaA==", "dependencies": { "@fontsource/poppins": "^5.0.14", "@intersect.mbo/intersectmbo.org-icons-set": "^1.0.8", "axios": "^1.7.2", "date-fns": "^3.6.0", + "react-markdown": "^8.0.6", "react-slick": "^0.30.2", "slick-carousel": "^1.8.1", "web-vitals": "^2.1.4" @@ -3369,6 +3369,22 @@ "sass": "^1.77.2" } }, + "node_modules/@intersect.mbo/pdf-ui/node_modules/@types/hast": { + "version": "2.3.10", + "resolved": "https://registry.npmjs.org/@types/hast/-/hast-2.3.10.tgz", + "integrity": "sha512-McWspRw8xx8J9HurkVBfYj0xKoE25tOFlHGdx4MJ5xORQrMGZNqJhVQWaIbm6Oyla5kYOXtDiopzKRJzEOkwJw==", + "dependencies": { + "@types/unist": "^2" + } + }, + "node_modules/@intersect.mbo/pdf-ui/node_modules/@types/mdast": { + "version": "3.0.15", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-3.0.15.tgz", + "integrity": "sha512-LnwD+mUEfxWMa1QpDraczIn6k0Ee3SMicuYSSzS6ZYl2gKS09EClnJYGd8Du6rfc5r/GZEk5o1mRb8TaTj03sQ==", + "dependencies": { + "@types/unist": "^2" + } + }, "node_modules/@intersect.mbo/pdf-ui/node_modules/date-fns": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-3.6.0.tgz", @@ -3378,6 +3394,705 @@ "url": "https://github.com/sponsors/kossnocorp" } }, + "node_modules/@intersect.mbo/pdf-ui/node_modules/hast-util-whitespace": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/hast-util-whitespace/-/hast-util-whitespace-2.0.1.tgz", + "integrity": "sha512-nAxA0v8+vXSBDt3AnRUNjyRIQ0rD+ntpbAp4LnPkumc5M9yUbSMa4XDU9Q6etY4f1Wp4bNgvc1yjiZtsTTrSng==", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/@intersect.mbo/pdf-ui/node_modules/inline-style-parser": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/inline-style-parser/-/inline-style-parser-0.1.1.tgz", + "integrity": "sha512-7NXolsK4CAS5+xvdj5OMMbI962hU/wvwoxk+LWR9Ek9bVtyuuYScDN6eS0rUm6TxApFpw7CX1o4uJzcd4AyD3Q==" + }, + "node_modules/@intersect.mbo/pdf-ui/node_modules/is-plain-obj": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.1.0.tgz", + "integrity": "sha512-+Pgi+vMuUNkJyExiMBt5IlFoMyKnr5zhJ4Uspz58WOhBF5QoIZkFyNHIbBAtHwzVAgk5RtndVNsDRN61/mmDqg==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@intersect.mbo/pdf-ui/node_modules/mdast-util-definitions": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/mdast-util-definitions/-/mdast-util-definitions-5.1.2.tgz", + "integrity": "sha512-8SVPMuHqlPME/z3gqVwWY4zVXn8lqKv/pAhC57FuJ40ImXyBpmO5ukh98zB2v7Blql2FiHjHv9LVztSIqjY+MA==", + "dependencies": { + "@types/mdast": "^3.0.0", + "@types/unist": "^2.0.0", + "unist-util-visit": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/@intersect.mbo/pdf-ui/node_modules/mdast-util-from-markdown": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/mdast-util-from-markdown/-/mdast-util-from-markdown-1.3.1.tgz", + "integrity": "sha512-4xTO/M8c82qBcnQc1tgpNtubGUW/Y1tBQ1B0i5CtSoelOLKFYlElIr3bvgREYYO5iRqbMY1YuqZng0GVOI8Qww==", + "dependencies": { + "@types/mdast": "^3.0.0", + "@types/unist": "^2.0.0", + "decode-named-character-reference": "^1.0.0", + "mdast-util-to-string": "^3.1.0", + "micromark": "^3.0.0", + "micromark-util-decode-numeric-character-reference": "^1.0.0", + "micromark-util-decode-string": "^1.0.0", + "micromark-util-normalize-identifier": "^1.0.0", + "micromark-util-symbol": "^1.0.0", + "micromark-util-types": "^1.0.0", + "unist-util-stringify-position": "^3.0.0", + "uvu": "^0.5.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/@intersect.mbo/pdf-ui/node_modules/mdast-util-to-hast": { + "version": "12.3.0", + "resolved": "https://registry.npmjs.org/mdast-util-to-hast/-/mdast-util-to-hast-12.3.0.tgz", + "integrity": "sha512-pits93r8PhnIoU4Vy9bjW39M2jJ6/tdHyja9rrot9uujkN7UTU9SDnE6WNJz/IGyQk3XHX6yNNtrBH6cQzm8Hw==", + "dependencies": { + "@types/hast": "^2.0.0", + "@types/mdast": "^3.0.0", + "mdast-util-definitions": "^5.0.0", + "micromark-util-sanitize-uri": "^1.1.0", + "trim-lines": "^3.0.0", + "unist-util-generated": "^2.0.0", + "unist-util-position": "^4.0.0", + "unist-util-visit": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/@intersect.mbo/pdf-ui/node_modules/mdast-util-to-string": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/mdast-util-to-string/-/mdast-util-to-string-3.2.0.tgz", + "integrity": "sha512-V4Zn/ncyN1QNSqSBxTrMOLpjr+IKdHl2v3KVLoWmDPscP4r9GcCi71gjgvUV1SFSKh92AjAG4peFuBl2/YgCJg==", + "dependencies": { + "@types/mdast": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/@intersect.mbo/pdf-ui/node_modules/micromark": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/micromark/-/micromark-3.2.0.tgz", + "integrity": "sha512-uD66tJj54JLYq0De10AhWycZWGQNUvDI55xPgk2sQM5kn1JYlhbCMTtEeT27+vAhW2FBQxLlOmS3pmA7/2z4aA==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "dependencies": { + "@types/debug": "^4.0.0", + "debug": "^4.0.0", + "decode-named-character-reference": "^1.0.0", + "micromark-core-commonmark": "^1.0.1", + "micromark-factory-space": "^1.0.0", + "micromark-util-character": "^1.0.0", + "micromark-util-chunked": "^1.0.0", + "micromark-util-combine-extensions": "^1.0.0", + "micromark-util-decode-numeric-character-reference": "^1.0.0", + "micromark-util-encode": "^1.0.0", + "micromark-util-normalize-identifier": "^1.0.0", + "micromark-util-resolve-all": "^1.0.0", + "micromark-util-sanitize-uri": "^1.0.0", + "micromark-util-subtokenize": "^1.0.0", + "micromark-util-symbol": "^1.0.0", + "micromark-util-types": "^1.0.1", + "uvu": "^0.5.0" + } + }, + "node_modules/@intersect.mbo/pdf-ui/node_modules/micromark-core-commonmark": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/micromark-core-commonmark/-/micromark-core-commonmark-1.1.0.tgz", + "integrity": "sha512-BgHO1aRbolh2hcrzL2d1La37V0Aoz73ymF8rAcKnohLy93titmv62E0gP8Hrx9PKcKrqCZ1BbLGbP3bEhoXYlw==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "dependencies": { + "decode-named-character-reference": "^1.0.0", + "micromark-factory-destination": "^1.0.0", + "micromark-factory-label": "^1.0.0", + "micromark-factory-space": "^1.0.0", + "micromark-factory-title": "^1.0.0", + "micromark-factory-whitespace": "^1.0.0", + "micromark-util-character": "^1.0.0", + "micromark-util-chunked": "^1.0.0", + "micromark-util-classify-character": "^1.0.0", + "micromark-util-html-tag-name": "^1.0.0", + "micromark-util-normalize-identifier": "^1.0.0", + "micromark-util-resolve-all": "^1.0.0", + "micromark-util-subtokenize": "^1.0.0", + "micromark-util-symbol": "^1.0.0", + "micromark-util-types": "^1.0.1", + "uvu": "^0.5.0" + } + }, + "node_modules/@intersect.mbo/pdf-ui/node_modules/micromark-factory-destination": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/micromark-factory-destination/-/micromark-factory-destination-1.1.0.tgz", + "integrity": "sha512-XaNDROBgx9SgSChd69pjiGKbV+nfHGDPVYFs5dOoDd7ZnMAE+Cuu91BCpsY8RT2NP9vo/B8pds2VQNCLiu0zhg==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "dependencies": { + "micromark-util-character": "^1.0.0", + "micromark-util-symbol": "^1.0.0", + "micromark-util-types": "^1.0.0" + } + }, + "node_modules/@intersect.mbo/pdf-ui/node_modules/micromark-factory-label": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/micromark-factory-label/-/micromark-factory-label-1.1.0.tgz", + "integrity": "sha512-OLtyez4vZo/1NjxGhcpDSbHQ+m0IIGnT8BoPamh+7jVlzLJBH98zzuCoUeMxvM6WsNeh8wx8cKvqLiPHEACn0w==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "dependencies": { + "micromark-util-character": "^1.0.0", + "micromark-util-symbol": "^1.0.0", + "micromark-util-types": "^1.0.0", + "uvu": "^0.5.0" + } + }, + "node_modules/@intersect.mbo/pdf-ui/node_modules/micromark-factory-space": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/micromark-factory-space/-/micromark-factory-space-1.1.0.tgz", + "integrity": "sha512-cRzEj7c0OL4Mw2v6nwzttyOZe8XY/Z8G0rzmWQZTBi/jjwyw/U4uqKtUORXQrR5bAZZnbTI/feRV/R7hc4jQYQ==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "dependencies": { + "micromark-util-character": "^1.0.0", + "micromark-util-types": "^1.0.0" + } + }, + "node_modules/@intersect.mbo/pdf-ui/node_modules/micromark-factory-title": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/micromark-factory-title/-/micromark-factory-title-1.1.0.tgz", + "integrity": "sha512-J7n9R3vMmgjDOCY8NPw55jiyaQnH5kBdV2/UXCtZIpnHH3P6nHUKaH7XXEYuWwx/xUJcawa8plLBEjMPU24HzQ==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "dependencies": { + "micromark-factory-space": "^1.0.0", + "micromark-util-character": "^1.0.0", + "micromark-util-symbol": "^1.0.0", + "micromark-util-types": "^1.0.0" + } + }, + "node_modules/@intersect.mbo/pdf-ui/node_modules/micromark-factory-whitespace": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/micromark-factory-whitespace/-/micromark-factory-whitespace-1.1.0.tgz", + "integrity": "sha512-v2WlmiymVSp5oMg+1Q0N1Lxmt6pMhIHD457whWM7/GUlEks1hI9xj5w3zbc4uuMKXGisksZk8DzP2UyGbGqNsQ==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "dependencies": { + "micromark-factory-space": "^1.0.0", + "micromark-util-character": "^1.0.0", + "micromark-util-symbol": "^1.0.0", + "micromark-util-types": "^1.0.0" + } + }, + "node_modules/@intersect.mbo/pdf-ui/node_modules/micromark-util-character": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-1.2.0.tgz", + "integrity": "sha512-lXraTwcX3yH/vMDaFWCQJP1uIszLVebzUa3ZHdrgxr7KEU/9mL4mVgCpGbyhvNLNlauROiNUq7WN5u7ndbY6xg==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "dependencies": { + "micromark-util-symbol": "^1.0.0", + "micromark-util-types": "^1.0.0" + } + }, + "node_modules/@intersect.mbo/pdf-ui/node_modules/micromark-util-chunked": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/micromark-util-chunked/-/micromark-util-chunked-1.1.0.tgz", + "integrity": "sha512-Ye01HXpkZPNcV6FiyoW2fGZDUw4Yc7vT0E9Sad83+bEDiCJ1uXu0S3mr8WLpsz3HaG3x2q0HM6CTuPdcZcluFQ==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "dependencies": { + "micromark-util-symbol": "^1.0.0" + } + }, + "node_modules/@intersect.mbo/pdf-ui/node_modules/micromark-util-classify-character": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/micromark-util-classify-character/-/micromark-util-classify-character-1.1.0.tgz", + "integrity": "sha512-SL0wLxtKSnklKSUplok1WQFoGhUdWYKggKUiqhX+Swala+BtptGCu5iPRc+xvzJ4PXE/hwM3FNXsfEVgoZsWbw==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "dependencies": { + "micromark-util-character": "^1.0.0", + "micromark-util-symbol": "^1.0.0", + "micromark-util-types": "^1.0.0" + } + }, + "node_modules/@intersect.mbo/pdf-ui/node_modules/micromark-util-combine-extensions": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/micromark-util-combine-extensions/-/micromark-util-combine-extensions-1.1.0.tgz", + "integrity": "sha512-Q20sp4mfNf9yEqDL50WwuWZHUrCO4fEyeDCnMGmG5Pr0Cz15Uo7KBs6jq+dq0EgX4DPwwrh9m0X+zPV1ypFvUA==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "dependencies": { + "micromark-util-chunked": "^1.0.0", + "micromark-util-types": "^1.0.0" + } + }, + "node_modules/@intersect.mbo/pdf-ui/node_modules/micromark-util-decode-numeric-character-reference": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/micromark-util-decode-numeric-character-reference/-/micromark-util-decode-numeric-character-reference-1.1.0.tgz", + "integrity": "sha512-m9V0ExGv0jB1OT21mrWcuf4QhP46pH1KkfWy9ZEezqHKAxkj4mPCy3nIH1rkbdMlChLHX531eOrymlwyZIf2iw==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "dependencies": { + "micromark-util-symbol": "^1.0.0" + } + }, + "node_modules/@intersect.mbo/pdf-ui/node_modules/micromark-util-decode-string": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/micromark-util-decode-string/-/micromark-util-decode-string-1.1.0.tgz", + "integrity": "sha512-YphLGCK8gM1tG1bd54azwyrQRjCFcmgj2S2GoJDNnh4vYtnL38JS8M4gpxzOPNyHdNEpheyWXCTnnTDY3N+NVQ==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "dependencies": { + "decode-named-character-reference": "^1.0.0", + "micromark-util-character": "^1.0.0", + "micromark-util-decode-numeric-character-reference": "^1.0.0", + "micromark-util-symbol": "^1.0.0" + } + }, + "node_modules/@intersect.mbo/pdf-ui/node_modules/micromark-util-encode": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/micromark-util-encode/-/micromark-util-encode-1.1.0.tgz", + "integrity": "sha512-EuEzTWSTAj9PA5GOAs992GzNh2dGQO52UvAbtSOMvXTxv3Criqb6IOzJUBCmEqrrXSblJIJBbFFv6zPxpreiJw==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ] + }, + "node_modules/@intersect.mbo/pdf-ui/node_modules/micromark-util-html-tag-name": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/micromark-util-html-tag-name/-/micromark-util-html-tag-name-1.2.0.tgz", + "integrity": "sha512-VTQzcuQgFUD7yYztuQFKXT49KghjtETQ+Wv/zUjGSGBioZnkA4P1XXZPT1FHeJA6RwRXSF47yvJ1tsJdoxwO+Q==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ] + }, + "node_modules/@intersect.mbo/pdf-ui/node_modules/micromark-util-normalize-identifier": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/micromark-util-normalize-identifier/-/micromark-util-normalize-identifier-1.1.0.tgz", + "integrity": "sha512-N+w5vhqrBihhjdpM8+5Xsxy71QWqGn7HYNUvch71iV2PM7+E3uWGox1Qp90loa1ephtCxG2ftRV/Conitc6P2Q==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "dependencies": { + "micromark-util-symbol": "^1.0.0" + } + }, + "node_modules/@intersect.mbo/pdf-ui/node_modules/micromark-util-resolve-all": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/micromark-util-resolve-all/-/micromark-util-resolve-all-1.1.0.tgz", + "integrity": "sha512-b/G6BTMSg+bX+xVCshPTPyAu2tmA0E4X98NSR7eIbeC6ycCqCeE7wjfDIgzEbkzdEVJXRtOG4FbEm/uGbCRouA==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "dependencies": { + "micromark-util-types": "^1.0.0" + } + }, + "node_modules/@intersect.mbo/pdf-ui/node_modules/micromark-util-sanitize-uri": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/micromark-util-sanitize-uri/-/micromark-util-sanitize-uri-1.2.0.tgz", + "integrity": "sha512-QO4GXv0XZfWey4pYFndLUKEAktKkG5kZTdUNaTAkzbuJxn2tNBOr+QtxR2XpWaMhbImT2dPzyLrPXLlPhph34A==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "dependencies": { + "micromark-util-character": "^1.0.0", + "micromark-util-encode": "^1.0.0", + "micromark-util-symbol": "^1.0.0" + } + }, + "node_modules/@intersect.mbo/pdf-ui/node_modules/micromark-util-subtokenize": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/micromark-util-subtokenize/-/micromark-util-subtokenize-1.1.0.tgz", + "integrity": "sha512-kUQHyzRoxvZO2PuLzMt2P/dwVsTiivCK8icYTeR+3WgbuPqfHgPPy7nFKbeqRivBvn/3N3GBiNC+JRTMSxEC7A==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "dependencies": { + "micromark-util-chunked": "^1.0.0", + "micromark-util-symbol": "^1.0.0", + "micromark-util-types": "^1.0.0", + "uvu": "^0.5.0" + } + }, + "node_modules/@intersect.mbo/pdf-ui/node_modules/micromark-util-symbol": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/micromark-util-symbol/-/micromark-util-symbol-1.1.0.tgz", + "integrity": "sha512-uEjpEYY6KMs1g7QfJ2eX1SQEV+ZT4rUD3UcF6l57acZvLNK7PBZL+ty82Z1qhK1/yXIY4bdx04FKMgR0g4IAag==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ] + }, + "node_modules/@intersect.mbo/pdf-ui/node_modules/micromark-util-types": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/micromark-util-types/-/micromark-util-types-1.1.0.tgz", + "integrity": "sha512-ukRBgie8TIAcacscVHSiddHjO4k/q3pnedmzMQ4iwDcK0FtFCohKOlFbaOL/mPgfnPsL3C1ZyxJa4sbWrBl3jg==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ] + }, + "node_modules/@intersect.mbo/pdf-ui/node_modules/react-markdown": { + "version": "8.0.7", + "resolved": "https://registry.npmjs.org/react-markdown/-/react-markdown-8.0.7.tgz", + "integrity": "sha512-bvWbzG4MtOU62XqBx3Xx+zB2raaFFsq4mYiAzfjXJMEz2sixgeAfraA3tvzULF02ZdOMUOKTBFFaZJDDrq+BJQ==", + "dependencies": { + "@types/hast": "^2.0.0", + "@types/prop-types": "^15.0.0", + "@types/unist": "^2.0.0", + "comma-separated-tokens": "^2.0.0", + "hast-util-whitespace": "^2.0.0", + "prop-types": "^15.0.0", + "property-information": "^6.0.0", + "react-is": "^18.0.0", + "remark-parse": "^10.0.0", + "remark-rehype": "^10.0.0", + "space-separated-tokens": "^2.0.0", + "style-to-object": "^0.4.0", + "unified": "^10.0.0", + "unist-util-visit": "^4.0.0", + "vfile": "^5.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + }, + "peerDependencies": { + "@types/react": ">=16", + "react": ">=16" + } + }, + "node_modules/@intersect.mbo/pdf-ui/node_modules/remark-parse": { + "version": "10.0.2", + "resolved": "https://registry.npmjs.org/remark-parse/-/remark-parse-10.0.2.tgz", + "integrity": "sha512-3ydxgHa/ZQzG8LvC7jTXccARYDcRld3VfcgIIFs7bI6vbRSxJJmzgLEIIoYKyrfhaY+ujuWaf/PJiMZXoiCXgw==", + "dependencies": { + "@types/mdast": "^3.0.0", + "mdast-util-from-markdown": "^1.0.0", + "unified": "^10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/@intersect.mbo/pdf-ui/node_modules/remark-rehype": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/remark-rehype/-/remark-rehype-10.1.0.tgz", + "integrity": "sha512-EFmR5zppdBp0WQeDVZ/b66CWJipB2q2VLNFMabzDSGR66Z2fQii83G5gTBbgGEnEEA0QRussvrFHxk1HWGJskw==", + "dependencies": { + "@types/hast": "^2.0.0", + "@types/mdast": "^3.0.0", + "mdast-util-to-hast": "^12.1.0", + "unified": "^10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/@intersect.mbo/pdf-ui/node_modules/space-separated-tokens": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/space-separated-tokens/-/space-separated-tokens-2.0.2.tgz", + "integrity": "sha512-PEGlAwrG8yXGXRjW32fGbg66JAlOAwbObuqVoJpv/mRgoWDQfgH1wDPvtzWyUSNAXBGSk8h755YDbbcEy3SH2Q==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/@intersect.mbo/pdf-ui/node_modules/style-to-object": { + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/style-to-object/-/style-to-object-0.4.4.tgz", + "integrity": "sha512-HYNoHZa2GorYNyqiCaBgsxvcJIn7OHq6inEga+E6Ke3m5JkoqpQbnFssk4jwe+K7AhGa2fcha4wSOf1Kn01dMg==", + "dependencies": { + "inline-style-parser": "0.1.1" + } + }, + "node_modules/@intersect.mbo/pdf-ui/node_modules/unified": { + "version": "10.1.2", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.2.tgz", + "integrity": "sha512-pUSWAi/RAnVy1Pif2kAoeWNBa3JVrx0MId2LASj8G+7AiHWoKZNTomq6LG326T68U7/e263X6fTdcXIy7XnF7Q==", + "dependencies": { + "@types/unist": "^2.0.0", + "bail": "^2.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^5.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/@intersect.mbo/pdf-ui/node_modules/unist-util-is": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.2.1.tgz", + "integrity": "sha512-u9njyyfEh43npf1M+yGKDGVPbY/JWEemg5nH05ncKPfi+kBbKBJoTdsogMu33uhytuLlv9y0O7GH7fEdwLdLQw==", + "dependencies": { + "@types/unist": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/@intersect.mbo/pdf-ui/node_modules/unist-util-position": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-4.0.4.tgz", + "integrity": "sha512-kUBE91efOWfIVBo8xzh/uZQ7p9ffYRtUbMRZBNFYwf0RK8koUMx6dGUfwylLOKmaT2cs4wSW96QoYUSXAyEtpg==", + "dependencies": { + "@types/unist": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/@intersect.mbo/pdf-ui/node_modules/unist-util-stringify-position": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-3.0.3.tgz", + "integrity": "sha512-k5GzIBZ/QatR8N5X2y+drfpWG8IDBzdnVj6OInRNWm1oXrzydiaAT2OQiA8DPRRZyAKb9b6I2a6PxYklZD0gKg==", + "dependencies": { + "@types/unist": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/@intersect.mbo/pdf-ui/node_modules/unist-util-visit": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-4.1.2.tgz", + "integrity": "sha512-MSd8OUGISqHdVvfY9TPhyK2VdUrPgxkUtWSuMHF6XAAFuL4LokseigBnZtPnJMu+FbynTkFNnFlyjxpVKujMRg==", + "dependencies": { + "@types/unist": "^2.0.0", + "unist-util-is": "^5.0.0", + "unist-util-visit-parents": "^5.1.1" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/@intersect.mbo/pdf-ui/node_modules/unist-util-visit-parents": { + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-5.1.3.tgz", + "integrity": "sha512-x6+y8g7wWMyQhL1iZfhIPhDAs7Xwbn9nRosDXl7qoPTSCy0yNxnKc+hWokFifWQIDGi154rdUqKvbCa4+1kLhg==", + "dependencies": { + "@types/unist": "^2.0.0", + "unist-util-is": "^5.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/@intersect.mbo/pdf-ui/node_modules/vfile": { + "version": "5.3.7", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-5.3.7.tgz", + "integrity": "sha512-r7qlzkgErKjobAmyNIkkSpizsFPYiUPuJb5pNW1RB4JcYVZhs4lIbVqk8XPk033CV/1z8ss5pkax8SuhGpcG8g==", + "dependencies": { + "@types/unist": "^2.0.0", + "is-buffer": "^2.0.0", + "unist-util-stringify-position": "^3.0.0", + "vfile-message": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/@intersect.mbo/pdf-ui/node_modules/vfile-message": { + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-3.1.4.tgz", + "integrity": "sha512-fa0Z6P8HUrQN4BZaX05SIVXic+7kE3b05PWAtPuYP9QLHsLKYR7/AlLW3NtOrpXRLeawpDLMsVkmk5DG0NXgWw==", + "dependencies": { + "@types/unist": "^2.0.0", + "unist-util-stringify-position": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/@isaacs/cliui": { "version": "8.0.2", "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", @@ -9696,7 +10411,8 @@ "node_modules/@types/react-gtm-module": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/@types/react-gtm-module/-/react-gtm-module-2.0.3.tgz", - "integrity": "sha512-fL2zKdDFN5LckSsVBXEhhm9M4tFTM9oHJfGcfZJzktQkzpOTGtDM8oXIP9d9UBDxO4xLNZhS22dlgRVv6wgK9w==" + "integrity": "sha512-fL2zKdDFN5LckSsVBXEhhm9M4tFTM9oHJfGcfZJzktQkzpOTGtDM8oXIP9d9UBDxO4xLNZhS22dlgRVv6wgK9w==", + "dev": true }, "node_modules/@types/react-transition-group": { "version": "4.4.10", @@ -14025,6 +14741,14 @@ "integrity": "sha512-gxtyfqMg7GKyhQmb056K7M3xszy/myH8w+B4RT+QXBQsvAOdc3XymqDDPHx1BgPgsdAA5SIifona89YtRATDzw==", "peer": true }, + "node_modules/diff": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-5.2.0.tgz", + "integrity": "sha512-uIFDxqpRZGZ6ThOk84hEfqWoHx2devRFvpTZcTHur85vImfaxUbTW9Ryh4CpCuDnToOP1CEtXKIgytHBPVff5A==", + "engines": { + "node": ">=0.3.1" + } + }, "node_modules/diff-sequences": { "version": "29.6.3", "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.6.3.tgz", @@ -18567,6 +19291,28 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-buffer": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.5.tgz", + "integrity": "sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "engines": { + "node": ">=4" + } + }, "node_modules/is-callable": { "version": "1.2.7", "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", @@ -24373,6 +25119,14 @@ "node": ">=0.4.0" } }, + "node_modules/mri": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/mri/-/mri-1.2.0.tgz", + "integrity": "sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==", + "engines": { + "node": ">=4" + } + }, "node_modules/mrmime": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/mrmime/-/mrmime-2.0.0.tgz", @@ -30882,6 +31636,17 @@ "tslib": "^2.1.0" } }, + "node_modules/sade": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/sade/-/sade-1.8.1.tgz", + "integrity": "sha512-xal3CZX1Xlo/k4ApwCFrHVACi9fBqJ7V+mwhBsuf/1IOKbBy098Fex+Wa/5QMubw09pSZ/u8EY8PWgevJsXp1A==", + "dependencies": { + "mri": "^1.1.0" + }, + "engines": { + "node": ">=6" + } + }, "node_modules/safe-array-concat": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.1.2.tgz", @@ -33389,6 +34154,15 @@ "node": ">=8" } }, + "node_modules/unist-util-generated": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/unist-util-generated/-/unist-util-generated-2.0.1.tgz", + "integrity": "sha512-qF72kLmPxAw0oN2fwpWIqbXAVyEqUzDHMsbtPvOudIlUzXYFIeQIuxXQCRCFh22B7cixvU0MG7m3MW8FTq/S+A==", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/unist-util-is": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-4.1.0.tgz", @@ -33757,6 +34531,31 @@ "uuid": "dist/bin/uuid" } }, + "node_modules/uvu": { + "version": "0.5.6", + "resolved": "https://registry.npmjs.org/uvu/-/uvu-0.5.6.tgz", + "integrity": "sha512-+g8ENReyr8YsOc6fv/NVJs2vFdHBnBNdfE49rshrTzDWOlUx4Gq7KOS2GD8eqhy2j+Ejq29+SbKH8yjkAqXqoA==", + "dependencies": { + "dequal": "^2.0.0", + "diff": "^5.0.0", + "kleur": "^4.0.3", + "sade": "^1.7.3" + }, + "bin": { + "uvu": "bin.js" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/uvu/node_modules/kleur": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/kleur/-/kleur-4.1.5.tgz", + "integrity": "sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ==", + "engines": { + "node": ">=6" + } + }, "node_modules/v8-to-istanbul": { "version": "9.2.0", "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.2.0.tgz", diff --git a/govtool/frontend/package.json b/govtool/frontend/package.json index 0c62659b1..a6739f5e8 100644 --- a/govtool/frontend/package.json +++ b/govtool/frontend/package.json @@ -1,11 +1,11 @@ { - "name": "voltaire-voting-app", + "name": "govtool", "private": true, - "version": "0.0.0", + "version": "1.0.6", "type": "module", "scripts": { "build": "vite build", - "build-storybook": "storybook build", + "build:storybook": "storybook build", "chromatic": "chromatic", "dev": "vite", "format": "prettier --write src", @@ -28,15 +28,12 @@ "@emurgo/cardano-serialization-lib-asmjs": "12.0.0-alpha.29", "@hookform/resolvers": "^3.3.1", "@intersect.mbo/intersectmbo.org-icons-set": "^1.0.8", - "@intersect.mbo/pdf-ui": "^0.1.9", + "@intersect.mbo/pdf-ui": "^0.2.1", "@mui/icons-material": "^5.14.3", "@mui/material": "^5.14.4", "@rollup/plugin-babel": "^6.0.4", "@rollup/pluginutils": "^5.1.0", "@sentry/react": "^7.77.0", - "@types/jsonld": "^1.5.13", - "@types/react": "^18.2.12", - "@types/react-gtm-module": "^2.0.2", "@usersnap/browser": "^0.0.5", "axios": "^1.4.0", "bech32": "^2.0.0", @@ -78,7 +75,9 @@ "@testing-library/user-event": "^14.5.2", "@types/jsonld": "^1.5.13", "@types/node": "^20.4.8", + "@types/react": "^18.2.12", "@types/react-dom": "^18.0.11", + "@types/react-gtm-module": "^2.0.2", "@typescript-eslint/eslint-plugin": "^7.3.1", "@typescript-eslint/parser": "^7.3.1", "@vitejs/plugin-react": "^4.3.0", @@ -107,5 +106,5 @@ "typescript": "^5.0.2" }, "readme": "ERROR: No README data found!", - "_id": "voltaire-voting-app@0.0.0" + "_id": "govtool@1.0.6" } diff --git a/govtool/frontend/src/App.tsx b/govtool/frontend/src/App.tsx index c1756cdae..9a8479522 100644 --- a/govtool/frontend/src/App.tsx +++ b/govtool/frontend/src/App.tsx @@ -1,5 +1,6 @@ import { useCallback, useEffect } from "react"; import { Route, Routes, useNavigate } from "react-router-dom"; + import { Modal, ScrollToTop } from "@atoms"; import { PATHS, PDF_PATHS } from "@consts"; import { useCardano, useFeatureFlag, useModal } from "@context"; @@ -27,6 +28,7 @@ import { RetireAsDrep, RetireAsDirectVoter, EditDRepMetadata, + ProposalDiscussionPillar, } from "@pages"; import { SetupInterceptors } from "@services"; import { @@ -36,8 +38,6 @@ import { removeItemFromLocalStorage, } from "@utils"; -import { PDFWrapper } from "./components/organisms/PDFWrapper"; - export default () => { const { isProposalDiscussionForumEnabled } = useFeatureFlag(); const { enable, isEnabled } = useCardano(); @@ -80,6 +80,8 @@ export default () => { checkTheWalletIsActive(); }, [checkTheWalletIsActive]); + // Proposal Discussion Pillar doesn't export pages or react router routes + // so we need to handle the routing here useEffect(() => { if (!isProposalDiscussionForumEnabled) return; if ( @@ -101,9 +103,6 @@ export default () => { } /> } /> - {isProposalDiscussionForumEnabled && !isEnabled && ( - } /> - )} } @@ -112,12 +111,18 @@ export default () => { path={PATHS.governanceActionsAction} element={} /> + {isProposalDiscussionForumEnabled && !isEnabled && ( + } + /> + )} }> } /> {isProposalDiscussionForumEnabled && ( } + element={} /> )} { ); const copyButton = screen.getByTestId("copy-button"); - await userEvent.click(copyButton); - expect(navigator.clipboard.writeText).toHaveBeenCalledWith("Example Text"); - expect(screen.getByText("alerts.copiedToClipboard")).toBeInTheDocument(); + await act(async () => { + await userEvent.click(copyButton); + }); + + expect(navigator.clipboard.writeText).toHaveBeenCalledWith("Example Text"); }); }); diff --git a/govtool/frontend/src/components/atoms/DrawerLink.tsx b/govtool/frontend/src/components/atoms/DrawerLink.tsx index e35bcdb0d..94848be2c 100644 --- a/govtool/frontend/src/components/atoms/DrawerLink.tsx +++ b/govtool/frontend/src/components/atoms/DrawerLink.tsx @@ -17,7 +17,7 @@ type LinkProps = { const isRouteActive = (isActive: boolean, route: string) => isActive || (route === - `${PATHS.connectedProposalPillar.replace("/*", "")}${ + `${PATHS.proposalPillar.replace("/*", "")}${ PDF_PATHS.proposalDiscussion }` && Object.values(PDF_PATHS).some((pdfPath) => diff --git a/govtool/frontend/src/components/atoms/modal/Modal.tsx b/govtool/frontend/src/components/atoms/modal/Modal.tsx index 4c88d99f8..9eb5ca08f 100644 --- a/govtool/frontend/src/components/atoms/modal/Modal.tsx +++ b/govtool/frontend/src/components/atoms/modal/Modal.tsx @@ -1,3 +1,4 @@ +import { DialogContent } from "@mui/material"; import MuiModal from "@mui/material/Modal"; import type { ComponentProps } from "react"; @@ -11,6 +12,6 @@ interface Props { export const Modal = ({ open, children, handleClose }: Props) => ( - {children} + {children} ); diff --git a/govtool/frontend/src/components/atoms/modal/ModalWrapper.tsx b/govtool/frontend/src/components/atoms/modal/ModalWrapper.tsx index 598b21e4b..8576b4824 100644 --- a/govtool/frontend/src/components/atoms/modal/ModalWrapper.tsx +++ b/govtool/frontend/src/components/atoms/modal/ModalWrapper.tsx @@ -3,6 +3,7 @@ import { SxProps, styled } from "@mui/material/styles"; import { ICONS } from "@consts"; import { useModal } from "@context"; import { callAll } from "@utils"; +import { forwardRef } from "react"; interface Props { variant?: "modal" | "popup"; @@ -49,27 +50,32 @@ export const CloseButton = styled("img")` right: 24px; `; -export const ModalWrapper = ({ - children, - onClose, - variant = "modal", - hideCloseButton = false, - dataTestId = "modal", - sx, -}: Props) => { - const { closeModal } = useModal(); +export const ModalWrapper = forwardRef( + ( + { + children, + onClose, + variant = "modal", + hideCloseButton = false, + dataTestId = "modal", + sx, + }, + ref, + ) => { + const { closeModal } = useModal(); - return ( - - {variant !== "popup" && !hideCloseButton && ( - - )} - {children} - - ); -}; + return ( + + {variant !== "popup" && !hideCloseButton && ( + + )} + {children} + + ); + }, +); diff --git a/govtool/frontend/src/components/atoms/types.ts b/govtool/frontend/src/components/atoms/types.ts index 94ab87d4f..f67bf37f2 100644 --- a/govtool/frontend/src/components/atoms/types.ts +++ b/govtool/frontend/src/components/atoms/types.ts @@ -21,7 +21,7 @@ export type LoadingButtonProps = ButtonProps & { export type TypographyProps = Pick< MUITypographyProps, - "color" | "lineHeight" | "sx" + "color" | "lineHeight" | "sx" | "component" > & { children?: React.ReactNode; fontSize?: number; diff --git a/govtool/frontend/src/components/molecules/DashboardActionCard.tsx b/govtool/frontend/src/components/molecules/DashboardActionCard.tsx index 243287f36..6c7f8ebf1 100644 --- a/govtool/frontend/src/components/molecules/DashboardActionCard.tsx +++ b/govtool/frontend/src/components/molecules/DashboardActionCard.tsx @@ -85,6 +85,7 @@ export const DashboardActionCard: FC = ({ variant="title2" fontWeight={600} sx={{ display: "inline" }} + component="span" > {` ${t("inProgress")}`} diff --git a/govtool/frontend/src/components/molecules/WalletInfoCard.tsx b/govtool/frontend/src/components/molecules/WalletInfoCard.tsx index 054067c3d..475828f64 100644 --- a/govtool/frontend/src/components/molecules/WalletInfoCard.tsx +++ b/govtool/frontend/src/components/molecules/WalletInfoCard.tsx @@ -16,7 +16,7 @@ export const WalletInfoCard = () => { await disconnectWallet(); navigate( pathname.includes("/connected") - ? `${pathname.replace("/connected", "")}${hash}` + ? `${pathname.replace("/connected", "")}${hash ?? ""}` : PATHS.home, ); window.location.reload(); diff --git a/govtool/frontend/src/components/molecules/WalletOption.tsx b/govtool/frontend/src/components/molecules/WalletOption.tsx index f33b599aa..381fa2ee5 100644 --- a/govtool/frontend/src/components/molecules/WalletOption.tsx +++ b/govtool/frontend/src/components/molecules/WalletOption.tsx @@ -35,9 +35,12 @@ export const WalletOptionButton: FC = ({ const result = await enable(name); if (result?.stakeKey) { navigate( - pathToNavigate ?? pathname === "/" + // eslint-disable-next-line no-unneeded-ternary + pathToNavigate + ? pathToNavigate + : pathname === "/" ? "/dashboard" - : `connected${pathname}${hash}`, + : `connected${pathname}${hash ?? ""}`, { state }, ); return; diff --git a/govtool/frontend/src/components/organisms/DashboardCards/ProposeGovActionDashboardCard.tsx b/govtool/frontend/src/components/organisms/DashboardCards/ProposeGovActionDashboardCard.tsx index a68aa2005..00a0adfc3 100644 --- a/govtool/frontend/src/components/organisms/DashboardCards/ProposeGovActionDashboardCard.tsx +++ b/govtool/frontend/src/components/organisms/DashboardCards/ProposeGovActionDashboardCard.tsx @@ -37,7 +37,7 @@ export const ProposeGovActionDashboardCard = ({ navigate( isProposalDiscussionForumEnabled - ? `${PATHS.connectedProposalPillar.replace("/*", "")}${ + ? `${PATHS.proposalPillar.replace("/*", "")}${ PDF_PATHS.proposalDiscussion }` : PATHS.createGovernanceAction, diff --git a/govtool/frontend/src/components/organisms/DrawerMobile.tsx b/govtool/frontend/src/components/organisms/DrawerMobile.tsx index 6fd27d050..4d87ea120 100644 --- a/govtool/frontend/src/components/organisms/DrawerMobile.tsx +++ b/govtool/frontend/src/components/organisms/DrawerMobile.tsx @@ -3,7 +3,7 @@ import { Box, Grid, IconButton, SwipeableDrawer } from "@mui/material"; import { Background, Button, Link, Typography } from "@atoms"; import { ICONS, IMAGES, NAV_ITEMS } from "@consts"; import { useScreenDimension, useTranslation } from "@hooks"; -import { useModal } from "@context"; +import { useFeatureFlag, useModal } from "@context"; import { openInNewTab } from "@utils"; import { DrawerMobileProps } from "./types"; @@ -16,6 +16,7 @@ export const DrawerMobile = ({ isDrawerOpen, setIsDrawerOpen, }: DrawerMobileProps) => { + const { isProposalDiscussionForumEnabled } = useFeatureFlag(); const { screenWidth } = useScreenDimension(); const { openModal } = useModal(); const { t } = useTranslation(); @@ -73,19 +74,28 @@ export const DrawerMobile = ({ ) : null} - {NAV_ITEMS.map((navItem) => ( - - { - if (navItem.newTabLink) openInNewTab(navItem.newTabLink); - setIsDrawerOpen(false); - }} - size="big" - /> - - ))} + {NAV_ITEMS.map((navItem) => { + if ( + !isProposalDiscussionForumEnabled && + navItem.dataTestId === "proposed-governance-actions-link" + ) { + return null; + } + return ( + + { + if (navItem.newTabLink) + openInNewTab(navItem.newTabLink); + setIsDrawerOpen(false); + }} + size="big" + /> + + ); + })} diff --git a/govtool/frontend/src/components/organisms/EditDRepInfoSteps/EditDRepForm.tsx b/govtool/frontend/src/components/organisms/EditDRepInfoSteps/EditDRepForm.tsx index 205321e00..00f121378 100644 --- a/govtool/frontend/src/components/organisms/EditDRepInfoSteps/EditDRepForm.tsx +++ b/govtool/frontend/src/components/organisms/EditDRepInfoSteps/EditDRepForm.tsx @@ -21,15 +21,19 @@ const MAX_NUMBER_OF_LINKS = 7; export const EditDRepForm = ({ onClickCancel, setStep, + loadUserData, + setLoadUserData, }: { onClickCancel: () => void; setStep: Dispatch>; + loadUserData: boolean; + setLoadUserData: Dispatch>; }) => { const { state } = useLocation(); const { t } = useTranslation(); const { isMobile } = useScreenDimension(); const { dRepID } = useCardano(); - const { control, errors, isError, register, watch, reset, getValues } = + const { control, errors, isError, register, watch, reset } = useEditDRepInfoForm(); const { append, @@ -47,7 +51,10 @@ export const EditDRepForm = ({ { enabled: !state }, ); - const onClickContinue = () => setStep(2); + const onClickContinue = () => { + setStep(2); + setLoadUserData(false); + }; const addLink = useCallback(() => append({ uri: "" }), [append]); @@ -56,25 +63,28 @@ export const EditDRepForm = ({ const isContinueButtonDisabled = !watch("dRepName") || isError; useEffect(() => { - if (!getValues().dRepName) + if (loadUserData) { reset( state ? { ...state, - references: state.references.map((uri: string) => ({ - uri, - })), + references: state.references.length + ? state.references.map((uri: string) => ({ + uri, + })) + : [{ uri: "" }], } : { ...yourselfDRepList?.[0], - references: yourselfDRepList?.[0].references.map( - (uri: string) => ({ - uri, - }), - ), + references: yourselfDRepList?.[0].references.length + ? yourselfDRepList?.[0].references.map((uri: string) => ({ + uri, + })) + : [{ uri: "" }], }, ); - }, [yourselfDRepList]); + } + }, [yourselfDRepList?.[0], loadUserData]); const renderLinks = useCallback( () => diff --git a/govtool/frontend/src/components/organisms/GovernanceActionDetailsCardData.tsx b/govtool/frontend/src/components/organisms/GovernanceActionDetailsCardData.tsx index 2350bb0a5..d1be2a797 100644 --- a/govtool/frontend/src/components/organisms/GovernanceActionDetailsCardData.tsx +++ b/govtool/frontend/src/components/organisms/GovernanceActionDetailsCardData.tsx @@ -64,7 +64,9 @@ export const GovernanceActionDetailsCardData = ({ const govActionLinkToShare = `${window.location.protocol}//${ window.location.hostname - }${window.location.port ? `:${window.location.port}` : ""}${pathname}${hash}`; + }${window.location.port ? `:${window.location.port}` : ""}${pathname}${ + hash ?? "" + }`; return ( { + const { isProposalDiscussionForumEnabled } = useFeatureFlag(); const navigate = useNavigate(); const { openModal } = useModal(); const { screenWidth } = useScreenDimension(); @@ -48,6 +49,16 @@ export const HomeCards = () => { [navigate], ); + const navigateToProposalDiscussionPillar = useCallback( + () => + navigate( + `${PATHS.connectedProposalPillar.replace("/*", "")}${ + PDF_PATHS.proposalDiscussion + }`, + ), + [navigate], + ); + return ( { imageHeight={84} imageURL={IMAGES.proposeGovActionImage} imageWidth={84} - secondButtonAction={onClickLearnMoreAboutProposingGovAction} - secondButtonLabel={t("learnMore")} + secondButtonAction={ + isProposalDiscussionForumEnabled + ? navigateToProposalDiscussionPillar + : onClickLearnMoreAboutProposingGovAction + } + secondButtonLabel={t( + isProposalDiscussionForumEnabled + ? "home.cards.proposeAGovernanceAction.secondButtonLabel" + : "learnMore", + )} title={t("home.cards.proposeAGovernanceAction.title")} /> {/* PROPOSE GOV ACTION CARD END */} diff --git a/govtool/frontend/src/components/organisms/Modal/ChooseWalletModal.tsx b/govtool/frontend/src/components/organisms/Modal/ChooseWalletModal.tsx index 043beb1e3..10c57da07 100644 --- a/govtool/frontend/src/components/organisms/Modal/ChooseWalletModal.tsx +++ b/govtool/frontend/src/components/organisms/Modal/ChooseWalletModal.tsx @@ -1,5 +1,5 @@ import { Box, Link, Typography } from "@mui/material"; -import { useMemo } from "react"; +import { forwardRef, useMemo } from "react"; import { ModalContents, ModalHeader, ModalWrapper } from "@atoms"; import { useModal } from "@context"; @@ -13,7 +13,7 @@ type ChooseWalletModalState = { pathToNavigate?: To; }; -export const ChooseWalletModal = () => { +export const ChooseWalletModal = forwardRef((_, ref) => { const { t } = useTranslation(); const { state } = useModal(); @@ -47,7 +47,7 @@ export const ChooseWalletModal = () => { }, [window]); return ( - + {t("wallet.connectYourWallet")} { ); -}; +}); diff --git a/govtool/frontend/src/components/organisms/Modal/ExternalLinkModal.tsx b/govtool/frontend/src/components/organisms/Modal/ExternalLinkModal.tsx index e49f5b625..8437f3ae0 100644 --- a/govtool/frontend/src/components/organisms/Modal/ExternalLinkModal.tsx +++ b/govtool/frontend/src/components/organisms/Modal/ExternalLinkModal.tsx @@ -1,3 +1,4 @@ +import { forwardRef } from "react"; import { Box, Button, Typography } from "@mui/material"; import { ModalContents, ModalHeader, ModalWrapper } from "@atoms"; @@ -11,7 +12,7 @@ export interface ExternalLinkModalState { externalLink: string; } -export const ExternalLinkModal = () => { +export const ExternalLinkModal = forwardRef((_, ref) => { const { state, closeModal } = useModal(); const { isMobile } = useScreenDimension(); const { t } = useTranslation(); @@ -20,7 +21,7 @@ export const ExternalLinkModal = () => { } = theme; return ( - + Status icon { ); -}; +}); diff --git a/govtool/frontend/src/components/organisms/Modal/LoadingModal.tsx b/govtool/frontend/src/components/organisms/Modal/LoadingModal.tsx index 2c95b9574..8a87b91bd 100644 --- a/govtool/frontend/src/components/organisms/Modal/LoadingModal.tsx +++ b/govtool/frontend/src/components/organisms/Modal/LoadingModal.tsx @@ -1,3 +1,4 @@ +import { forwardRef } from "react"; import { Typography } from "@mui/material"; import { Loader, ModalContents, ModalHeader, ModalWrapper } from "@atoms"; @@ -10,7 +11,7 @@ export interface LoadingModalState { dataTestId: string; } -export const LoadingModal = () => { +export const LoadingModal = forwardRef((_, ref) => { const { state } = useModal(); const { isMobile } = useScreenDimension(); @@ -18,6 +19,7 @@ export const LoadingModal = () => { @@ -33,4 +35,4 @@ export const LoadingModal = () => { ); -}; +}); diff --git a/govtool/frontend/src/components/organisms/Modal/StatusModal.tsx b/govtool/frontend/src/components/organisms/Modal/StatusModal.tsx index ca5adb5d1..2b1e24ea6 100644 --- a/govtool/frontend/src/components/organisms/Modal/StatusModal.tsx +++ b/govtool/frontend/src/components/organisms/Modal/StatusModal.tsx @@ -1,3 +1,4 @@ +import { forwardRef } from "react"; import { Button, Link, Typography } from "@mui/material"; import { ModalContents, ModalHeader, ModalWrapper } from "@atoms"; @@ -22,7 +23,7 @@ export interface StatusModalState { dataTestId: string; } -export const StatusModal = () => { +export const StatusModal = forwardRef((_, ref) => { const { state, closeModal } = useModal(); const { isMobile } = useScreenDimension(); const { t } = useTranslation(); @@ -34,7 +35,10 @@ export const StatusModal = () => { }; return ( - + Status icon { WebkitBoxOrient: "vertical", WebkitLineClamp: 8, wordBreak: "break-word", + whiteSpace: "pre-line", }} > {state?.message}{" "} @@ -125,4 +130,4 @@ export const StatusModal = () => { )} ); -}; +}); diff --git a/govtool/frontend/src/components/organisms/Modal/VotingPowerModal.tsx b/govtool/frontend/src/components/organisms/Modal/VotingPowerModal.tsx index 95c03b718..524f9bda4 100644 --- a/govtool/frontend/src/components/organisms/Modal/VotingPowerModal.tsx +++ b/govtool/frontend/src/components/organisms/Modal/VotingPowerModal.tsx @@ -1,3 +1,4 @@ +import { forwardRef } from "react"; import { Box } from "@mui/material"; import { ModalContents, ModalWrapper, Typography, VotePill } from "@atoms"; @@ -13,7 +14,7 @@ export interface VotingPowerModalState { vote?: string; } -export const VotingPowerModal = () => { +export const VotingPowerModal = forwardRef((_, ref) => { const { state } = useModal(); const { isMobile } = useScreenDimension(); const { t } = useTranslation(); @@ -28,6 +29,7 @@ export const VotingPowerModal = () => { @@ -94,4 +96,4 @@ export const VotingPowerModal = () => { ); -}; +}); diff --git a/govtool/frontend/src/components/organisms/PDFWrapper.tsx b/govtool/frontend/src/components/organisms/PDFWrapper.tsx index 5571c632d..310bc889d 100644 --- a/govtool/frontend/src/components/organisms/PDFWrapper.tsx +++ b/govtool/frontend/src/components/organisms/PDFWrapper.tsx @@ -1,11 +1,15 @@ -import React, { Suspense } from "react"; +import React, { ComponentProps, Suspense } from "react"; import { Box, CircularProgress } from "@mui/material"; import "@intersect.mbo/pdf-ui/style"; import { useCardano, useGovernanceActions } from "@/context"; +import { useValidateMutation } from "@/hooks/mutations"; -const PDF = React.lazy(() => import("@intersect.mbo/pdf-ui/cjs")); +const ProposalDiscussion = React.lazy( + () => import("@intersect.mbo/pdf-ui/cjs"), +); export const PDFWrapper = () => { + const { validateMetadata } = useValidateMutation(); const { walletApi, ...context } = useCardano(); const { createGovernanceActionJsonLD, createHash } = useGovernanceActions(); @@ -33,7 +37,7 @@ export const PDFWrapper = () => { } > - { createHash, }} pathname={window.location.pathname} + validateMetadata={ + validateMetadata as ComponentProps< + typeof ProposalDiscussion + >["validateMetadata"] + } /> diff --git a/govtool/frontend/src/components/organisms/RegisterAsDRepSteps/WhatRetirementMeans.tsx b/govtool/frontend/src/components/organisms/RegisterAsDRepSteps/WhatRetirementMeans.tsx index 36e6459ac..f04378102 100644 --- a/govtool/frontend/src/components/organisms/RegisterAsDRepSteps/WhatRetirementMeans.tsx +++ b/govtool/frontend/src/components/organisms/RegisterAsDRepSteps/WhatRetirementMeans.tsx @@ -1,4 +1,5 @@ -import { useCallback, useState } from "react"; +import { useCallback, useEffect, useState } from "react"; +import * as Sentry from "@sentry/react"; import { Typography } from "@atoms"; import { useCardano, useModal } from "@context"; @@ -34,6 +35,10 @@ export const WhatRetirementMeans = ({ closeModal(); }; + useEffect(() => { + Sentry.setTag("component_name", "WhatRetirementMeans"); + }, []); + const retireAsDrep = useCallback(async () => { try { setIsRetirementLoading(true); @@ -65,6 +70,7 @@ export const WhatRetirementMeans = ({ } // eslint-disable-next-line @typescript-eslint/no-explicit-any } catch (error: any) { + Sentry.captureException(error); openWalletErrorModal({ error, onSumbit: onClickCancel, diff --git a/govtool/frontend/src/components/organisms/RegisterAsDirectVoterBox.tsx b/govtool/frontend/src/components/organisms/RegisterAsDirectVoterBox.tsx index dc5e3a78d..05922d965 100644 --- a/govtool/frontend/src/components/organisms/RegisterAsDirectVoterBox.tsx +++ b/govtool/frontend/src/components/organisms/RegisterAsDirectVoterBox.tsx @@ -1,6 +1,7 @@ -import { useCallback, useState } from "react"; +import { useCallback, useState, useEffect } from "react"; import { useNavigate } from "react-router-dom"; import { useTranslation } from "react-i18next"; +import * as Sentry from "@sentry/react"; import { PATHS } from "@consts"; import { RegisterAsDirectVoterBoxContent } from "@organisms"; @@ -19,6 +20,10 @@ export const RegisterAsDirectVoterBox = () => { const { voter } = useGetVoterInfo(); const openWalletErrorModal = useWalletErrorModal(); + useEffect(() => { + Sentry.setTag("component_name", "RegisterAsDirectVoterBox"); + }, []); + const onRegister = useCallback(async () => { setIsLoading(true); @@ -49,6 +54,7 @@ export const RegisterAsDirectVoterBox = () => { } // eslint-disable-next-line @typescript-eslint/no-explicit-any } catch (error: any) { + Sentry.captureException(error); openWalletErrorModal({ error, buttonText: t("modals.common.goToDashboard"), diff --git a/govtool/frontend/src/components/organisms/TopNav.tsx b/govtool/frontend/src/components/organisms/TopNav.tsx index fa34ff4b7..782241d87 100644 --- a/govtool/frontend/src/components/organisms/TopNav.tsx +++ b/govtool/frontend/src/components/organisms/TopNav.tsx @@ -5,7 +5,7 @@ import MenuIcon from "@mui/icons-material/Menu"; import { Button, Link } from "@atoms"; import { ICONS, IMAGES, PATHS, NAV_ITEMS } from "@consts"; -import { useCardano, useModal } from "@context"; +import { useCardano, useFeatureFlag, useModal } from "@context"; import { useScreenDimension, useTranslation } from "@hooks"; import { openInNewTab } from "@utils"; @@ -14,6 +14,7 @@ import { DrawerMobile } from "./DrawerMobile"; const POSITION_TO_BLUR = 50; export const TopNav = ({ isConnectButton = true }) => { + const { isProposalDiscussionForumEnabled } = useFeatureFlag(); const [windowScroll, setWindowScroll] = useState(0); const { openModal } = useModal(); const [isDrawerOpen, setIsDrawerOpen] = useState(false); @@ -98,20 +99,28 @@ export const TopNav = ({ isConnectButton = true }) => { columnSpacing={screenWidth < 1024 ? 2 : 4} container > - {NAV_ITEMS.map((navItem) => ( - - { - if (navItem.newTabLink) { - openInNewTab(navItem.newTabLink); - } - setIsDrawerOpen(false); - }} - /> - - ))} + {NAV_ITEMS.map((navItem) => { + if ( + !isProposalDiscussionForumEnabled && + navItem.dataTestId === "proposed-governance-actions-link" + ) { + return null; + } + return ( + + { + if (navItem.newTabLink) { + openInNewTab(navItem.newTabLink); + } + setIsDrawerOpen(false); + }} + /> + + ); + })} {isConnectButton ? (