From 11a8d8750a47511012f89b284157d6383e68766c Mon Sep 17 00:00:00 2001 From: Sudip Bhattarai Date: Wed, 19 Jun 2024 21:14:25 +0545 Subject: [PATCH 01/36] Test-infra: Expose storybook deployment publicly --- tests/test-infrastructure/docker-compose-govtool.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/test-infrastructure/docker-compose-govtool.yml b/tests/test-infrastructure/docker-compose-govtool.yml index c129fd247..fd450f1c7 100644 --- a/tests/test-infrastructure/docker-compose-govtool.yml +++ b/tests/test-infrastructure/docker-compose-govtool.yml @@ -79,6 +79,8 @@ services: NPMRC_TOKEN: ${NPMRC_TOKEN} environment: VIRTUAL_HOST: https://storybook-${BASE_DOMAIN} + networks: + - frontend deploy: restart_policy: delay: "30s" From 2611b68213c7f341900e827362e06d6e6db01f79 Mon Sep 17 00:00:00 2001 From: Sudip Bhattarai Date: Wed, 19 Jun 2024 23:28:24 +0545 Subject: [PATCH 02/36] Test-infra: Add USERSNAP_SPACE_API_KEY build-arg --- tests/test-infrastructure/docker-compose-govtool.yml | 1 + tests/test-infrastructure/playbook.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/tests/test-infrastructure/docker-compose-govtool.yml b/tests/test-infrastructure/docker-compose-govtool.yml index c129fd247..16123144f 100644 --- a/tests/test-infrastructure/docker-compose-govtool.yml +++ b/tests/test-infrastructure/docker-compose-govtool.yml @@ -43,6 +43,7 @@ services: VITE_SENTRY_DSN: ${SENTRY_DSN_FRONTEND} NPMRC_TOKEN: ${NPMRC_TOKEN} VITE_APP_ENV: ${APP_ENV:-test} + VITE_USERSNAP_SPACE_API_KEY: ${USERSNAP_SPACE_API_KEY} VITE_IS_PROPOSAL_DISCUSSION_FORUM_ENABLED: "true" GTM_ID: ${GTM_ID} environment: diff --git a/tests/test-infrastructure/playbook.yml b/tests/test-infrastructure/playbook.yml index 7a6337f3c..f38eace75 100644 --- a/tests/test-infrastructure/playbook.yml +++ b/tests/test-infrastructure/playbook.yml @@ -22,6 +22,7 @@ GTM_ID: "{{ lookup ('env', 'GTM_ID') }}" GOVTOOL_TAG: "{{ lookup('env', 'GOVTOOL_TAG') }}" NPMRC_TOKEN: "{{ lookup('env','NPMRC_TOKEN') }}" + USERSNAP_SPACE_API_KEY: "{{ lookup('env','USERSNAP_SPACE_API_KEY') }}" SENTRY_DSN_FRONTEND: "{{ lookup ('env', 'SENTRY_DSN_FRONTEND') }}" SENTRY_DSN_BACKEND: "{{ lookup ('env', 'SENTRY_DSN_BACKEND') }}" become: yes \ No newline at end of file From c235dd95c04a37cf616a2674c5f075ccd57d8e03 Mon Sep 17 00:00:00 2001 From: Nabin Kawan Date: Thu, 20 Jun 2024 10:53:10 +0545 Subject: [PATCH 03/36] chore: Update proposal-id for frontend validation in sorting --- tests/govtool-frontend/playwright/lib/helpers/enum.ts | 6 ++++++ .../playwright/lib/pages/governanceActionsPage.ts | 8 +++++++- 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 tests/govtool-frontend/playwright/lib/helpers/enum.ts diff --git a/tests/govtool-frontend/playwright/lib/helpers/enum.ts b/tests/govtool-frontend/playwright/lib/helpers/enum.ts new file mode 100644 index 000000000..7cfed0143 --- /dev/null +++ b/tests/govtool-frontend/playwright/lib/helpers/enum.ts @@ -0,0 +1,6 @@ +export function getEnumKeyByValue( + enumObj: any, + value: string +): string | undefined { + return Object.keys(enumObj).find((key) => enumObj[key] === value); +} diff --git a/tests/govtool-frontend/playwright/lib/pages/governanceActionsPage.ts b/tests/govtool-frontend/playwright/lib/pages/governanceActionsPage.ts index 12d5bbbd3..28694a3f2 100644 --- a/tests/govtool-frontend/playwright/lib/pages/governanceActionsPage.ts +++ b/tests/govtool-frontend/playwright/lib/pages/governanceActionsPage.ts @@ -3,6 +3,7 @@ import { Locator, Page, expect } from "@playwright/test"; import { FilterOption, IProposal } from "@types"; import environments from "lib/constants/environments"; import GovernanceActionDetailsPage from "./governanceActionDetailsPage"; +import { getEnumKeyByValue } from "@helpers/enum"; const MAX_SLIDES_DISPLAY_PER_TYPE = 6; @@ -135,8 +136,13 @@ export default class GovernanceActionsPage { // Frontend validation for (let dIdx = 0; dIdx <= proposalsByType.length - 1; dIdx++) { const proposals = proposalsByType[0] as IProposal[]; + const filterOptionKey = getEnumKeyByValue( + FilterOption, + proposals[0].type + ); + const slides = await this.page - .locator(`[data-testid="govaction-${proposals[0].type}-card"]`) + .locator(`[data-testid="govaction-${filterOptionKey}-card"]`) .all(); const actualSlidesInDisplay = From b18c87dc8367a75d3aa2e60e56c59a024ba11c44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Placzy=C5=84ski?= Date: Thu, 20 Jun 2024 10:06:43 +0200 Subject: [PATCH 04/36] Fix CSP issue blocking Sentry requests in Traefik configuration The Content Security Policy (CSP) was updated to resolve the issue that was blocking Sentry requests. Previously, the `connect-src` directive did not include wildcard entries for Sentry endpoints, causing POST requests to the Sentry API to fail. The configuration was adjusted to permit requests to any instance of Sentry under the `*.ingest.sentry.io` domain. This change ensures that error tracking and monitoring via Sentry can function correctly, as required by the user story. The updated CSP also maintains security best practices and has been tested to confirm successful transmission of error data to Sentry. --- scripts/govtool/config/templates/docker-compose.yml.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/govtool/config/templates/docker-compose.yml.tpl b/scripts/govtool/config/templates/docker-compose.yml.tpl index 5882aef20..3c56a1064 100644 --- a/scripts/govtool/config/templates/docker-compose.yml.tpl +++ b/scripts/govtool/config/templates/docker-compose.yml.tpl @@ -273,7 +273,7 @@ services: logging: *logging labels: - "traefik.enable=true" - - "traefik.http.middlewares.frontend-csp.headers.contentSecurityPolicy=default-src 'self'; img-src *.usersnap.com https://www.googletagmanager.com 'self' data:; script-src *.usersnap.com 'self' https://www.googletagmanager.com https://browser.sentry-cdn.com; style-src *.usersnap.com *.googleapis.com 'self' 'unsafe-inline' https://fonts.googleapis.com; connect-src *.usersnap.com https://s3.eu-central-1.amazonaws.com/upload.usersnap.com 'self' o4506155985141760.ingest.sentry.io *.google-analytics.com *.api.pdf.gov.tools; font-src *.usersnap.com *.gstatic.com 'self' https://fonts.gstatic.com data:; worker-src blob:" + - "traefik.http.middlewares.frontend-csp.headers.contentSecurityPolicy=default-src 'self'; img-src *.usersnap.com https://www.googletagmanager.com 'self' data:; script-src *.usersnap.com 'self' https://www.googletagmanager.com https://browser.sentry-cdn.com; style-src *.usersnap.com *.googleapis.com 'self' 'unsafe-inline' https://fonts.googleapis.com; connect-src *.usersnap.com https://s3.eu-central-1.amazonaws.com/upload.usersnap.com 'self' *.ingest.sentry.io *.google-analytics.com *.api.pdf.gov.tools; font-src *.usersnap.com *.gstatic.com 'self' https://fonts.gstatic.com data:; worker-src blob:" - "traefik.http.routers.to-frontend.rule=Host(``)" - "traefik.http.routers.to-frontend.entrypoints=websecure" - "traefik.http.routers.to-frontend.tls.certresolver=myresolver" From 179d4e70b9596f77b7353b1c2d311d2e6c5c23d5 Mon Sep 17 00:00:00 2001 From: niraj Date: Thu, 20 Jun 2024 10:49:40 +0545 Subject: [PATCH 05/36] chore: Update matadata-anchor incorrect test ids --- .../3-drep-registration/dRepRegistration.loggedin.spec.ts | 4 +++- .../tests/3-drep-registration/editDRep.dRep.spec.ts | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/govtool-frontend/playwright/tests/3-drep-registration/dRepRegistration.loggedin.spec.ts b/tests/govtool-frontend/playwright/tests/3-drep-registration/dRepRegistration.loggedin.spec.ts index ddfcf7e44..95aec9138 100644 --- a/tests/govtool-frontend/playwright/tests/3-drep-registration/dRepRegistration.loggedin.spec.ts +++ b/tests/govtool-frontend/playwright/tests/3-drep-registration/dRepRegistration.loggedin.spec.ts @@ -121,7 +121,9 @@ test.describe("Validation of dRep Registration Form", () => { metadataAnchorGreaterThan128Bytes ); - await expect(page.getByTestId("invalid-url-error")).toBeVisible(); + await expect( + page.getByTestId("url-must-be-less-than-128-bytes-error") + ).toBeVisible(); }); }); diff --git a/tests/govtool-frontend/playwright/tests/3-drep-registration/editDRep.dRep.spec.ts b/tests/govtool-frontend/playwright/tests/3-drep-registration/editDRep.dRep.spec.ts index b5ff1317e..718cb68df 100644 --- a/tests/govtool-frontend/playwright/tests/3-drep-registration/editDRep.dRep.spec.ts +++ b/tests/govtool-frontend/playwright/tests/3-drep-registration/editDRep.dRep.spec.ts @@ -99,7 +99,9 @@ test.describe("Validation of edit dRep Form", () => { await editDRepPage.metadataUrlInput.fill(metadataAnchorGreaterThan128Bytes); - await expect(page.getByTestId("invalid-url-error")).toBeVisible(); + await expect( + page.getByTestId("url-must-be-less-than-128-bytes-error") + ).toBeVisible(); }); }); From a792eb40780b8214b6cf9fcd6d12895090390e00 Mon Sep 17 00:00:00 2001 From: niraj Date: Thu, 20 Jun 2024 10:52:15 +0545 Subject: [PATCH 06/36] fix: Metadata error modal --- .../playwright/lib/pages/dRepRegistrationPage.ts | 2 ++ .../3-drep-registration/dRepRegistration.loggedin.spec.ts | 6 +++--- .../tests/3-drep-registration/editDRep.dRep.spec.ts | 6 +++--- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/tests/govtool-frontend/playwright/lib/pages/dRepRegistrationPage.ts b/tests/govtool-frontend/playwright/lib/pages/dRepRegistrationPage.ts index 128a80e1a..90de67800 100644 --- a/tests/govtool-frontend/playwright/lib/pages/dRepRegistrationPage.ts +++ b/tests/govtool-frontend/playwright/lib/pages/dRepRegistrationPage.ts @@ -5,9 +5,11 @@ import DRepForm from "../forms/dRepForm"; export default class DRepRegistrationPage extends DRepForm { readonly registerBtn = this.page.getByTestId("register-button"); readonly confirmBtn = this.page.getByTestId("confirm-modal-button"); + readonly registrationSuccessModal = this.page.getByTestId( "governance-action-submitted-modal" ); + readonly metadataErrorModal = this.page.getByTestId("modal"); constructor(private readonly page: Page) { super(page); diff --git a/tests/govtool-frontend/playwright/tests/3-drep-registration/dRepRegistration.loggedin.spec.ts b/tests/govtool-frontend/playwright/tests/3-drep-registration/dRepRegistration.loggedin.spec.ts index 95aec9138..73de7344d 100644 --- a/tests/govtool-frontend/playwright/tests/3-drep-registration/dRepRegistration.loggedin.spec.ts +++ b/tests/govtool-frontend/playwright/tests/3-drep-registration/dRepRegistration.loggedin.spec.ts @@ -156,7 +156,7 @@ test("3O. Should reject invalid dRep registration metadata", async ({ await dRepRegistrationPage.metadataUrlInput.fill(invalidMetadataAnchor); await dRepRegistrationPage.registerBtn.click(); - await expect( - page.getByTestId("registration-transaction-error-modal") - ).not.toHaveText(/utxo balance insufficient/i); + await expect(dRepRegistrationPage.metadataErrorModal).toHaveText( + /your external data does not/i + ); }); diff --git a/tests/govtool-frontend/playwright/tests/3-drep-registration/editDRep.dRep.spec.ts b/tests/govtool-frontend/playwright/tests/3-drep-registration/editDRep.dRep.spec.ts index 718cb68df..731cf2cfa 100644 --- a/tests/govtool-frontend/playwright/tests/3-drep-registration/editDRep.dRep.spec.ts +++ b/tests/govtool-frontend/playwright/tests/3-drep-registration/editDRep.dRep.spec.ts @@ -120,7 +120,7 @@ test("3P. Should reject invalid edit dRep metadata", async ({ page }) => { await editDRepPage.metadataUrlInput.fill(invalidMetadataAnchor); await editDRepPage.continueBtn.click(); - await expect( - page.getByTestId("registration-transaction-error-modal") - ).toBeVisible(); + await expect(page.getByTestId("modal")).toHaveText( + /your external data does not/i + ); }); From 340554a758ef95c4fb59ec05e05c65cb8c68b588 Mon Sep 17 00:00:00 2001 From: niraj Date: Thu, 20 Jun 2024 12:44:30 +0545 Subject: [PATCH 07/36] chore: Add email and bio data on update dRep test --- .../3-drep-registration/dRepRegistration.dRep.spec.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tests/govtool-frontend/playwright/tests/3-drep-registration/dRepRegistration.dRep.spec.ts b/tests/govtool-frontend/playwright/tests/3-drep-registration/dRepRegistration.dRep.spec.ts index 10f0601cb..8b8298238 100644 --- a/tests/govtool-frontend/playwright/tests/3-drep-registration/dRepRegistration.dRep.spec.ts +++ b/tests/govtool-frontend/playwright/tests/3-drep-registration/dRepRegistration.dRep.spec.ts @@ -48,13 +48,17 @@ test.describe("Logged in DReps", () => { await page.getByTestId("view-drep-details-button").click(); await page.getByTestId("edit-drep-data-button").click(); - const newDRepName = faker.internet.userName(); - await page.getByPlaceholder("ex. JohnDRep").fill(newDRepName); + const newDRepName = faker.person.firstName(); + await page.getByTestId("name-input").fill(newDRepName); + await page.getByTestId("email-input").fill(faker.internet.email()); + await page.getByTestId("bio-input").fill(faker.lorem.paragraph(2)); + await page.getByTestId("continue-button").click(); await page.getByRole("checkbox").click(); await page.getByTestId("continue-button").click(); - page.getByRole("button", { name: `${newDRepName}.jsonld` }).click(); + page.getByRole("button", { name: `${newDRepName}.jsonld` }).click(); // BUG missing test ids + const download: Download = await page.waitForEvent("download"); const dRepMetadata = await downloadMetadata(download); From 3b73afe6b94d18a5b52fe135a69646c61d13a25a Mon Sep 17 00:00:00 2001 From: niraj Date: Fri, 21 Jun 2024 11:55:05 +0545 Subject: [PATCH 08/36] chore: Change navigation of dRep details page --- .../playwright/tests/2-delegation/delegation.drep.spec.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/tests/govtool-frontend/playwright/tests/2-delegation/delegation.drep.spec.ts b/tests/govtool-frontend/playwright/tests/2-delegation/delegation.drep.spec.ts index 572d0f788..13434f4aa 100644 --- a/tests/govtool-frontend/playwright/tests/2-delegation/delegation.drep.spec.ts +++ b/tests/govtool-frontend/playwright/tests/2-delegation/delegation.drep.spec.ts @@ -66,11 +66,7 @@ test("2N. Should show DRep information on details page", async ({ await dRepRegistrationPage.confirmBtn.click(); - const dRepDirectory = new DRepDirectoryPage(dRepPage); - await dRepDirectory.goto(); - - await dRepDirectory.searchInput.fill(wallet.dRepId); - await dRepPage.getByTestId(`${wallet.dRepId}-view-details-button`).click(); + await dRepPage.getByTestId("view-drep-details-button").click(); // Verification await expect(dRepPage.getByTestId("copy-drep-id-button")).toHaveText( From 97e8f284849b4577835fed518fea74f8de6987af Mon Sep 17 00:00:00 2001 From: niraj Date: Fri, 21 Jun 2024 11:56:08 +0545 Subject: [PATCH 09/36] chore: Add "add link" button click event on edit dRep --- .../tests/3-drep-registration/editDRep.dRep.spec.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/govtool-frontend/playwright/tests/3-drep-registration/editDRep.dRep.spec.ts b/tests/govtool-frontend/playwright/tests/3-drep-registration/editDRep.dRep.spec.ts index b5ff1317e..9434fd57b 100644 --- a/tests/govtool-frontend/playwright/tests/3-drep-registration/editDRep.dRep.spec.ts +++ b/tests/govtool-frontend/playwright/tests/3-drep-registration/editDRep.dRep.spec.ts @@ -19,6 +19,8 @@ test.describe("Validation of edit dRep Form", () => { const editDRepPage = new EditDRepPage(page); await editDRepPage.goto(); + await editDRepPage.addLinkBtn.click(); + for (let i = 0; i < 100; i++) { await editDRepPage.validateForm( faker.internet.displayName(), @@ -44,6 +46,8 @@ test.describe("Validation of edit dRep Form", () => { const editDRepPage = new EditDRepPage(page); await editDRepPage.goto(); + await editDRepPage.addLinkBtn.click(); + for (let i = 0; i < 100; i++) { await editDRepPage.inValidateForm( mockInvalid.name(), From f1297b8b86ec7b4fa149d73444bebb342c7410fc Mon Sep 17 00:00:00 2001 From: niraj Date: Thu, 20 Jun 2024 16:49:11 +0545 Subject: [PATCH 10/36] chore: Add missing testids on dRepDirectory page --- .../playwright/lib/pages/dRepDirectoryPage.ts | 20 +++++++++---------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/tests/govtool-frontend/playwright/lib/pages/dRepDirectoryPage.ts b/tests/govtool-frontend/playwright/lib/pages/dRepDirectoryPage.ts index 9b07aa783..bff4c432e 100644 --- a/tests/govtool-frontend/playwright/lib/pages/dRepDirectoryPage.ts +++ b/tests/govtool-frontend/playwright/lib/pages/dRepDirectoryPage.ts @@ -19,19 +19,17 @@ export default class DRepDirectoryPage { "signal-no-confidence-on-every-vote-info-button" ); - readonly automaticDelegationOptionsDropdown = this.page.getByRole("button", { - name: "Automated Voting Options arrow", - }); // BUG: testId -> delegation-options-dropdown + readonly automaticDelegationOptionsDropdown = this.page.getByTestId( + "automated-voting-options-accordion" + ); readonly delegateToDRepCard = this.page.getByTestId("delegate-to-drep-card"); - readonly signalNoConfidenceCard = this.page - .getByRole("region") - .locator("div") - .filter({ hasText: "Signal No Confidence on Every" }) - .nth(2); // BUG: testId -> signal-no-confidence-card - readonly abstainDelegationCard = this.page.getByText( - "Abstain from Every VoteSelect this to vote ABSTAIN to every vote.Voting Power₳" - ); // BUG: testId -> abstain-delegation-card + readonly signalNoConfidenceCard = this.page.getByTestId( + "no-confidence-delegation-card" + ); + readonly abstainDelegationCard = this.page.getByTestId( + "abstain-delegation-card" + ); readonly delegationErrorModal = this.page.getByTestId( "delegate-transaction-error-modal" From 4f4dbf0a87efa4bee3435f23d106b499b79b582e Mon Sep 17 00:00:00 2001 From: niraj Date: Thu, 20 Jun 2024 16:49:34 +0545 Subject: [PATCH 11/36] chore: Add missing testids on dRep Registration page --- .../3-drep-registration/dRepRegistration.dRep.spec.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/govtool-frontend/playwright/tests/3-drep-registration/dRepRegistration.dRep.spec.ts b/tests/govtool-frontend/playwright/tests/3-drep-registration/dRepRegistration.dRep.spec.ts index 10f0601cb..3ab552e36 100644 --- a/tests/govtool-frontend/playwright/tests/3-drep-registration/dRepRegistration.dRep.spec.ts +++ b/tests/govtool-frontend/playwright/tests/3-drep-registration/dRepRegistration.dRep.spec.ts @@ -27,9 +27,9 @@ test.describe("Logged in DReps", () => { await expect(page.getByTestId("voting-power-chips")).toBeVisible(); - await expect(page.getByTestId("dRep-id-display")).toContainText( - dRep01Wallet.dRepId - ); // BUG: testId -> dRep-id-display-dashboard (It is taking sidebar dRep-id) + await expect( + page.getByTestId("dRep-id-display-card-dashboard") + ).toContainText(dRep01Wallet.dRepId); await page.goto(`${environments.frontendUrl}/governance_actions`); await page @@ -63,7 +63,7 @@ test.describe("Logged in DReps", () => { dRepMetadata.data ); - await page.getByPlaceholder("URL").fill(url); + await page.getByTestId("metadata-url-input").fill(url); await page.getByTestId("continue-button").click(); // BUG -> incorrect test id await page.getByTestId("confirm-modal-button").click(); From e6940d44b1856b77ec04b1a38fc41ff658e5457c Mon Sep 17 00:00:00 2001 From: niraj Date: Thu, 20 Jun 2024 16:50:03 +0545 Subject: [PATCH 12/36] chore: Add missing test ids on GA page --- .../playwright/lib/pages/governanceActionDetailsPage.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/tests/govtool-frontend/playwright/lib/pages/governanceActionDetailsPage.ts b/tests/govtool-frontend/playwright/lib/pages/governanceActionDetailsPage.ts index 6cebc20fd..265b00d82 100644 --- a/tests/govtool-frontend/playwright/lib/pages/governanceActionDetailsPage.ts +++ b/tests/govtool-frontend/playwright/lib/pages/governanceActionDetailsPage.ts @@ -19,9 +19,7 @@ export default class GovernanceActionDetailsPage { readonly externalModalBtn = this.page.getByTestId("external-modal-button"); readonly governanceActionId = this.page.getByText("Governance Action ID:"); - readonly contextBtn = this.page.getByRole("button", { - name: "Provide context about your", - }); // BUG testId + readonly contextBtn = this.page.getByTestId("provide-context-button"); readonly viewOtherDetailsLink = this.page.getByTestId( "view-other-details-button" ); @@ -59,14 +57,14 @@ export default class GovernanceActionDetailsPage { this.page .getByRole("button", { name: "download Vote_Context.jsonld" }) - .click(); + .click(); // BUG missing test id const voteMetadata = await this.downloadVoteMetadata(); const url = await metadataBucketService.uploadMetadata( voteMetadata.name, voteMetadata.data ); - await this.page.getByPlaceholder("URL").fill(url); + await this.page.getByPlaceholder("URL").fill(url); // Bug showing data-testid="undefinedinput" on url await this.confirmModalBtn.click(); await this.page.getByTestId("go-to-vote-modal-button").click(); } From dfd60949acde6c1c4aabf330c73a89c4279ea504 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Sworze=C5=84?= Date: Fri, 21 Jun 2024 11:27:06 +0200 Subject: [PATCH 13/36] fix edit drep form --- .../EditDRepInfoSteps/EditDRepForm.tsx | 34 ++++++++++++------- .../src/hooks/forms/useEditDRepInfoForm.ts | 1 + .../frontend/src/pages/EditDRepMetadata.tsx | 3 ++ 3 files changed, 26 insertions(+), 12 deletions(-) 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/hooks/forms/useEditDRepInfoForm.ts b/govtool/frontend/src/hooks/forms/useEditDRepInfoForm.ts index a01bfa121..eb8728c22 100644 --- a/govtool/frontend/src/hooks/forms/useEditDRepInfoForm.ts +++ b/govtool/frontend/src/hooks/forms/useEditDRepInfoForm.ts @@ -77,6 +77,7 @@ export const useEditDRepInfoForm = ( // Navigation const backToForm = useCallback(() => { + window.scrollTo(0, 0); setStep?.(1); closeModal(); }, [setStep]); diff --git a/govtool/frontend/src/pages/EditDRepMetadata.tsx b/govtool/frontend/src/pages/EditDRepMetadata.tsx index de3736d6a..15639360c 100644 --- a/govtool/frontend/src/pages/EditDRepMetadata.tsx +++ b/govtool/frontend/src/pages/EditDRepMetadata.tsx @@ -24,6 +24,7 @@ import { checkIsWalletConnected } from "@utils"; export const EditDRepMetadata = () => { const [step, setStep] = useState(1); + const [loadUserData, setLoadUserData] = useState(true); const { isMobile } = useScreenDimension(); const navigate = useNavigate(); const { t } = useTranslation(); @@ -95,6 +96,8 @@ export const EditDRepMetadata = () => { )} {step === 2 && } From 013e0ab40b9924c1117605b1538755de5cfa8633 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Sworze=C5=84?= Date: Wed, 19 Jun 2024 11:20:09 +0200 Subject: [PATCH 14/36] fix Modal ref error --- .../components/atoms/modal/ModalWrapper.tsx | 52 +++++++++++-------- .../organisms/Modal/ChooseWalletModal.tsx | 8 +-- .../organisms/Modal/ExternalLinkModal.tsx | 7 +-- .../organisms/Modal/LoadingModal.tsx | 6 ++- .../organisms/Modal/StatusModal.tsx | 11 ++-- .../organisms/Modal/VotingPowerModal.tsx | 6 ++- 6 files changed, 53 insertions(+), 37 deletions(-) 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/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 = () => { ); -}; +}); From 3e74a2d9339598554078c6458e522044cfaba8ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Sworze=C5=84?= Date: Wed, 19 Jun 2024 11:20:33 +0200 Subject: [PATCH 15/36] fix tab index Modal --- govtool/frontend/src/components/atoms/modal/Modal.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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} ); From 2181a363e69e2d32a0551625f88e8002b4078586 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Sworze=C5=84?= Date: Wed, 19 Jun 2024 11:21:01 +0200 Subject: [PATCH 16/36] fix nested p error --- govtool/frontend/src/components/atoms/types.ts | 2 +- .../src/components/molecules/DashboardActionCard.tsx | 1 + govtool/frontend/src/i18n/locales/en.ts | 9 +++------ 3 files changed, 5 insertions(+), 7 deletions(-) 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/i18n/locales/en.ts b/govtool/frontend/src/i18n/locales/en.ts index 9e2b2ddf6..de8d0b8c2 100644 --- a/govtool/frontend/src/i18n/locales/en.ts +++ b/govtool/frontend/src/i18n/locales/en.ts @@ -712,12 +712,9 @@ export const en = { retireDirectVoter: "Retire as a Direct Voter", }, system: { - sanchoNet: "SanchoNet", - sanchoNetIsBeta: - "The SanchoNet GovTool is currently in beta and it connects to ", - testAdaNote: - "Please note, this tool uses ‘Test ada’ <0>NOT real ada. All governance actions and related terms pertain to SanchoNet.", - toolConnectedToSanchonet: "This tool is connected to SanchoNet", + testnetDescription: + "The SanchoNet GovTool is currently in beta and it connects to <0>SanchoNet.\n\n Please note, this tool uses ‘Test ada’ NOT real ada. All governance actions and related terms pertain to SanchoNet.", + testnetTitle: "This tool is connected to SanchoNet", }, tooltips: { delegateTodRep: { From 781914dbe0768ac32b54d4255311067bf091d886 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Sworze=C5=84?= Date: Wed, 19 Jun 2024 11:22:04 +0200 Subject: [PATCH 17/36] fix cannot get value from undefined and improve sanchonet info modal --- .../src/context/pendingTransaction/utils.tsx | 8 ++--- govtool/frontend/src/context/wallet.tsx | 30 +++++++------------ 2 files changed, 15 insertions(+), 23 deletions(-) diff --git a/govtool/frontend/src/context/pendingTransaction/utils.tsx b/govtool/frontend/src/context/pendingTransaction/utils.tsx index ffa97b22a..1d3e765dd 100644 --- a/govtool/frontend/src/context/pendingTransaction/utils.tsx +++ b/govtool/frontend/src/context/pendingTransaction/utils.tsx @@ -70,13 +70,13 @@ export const refetchData = async ( resourceId === AutomatedVotingOptionDelegationId.no_confidence || resourceId === AutomatedVotingOptionDelegationId.abstain ) { - return data.dRepView; + return data?.dRepView; } - return data.dRepHash; + return data?.dRepHash; } if (type === "registerAsDrep" || type === "retireAsDrep") - return data.isRegisteredAsDRep; + return data?.isRegisteredAsDRep; if (type === "registerAsDirectVoter" || type === "retireAsDirectVoter") - return data.isRegisteredAsSoleVoter; + return data?.isRegisteredAsSoleVoter; return undefined; }; diff --git a/govtool/frontend/src/context/wallet.tsx b/govtool/frontend/src/context/wallet.tsx index 1ea70f80c..494df38ef 100644 --- a/govtool/frontend/src/context/wallet.tsx +++ b/govtool/frontend/src/context/wallet.tsx @@ -217,6 +217,7 @@ const CardanoProvider = (props: Props) => { try { const raw = await enabledApi.getUsedAddresses(); const rawFirst = raw[0]; + if (!rawFirst) return []; const usedAddress = Address.from_bytes( Buffer.from(rawFirst, "hex"), ).to_bech32(); @@ -932,26 +933,17 @@ function useCardano() { status: "info", dataTestId: "info-about-sancho-net-modal", message: ( -

