diff --git a/instances/devhub.near/widget/devhub/entity/proposal/Editor.jsx b/instances/devhub.near/widget/devhub/entity/proposal/Editor.jsx index 31fb566cb..50bc35fc5 100644 --- a/instances/devhub.near/widget/devhub/entity/proposal/Editor.jsx +++ b/instances/devhub.near/widget/devhub/entity/proposal/Editor.jsx @@ -898,7 +898,7 @@ const ConsentComponent = useMemo(() => { src={ "${REPL_DEVHUB}/widget/devhub.entity.proposal.AcceptedTerms" } - props={{ proposalId: proposalId }} + props={{ proposalId: proposalId, portal: "DevHub" }} /> and commit to honoring it diff --git a/instances/events-committee.near/widget/devhub/components/molecule/Button.jsx b/instances/events-committee.near/widget/devhub/components/molecule/Button.jsx index c7cdfae46..7a580525c 100644 --- a/instances/events-committee.near/widget/devhub/components/molecule/Button.jsx +++ b/instances/events-committee.near/widget/devhub/components/molecule/Button.jsx @@ -145,6 +145,7 @@ const Button = ({ disabled ? "disabled" : "", ].join(" ")} style={{ width: "fit-content" }} + disabled={disabled} {...restProps} data-testid={props.testId ?? "button"} > diff --git a/instances/events-committee.near/widget/devhub/entity/proposal/CommentsAndLogs.jsx b/instances/events-committee.near/widget/devhub/entity/proposal/CommentsAndLogs.jsx index b534383f5..fce79b846 100644 --- a/instances/events-committee.near/widget/devhub/entity/proposal/CommentsAndLogs.jsx +++ b/instances/events-committee.near/widget/devhub/entity/proposal/CommentsAndLogs.jsx @@ -93,6 +93,16 @@ function sortTimelineAndComments() { .slice(1) .map((item, index) => { const startingPoint = snapshotHistory[index]; // Set comparison to the previous item + // we don't show timeline_version in logs + delete startingPoint.timeline.timeline_version; + delete item.timeline.timeline_version; + if ( + startingPoint.timeline.kyc_verified === undefined && + item.timeline.kyc_verified === false + ) { + startingPoint.timeline.kyc_verified = false; + } + return { editorId: item.editor_id, ...getDifferentKeysWithValues(startingPoint, item), @@ -270,8 +280,12 @@ function parseTimelineKeyAndValue(timeline, originalValue, modifiedValue) { ) ); - case "sponsor_requested_review": - return !oldValue && newValue && completed review; + case "sponsor_requested_review": { + if (!oldValue && newValue) { + return completed review; + } else if (oldValue && !newValue) return unmarked review; + return null; + } case "reviewer_completed_attestation": return !oldValue && newValue && completed attestation; case "kyc_verified": diff --git a/instances/events-committee.near/widget/devhub/entity/proposal/Editor.jsx b/instances/events-committee.near/widget/devhub/entity/proposal/Editor.jsx index 6ac9c3a19..e991ac55c 100644 --- a/instances/events-committee.near/widget/devhub/entity/proposal/Editor.jsx +++ b/instances/events-committee.near/widget/devhub/entity/proposal/Editor.jsx @@ -737,9 +737,12 @@ const onSubmit = ({ isDraft, isCancel }) => { status: "CANCELLED", sponsor_requested_review: false, reviewer_completed_attestation: false, + kyc_verified: false, } : isDraft ? { status: "DRAFT" } + : isEditPage + ? editProposalData.snapshot.timeline : { status: "REVIEW", sponsor_requested_review: false, @@ -749,6 +752,10 @@ const onSubmit = ({ isDraft, isCancel }) => { const args = { labels: (labels ?? []).map((i) => i.value), body: body }; if (isEditPage) { args["id"] = editProposalData.id; + } else { + args["accepted_terms_and_conditions_version"] = parseInt( + Near.block().header.height + ); } Near.call([ @@ -890,16 +897,12 @@ const ConsentComponent = useMemo(() => { label: ( <> I’ve agree to{" "} - - Event Committee’s Terms and Conditions - + props={{ proposalId: proposalId, portal: "Events Committee" }} + /> and commit to honoring it ), @@ -926,7 +929,7 @@ const ConsentComponent = useMemo(() => { target="_blank" rel="noopener noreferrer" > - Event Committee’s Code of Conduct + Events Committee’s Code of Conduct and commit to honoring it diff --git a/instances/events-committee.near/widget/devhub/entity/proposal/Proposal.jsx b/instances/events-committee.near/widget/devhub/entity/proposal/Proposal.jsx index 3e790cf62..249b31351 100644 --- a/instances/events-committee.near/widget/devhub/entity/proposal/Proposal.jsx +++ b/instances/events-committee.near/widget/devhub/entity/proposal/Proposal.jsx @@ -351,12 +351,14 @@ const proposalStatusOptions = [ status: TIMELINE_STATUS.REVIEW, sponsor_requested_review: false, reviewer_completed_attestation: false, + kyc_verified: false, }, }, { label: "Approved", value: { status: TIMELINE_STATUS.APPROVED, + kyc_verified: true, sponsor_requested_review: true, reviewer_completed_attestation: false, }, @@ -365,6 +367,7 @@ const proposalStatusOptions = [ label: "Approved-Conditionally", value: { status: TIMELINE_STATUS.APPROVED_CONDITIONALLY, + kyc_verified: true, sponsor_requested_review: true, reviewer_completed_attestation: false, }, @@ -375,6 +378,7 @@ const proposalStatusOptions = [ status: TIMELINE_STATUS.REJECTED, sponsor_requested_review: true, reviewer_completed_attestation: false, + kyc_verified: true, }, }, { @@ -383,13 +387,14 @@ const proposalStatusOptions = [ status: TIMELINE_STATUS.CANCELED, sponsor_requested_review: false, reviewer_completed_attestation: false, + kyc_verified: true, }, }, { label: "Payment-processing", value: { status: TIMELINE_STATUS.PAYMENT_PROCESSING, - kyc_verified: false, + kyc_verified: true, test_transaction_sent: false, request_for_trustees_created: false, sponsor_requested_review: true, @@ -438,9 +443,11 @@ const LinkedProposals = () => { }} />
- - {item.snapshot.name} - +
+ + {item.snapshot.name} + +
created on {readableDate(item.snapshot.timestamp / 1000000)}
@@ -532,10 +539,10 @@ const editProposalStatus = ({ timeline }) => { Near.call([ { contractName: "${REPL_EVENTS_CONTRACT}", - methodName: "edit_proposal_timeline", + methodName: "edit_proposal_versioned_timeline", args: { id: proposal.id, - timeline: timeline, + timeline: { timeline_version: "V1", ...timeline }, }, gas: 270000000000000, }, @@ -1156,6 +1163,21 @@ return ( .reviewer_completed_attestation } /> + + setUpdatedProposalStatus((prevState) => ({ + ...prevState, + value: { + ...prevState.value, + kyc_verified: value, + }, + })) + } + isChecked={updatedProposalStatus.value.kyc_verified} + />
- - setUpdatedProposalStatus((prevState) => ({ - ...prevState, - value: { - ...prevState.value, - kyc_verified: value, - }, - })) - } - isChecked={updatedProposalStatus.value.kyc_verified} - /> + { if (snapshot.supervisor !== supervisor) { diff --git a/playwright-tests/tests/events/proposals.spec.js b/playwright-tests/tests/events/proposals.spec.js index 0cc55f524..33bfcf9b9 100644 --- a/playwright-tests/tests/events/proposals.spec.js +++ b/playwright-tests/tests/events/proposals.spec.js @@ -43,7 +43,7 @@ async function getCurrentBlockHeight(page) { }); } -test.describe.skip("Wallet is connected, but not KYC verified", () => { +test.describe("Wallet is connected, but not KYC verified", () => { test.use({ storageState: "playwright-tests/storage-states/wallet-connected-not-kyc-verified-account.json", @@ -188,7 +188,7 @@ test.describe("Don't ask again enabled", () => { }); }); -test.describe.skip('Moderator with "Don\'t ask again" enabled', () => { +test.describe('Moderator with "Don\'t ask again" enabled', () => { test.use({ storageState: "playwright-tests/storage-states/wallet-connected-with-devhub-moderator-access-key.json", @@ -246,11 +246,11 @@ test.describe.skip('Moderator with "Don\'t ask again" enabled', () => { ); await page.goto(`/${account}/widget/app?page=proposal&id=17`); - console.log({ account }); + await setDontAskAgainCacheValues({ page, contractId: account, - widgetSrc: `/${account}/widget/devhub.entity.proposal.Proposal`, + widgetSrc: `${account}/widget/devhub.entity.proposal.Proposal`, methodName: "edit_proposal_versioned_timeline", }); @@ -271,9 +271,9 @@ test.describe.skip('Moderator with "Don\'t ask again" enabled', () => { const callContractToast = await page.getByText("Sending transaction"); await expect(callContractToast).toBeVisible(); - await expect(callContractToast).not.toBeAttached({ timeout: 10000 }); + await expect(callContractToast).not.toBeAttached(); const timeLineStatusSubmittedToast = await page - .getByText("Timeline status submitted") + .getByText("Timeline status submitted successfully") .first(); await expect(timeLineStatusSubmittedToast).toBeVisible(); @@ -285,7 +285,8 @@ test.describe.skip('Moderator with "Don\'t ask again" enabled', () => { { hasText: /.*s ago/ } ); await expect(lastLogItem).toContainText( - "moved proposal from REVIEW to APPROVED" + "moved proposal from REVIEW to APPROVED", + { timeout: 10000 } ); await lastLogItem.scrollIntoViewIfNeeded(); await expect(timeLineStatusSubmittedToast).not.toBeAttached(); @@ -340,7 +341,6 @@ test.describe("Wallet is connected", () => { test.setTimeout(120000); await getCurrentBlockHeight(page); await page.goto(`/${account}/widget/app?page=create-proposal`); - const delay_milliseconds_between_keypress_when_typing = 0; const titleArea = await page.getByRole("textbox").first(); await expect(titleArea).toBeEditable(); @@ -379,7 +379,10 @@ test.describe("Wallet is connected", () => { await pauseIfVideoRecording(page); - await page.frameLocator("iframe").getByText("petersalomonsen.near").click(); + await page + .frameLocator("iframe") + .getByText("petersalomonsen.near") + .click({ timeout: 10000 }); await descriptionArea.pressSequentially(`. Also mentioning @m`, { delay: delay_milliseconds_between_keypress_when_typing, @@ -417,7 +420,7 @@ test.describe("Wallet is connected", () => { null, 1 ); - await expect(transactionText).toEqual( + expect(transactionText).toEqual( JSON.stringify( { labels: ["Bounty booster"], @@ -438,7 +441,7 @@ test.describe("Wallet is connected", () => { status: "DRAFT", }, }, - // accepted_terms_and_conditions_version: 122927956, + accepted_terms_and_conditions_version: acceptedTermsVersion, }, null, 1 @@ -541,18 +544,9 @@ test.describe("Wallet is connected", () => { await page.route( "https://near-queryapi.api.pagoda.co/v1/graphql", async (route) => { - // const request = await route.request(); - // const requestPostData = request.postDataJSON(); - const response = await route.fetch({ url: "https://near-queryapi.api.pagoda.co/v1/graphql", }); - // const json = await response.json(); - - // let proposal2 = - // json.data.thomasguntenaar_near_events_committee_proposals_2_proposals_with_latest_snapshot.find( - // (proposal) => proposal.proposal_id === 2 - // ); const json = { data: { @@ -612,6 +606,8 @@ test.describe("Wallet is connected", () => { await route.fulfill({ response, json }); } ); + await getCurrentBlockHeight(page); + const delay_milliseconds_between_keypress_when_typing = 100; const titleArea = await page.getByRole("textbox").first(); await expect(titleArea).toBeEditable(); @@ -698,7 +694,7 @@ test.describe("Wallet is connected", () => { status: "DRAFT", }, }, - // accepted_terms_and_conditions_version: 122927956, + accepted_terms_and_conditions_version: acceptedTermsVersion, }, null, 1