diff --git a/.github/workflows/build-and-deploy-staging.yml b/.github/workflows/build-and-deploy-staging.yml index 8f854a5ca..27d10fdb0 100644 --- a/.github/workflows/build-and-deploy-staging.yml +++ b/.github/workflows/build-and-deploy-staging.yml @@ -61,7 +61,7 @@ jobs: SENTRY_IGNORE_API_RESOLUTION_ERROR: "1" TRAEFIK_LE_EMAIL: "admin+govtool@binarapps.com" USERSNAP_SPACE_API_KEY: ${{ secrets.USERSNAP_SPACE_API_KEY }} - IS_PROPOSAL_DISCUSSION_FORUM_ENABLED: ${{github.event_name == 'push' && 'false' || inputs.isProposalDiscussionForumEnabled == 'enabled'}} + IS_PROPOSAL_DISCUSSION_FORUM_ENABLED: ${{github.event_name == 'push' && 'true' || inputs.isProposalDiscussionForumEnabled == 'enabled'}} PDF_API_URL: ${{ secrets.PDF_API_URL}} steps: - name: Checkout code diff --git a/.github/workflows/build-and-deploy-test.yml b/.github/workflows/build-and-deploy-test.yml index 57c47f6c5..64cc7a89f 100644 --- a/.github/workflows/build-and-deploy-test.yml +++ b/.github/workflows/build-and-deploy-test.yml @@ -61,7 +61,7 @@ jobs: SENTRY_IGNORE_API_RESOLUTION_ERROR: "1" TRAEFIK_LE_EMAIL: "admin+govtool@binarapps.com" USERSNAP_SPACE_API_KEY: ${{ secrets.USERSNAP_SPACE_API_KEY }} - IS_PROPOSAL_DISCUSSION_FORUM_ENABLED: ${{github.event_name == 'push' && 'false' || inputs.isProposalDiscussionForumEnabled == 'enabled'}} + IS_PROPOSAL_DISCUSSION_FORUM_ENABLED: ${{github.event_name == 'push' && 'true' || inputs.isProposalDiscussionForumEnabled == 'enabled'}} PDF_API_URL: ${{ secrets.PDF_API_URL}} steps: - name: Checkout code diff --git a/CHANGELOG.md b/CHANGELOG.md index a3d75643e..53e928b6a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,9 @@ changes. ### Fixed - Incorrect copy on DRep votes + other minor copy spelling mistakes +- Remove incorrect @value property to fix validating the metadata body [Issue 1687](https://github.com/IntersectMBO/govtool/issues/1687) +- Fix PDF not enabled in default deployments +- Fix displaying incorrect connected to Voltaire GovTool network ### Changed diff --git a/CODEOWNERS b/CODEOWNERS index 27885d4d5..91d3c7698 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -4,10 +4,10 @@ * @Ryun1 @MSzalowski # Frontend assets templates -govtool/frontend/* @MSzalowski @Sworzen1 @JanJaroszczak -*.tsx @MSzalowski @Sworzen1 @JanJaroszczak -*.ts @MSzalowski @Sworzen1 @JanJaroszczak -*.css @MSzalowski @Sworzen1 @JanJaroszczak +govtool/frontend/* @MSzalowski @jdyczka +*.tsx @MSzalowski @jdyczka +*.ts @MSzalowski @jdyczka +*.css @MSzalowski @jdyczka # Backend govtool/backend/* @MSzalowski @jankun4 @@ -18,5 +18,5 @@ config/govtool/* @pla infra/terraform/* @placek @adgud # Testing -tests/* @IntersectMBO/govtool-test -gov-action-loader/* @IntersectMBO/govtool-test +tests/* @spannercode @mesudip @kneerose +gov-action-loader/* @spannercode @mesudip @kneerose diff --git a/govtool/frontend/junit-report.xml b/govtool/frontend/junit-report.xml new file mode 100644 index 000000000..e69de29bb diff --git a/govtool/frontend/src/consts/CIP100Context.ts b/govtool/frontend/src/consts/CIP100Context.ts index 2cfa2127f..4ceddefcc 100644 --- a/govtool/frontend/src/consts/CIP100Context.ts +++ b/govtool/frontend/src/consts/CIP100Context.ts @@ -1,5 +1,4 @@ export const CIP_100_CONTEXT = { - "@language": "en-us", CIP100: "https://github.com/cardano-foundation/CIPs/blob/master/CIP-0100/README.md#", hashAlgorithm: "CIP100:hashAlgorithm", diff --git a/govtool/frontend/src/consts/dRepActions/jsonContext.ts b/govtool/frontend/src/consts/dRepActions/jsonContext.ts index 78a6040df..5969d7999 100644 --- a/govtool/frontend/src/consts/dRepActions/jsonContext.ts +++ b/govtool/frontend/src/consts/dRepActions/jsonContext.ts @@ -2,7 +2,6 @@ export const CIP_QQQ = "https://github.com/cardano-foundation/CIPs/blob/master/CIP-QQQ/README.md#"; export const DREP_CONTEXT = { - "@language": "en-us", CIP100: "https://github.com/cardano-foundation/CIPs/blob/master/CIP-0100/README.md#", CIPQQQ: CIP_QQQ, diff --git a/govtool/frontend/src/consts/governanceAction/fields.ts b/govtool/frontend/src/consts/governanceAction/fields.ts index b831a052f..c48320e12 100644 --- a/govtool/frontend/src/consts/governanceAction/fields.ts +++ b/govtool/frontend/src/consts/governanceAction/fields.ts @@ -126,7 +126,6 @@ export const GOVERNANCE_ACTION_FIELDS: GovernanceActionFields = { } as const; export const GOVERNANCE_ACTION_CONTEXT = { - "@language": "en-us", CIP100: "https://github.com/cardano-foundation/CIPs/blob/master/CIP-0100/README.md#", CIP108: diff --git a/govtool/frontend/src/context/governanceAction.test.tsx b/govtool/frontend/src/context/governanceAction.test.tsx index 87d4d2835..6e1f8a6fb 100644 --- a/govtool/frontend/src/context/governanceAction.test.tsx +++ b/govtool/frontend/src/context/governanceAction.test.tsx @@ -7,29 +7,17 @@ import { } from "./governanceAction"; const resultMetadataBody = { - abstract: { - "@value": "Test", - }, - motivation: { - "@value": "Test", - }, - rationale: { - "@value": "Test", - }, + abstract: "Test", + motivation: "Test", + rationale: "Test", references: [ { "@type": "Other", - label: { - "@value": "Test", - }, - uri: { - "@value": "http://example.com", - }, + label: "Test", + uri: "http://example.com", }, ], - title: { - "@value": "Test", - }, + title: "Test", }; describe("GovernanceActionProvider", () => { @@ -92,7 +80,7 @@ describe("GovernanceActionProvider", () => { const hash = await createHash(jsonld!); expect(hash).toBeDefined(); expect(hash).toBe( - "b84e9890a34d6e59a983cf8f695214162893de5fc5310b12b75f4fe3dab0d7ab", + "bbdbbe163d1b8e4d6c10180df515cc7d58109412d90a42e898fc66850b3fc98c", ); }; test(); diff --git a/govtool/frontend/src/context/wallet.tsx b/govtool/frontend/src/context/wallet.tsx index 70b25b8fd..6dbeed788 100644 --- a/govtool/frontend/src/context/wallet.tsx +++ b/govtool/frontend/src/context/wallet.tsx @@ -48,7 +48,7 @@ import { Link } from "@mui/material"; import * as Sentry from "@sentry/react"; import { Trans } from "react-i18next"; -import { PATHS, NETWORK_NAMES } from "@consts"; +import { PATHS } from "@consts"; import { CardanoApiWallet, Protocol, VoterInfo } from "@models"; import type { StatusModalState } from "@organisms"; import { @@ -64,11 +64,11 @@ import { WALLET_LS_KEY, } from "@utils"; import { getEpochParams } from "@services"; -import { useGetNetworkMetrics, useTranslation } from "@hooks"; +import { useTranslation } from "@hooks"; import { AutomatedVotingOptionDelegationId } from "@/types/automatedVotingOptions"; import { getUtxos } from "./getUtxos"; -import { useModal, useSnackbar } from "."; +import { useAppContext, useModal, useSnackbar } from "."; import { PendingTransaction, TransactionStateWithResource, @@ -941,11 +941,7 @@ const CardanoProvider = (props: Props) => { }; function useCardano() { - const { networkMetrics } = useGetNetworkMetrics(); - const networkName = - NETWORK_NAMES[ - (networkMetrics?.networkName as keyof typeof NETWORK_NAMES) || "preview" - ]; + const { networkName } = useAppContext(); const context = useContext(CardanoContext); const { openModal, closeModal } = useModal(); diff --git a/govtool/frontend/src/utils/tests/canonizeJSON.test.ts b/govtool/frontend/src/utils/tests/canonizeJSON.test.ts index 7115cc430..1dfc22677 100644 --- a/govtool/frontend/src/utils/tests/canonizeJSON.test.ts +++ b/govtool/frontend/src/utils/tests/canonizeJSON.test.ts @@ -3,7 +3,6 @@ import { canonizeJSON } from ".."; const exampleJson = { "@context": { - "@language": "en-us", CIP100: "https://github.com/cardano-foundation/CIPs/blob/master/CIP-0100/README.md#", CIP108: diff --git a/govtool/metadata-validation/src/schemas/cipStandardSchema.test.ts b/govtool/metadata-validation/src/schemas/cipStandardSchema.test.ts index fab4dbfdd..96a740e24 100644 --- a/govtool/metadata-validation/src/schemas/cipStandardSchema.test.ts +++ b/govtool/metadata-validation/src/schemas/cipStandardSchema.test.ts @@ -4,7 +4,6 @@ import { cipStandardSchema } from './cipStandardSchema'; const validCIP108Data = { '@context': { - '@language': 'en', CIP100: 'https://github.com/cardano-foundation/CIPs/blob/master/CIP-0100/README.md#', CIP108: @@ -38,7 +37,6 @@ const validCIP108Data = { const validCIPQQQData = { '@context': { - '@language': 'en', CIP100: 'https://github.com/cardano-foundation/CIPs/blob/master/CIP-0100/README.md#', CIPQQQ: diff --git a/govtool/metadata-validation/src/schemas/cipStandardSchema.ts b/govtool/metadata-validation/src/schemas/cipStandardSchema.ts index 03781bf4b..d578ea516 100644 --- a/govtool/metadata-validation/src/schemas/cipStandardSchema.ts +++ b/govtool/metadata-validation/src/schemas/cipStandardSchema.ts @@ -17,7 +17,6 @@ export const cipStandardSchema: StandardSpecification = { // Source of CIP-108: https://github.com/Ryun1/CIPs/blob/governance-metadata-actions/CIP-0108/README.md [MetadataStandard.CIP108]: Joi.object({ '@context': Joi.object({ - '@language': Joi.string().required(), CIP100: Joi.string().valid(CIP100_URL).required(), CIP108: Joi.string().valid(CIP108_URL).required(), hashAlgorithm: Joi.string().valid('CIP100:hashAlgorithm').required(), @@ -25,28 +24,18 @@ export const cipStandardSchema: StandardSpecification = { authors: Joi.object(), }), authors: Joi.array(), - hashAlgorithm: Joi.object({ - '@value': Joi.string().valid('blake2b-256').required(), - }), + hashAlgorithm: Joi.string().valid('blake2b-256').required(), body: Joi.object({ - title: Joi.object({ - '@value': Joi.string().max(80).required(), - }).required(), - abstract: Joi.object({ - '@value': Joi.string().max(2500).required(), - }).required(), - motivation: Joi.object({ '@value': Joi.string().required() }).required(), - rationale: Joi.object({ '@value': Joi.string().required() }).required(), + title: Joi.string().max(80).required(), + abstract: Joi.string().max(2500).required(), + motivation: Joi.string().required(), + rationale: Joi.string().required(), references: Joi.array() .items( Joi.object({ '@type': Joi.string().required(), - label: Joi.object({ - '@value': Joi.string().required(), - }).required(), - uri: Joi.object({ - '@value': Joi.string().required(), - }).required(), + label: Joi.string().required(), + uri: Joi.string().required(), referenceHash: Joi.object({ hashDigest: Joi.string().required(), hashAlgorithm: Joi.string().required(), @@ -58,7 +47,6 @@ export const cipStandardSchema: StandardSpecification = { }), [MetadataStandard.CIPQQQ]: Joi.object({ '@context': Joi.object({ - '@language': Joi.string().required(), CIP100: Joi.string().valid(CIP100_URL).required(), CIPQQQ: Joi.string().valid(CIPQQQ_URL).required(), hashAlgorithm: Joi.string().valid('CIP100:hashAlgorithm').required(), @@ -66,23 +54,17 @@ export const cipStandardSchema: StandardSpecification = { authors: Joi.object(), }), authors: Joi.array(), - hashAlgorithm: Joi.object({ - '@value': Joi.string().valid('blake2b-256').required(), - }), + hashAlgorithm: Joi.string().valid('blake2b-256').required(), body: Joi.object({ - bio: Joi.object({ '@value': Joi.string().allow('') }).required(), - dRepName: Joi.object({ '@value': Joi.string().allow('') }).required(), - email: Joi.object({ '@value': Joi.string().allow('') }).required(), + bio: Joi.string().allow(''), + dRepName: Joi.string().allow(''), + email: Joi.string().allow('').required(), references: Joi.array() .items( Joi.object({ '@type': Joi.string(), - label: Joi.object({ - '@value': Joi.string().allow('').required(), - }).required(), - uri: Joi.object({ - '@value': Joi.string().required(), - }).required(), + label: Joi.string().allow('').required(), + uri: Joi.string().required(), referenceHash: Joi.object({ hashDigest: Joi.string().required(), hashAlgorithm: Joi.string().required(),