- {t("system.sanchoNetIsBeta")} - openInNewTab("https://sancho.network/")} - sx={{ cursor: "pointer" }} - > - {t("system.sanchoNet")} - - . -
-
- , - ]} - /> -

+ openInNewTab("https://sancho.network/")} + sx={{ cursor: "pointer" }} + />, + ]} + /> ), - title: t("system.toolConnectedToSanchonet"), + title: t("system.testnetTitle"), buttonText: t("ok"), }, }); From f185f8b24d30ab04e2c94c5cbefdc50ab39309d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Sworze=C5=84?= Date: Wed, 19 Jun 2024 11:36:44 +0200 Subject: [PATCH 18/36] fix navigation --- .../frontend/src/components/molecules/WalletInfoCard.tsx | 2 +- govtool/frontend/src/components/molecules/WalletOption.tsx | 7 +++++-- .../organisms/GovernanceActionDetailsCardData.tsx | 4 +++- 3 files changed, 9 insertions(+), 4 deletions(-) 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/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 ( Date: Mon, 17 Jun 2024 18:57:37 +0545 Subject: [PATCH 19/36] fix: Dashboard and homepage learn more navigation link --- .../tests/6-miscellaneous/miscellaneous.loggedin.spec.ts | 8 +++++--- .../tests/6-miscellaneous/miscellaneous.spec.ts | 6 ++++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/tests/govtool-frontend/playwright/tests/6-miscellaneous/miscellaneous.loggedin.spec.ts b/tests/govtool-frontend/playwright/tests/6-miscellaneous/miscellaneous.loggedin.spec.ts index 2d3d1c46c..d4d7e9895 100644 --- a/tests/govtool-frontend/playwright/tests/6-miscellaneous/miscellaneous.loggedin.spec.ts +++ b/tests/govtool-frontend/playwright/tests/6-miscellaneous/miscellaneous.loggedin.spec.ts @@ -51,7 +51,7 @@ test.describe("Logged in user", () => { ]); await expect(directVoterLearnMorepage).toHaveURL( - `${environments.docsUrl}/faqs/what-does-it-mean-to-register-as-a-drep` + `${environments.docsUrl}/how-to-use-the-govtool/using-govtool/direct-voting` ); const [GA_LearnMorepage] = await Promise.all([ @@ -59,7 +59,9 @@ test.describe("Logged in user", () => { page.getByTestId("learn-more-governance-actions-button").click(), ]); - await expect(GA_LearnMorepage).toHaveURL("https://sancho.network/actions/"); + await expect(GA_LearnMorepage).toHaveURL( + `${environments.docsUrl}/how-to-use-the-govtool/using-govtool/governance-actions/governance-actions-how-to-vote` + ); const [proposed_GA_VoterLearnMorepage] = await Promise.all([ context.waitForEvent("page"), @@ -71,7 +73,7 @@ test.describe("Logged in user", () => { ]); // BUG should be unique test id await expect(proposed_GA_VoterLearnMorepage).toHaveURL( - `${environments.docsUrl}/faqs/what-is-a-governance-action` + `${environments.docsUrl}/how-to-use-the-govtool/using-govtool/governance-actions` ); }); diff --git a/tests/govtool-frontend/playwright/tests/6-miscellaneous/miscellaneous.spec.ts b/tests/govtool-frontend/playwright/tests/6-miscellaneous/miscellaneous.spec.ts index 67ee1af2d..46de683b3 100644 --- a/tests/govtool-frontend/playwright/tests/6-miscellaneous/miscellaneous.spec.ts +++ b/tests/govtool-frontend/playwright/tests/6-miscellaneous/miscellaneous.spec.ts @@ -75,7 +75,9 @@ test("6D. Should open Sanchonet docs in a new tab when clicking `Learn More` on page.getByTestId("lear-more-about-sole-voter-button").click(), ]); - await expect(directVoterLearnMorepage).toHaveURL(`${environments.docsUrl}`); + await expect(directVoterLearnMorepage).toHaveURL( + `${environments.docsUrl}/how-to-use-the-govtool/using-govtool/direct-voting` + ); const [proposed_GA_VoterLearnMorepage] = await Promise.all([ context.waitForEvent("page"), @@ -83,6 +85,6 @@ test("6D. Should open Sanchonet docs in a new tab when clicking `Learn More` on ]); await expect(proposed_GA_VoterLearnMorepage).toHaveURL( - `${environments.docsUrl}` + `${environments.docsUrl}/how-to-use-the-govtool/using-govtool/governance-actions` ); }); From 2c96724fe5cab12522d19dae2def74a0cab0335d Mon Sep 17 00:00:00 2001 From: niraj Date: Mon, 17 Jun 2024 18:58:18 +0545 Subject: [PATCH 20/36] fix: Abstain and signal-no-confidence info navigation url --- .../tests/6-miscellaneous/miscellaneous.loggedin.spec.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/govtool-frontend/playwright/tests/6-miscellaneous/miscellaneous.loggedin.spec.ts b/tests/govtool-frontend/playwright/tests/6-miscellaneous/miscellaneous.loggedin.spec.ts index d4d7e9895..d564de696 100644 --- a/tests/govtool-frontend/playwright/tests/6-miscellaneous/miscellaneous.loggedin.spec.ts +++ b/tests/govtool-frontend/playwright/tests/6-miscellaneous/miscellaneous.loggedin.spec.ts @@ -91,7 +91,9 @@ test.describe("Logged in user", () => { dRepDirectoryPage.abstainInfoButton.click(), ]); - await expect(abstain_Info_Page).toHaveURL(`${environments.docsUrl}`); + await expect(abstain_Info_Page).toHaveURL( + `${environments.docsUrl}/how-to-use-the-govtool/using-govtool/delegating/abstain-from-every-vote` + ); const [signal_No_Confidence_Info_Page] = await Promise.all([ context.waitForEvent("page"), @@ -99,7 +101,7 @@ test.describe("Logged in user", () => { ]); await expect(signal_No_Confidence_Info_Page).toHaveURL( - `${environments.docsUrl}` + `${environments.docsUrl}/how-to-use-the-govtool/using-govtool/delegating/signal-no-confidence-on-every-vote` ); }); From bd439fa22797a9a3f1dbfbb9111272736f5b5293 Mon Sep 17 00:00:00 2001 From: niraj Date: Fri, 21 Jun 2024 15:46:10 +0545 Subject: [PATCH 21/36] chore: Replace hardcoded docs url with constant --- .../playwright/lib/constants/docsUrl.ts | 11 +++++ .../miscellaneous.loggedin.spec.ts | 41 ++++++++----------- .../6-miscellaneous/miscellaneous.spec.ts | 33 +++++++-------- 3 files changed, 42 insertions(+), 43 deletions(-) create mode 100644 tests/govtool-frontend/playwright/lib/constants/docsUrl.ts diff --git a/tests/govtool-frontend/playwright/lib/constants/docsUrl.ts b/tests/govtool-frontend/playwright/lib/constants/docsUrl.ts new file mode 100644 index 000000000..3f6c27f0d --- /dev/null +++ b/tests/govtool-frontend/playwright/lib/constants/docsUrl.ts @@ -0,0 +1,11 @@ +import environments from "./environments"; + +export const DELEGATION_DOC_URL = `${environments.docsUrl}/faqs/ways-to-use-your-voting-power`; +export const REGISTER_DREP_DOC_URL = `${environments.docsUrl}/faqs/what-does-it-mean-to-register-as-a-drep`; +export const DIRECT_VOTER_DOC_URL = `${environments.docsUrl}/how-to-use-the-govtool/using-govtool/direct-voting`; +export const GOVERNANCE_ACTION_DOC_URL = `${environments.docsUrl}/how-to-use-the-govtool/using-govtool/governance-actions/governance-actions-how-to-vote`; +export const PROPOSE_GOVERNANCE_ACTION_DOC_URL = `${environments.docsUrl}/how-to-use-the-govtool/using-govtool/governance-actions`; +export const ABSTAIN_VOTE_DOC_URL = `${environments.docsUrl}/how-to-use-the-govtool/using-govtool/delegating/abstain-from-every-vote`; +export const SIGNAL_NO_CONFIDENCE_VOTE_DOC_URL = `${environments.docsUrl}/how-to-use-the-govtool/using-govtool/delegating/signal-no-confidence-on-every-vote`; +export const FAQS_DOC_URL = `${environments.docsUrl}/faqs`; +export const GUIDES_DOC_URL = `${environments.docsUrl}/about/what-is-sanchonet-govtool`; diff --git a/tests/govtool-frontend/playwright/tests/6-miscellaneous/miscellaneous.loggedin.spec.ts b/tests/govtool-frontend/playwright/tests/6-miscellaneous/miscellaneous.loggedin.spec.ts index d564de696..b96e62322 100644 --- a/tests/govtool-frontend/playwright/tests/6-miscellaneous/miscellaneous.loggedin.spec.ts +++ b/tests/govtool-frontend/playwright/tests/6-miscellaneous/miscellaneous.loggedin.spec.ts @@ -1,4 +1,12 @@ -import environments from "@constants/environments"; +import { + ABSTAIN_VOTE_DOC_URL, + DELEGATION_DOC_URL, + DIRECT_VOTER_DOC_URL, + GOVERNANCE_ACTION_DOC_URL, + PROPOSE_GOVERNANCE_ACTION_DOC_URL, + REGISTER_DREP_DOC_URL, + SIGNAL_NO_CONFIDENCE_VOTE_DOC_URL, +} from "@constants/docsUrl"; import { user01Wallet } from "@constants/staticWallets"; import { createTempUserAuth } from "@datafactory/createAuth"; import { faker } from "@faker-js/faker"; @@ -31,37 +39,25 @@ test.describe("Logged in user", () => { context.waitForEvent("page"), page.getByTestId("delegate-learn-more-button").click(), ]); - - await expect(delegationLearnMorepage).toHaveURL( - `${environments.docsUrl}/faqs/ways-to-use-your-voting-power` - ); + await expect(delegationLearnMorepage).toHaveURL(DELEGATION_DOC_URL); const [registerLearnMorepage] = await Promise.all([ context.waitForEvent("page"), page.getByTestId("register-learn-more-button").click(), ]); - - await expect(registerLearnMorepage).toHaveURL( - `${environments.docsUrl}/faqs/what-does-it-mean-to-register-as-a-drep` - ); + await expect(registerLearnMorepage).toHaveURL(REGISTER_DREP_DOC_URL); const [directVoterLearnMorepage] = await Promise.all([ context.waitForEvent("page"), page.getByTestId("learn-more-button").first().click(), // BUG should be unique test id ]); - - await expect(directVoterLearnMorepage).toHaveURL( - `${environments.docsUrl}/how-to-use-the-govtool/using-govtool/direct-voting` - ); + await expect(directVoterLearnMorepage).toHaveURL(DIRECT_VOTER_DOC_URL); const [GA_LearnMorepage] = await Promise.all([ context.waitForEvent("page"), page.getByTestId("learn-more-governance-actions-button").click(), ]); - - await expect(GA_LearnMorepage).toHaveURL( - `${environments.docsUrl}/how-to-use-the-govtool/using-govtool/governance-actions/governance-actions-how-to-vote` - ); + await expect(GA_LearnMorepage).toHaveURL(GOVERNANCE_ACTION_DOC_URL); const [proposed_GA_VoterLearnMorepage] = await Promise.all([ context.waitForEvent("page"), @@ -71,9 +67,8 @@ test.describe("Logged in user", () => { .getByTestId("learn-more-button") .click(), ]); // BUG should be unique test id - await expect(proposed_GA_VoterLearnMorepage).toHaveURL( - `${environments.docsUrl}/how-to-use-the-govtool/using-govtool/governance-actions` + PROPOSE_GOVERNANCE_ACTION_DOC_URL ); }); @@ -90,18 +85,14 @@ test.describe("Logged in user", () => { context.waitForEvent("page"), dRepDirectoryPage.abstainInfoButton.click(), ]); - - await expect(abstain_Info_Page).toHaveURL( - `${environments.docsUrl}/how-to-use-the-govtool/using-govtool/delegating/abstain-from-every-vote` - ); + await expect(abstain_Info_Page).toHaveURL(ABSTAIN_VOTE_DOC_URL); const [signal_No_Confidence_Info_Page] = await Promise.all([ context.waitForEvent("page"), dRepDirectoryPage.signalNoConfidenceInfoButton.click(), ]); - await expect(signal_No_Confidence_Info_Page).toHaveURL( - `${environments.docsUrl}/how-to-use-the-govtool/using-govtool/delegating/signal-no-confidence-on-every-vote` + SIGNAL_NO_CONFIDENCE_VOTE_DOC_URL ); }); diff --git a/tests/govtool-frontend/playwright/tests/6-miscellaneous/miscellaneous.spec.ts b/tests/govtool-frontend/playwright/tests/6-miscellaneous/miscellaneous.spec.ts index 46de683b3..2a65c17b4 100644 --- a/tests/govtool-frontend/playwright/tests/6-miscellaneous/miscellaneous.spec.ts +++ b/tests/govtool-frontend/playwright/tests/6-miscellaneous/miscellaneous.spec.ts @@ -1,3 +1,12 @@ +import { + DELEGATION_DOC_URL, + DIRECT_VOTER_DOC_URL, + REGISTER_DREP_DOC_URL, + GOVERNANCE_ACTION_DOC_URL, + PROPOSE_GOVERNANCE_ACTION_DOC_URL, + FAQS_DOC_URL, + GUIDES_DOC_URL, +} from "@constants/docsUrl"; import { test } from "@fixtures/walletExtension"; import { setAllureEpic } from "@helpers/allure"; import { isMobile, openDrawer } from "@helpers/mobile"; @@ -25,9 +34,7 @@ test("6C. Navigation within the dApp", async ({ page, context }) => { page.getByTestId("guides-link").click(), ]); - await expect(guidesPage).toHaveURL( - `${environments.docsUrl}/about/what-is-sanchonet-govtool` - ); + await expect(guidesPage).toHaveURL(GUIDES_DOC_URL); if (isMobile(page)) { await openDrawer(page); @@ -37,7 +44,7 @@ test("6C. Navigation within the dApp", async ({ page, context }) => { page.getByTestId("faqs-link").click(), ]); - await expect(faqsPage).toHaveURL(`${environments.docsUrl}/faqs`); + await expect(faqsPage).toHaveURL(FAQS_DOC_URL); if (isMobile(page)) { await openDrawer(page); @@ -56,35 +63,25 @@ test("6D. Should open Sanchonet docs in a new tab when clicking `Learn More` on context.waitForEvent("page"), page.getByTestId("delegate-learn-more-button").click(), ]); - - await expect(delegationLearnMorepage).toHaveURL( - `${environments.docsUrl}/faqs/ways-to-use-your-voting-power` - ); + await expect(delegationLearnMorepage).toHaveURL(DELEGATION_DOC_URL); const [registerLearnMorepage] = await Promise.all([ context.waitForEvent("page"), page.getByTestId("register-learn-more-button").click(), ]); - - await expect(registerLearnMorepage).toHaveURL( - `${environments.docsUrl}/faqs/what-does-it-mean-to-register-as-a-drep` - ); + await expect(registerLearnMorepage).toHaveURL(REGISTER_DREP_DOC_URL); const [directVoterLearnMorepage] = await Promise.all([ context.waitForEvent("page"), page.getByTestId("lear-more-about-sole-voter-button").click(), ]); - - await expect(directVoterLearnMorepage).toHaveURL( - `${environments.docsUrl}/how-to-use-the-govtool/using-govtool/direct-voting` - ); + await expect(directVoterLearnMorepage).toHaveURL(DIRECT_VOTER_DOC_URL); const [proposed_GA_VoterLearnMorepage] = await Promise.all([ context.waitForEvent("page"), page.getByRole("button", { name: "Learn more" }).nth(3).click(), // BUG missing test id ]); - await expect(proposed_GA_VoterLearnMorepage).toHaveURL( - `${environments.docsUrl}/how-to-use-the-govtool/using-govtool/governance-actions` + PROPOSE_GOVERNANCE_ACTION_DOC_URL ); }); From be00b5066820976e64c3f29ad1f8c3c152603e50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Sza=C5=82owski?= Date: Thu, 20 Jun 2024 12:58:21 +0200 Subject: [PATCH 22/36] chore: fix flaky tests --- .../frontend/src/components/atoms/CopyButton.test.tsx | 9 ++++++--- govtool/frontend/src/utils/tests/getDRepID.test.ts | 11 +++++++---- govtool/frontend/vite.config.ts | 7 +++++++ 3 files changed, 20 insertions(+), 7 deletions(-) diff --git a/govtool/frontend/src/components/atoms/CopyButton.test.tsx b/govtool/frontend/src/components/atoms/CopyButton.test.tsx index 8f7666858..3000ec952 100644 --- a/govtool/frontend/src/components/atoms/CopyButton.test.tsx +++ b/govtool/frontend/src/components/atoms/CopyButton.test.tsx @@ -3,6 +3,7 @@ import { render, screen } from "@testing-library/react"; import userEvent from "@testing-library/user-event"; import { SnackbarProvider } from "@context"; import { CopyButton } from "@atoms"; +import { act } from "react"; Object.defineProperty(global.navigator, "clipboard", { value: { @@ -61,9 +62,11 @@ describe("CopyButton", () => { ); 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/utils/tests/getDRepID.test.ts b/govtool/frontend/src/utils/tests/getDRepID.test.ts index 61bc5470c..d533d4a40 100644 --- a/govtool/frontend/src/utils/tests/getDRepID.test.ts +++ b/govtool/frontend/src/utils/tests/getDRepID.test.ts @@ -43,15 +43,18 @@ describe("getPubDRepID function", () => { }); it("returns undefined values for dRepKey, dRepID, and dRepIDBech32 when walletApi throws an error", async () => { - mockGetPubDRepKey.mockRejectedValueOnce( - new Error("Failed to get PubDRepKey"), - ); + const failedToGetPubDRepKeyError = new Error("Failed to get PubDRepKey"); + mockGetPubDRepKey.mockRejectedValueOnce(failedToGetPubDRepKeyError); + + const consoleErrorSpy = vi.spyOn(console, "error"); const result = await getPubDRepID(mockWalletApi); + expect(result).toEqual({ dRepKey: undefined, dRepID: undefined, dRepIDBech32: undefined, }); - expect(mockGetPubDRepKey).toHaveBeenCalled(); + + expect(consoleErrorSpy).toHaveBeenCalledWith(failedToGetPubDRepKeyError); }); }); diff --git a/govtool/frontend/vite.config.ts b/govtool/frontend/vite.config.ts index 5ad7053a3..877fbe5a3 100644 --- a/govtool/frontend/vite.config.ts +++ b/govtool/frontend/vite.config.ts @@ -81,6 +81,13 @@ const vitestConfig = defineVitestConfig({ test: { setupFiles: "./src/setupTests.ts", globals: true, + pool: "forks", + poolOptions: { + threads: { + minThreads: 2, + }, + }, + maxConcurrency: 4, environment: "jsdom", reporters: ["default", "junit"], outputFile: { From dbb00ed2a69218fbf5c39b8c39a5aed0bb617069 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Sza=C5=82owski?= Date: Thu, 20 Jun 2024 14:47:17 +0200 Subject: [PATCH 23/36] feat: pass govtool metadata validator to pdf pillar --- docs/GOVERNANCE_ACTION_SUBMISSION.md | 43 +++++++++++++++++++ .../src/components/organisms/PDFWrapper.tsx | 15 +++++-- .../frontend/src/types/@intersect.mbo.d.ts | 26 ++++++++++- 3 files changed, 79 insertions(+), 5 deletions(-) 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/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/types/@intersect.mbo.d.ts b/govtool/frontend/src/types/@intersect.mbo.d.ts index 3c9ca7e21..df61e1eae 100644 --- a/govtool/frontend/src/types/@intersect.mbo.d.ts +++ b/govtool/frontend/src/types/@intersect.mbo.d.ts @@ -1,10 +1,32 @@ -type PDFProps = { +enum MetadataValidationStatus { + URL_NOT_FOUND = "URL_NOT_FOUND", + INVALID_JSONLD = "INVALID_JSONLD", + INVALID_HASH = "INVALID_HASH", + INCORRECT_FORMAT = "INCORRECT_FORMAT", +} + +type ProposalDiscussionProps = { // eslint-disable-next-line @typescript-eslint/no-explicit-any walletAPI: any; pathname: string; locale?: string; + validateMetadata: ({ + url, + hash, + standard, + }: { + url: string; + hash: string; + standard: "CIP108"; + }) => Promise< + // eslint-disable-next-line @typescript-eslint/no-explicit-any + | { status?: MetadataValidationStatus; metadata?: any; valid: boolean } + | undefined + >; }; declare module "@intersect.mbo/pdf-ui/cjs" { - export default function PDF(props: PDFProps): JSX.Element; + export default function ProposalDiscussion( + props: ProposalDiscussionProps, + ): JSX.Element; } From 0052547cd3e4903f4a2d1417c48dffebf22e3393 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Sworze=C5=84?= Date: Fri, 21 Jun 2024 15:14:34 +0200 Subject: [PATCH 24/36] fix vote --- .../src/hooks/forms/useVoteActionForm.tsx | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/govtool/frontend/src/hooks/forms/useVoteActionForm.tsx b/govtool/frontend/src/hooks/forms/useVoteActionForm.tsx index b554413a4..499c02b6e 100644 --- a/govtool/frontend/src/hooks/forms/useVoteActionForm.tsx +++ b/govtool/frontend/src/hooks/forms/useVoteActionForm.tsx @@ -2,7 +2,7 @@ import { useCallback, useMemo, useState } from "react"; import { useForm, useWatch } from "react-hook-form"; import * as Yup from "yup"; import { yupResolver } from "@hookform/resolvers/yup"; -import { useLocation, useNavigate } from "react-router-dom"; +import { useLocation, useNavigate, useParams } from "react-router-dom"; import { PATHS } from "@consts"; import { useCardano, useSnackbar } from "@context"; @@ -37,7 +37,8 @@ export const useVoteActionForm = ( useCardano(); const { addSuccessAlert } = useSnackbar(); const navigate = useNavigate(); - const { state } = useLocation(); + const { state, hash } = useLocation(); + const params = useParams(); const openWalletErrorModal = useWalletErrorModal(); const { @@ -62,21 +63,23 @@ export const useVoteActionForm = ( const urlSubmitValue = voteContextUrl ?? ""; const hashSubmitValue = voteContextHash ?? ""; + const txHash = state?.txHash ?? params.proposalId; + const index = state?.index ?? hash.replace("#", ""); try { const isPendingTx = isPendingTransaction(); if (isPendingTx) return; const votingBuilder = await buildVote( vote, - state.txHash, - state.index, + txHash, + index, urlSubmitValue, hashSubmitValue, ); const result = await buildSignSubmitConwayCertTx({ votingBuilder, type: "vote", - resourceId: state.txHash + state.index, + resourceId: txHash + index, }); if (result) { addSuccessAlert("Vote submitted"); @@ -95,7 +98,7 @@ export const useVoteActionForm = ( setIsLoading(false); } }, - [state, buildVote, buildSignSubmitConwayCertTx], + [state, buildVote, buildSignSubmitConwayCertTx, params, hash], ); return { From f5507e8f8ce198c36620f2f1437b8a55dd867497 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Sza=C5=82owski?= Date: Fri, 21 Jun 2024 11:39:20 +0200 Subject: [PATCH 25/36] chore: provide tags to sentry events --- .github/workflows/test_storybook.yml | 2 +- govtool/frontend/package-lock.json | 16 +++++----- govtool/frontend/package.json | 13 ++++---- .../WhatRetirementMeans.tsx | 8 ++++- .../organisms/RegisterAsDirectVoterBox.tsx | 8 ++++- govtool/frontend/src/context/getUtxos.ts | 7 ++-- .../frontend/src/context/governanceAction.tsx | 9 ++++++ govtool/frontend/src/context/wallet.tsx | 32 ++++++++++++++++++- .../forms/useCreateGovernanceActionForm.ts | 8 +++-- .../src/hooks/forms/useDelegateTodRepForm.tsx | 3 ++ .../src/hooks/forms/useEditDRepInfoForm.ts | 5 +-- .../src/hooks/forms/useRegisterAsdRepForm.tsx | 8 +++-- .../src/hooks/forms/useVoteActionForm.tsx | 3 ++ .../src/hooks/forms/useVoteContextForm.tsx | 5 +-- .../frontend/src/hooks/useDelegateToDrep.ts | 1 + govtool/frontend/src/main.tsx | 17 +++------- govtool/frontend/src/types/global.d.ts | 9 ++++++ govtool/frontend/storybook.Dockerfile | 2 +- 18 files changed, 110 insertions(+), 46 deletions(-) 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/govtool/frontend/package-lock.json b/govtool/frontend/package-lock.json index 3d53d63ab..dcea00ac9 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", @@ -20,9 +20,6 @@ "@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", @@ -9696,7 +9695,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", diff --git a/govtool/frontend/package.json b/govtool/frontend/package.json index 0c62659b1..12d82d250 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", @@ -34,9 +34,6 @@ "@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/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/context/getUtxos.ts b/govtool/frontend/src/context/getUtxos.ts index 6888846a8..615877691 100644 --- a/govtool/frontend/src/context/getUtxos.ts +++ b/govtool/frontend/src/context/getUtxos.ts @@ -13,7 +13,7 @@ type Utxos = { }[]; export const getUtxos = async ( - enabledApi: CardanoApiWallet + enabledApi: CardanoApiWallet, ): Promise => { const utxos = []; @@ -24,7 +24,7 @@ export const getUtxos = async ( // eslint-disable-next-line no-restricted-syntax for (const rawUtxo of rawUtxos) { const utxo = TransactionUnspentOutput.from_bytes( - Buffer.from(rawUtxo, "hex") + Buffer.from(rawUtxo, "hex"), ); const input = utxo.input(); const txid = input.transaction_id().to_hex(); @@ -54,7 +54,7 @@ export const getUtxos = async ( // @ts-ignore const assetNameHex = Buffer.from( assetName.name(), - "utf8" + "utf8", ).toString("hex"); const multiassetAmt = multiasset.get_asset(policyId, assetName); multiAssetStr += `+ ${multiassetAmt.to_str()} + ${policyIdHex}.${assetNameHex} (${assetNameString})`; @@ -76,6 +76,7 @@ export const getUtxos = async ( return utxos; } catch (err) { + Sentry.setTag("util", "getUtxos"); Sentry.captureException(err); console.error(err); } diff --git a/govtool/frontend/src/context/governanceAction.tsx b/govtool/frontend/src/context/governanceAction.tsx index c03cd9460..a1f1066e2 100644 --- a/govtool/frontend/src/context/governanceAction.tsx +++ b/govtool/frontend/src/context/governanceAction.tsx @@ -4,9 +4,11 @@ import { createContext, useContext, useCallback, + useEffect, } from "react"; import { NodeObject } from "jsonld"; import { blake2bHex } from "blakejs"; +import * as Sentry from "@sentry/react"; import { CIP_108, GOVERNANCE_ACTION_CONTEXT } from "@/consts"; import { canonizeJSON, generateJsonld, generateMetadataBody } from "@/utils"; @@ -40,6 +42,11 @@ const GovernanceActionProvider = ({ children }: PropsWithChildren) => { * @param {GovActionMetadata} govActionMetadata - The metadata of the governance action. * @returns The JSON-LD representation of the governance action. */ + + useEffect(() => { + Sentry.setTag("component_name", "GovernanceActionProvider"); + }, []); + const createGovernanceActionJsonLD = useCallback( async (govActionMetadata: GovActionMetadata) => { try { @@ -55,6 +62,7 @@ const GovernanceActionProvider = ({ children }: PropsWithChildren) => { ); return jsonLD; } catch (error) { + Sentry.captureException(error); console.error(error); } }, @@ -72,6 +80,7 @@ const GovernanceActionProvider = ({ children }: PropsWithChildren) => { const canonizedJsonHash = blake2bHex(canonizedJson, undefined, 32); return canonizedJsonHash; } catch (error) { + Sentry.captureException(error); console.error(error); } }, []); diff --git a/govtool/frontend/src/context/wallet.tsx b/govtool/frontend/src/context/wallet.tsx index 494df38ef..3251c0ae9 100644 --- a/govtool/frontend/src/context/wallet.tsx +++ b/govtool/frontend/src/context/wallet.tsx @@ -208,6 +208,7 @@ const CardanoProvider = (props: Props) => { // return changeAddress for the usage of the pillars; return changeAddress; } catch (err) { + Sentry.setTag("wallet-action", "getChangeAddress"); Sentry.captureException(err); console.error(err); } @@ -223,6 +224,7 @@ const CardanoProvider = (props: Props) => { ).to_bech32(); setWalletState((prev) => ({ ...prev, usedAddress })); } catch (err) { + Sentry.setTag("wallet-action", "getUsedAddresses"); Sentry.captureException(err); console.error(err); } @@ -251,8 +253,22 @@ const CardanoProvider = (props: Props) => { .enable({ extensions: [{ cip: 95 }], }) + .then((enabledWalletApi) => { + Sentry.addBreadcrumb({ + category: "wallet", + message: "Wallet connected", + level: "info", + data: window.cardano[walletName], + }); + return enabledWalletApi; + }) .catch((e) => { - Sentry.captureException(e); + Sentry.addBreadcrumb({ + category: "wallet", + message: "Wallet connection failed", + level: "warning", + }); + Sentry.captureException(e, { data: window.cardano[walletName] }); throw e.info; }); await getChangeAddress(enabledApi); @@ -352,6 +368,7 @@ const CardanoProvider = (props: Props) => { return { status: t("ok"), stakeKey: stakeKeySet }; } catch (e) { + Sentry.setTag("wallet-action", "enable"); Sentry.captureException(e); console.error(e); setError(`${e}`); @@ -382,6 +399,12 @@ const CardanoProvider = (props: Props) => { setAddress(undefined); setStakeKey(undefined); setIsEnabled(false); + + Sentry.addBreadcrumb({ + category: "wallet", + message: "Wallet disconnected", + level: "info", + }); }, []); // Create transaction builder @@ -562,6 +585,7 @@ const CardanoProvider = (props: Props) => { disconnectWallet(); } + Sentry.setTag("wallet-action", "buildSignSubmitConwayCertTx"); Sentry.captureException(error); console.error(error, "error"); throw error?.info ?? error; @@ -608,6 +632,7 @@ const CardanoProvider = (props: Props) => { return certBuilder; } catch (e) { + Sentry.setTag("wallet-action", "buildVoteDelegationCert"); Sentry.captureException(e); console.error(e); throw e; @@ -646,6 +671,7 @@ const CardanoProvider = (props: Props) => { } return Certificate.new_drep_registration(dRepRegCert); } catch (e) { + Sentry.setTag("wallet-action", "buildDRepRegCert"); Sentry.captureException(e); console.error(e); throw e; @@ -675,6 +701,7 @@ const CardanoProvider = (props: Props) => { } return Certificate.new_drep_update(dRepUpdateCert); } catch (e) { + Sentry.setTag("wallet-action", "buildDRepUpdateCert"); Sentry.captureException(e); console.error(e); throw e; @@ -697,6 +724,7 @@ const CardanoProvider = (props: Props) => { return Certificate.new_drep_deregistration(dRepRetirementCert); } catch (e) { + Sentry.setTag("wallet-action", "buildDRepRetirementCert"); Sentry.captureException(e); console.error(e); throw e; @@ -750,6 +778,7 @@ const CardanoProvider = (props: Props) => { return votingBuilder; } catch (e) { + Sentry.setTag("wallet-action", "buildVote"); Sentry.captureException(e); console.error(e); throw e; @@ -954,6 +983,7 @@ function useCardano() { // TODO: type error // eslint-disable-next-line @typescript-eslint/no-explicit-any } catch (e: any) { + Sentry.setTag("wallet-action", "enable"); Sentry.captureException(e); await context.disconnectWallet(); navigate(PATHS.home); diff --git a/govtool/frontend/src/hooks/forms/useCreateGovernanceActionForm.ts b/govtool/frontend/src/hooks/forms/useCreateGovernanceActionForm.ts index 7406665b0..9fdaae96f 100644 --- a/govtool/frontend/src/hooks/forms/useCreateGovernanceActionForm.ts +++ b/govtool/frontend/src/hooks/forms/useCreateGovernanceActionForm.ts @@ -2,7 +2,7 @@ import { Dispatch, SetStateAction, useCallback, useState } from "react"; import { useNavigate } from "react-router-dom"; import { useFormContext } from "react-hook-form"; import { blake2bHex } from "blakejs"; -import { captureException } from "@sentry/react"; +import * as Sentry from "@sentry/react"; import { useTranslation } from "react-i18next"; import { NodeObject } from "jsonld"; @@ -156,7 +156,8 @@ export const useCreateGovernanceActionForm = ( throw new Error(t("errors.invalidGovernanceActionType")); } } catch (error) { - captureException(error); + Sentry.setTag("hook", "useCreateGovernanceActionForm"); + Sentry.captureException(error); } }, [hash], @@ -248,7 +249,8 @@ export const useCreateGovernanceActionForm = ( : undefined, dataTestId: "create-governance-action-error-modal", }); - captureException(error); + Sentry.setTag("hook", "useCreateGovernanceActionForm"); + Sentry.captureException(error); } } finally { setIsLoading(false); diff --git a/govtool/frontend/src/hooks/forms/useDelegateTodRepForm.tsx b/govtool/frontend/src/hooks/forms/useDelegateTodRepForm.tsx index 7de68755c..720aac3b7 100644 --- a/govtool/frontend/src/hooks/forms/useDelegateTodRepForm.tsx +++ b/govtool/frontend/src/hooks/forms/useDelegateTodRepForm.tsx @@ -1,6 +1,7 @@ import { useCallback, useState } from "react"; import { useNavigate } from "react-router-dom"; import { useForm, useWatch } from "react-hook-form"; +import * as Sentry from "@sentry/react"; import { PATHS } from "@consts"; import { useCardano, useModal } from "@context"; @@ -72,6 +73,8 @@ export const useDelegateTodRepForm = () => { }); } } catch (error) { + Sentry.setTag("hook", "useDelegateTodRepForm"); + Sentry.captureException(error); openModal({ type: "statusModal", state: { diff --git a/govtool/frontend/src/hooks/forms/useEditDRepInfoForm.ts b/govtool/frontend/src/hooks/forms/useEditDRepInfoForm.ts index a01bfa121..3d6ad9338 100644 --- a/govtool/frontend/src/hooks/forms/useEditDRepInfoForm.ts +++ b/govtool/frontend/src/hooks/forms/useEditDRepInfoForm.ts @@ -3,7 +3,7 @@ import { useNavigate } from "react-router-dom"; import { useTranslation } from "react-i18next"; import { useFormContext } from "react-hook-form"; import { blake2bHex } from "blakejs"; -import { captureException } from "@sentry/react"; +import * as Sentry from "@sentry/react"; import { NodeObject } from "jsonld"; import { @@ -177,7 +177,8 @@ export const useEditDRepInfoForm = ( }, }); } else { - captureException(error); + Sentry.setTag("hook", "useEditDRepInfoForm"); + Sentry.captureException(error); openWalletErrorModal({ error, diff --git a/govtool/frontend/src/hooks/forms/useRegisterAsdRepForm.tsx b/govtool/frontend/src/hooks/forms/useRegisterAsdRepForm.tsx index e7724c407..39c590d95 100644 --- a/govtool/frontend/src/hooks/forms/useRegisterAsdRepForm.tsx +++ b/govtool/frontend/src/hooks/forms/useRegisterAsdRepForm.tsx @@ -3,7 +3,7 @@ import { useNavigate } from "react-router-dom"; import { useTranslation } from "react-i18next"; import { useFormContext } from "react-hook-form"; import { blake2bHex } from "blakejs"; -import { captureException } from "@sentry/react"; +import * as Sentry from "@sentry/react"; import { NodeObject } from "jsonld"; import { @@ -136,7 +136,8 @@ export const useRegisterAsdRepForm = ( return certBuilder; } catch (error) { - captureException(error); + Sentry.setTag("hook", "useRegisterAsdRepForm"); + Sentry.captureException(error); throw error; } }, @@ -212,7 +213,8 @@ export const useRegisterAsdRepForm = ( }, }); } else { - captureException(error); + Sentry.setTag("hook", "useRegisterAsdRepForm"); + Sentry.captureException(error); openWalletErrorModal({ error, diff --git a/govtool/frontend/src/hooks/forms/useVoteActionForm.tsx b/govtool/frontend/src/hooks/forms/useVoteActionForm.tsx index 499c02b6e..b23a369f4 100644 --- a/govtool/frontend/src/hooks/forms/useVoteActionForm.tsx +++ b/govtool/frontend/src/hooks/forms/useVoteActionForm.tsx @@ -3,6 +3,7 @@ import { useForm, useWatch } from "react-hook-form"; import * as Yup from "yup"; import { yupResolver } from "@hookform/resolvers/yup"; import { useLocation, useNavigate, useParams } from "react-router-dom"; +import * as Sentry from "@sentry/react"; import { PATHS } from "@consts"; import { useCardano, useSnackbar } from "@context"; @@ -90,6 +91,8 @@ export const useVoteActionForm = ( }); } } catch (error) { + Sentry.setTag("hook", "useVoteActionForm"); + Sentry.captureException(error); openWalletErrorModal({ error, dataTestId: "vote-transaction-error-modal", diff --git a/govtool/frontend/src/hooks/forms/useVoteContextForm.tsx b/govtool/frontend/src/hooks/forms/useVoteContextForm.tsx index d0afc7ea6..e94e80a79 100644 --- a/govtool/frontend/src/hooks/forms/useVoteContextForm.tsx +++ b/govtool/frontend/src/hooks/forms/useVoteContextForm.tsx @@ -1,7 +1,7 @@ import { Dispatch, SetStateAction, useCallback, useState } from "react"; import { useFormContext } from "react-hook-form"; import { blake2bHex } from "blakejs"; -import { captureException } from "@sentry/react"; +import * as Sentry from "@sentry/react"; import { downloadTextFile } from "@utils"; import { MetadataValidationStatus } from "@models"; @@ -85,7 +85,8 @@ export const useVoteContextForm = ( await validateHash(data.storingURL, hash); // eslint-disable-next-line @typescript-eslint/no-explicit-any } catch (error: any) { - captureException(error); + Sentry.setTag("hook", "useVoteContextForm"); + Sentry.captureException(error); } finally { if (setSavedHash) setSavedHash(hash); if (setStep) setStep(4); diff --git a/govtool/frontend/src/hooks/useDelegateToDrep.ts b/govtool/frontend/src/hooks/useDelegateToDrep.ts index d86655a6a..963c782ec 100644 --- a/govtool/frontend/src/hooks/useDelegateToDrep.ts +++ b/govtool/frontend/src/hooks/useDelegateToDrep.ts @@ -44,6 +44,7 @@ export const useDelegateTodRep = () => { error, dataTestId: "delegate-transaction-error-modal", }); + Sentry.setTag("hook", "useDelegateTodRep"); Sentry.captureException(error); } finally { setIsDelegating(null); diff --git a/govtool/frontend/src/main.tsx b/govtool/frontend/src/main.tsx index 641d5f102..6a39a1d3a 100644 --- a/govtool/frontend/src/main.tsx +++ b/govtool/frontend/src/main.tsx @@ -18,21 +18,11 @@ import { ContextProviders, UsersnapProvider } from "@context"; import App from "./App.tsx"; import { theme } from "./theme.ts"; import "./i18n"; +import pkg from "../package.json"; -const queryClient = new QueryClient(); - -interface SentryEventDataLayer { - event: string; - sentryEventId: string; - sentryErrorMessage?: JSONValue; -} +const { version } = pkg; -// TODO: Move to types -declare global { - interface Window { - dataLayer: SentryEventDataLayer[]; - } -} +const queryClient = new QueryClient(); const tagManagerArgs = { gtmId: import.meta.env.VITE_GTM_ID, @@ -43,6 +33,7 @@ TagManager.initialize(tagManagerArgs); Sentry.init({ dsn: import.meta.env.VITE_SENTRY_DSN, environment: import.meta.env.VITE_APP_ENV, + release: version, integrations: [ new Sentry.BrowserTracing({ routingInstrumentation: Sentry.reactRouterV6Instrumentation( diff --git a/govtool/frontend/src/types/global.d.ts b/govtool/frontend/src/types/global.d.ts index 0e91e6dcd..f4c1c3b93 100644 --- a/govtool/frontend/src/types/global.d.ts +++ b/govtool/frontend/src/types/global.d.ts @@ -1,6 +1,15 @@ export {}; +interface SentryEventDataLayer { + event: string; + sentryEventId: string; + sentryErrorMessage?: JSONValue; +} declare global { + interface Window { + dataLayer: SentryEventDataLayer[]; + } + type VoteType = "yes" | "no" | "abstain"; type ActionTypeFromAPI = { diff --git a/govtool/frontend/storybook.Dockerfile b/govtool/frontend/storybook.Dockerfile index 599f88e16..183ed82ec 100644 --- a/govtool/frontend/storybook.Dockerfile +++ b/govtool/frontend/storybook.Dockerfile @@ -18,7 +18,7 @@ WORKDIR /src COPY --from=deps /src/node_modules ./node_modules COPY . . -RUN npm run build-storybook --quiet +RUN npm run build:storybook --quiet FROM nginx:stable-alpine EXPOSE 80 From fb643d0477ff5c55bfd96e50db80fcabd6e8dd0e Mon Sep 17 00:00:00 2001 From: jankun4 Date: Sun, 23 Jun 2024 17:05:41 +0200 Subject: [PATCH 26/36] [#1093] return 0 drep voting power instead of throwing 500 --- CHANGELOG.md | 1 + govtool/backend/src/VVA/DRep.hs | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e18791a97..6c3d2a38e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -68,6 +68,7 @@ changes. ### Fixed +- 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) 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") From 9c729bc777f1dbe2b7cdd088dd5a8a03f672afb7 Mon Sep 17 00:00:00 2001 From: jankun4 Date: Sun, 23 Jun 2024 17:52:22 +0200 Subject: [PATCH 27/36] [#1148] add -threaded flag to backend --- CHANGELOG.md | 1 + govtool/backend/vva-be.cabal | 2 ++ 2 files changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6c3d2a38e..f7f195c4d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -68,6 +68,7 @@ changes. ### Fixed +- 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) 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 From d4478470672a5ac204682c1be6d81de37ebece37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Sza=C5=82owski?= Date: Mon, 24 Jun 2024 11:20:25 +0200 Subject: [PATCH 28/36] fix(#1355): fix the navigation to Home from Proposal pillar on disconnected wallet --- CHANGELOG.md | 1 + govtool/frontend/src/App.tsx | 15 +++------------ .../frontend/src/components/atoms/DrawerLink.tsx | 2 +- .../ProposeGovActionDashboardCard.tsx | 2 +- govtool/frontend/src/consts/navItems.tsx | 2 +- govtool/frontend/src/consts/paths.ts | 1 - 6 files changed, 7 insertions(+), 16 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6c3d2a38e..d95381537 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -100,6 +100,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 diff --git a/govtool/frontend/src/App.tsx b/govtool/frontend/src/App.tsx index c1756cdae..c61c798cc 100644 --- a/govtool/frontend/src/App.tsx +++ b/govtool/frontend/src/App.tsx @@ -40,7 +40,7 @@ import { PDFWrapper } from "./components/organisms/PDFWrapper"; export default () => { const { isProposalDiscussionForumEnabled } = useFeatureFlag(); - const { enable, isEnabled } = useCardano(); + const { enable } = useCardano(); const navigate = useNavigate(); const { modal, openModal, modals } = useModal(); @@ -87,10 +87,7 @@ export default () => { !window.location.pathname.includes(PATHS.proposalPillar.replace("/*", "")) ) { navigate( - `${(isEnabled - ? PATHS.connectedProposalPillar - : PATHS.proposalPillar - ).replace("/*", "")}${window.location.pathname}`, + `${PATHS.proposalPillar.replace("/*", "")}${window.location.pathname}`, ); } }, [window.location.pathname]); @@ -101,9 +98,6 @@ export default () => { } /> } /> - {isProposalDiscussionForumEnabled && !isEnabled && ( - } /> - )} } @@ -115,10 +109,7 @@ export default () => { }> } /> {isProposalDiscussionForumEnabled && ( - } - /> + } /> )} isActive || (route === - `${PATHS.connectedProposalPillar.replace("/*", "")}${ + `${PATHS.proposalPillar.replace("/*", "")}${ PDF_PATHS.proposalDiscussion }` && Object.values(PDF_PATHS).some((pdfPath) => 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/consts/navItems.tsx b/govtool/frontend/src/consts/navItems.tsx index 5b6ec10f0..acd4fb2b2 100644 --- a/govtool/frontend/src/consts/navItems.tsx +++ b/govtool/frontend/src/consts/navItems.tsx @@ -64,7 +64,7 @@ export const CONNECTED_NAV_ITEMS = [ { dataTestId: "proposal-discussion-link", label: i18n.t("proposalDiscussion.title"), - navTo: `${PATHS.connectedProposalPillar.replace("/*", "")}${ + navTo: `${PATHS.proposalPillar.replace("/*", "")}${ PDF_PATHS.proposalDiscussion }`, activeIcon: ( diff --git a/govtool/frontend/src/consts/paths.ts b/govtool/frontend/src/consts/paths.ts index d7e1973d1..3c16566ca 100644 --- a/govtool/frontend/src/consts/paths.ts +++ b/govtool/frontend/src/consts/paths.ts @@ -25,7 +25,6 @@ export const PATHS = { retireAsDirectVoter: "/retire_direct_voter", stakeKeys: "/stake_keys", proposalPillar: "/proposal_pillar/*", - connectedProposalPillar: "/connected/proposal_pillar/*", }; export const PDF_PATHS = { From 518acd20aebc8027be4a89bb24c2fa8055a98e06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Sza=C5=82owski?= Date: Mon, 24 Jun 2024 10:14:55 +0200 Subject: [PATCH 29/36] fix(#1349): Change label of Proposal Discussion nav item --- CHANGELOG.md | 1 + govtool/frontend/src/i18n/locales/en.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6c3d2a38e..ae0976b8c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -132,6 +132,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/govtool/frontend/src/i18n/locales/en.ts b/govtool/frontend/src/i18n/locales/en.ts index de8d0b8c2..809815140 100644 --- a/govtool/frontend/src/i18n/locales/en.ts +++ b/govtool/frontend/src/i18n/locales/en.ts @@ -385,7 +385,7 @@ export const en = { }, }, proposalDiscussion: { - title: "Proposal Discussion", + title: "Proposals", proposeAGovernanceAction: "Propose a Governance Action", }, govActions: { From af33e4359d2a0e0753da2495a2941f86eb58e91d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Sza=C5=82owski?= Date: Mon, 24 Jun 2024 17:06:29 +0200 Subject: [PATCH 30/36] chore: bump @intersect.mbo/pdf-ui@0.2.0 --- govtool/frontend/package-lock.json | 807 ++++++++++++++++++++++++++++- govtool/frontend/package.json | 2 +- govtool/frontend/yarn.lock | 439 +++++++++++++++- 3 files changed, 1236 insertions(+), 12 deletions(-) diff --git a/govtool/frontend/package-lock.json b/govtool/frontend/package-lock.json index dcea00ac9..dd5ac2696 100644 --- a/govtool/frontend/package-lock.json +++ b/govtool/frontend/package-lock.json @@ -14,7 +14,7 @@ "@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.0", "@mui/icons-material": "^5.14.3", "@mui/material": "^5.14.4", "@rollup/plugin-babel": "^6.0.4", @@ -3345,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.0", + "resolved": "https://registry.npmjs.org/@intersect.mbo/pdf-ui/-/pdf-ui-0.2.0.tgz", + "integrity": "sha512-2kY7XgPVikzLsDFv/GQwBvQ8UcmPVx+mHFxnM59DPMTh0bbJf3sjGPNm+QskUJ5HzlndzeUdD9UAQjhC/+rFog==", "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" @@ -3368,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", @@ -3377,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", @@ -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 12d82d250..e1e72c1d3 100644 --- a/govtool/frontend/package.json +++ b/govtool/frontend/package.json @@ -28,7 +28,7 @@ "@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.0", "@mui/icons-material": "^5.14.3", "@mui/material": "^5.14.4", "@rollup/plugin-babel": "^6.0.4", diff --git a/govtool/frontend/yarn.lock b/govtool/frontend/yarn.lock index 7be858c27..b1d3989b6 100644 --- a/govtool/frontend/yarn.lock +++ b/govtool/frontend/yarn.lock @@ -1596,15 +1596,16 @@ resolved "https://registry.npmjs.org/@intersect.mbo/intersectmbo.org-icons-set/-/intersectmbo.org-icons-set-1.0.8.tgz" integrity sha512-Y+5vYGlF3Smg/QscQT/4ZwsKTNm2C0GCs2czzYWrE4O4RV2YAAg9MZkQ52u8uZp3cEW0h9vr+f9W9ihhwsNHGQ== -"@intersect.mbo/pdf-ui@^0.1.9": - 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== +"@intersect.mbo/pdf-ui@^0.2.0": + version "0.2.0" + resolved "https://registry.npmjs.org/@intersect.mbo/pdf-ui/-/pdf-ui-0.2.0.tgz" + integrity sha512-2kY7XgPVikzLsDFv/GQwBvQ8UcmPVx+mHFxnM59DPMTh0bbJf3sjGPNm+QskUJ5HzlndzeUdD9UAQjhC/+rFog== 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" @@ -4000,6 +4001,13 @@ dependencies: "@types/node" "*" +"@types/hast@^2.0.0": + version "2.3.10" + resolved "https://registry.npmjs.org/@types/hast/-/hast-2.3.10.tgz" + integrity sha512-McWspRw8xx8J9HurkVBfYj0xKoE25tOFlHGdx4MJ5xORQrMGZNqJhVQWaIbm6Oyla5kYOXtDiopzKRJzEOkwJw== + dependencies: + "@types/unist" "^2" + "@types/hast@^3.0.0": version "3.0.4" resolved "https://registry.npmjs.org/@types/hast/-/hast-3.0.4.tgz" @@ -4071,6 +4079,13 @@ resolved "https://registry.npmjs.org/@types/lodash/-/lodash-4.17.4.tgz" integrity sha512-wYCP26ZLxaT3R39kiN2+HcJ4kTd3U1waI/cY7ivWYqFP6pW3ZNpvi6Wd6PHZx7T/t8z0vlkXMg3QYLa7DZ/IJQ== +"@types/mdast@^3.0.0": + 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" + "@types/mdast@^4.0.0": version "4.0.4" resolved "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.4.tgz" @@ -4152,7 +4167,7 @@ resolved "https://registry.npmjs.org/@types/pretty-hrtime/-/pretty-hrtime-1.0.3.tgz" integrity sha512-nj39q0wAIdhwn7DGUyT9irmsKK1tV0bd5WFEhgpqNTMFZ8cE+jieuTphCW0tfdm47S2zVT5mr09B28b1chmQMA== -"@types/prop-types@*", "@types/prop-types@^15.7.11": +"@types/prop-types@*", "@types/prop-types@^15.0.0", "@types/prop-types@^15.7.11": version "15.7.12" resolved "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.12.tgz" integrity sha512-5zvhXYtRNRluoE/jAp4GVsSduVUzNWKkOZrCDBWYtE7biZywwdC2AcEzg+cSMLFRfVgeAFqpfNabiPjxFddV1Q== @@ -4262,7 +4277,7 @@ resolved "https://registry.npmjs.org/@types/trusted-types/-/trusted-types-2.0.7.tgz" integrity sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw== -"@types/unist@*", "@types/unist@^2.0.0": +"@types/unist@*", "@types/unist@^2", "@types/unist@^2.0.0": version "2.0.10" resolved "https://registry.npmjs.org/@types/unist/-/unist-2.0.10.tgz" integrity sha512-IfYcSBWE3hLpBg8+X2SEa8LVkJdJEkT2Ese2aaLs3ptGdVtABxndrMaxuFlQ1qdFf9Q5rDvDpxI3WwgvKFAsQA== @@ -6932,6 +6947,11 @@ diff-sequences@^29.6.3: resolved "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.6.3.tgz" integrity sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q== +diff@^5.0.0: + version "5.2.0" + resolved "https://registry.npmjs.org/diff/-/diff-5.2.0.tgz" + integrity sha512-uIFDxqpRZGZ6ThOk84hEfqWoHx2devRFvpTZcTHur85vImfaxUbTW9Ryh4CpCuDnToOP1CEtXKIgytHBPVff5A== + diffable-html@^4.1.0: version "4.1.0" resolved "https://registry.npmjs.org/diffable-html/-/diffable-html-4.1.0.tgz" @@ -8804,6 +8824,11 @@ hast-util-to-jsx-runtime@^2.0.0: unist-util-position "^5.0.0" vfile-message "^4.0.0" +hast-util-whitespace@^2.0.0: + version "2.0.1" + resolved "https://registry.npmjs.org/hast-util-whitespace/-/hast-util-whitespace-2.0.1.tgz" + integrity sha512-nAxA0v8+vXSBDt3AnRUNjyRIQ0rD+ntpbAp4LnPkumc5M9yUbSMa4XDU9Q6etY4f1Wp4bNgvc1yjiZtsTTrSng== + hast-util-whitespace@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/hast-util-whitespace/-/hast-util-whitespace-3.0.0.tgz" @@ -9158,6 +9183,11 @@ ini@^1.3.4, ini@^1.3.5: resolved "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz" integrity sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew== +inline-style-parser@0.1.1: + 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== + inline-style-parser@0.2.3: version "0.2.3" resolved "https://registry.npmjs.org/inline-style-parser/-/inline-style-parser-0.2.3.tgz" @@ -9267,6 +9297,11 @@ is-boolean-object@^1.1.0: call-bind "^1.0.2" has-tostringtag "^1.0.0" +is-buffer@^2.0.0: + version "2.0.5" + resolved "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.5.tgz" + integrity sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ== + is-callable@^1.1.3, is-callable@^1.1.4, is-callable@^1.2.7: version "1.2.7" resolved "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz" @@ -10930,6 +10965,11 @@ kleur@^3.0.3: resolved "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz" integrity sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w== +kleur@^4.0.3: + version "4.1.5" + resolved "https://registry.npmjs.org/kleur/-/kleur-4.1.5.tgz" + integrity sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ== + klona@^2.0.4, klona@^2.0.5: version "2.0.6" resolved "https://registry.npmjs.org/klona/-/klona-2.0.6.tgz" @@ -11265,6 +11305,33 @@ mdast-util-definitions@^4.0.0: dependencies: unist-util-visit "^2.0.0" +mdast-util-definitions@^5.0.0: + 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" + +mdast-util-from-markdown@^1.0.0: + 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" + mdast-util-from-markdown@^2.0.0: version "2.0.1" resolved "https://registry.npmjs.org/mdast-util-from-markdown/-/mdast-util-from-markdown-2.0.1.tgz" @@ -11334,6 +11401,20 @@ mdast-util-phrasing@^4.0.0: "@types/mdast" "^4.0.0" unist-util-is "^6.0.0" +mdast-util-to-hast@^12.1.0: + 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" + mdast-util-to-hast@^13.0.0: version "13.2.0" resolved "https://registry.npmjs.org/mdast-util-to-hast/-/mdast-util-to-hast-13.2.0.tgz" @@ -11368,6 +11449,13 @@ mdast-util-to-string@^1.0.0: resolved "https://registry.npmjs.org/mdast-util-to-string/-/mdast-util-to-string-1.1.0.tgz" integrity sha512-jVU0Nr2B9X3MU4tSK7JP1CMkSvOj7X5l/GboG1tKRw52lLF1x2Ju92Ms9tNetCcbfX3hzlM73zYo2NKkWSfF/A== +mdast-util-to-string@^3.1.0: + 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" + mdast-util-to-string@^4.0.0: version "4.0.0" resolved "https://registry.npmjs.org/mdast-util-to-string/-/mdast-util-to-string-4.0.0.tgz" @@ -11436,6 +11524,28 @@ methods@~1.1.2: resolved "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz" integrity sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w== +micromark-core-commonmark@^1.0.1: + version "1.1.0" + resolved "https://registry.npmjs.org/micromark-core-commonmark/-/micromark-core-commonmark-1.1.0.tgz" + integrity sha512-BgHO1aRbolh2hcrzL2d1La37V0Aoz73ymF8rAcKnohLy93titmv62E0gP8Hrx9PKcKrqCZ1BbLGbP3bEhoXYlw== + 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" + micromark-core-commonmark@^2.0.0: version "2.0.1" resolved "https://registry.npmjs.org/micromark-core-commonmark/-/micromark-core-commonmark-2.0.1.tgz" @@ -11458,6 +11568,15 @@ micromark-core-commonmark@^2.0.0: micromark-util-symbol "^2.0.0" micromark-util-types "^2.0.0" +micromark-factory-destination@^1.0.0: + 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== + dependencies: + micromark-util-character "^1.0.0" + micromark-util-symbol "^1.0.0" + micromark-util-types "^1.0.0" + micromark-factory-destination@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/micromark-factory-destination/-/micromark-factory-destination-2.0.0.tgz" @@ -11467,6 +11586,16 @@ micromark-factory-destination@^2.0.0: micromark-util-symbol "^2.0.0" micromark-util-types "^2.0.0" +micromark-factory-label@^1.0.0: + 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== + dependencies: + micromark-util-character "^1.0.0" + micromark-util-symbol "^1.0.0" + micromark-util-types "^1.0.0" + uvu "^0.5.0" + micromark-factory-label@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/micromark-factory-label/-/micromark-factory-label-2.0.0.tgz" @@ -11477,6 +11606,14 @@ micromark-factory-label@^2.0.0: micromark-util-symbol "^2.0.0" micromark-util-types "^2.0.0" +micromark-factory-space@^1.0.0: + 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== + dependencies: + micromark-util-character "^1.0.0" + micromark-util-types "^1.0.0" + micromark-factory-space@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/micromark-factory-space/-/micromark-factory-space-2.0.0.tgz" @@ -11485,6 +11622,16 @@ micromark-factory-space@^2.0.0: micromark-util-character "^2.0.0" micromark-util-types "^2.0.0" +micromark-factory-title@^1.0.0: + version "1.1.0" + resolved "https://registry.npmjs.org/micromark-factory-title/-/micromark-factory-title-1.1.0.tgz" + integrity sha512-J7n9R3vMmgjDOCY8NPw55jiyaQnH5kBdV2/UXCtZIpnHH3P6nHUKaH7XXEYuWwx/xUJcawa8plLBEjMPU24HzQ== + 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" + micromark-factory-title@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/micromark-factory-title/-/micromark-factory-title-2.0.0.tgz" @@ -11495,6 +11642,16 @@ micromark-factory-title@^2.0.0: micromark-util-symbol "^2.0.0" micromark-util-types "^2.0.0" +micromark-factory-whitespace@^1.0.0: + version "1.1.0" + resolved "https://registry.npmjs.org/micromark-factory-whitespace/-/micromark-factory-whitespace-1.1.0.tgz" + integrity sha512-v2WlmiymVSp5oMg+1Q0N1Lxmt6pMhIHD457whWM7/GUlEks1hI9xj5w3zbc4uuMKXGisksZk8DzP2UyGbGqNsQ== + 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" + micromark-factory-whitespace@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/micromark-factory-whitespace/-/micromark-factory-whitespace-2.0.0.tgz" @@ -11505,6 +11662,14 @@ micromark-factory-whitespace@^2.0.0: micromark-util-symbol "^2.0.0" micromark-util-types "^2.0.0" +micromark-util-character@^1.0.0: + version "1.2.0" + resolved "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-1.2.0.tgz" + integrity sha512-lXraTwcX3yH/vMDaFWCQJP1uIszLVebzUa3ZHdrgxr7KEU/9mL4mVgCpGbyhvNLNlauROiNUq7WN5u7ndbY6xg== + dependencies: + micromark-util-symbol "^1.0.0" + micromark-util-types "^1.0.0" + micromark-util-character@^2.0.0: version "2.1.0" resolved "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-2.1.0.tgz" @@ -11513,6 +11678,13 @@ micromark-util-character@^2.0.0: micromark-util-symbol "^2.0.0" micromark-util-types "^2.0.0" +micromark-util-chunked@^1.0.0: + version "1.1.0" + resolved "https://registry.npmjs.org/micromark-util-chunked/-/micromark-util-chunked-1.1.0.tgz" + integrity sha512-Ye01HXpkZPNcV6FiyoW2fGZDUw4Yc7vT0E9Sad83+bEDiCJ1uXu0S3mr8WLpsz3HaG3x2q0HM6CTuPdcZcluFQ== + dependencies: + micromark-util-symbol "^1.0.0" + micromark-util-chunked@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/micromark-util-chunked/-/micromark-util-chunked-2.0.0.tgz" @@ -11520,6 +11692,15 @@ micromark-util-chunked@^2.0.0: dependencies: micromark-util-symbol "^2.0.0" +micromark-util-classify-character@^1.0.0: + 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== + dependencies: + micromark-util-character "^1.0.0" + micromark-util-symbol "^1.0.0" + micromark-util-types "^1.0.0" + micromark-util-classify-character@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/micromark-util-classify-character/-/micromark-util-classify-character-2.0.0.tgz" @@ -11529,6 +11710,14 @@ micromark-util-classify-character@^2.0.0: micromark-util-symbol "^2.0.0" micromark-util-types "^2.0.0" +micromark-util-combine-extensions@^1.0.0: + 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== + dependencies: + micromark-util-chunked "^1.0.0" + micromark-util-types "^1.0.0" + micromark-util-combine-extensions@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/micromark-util-combine-extensions/-/micromark-util-combine-extensions-2.0.0.tgz" @@ -11537,6 +11726,13 @@ micromark-util-combine-extensions@^2.0.0: micromark-util-chunked "^2.0.0" micromark-util-types "^2.0.0" +micromark-util-decode-numeric-character-reference@^1.0.0: + 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== + dependencies: + micromark-util-symbol "^1.0.0" + micromark-util-decode-numeric-character-reference@^2.0.0: version "2.0.1" resolved "https://registry.npmjs.org/micromark-util-decode-numeric-character-reference/-/micromark-util-decode-numeric-character-reference-2.0.1.tgz" @@ -11544,6 +11740,16 @@ micromark-util-decode-numeric-character-reference@^2.0.0: dependencies: micromark-util-symbol "^2.0.0" +micromark-util-decode-string@^1.0.0: + 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== + 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" + micromark-util-decode-string@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/micromark-util-decode-string/-/micromark-util-decode-string-2.0.0.tgz" @@ -11554,16 +11760,33 @@ micromark-util-decode-string@^2.0.0: micromark-util-decode-numeric-character-reference "^2.0.0" micromark-util-symbol "^2.0.0" +micromark-util-encode@^1.0.0: + version "1.1.0" + resolved "https://registry.npmjs.org/micromark-util-encode/-/micromark-util-encode-1.1.0.tgz" + integrity sha512-EuEzTWSTAj9PA5GOAs992GzNh2dGQO52UvAbtSOMvXTxv3Criqb6IOzJUBCmEqrrXSblJIJBbFFv6zPxpreiJw== + micromark-util-encode@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/micromark-util-encode/-/micromark-util-encode-2.0.0.tgz" integrity sha512-pS+ROfCXAGLWCOc8egcBvT0kf27GoWMqtdarNfDcjb6YLuV5cM3ioG45Ys2qOVqeqSbjaKg72vU+Wby3eddPsA== +micromark-util-html-tag-name@^1.0.0: + 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== + micromark-util-html-tag-name@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/micromark-util-html-tag-name/-/micromark-util-html-tag-name-2.0.0.tgz" integrity sha512-xNn4Pqkj2puRhKdKTm8t1YHC/BAjx6CEwRFXntTaRf/x16aqka6ouVoutm+QdkISTlT7e2zU7U4ZdlDLJd2Mcw== +micromark-util-normalize-identifier@^1.0.0: + 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== + dependencies: + micromark-util-symbol "^1.0.0" + micromark-util-normalize-identifier@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/micromark-util-normalize-identifier/-/micromark-util-normalize-identifier-2.0.0.tgz" @@ -11571,6 +11794,13 @@ micromark-util-normalize-identifier@^2.0.0: dependencies: micromark-util-symbol "^2.0.0" +micromark-util-resolve-all@^1.0.0: + 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== + dependencies: + micromark-util-types "^1.0.0" + micromark-util-resolve-all@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/micromark-util-resolve-all/-/micromark-util-resolve-all-2.0.0.tgz" @@ -11578,6 +11808,15 @@ micromark-util-resolve-all@^2.0.0: dependencies: micromark-util-types "^2.0.0" +micromark-util-sanitize-uri@^1.0.0, micromark-util-sanitize-uri@^1.1.0: + 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== + dependencies: + micromark-util-character "^1.0.0" + micromark-util-encode "^1.0.0" + micromark-util-symbol "^1.0.0" + micromark-util-sanitize-uri@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/micromark-util-sanitize-uri/-/micromark-util-sanitize-uri-2.0.0.tgz" @@ -11587,6 +11826,16 @@ micromark-util-sanitize-uri@^2.0.0: micromark-util-encode "^2.0.0" micromark-util-symbol "^2.0.0" +micromark-util-subtokenize@^1.0.0: + 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== + dependencies: + micromark-util-chunked "^1.0.0" + micromark-util-symbol "^1.0.0" + micromark-util-types "^1.0.0" + uvu "^0.5.0" + micromark-util-subtokenize@^2.0.0: version "2.0.1" resolved "https://registry.npmjs.org/micromark-util-subtokenize/-/micromark-util-subtokenize-2.0.1.tgz" @@ -11597,16 +11846,49 @@ micromark-util-subtokenize@^2.0.0: micromark-util-symbol "^2.0.0" micromark-util-types "^2.0.0" +micromark-util-symbol@^1.0.0: + 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== + micromark-util-symbol@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/micromark-util-symbol/-/micromark-util-symbol-2.0.0.tgz" integrity sha512-8JZt9ElZ5kyTnO94muPxIGS8oyElRJaiJO8EzV6ZSyGQ1Is8xwl4Q45qU5UOg+bGH4AikWziz0iN4sFLWs8PGw== +micromark-util-types@^1.0.0, micromark-util-types@^1.0.1: + version "1.1.0" + resolved "https://registry.npmjs.org/micromark-util-types/-/micromark-util-types-1.1.0.tgz" + integrity sha512-ukRBgie8TIAcacscVHSiddHjO4k/q3pnedmzMQ4iwDcK0FtFCohKOlFbaOL/mPgfnPsL3C1ZyxJa4sbWrBl3jg== + micromark-util-types@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/micromark-util-types/-/micromark-util-types-2.0.0.tgz" integrity sha512-oNh6S2WMHWRZrmutsRmDDfkzKtxF+bc2VxLC9dvtrDIRFln627VsFP6fLMgTryGDljgLPjkrzQSDcPrjPyDJ5w== +micromark@^3.0.0: + version "3.2.0" + resolved "https://registry.npmjs.org/micromark/-/micromark-3.2.0.tgz" + integrity sha512-uD66tJj54JLYq0De10AhWycZWGQNUvDI55xPgk2sQM5kn1JYlhbCMTtEeT27+vAhW2FBQxLlOmS3pmA7/2z4aA== + 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" + micromark@^4.0.0: version "4.0.0" resolved "https://registry.npmjs.org/micromark/-/micromark-4.0.0.tgz" @@ -11799,6 +12081,11 @@ mlly@^1.4.2, mlly@^1.7.0: pkg-types "^1.1.1" ufo "^1.5.3" +mri@^1.1.0: + version "1.2.0" + resolved "https://registry.npmjs.org/mri/-/mri-1.2.0.tgz" + integrity sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA== + mrmime@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/mrmime/-/mrmime-2.0.0.tgz" @@ -13280,7 +13567,7 @@ prompts@^2.0.1, prompts@^2.4.0, prompts@^2.4.1, prompts@^2.4.2: kleur "^3.0.3" sisteransi "^1.0.5" -prop-types@^15.6.2, prop-types@^15.7.2, prop-types@^15.8.1: +prop-types@^15.0.0, prop-types@^15.6.2, prop-types@^15.7.2, prop-types@^15.8.1: version "15.8.1" resolved "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz" integrity sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg== @@ -13596,6 +13883,27 @@ react-json-tree@^0.19.0: "@types/lodash" "^4.17.0" react-base16-styling "^0.10.0" +react-markdown@^8.0.6: + 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" + react-markdown@^9.0.1: version "9.0.1" resolved "https://registry.npmjs.org/react-markdown/-/react-markdown-9.0.1.tgz" @@ -13976,6 +14284,15 @@ remark-external-links@^8.0.0: space-separated-tokens "^1.0.0" unist-util-visit "^2.0.0" +remark-parse@^10.0.0: + 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" + remark-parse@^11.0.0: version "11.0.0" resolved "https://registry.npmjs.org/remark-parse/-/remark-parse-11.0.0.tgz" @@ -13986,6 +14303,16 @@ remark-parse@^11.0.0: micromark-util-types "^2.0.0" unified "^11.0.0" +remark-rehype@^10.0.0: + 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" + remark-rehype@^11.0.0: version "11.1.0" resolved "https://registry.npmjs.org/remark-rehype/-/remark-rehype-11.1.0.tgz" @@ -14230,6 +14557,13 @@ rxjs@^7.8.1: dependencies: tslib "^2.1.0" +sade@^1.7.3: + 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" + safe-array-concat@^1.1.2: version "1.1.2" resolved "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.1.2.tgz" @@ -15105,6 +15439,13 @@ style-loader@^3.3.1: resolved "https://registry.npmjs.org/style-loader/-/style-loader-3.3.4.tgz" integrity sha512-0WqXzrsMTyb8yjZJHDqwmnwRJvhALK9LfRtRc6B4UTWe8AijYLZYZ9thuJTZc2VfQWINADW/j+LiJnfy2RoC1w== +style-to-object@^0.4.0: + 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" + style-to-object@^1.0.0: version "1.0.6" resolved "https://registry.npmjs.org/style-to-object/-/style-to-object-1.0.6.tgz" @@ -15772,6 +16113,19 @@ unicode-property-aliases-ecmascript@^2.0.0: resolved "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-2.1.0.tgz" integrity sha512-6t3foTQI9qne+OZoVQB/8x8rk2k1eVy1gRXhV3oFQ5T6R1dqQ1xtin3XqSlx3+ATBkliTaR/hHyJBm+LVPNM8w== +unified@^10.0.0: + 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" + unified@^11.0.0: version "11.0.4" resolved "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz" @@ -15792,11 +16146,23 @@ unique-string@^2.0.0: dependencies: crypto-random-string "^2.0.0" +unist-util-generated@^2.0.0: + version "2.0.1" + resolved "https://registry.npmjs.org/unist-util-generated/-/unist-util-generated-2.0.1.tgz" + integrity sha512-qF72kLmPxAw0oN2fwpWIqbXAVyEqUzDHMsbtPvOudIlUzXYFIeQIuxXQCRCFh22B7cixvU0MG7m3MW8FTq/S+A== + unist-util-is@^4.0.0: version "4.1.0" resolved "https://registry.npmjs.org/unist-util-is/-/unist-util-is-4.1.0.tgz" integrity sha512-ZOQSsnce92GrxSqlnEEseX0gi7GH9zTJZ0p9dtu87WRb/37mMPO2Ilx1s/t9vBHrFhbgweUwb+t7cIn5dxPhZg== +unist-util-is@^5.0.0: + 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" + unist-util-is@^6.0.0: version "6.0.0" resolved "https://registry.npmjs.org/unist-util-is/-/unist-util-is-6.0.0.tgz" @@ -15804,6 +16170,13 @@ unist-util-is@^6.0.0: dependencies: "@types/unist" "^3.0.0" +unist-util-position@^4.0.0: + 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" + unist-util-position@^5.0.0: version "5.0.0" resolved "https://registry.npmjs.org/unist-util-position/-/unist-util-position-5.0.0.tgz" @@ -15819,6 +16192,13 @@ unist-util-remove-position@^5.0.0: "@types/unist" "^3.0.0" unist-util-visit "^5.0.0" +unist-util-stringify-position@^3.0.0: + 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" + unist-util-stringify-position@^4.0.0: version "4.0.0" resolved "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz" @@ -15834,6 +16214,14 @@ unist-util-visit-parents@^3.0.0: "@types/unist" "^2.0.0" unist-util-is "^4.0.0" +unist-util-visit-parents@^5.1.1: + 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" + unist-util-visit-parents@^6.0.0: version "6.0.1" resolved "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-6.0.1.tgz" @@ -15851,6 +16239,15 @@ unist-util-visit@^2.0.0: unist-util-is "^4.0.0" unist-util-visit-parents "^3.0.0" +unist-util-visit@^4.0.0: + 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" + unist-util-visit@^5.0.0: version "5.0.0" resolved "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-5.0.0.tgz" @@ -15999,6 +16396,16 @@ uuid@^9.0.0: resolved "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz" integrity sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA== +uvu@^0.5.0: + 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" + v8-to-istanbul@^8.1.0: version "8.1.1" resolved "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-8.1.1.tgz" @@ -16030,6 +16437,14 @@ vary@~1.1.2: resolved "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz" integrity sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg== +vfile-message@^3.0.0: + 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" + vfile-message@^4.0.0: version "4.0.2" resolved "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz" @@ -16038,6 +16453,16 @@ vfile-message@^4.0.0: "@types/unist" "^3.0.0" unist-util-stringify-position "^4.0.0" +vfile@^5.0.0: + 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" + vfile@^6.0.0: version "6.0.1" resolved "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz" From e93f6c17afa8a55f801e81ca9d2257de0d8cd3f6 Mon Sep 17 00:00:00 2001 From: jankun4 Date: Wed, 26 Jun 2024 01:19:09 +0200 Subject: [PATCH 31/36] [#1417] silence timeout errors --- CHANGELOG.md | 1 + govtool/backend/app/Main.hs | 1 + 2 files changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 78516ef5e..8203eed3b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -68,6 +68,7 @@ changes. ### Fixed +- silenced `Thread killed by timeout manager` sentry log [Issue 1417](https://github.com/IntersectMBO/govtool/issues/1417) - 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) diff --git a/govtool/backend/app/Main.hs b/govtool/backend/app/Main.hs index 1385ae1f1..728166b3d 100644 --- a/govtool/backend/app/Main.hs +++ b/govtool/backend/app/Main.hs @@ -143,6 +143,7 @@ exceptionHandler :: VVAConfig -> Maybe Request -> SomeException -> IO () exceptionHandler vvaConfig mRequest exception = do print mRequest print exception + guard (show exception /= "Thread killed by timeout manager") sentryService <- initRaven (sentryDSN vvaConfig) From 75e7c78fd984c015f9ff5c17ffa5f10065456830 Mon Sep 17 00:00:00 2001 From: jankun4 Date: Wed, 26 Jun 2024 01:23:52 +0200 Subject: [PATCH 32/36] [#1422] silence closed connection error --- CHANGELOG.md | 1 + govtool/backend/app/Main.hs | 1 + 2 files changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8203eed3b..7cc43abca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -69,6 +69,7 @@ changes. ### 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) diff --git a/govtool/backend/app/Main.hs b/govtool/backend/app/Main.hs index 728166b3d..875a50783 100644 --- a/govtool/backend/app/Main.hs +++ b/govtool/backend/app/Main.hs @@ -144,6 +144,7 @@ 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") sentryService <- initRaven (sentryDSN vvaConfig) From bdec2d451519bfaf1a61537c8a07f48698d1d12a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Sza=C5=82owski?= Date: Wed, 26 Jun 2024 11:14:42 +0200 Subject: [PATCH 33/36] feat(#1431): handle disconnected state of proposal pillar --- CHANGELOG.md | 1 + govtool/frontend/src/App.tsx | 24 +++++-- .../src/components/organisms/DrawerMobile.tsx | 38 ++++++----- .../src/components/organisms/HomeCards.tsx | 27 ++++++-- .../src/components/organisms/TopNav.tsx | 39 +++++++----- govtool/frontend/src/consts/navItems.tsx | 9 ++- govtool/frontend/src/consts/paths.ts | 1 + govtool/frontend/src/i18n/locales/en.ts | 3 +- .../frontend/src/pages/ProposalDiscussion.tsx | 63 +++++++++++++++++++ govtool/frontend/src/pages/index.ts | 7 ++- 10 files changed, 169 insertions(+), 43 deletions(-) create mode 100644 govtool/frontend/src/pages/ProposalDiscussion.tsx diff --git a/CHANGELOG.md b/CHANGELOG.md index 7cc43abca..a87ebcdd9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -65,6 +65,7 @@ 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 diff --git a/govtool/frontend/src/App.tsx b/govtool/frontend/src/App.tsx index c61c798cc..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,11 +38,9 @@ import { removeItemFromLocalStorage, } from "@utils"; -import { PDFWrapper } from "./components/organisms/PDFWrapper"; - export default () => { const { isProposalDiscussionForumEnabled } = useFeatureFlag(); - const { enable } = useCardano(); + const { enable, isEnabled } = useCardano(); const navigate = useNavigate(); const { modal, openModal, modals } = useModal(); @@ -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 ( @@ -87,7 +89,10 @@ export default () => { !window.location.pathname.includes(PATHS.proposalPillar.replace("/*", "")) ) { navigate( - `${PATHS.proposalPillar.replace("/*", "")}${window.location.pathname}`, + `${(isEnabled + ? PATHS.connectedProposalPillar + : PATHS.proposalPillar + ).replace("/*", "")}${window.location.pathname}`, ); } }, [window.location.pathname]); @@ -106,10 +111,19 @@ export default () => { path={PATHS.governanceActionsAction} element={} /> + {isProposalDiscussionForumEnabled && !isEnabled && ( + } + /> + )} }> } /> {isProposalDiscussionForumEnabled && ( - } /> + } + /> )} { + 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/HomeCards.tsx b/govtool/frontend/src/components/organisms/HomeCards.tsx index 707870994..ae2831594 100644 --- a/govtool/frontend/src/components/organisms/HomeCards.tsx +++ b/govtool/frontend/src/components/organisms/HomeCards.tsx @@ -2,13 +2,14 @@ import { useCallback } from "react"; import { useNavigate } from "react-router-dom"; import { Box } from "@mui/material"; -import { IMAGES, PATHS } from "@consts"; -import { useModal } from "@context"; +import { IMAGES, PATHS, PDF_PATHS } from "@consts"; +import { useFeatureFlag, useModal } from "@context"; import { ActionCard } from "@molecules"; import { useScreenDimension, useTranslation } from "@hooks"; import { openInNewTab } from "@utils"; export const HomeCards = () => { + 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/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 ? (