Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 2 additions & 34 deletions govtool/frontend/src/context/usersnapContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,39 +79,7 @@ export const UsersnapProvider = ({
if (API_KEY) {
try {
const api = await loadSpace(API_KEY);
api.init({
...initParams,
customFields: {
sentiment_score: {
type: 'rating',
label: t("feedback.sentimentScore"),
required: true,
options: [1, 2, 3, 4, 5]
},
additional_notes: {
type: 'textarea',
label: t("feedback.additionalNotes"),
required: false
}
},
feedbackTypes: [
{
id: 'bug',
label: t("feedback.reportBug"),
description: t("feedback.reportBugDescription")
},
{
id: 'idea',
label: t("feedback.suggestIdea"),
description: t("feedback.suggestIdeaDescription")
},
{
id: 'sentiment',
label: t("feedback.sentimentFeedback"),
description: t("feedback.sentimentFeedbackDescription")
}
]
});
api.init(initParams);
setUsersnapApi(api);
} catch (error) {
console.error(error);
Expand All @@ -132,4 +100,4 @@ export const UsersnapProvider = ({

export function useUsersnapApi() {
return useContext(UsersnapContext);
}
}
39 changes: 14 additions & 25 deletions govtool/frontend/src/i18n/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@
"noDelegationDescription": "Find a DRep to vote on your behalf.",
"noDelegationActionButton": "View DRep Directory",
"dRepDelegationTitle": "Your Voting Power of <strong>₳{{ada}}</strong>\nis Delegated to:",
"noConfidenceDelegationTitle": "You have delegated your Voting Power <strong>₳{{ada}}</strong>\nto \"No Confidence\"",
"abstainDelegationTitle": "You have delegated your Voting Power <strong>₳{{ada}}</strong>\nto \"Abstain\"",
"noConfidenceDelegationTitle": "You have delegated your Voting Power <strong>₳{{ada}}</strong>\nto No Confidence",
"abstainDelegationTitle": "You have delegated your Voting Power <strong>₳{{ada}}</strong>\nto Abstain",
"abstainDescription": "You have selected to apply your Voting Power to Abstain on every vote.",
"noDescription": "You have selected to apply your Voting Power to No Confidence on every vote.",
"inProgress": {
Expand Down Expand Up @@ -283,8 +283,8 @@
"abstainCardDefaultTitle": "Abstain from Every Vote",
"automatedVotingOptions": "Automated Voting Options",
"editBtn": "Edit DRep data",
"delegatedToAbstainTitle": "You have delegated ₳{{ada}} to \"Abstain\"",
"delegatedToNoConfidenceTitle": "You have delegated ₳{{ada}} to \"No Confidence\"",
"delegatedToAbstainTitle": "You have delegated ₳{{ada}} to Abstain",
"delegatedToNoConfidenceTitle": "You have delegated ₳{{ada}} to No Confidence",
"delegatedToAbstainDescription": "You have selected to apply your Voting Power to Abstain on every vote.",
"delegatedToNoConfidenceDescription": "You have selected to apply your Voting Power to No Confidence on every vote.",
"delegationOptions": "Delegation Options",
Expand Down Expand Up @@ -429,7 +429,7 @@
"chooseHowToVote": "Choose how you want to vote:",
"contextAboutYourVote": "Context about your vote",
"dataMissing": "Data Missing",
"dataMissingTooltipExplanation": "Please click \"View Details\" for more information.",
"dataMissingTooltipExplanation": "Please click View Details for more information.",
"details": "Governance Details:",
"expiresDateWithEpoch": "Expires: <0>{{date}}</0> <1>(Epoch {{epoch}})</1>",
"expiryDate": "Expiry date:",
Expand Down Expand Up @@ -656,7 +656,7 @@
},
"pendingValidation": {
"title": "GovTool Is Checking Your Data",
"message": "GovTool will read the URL that you supplied and make a check to see if it's identical with the information that you entered on the form."
"message": "GovTool will read the URL that you supplied and make a check to see if its identical with the information that you entered on the form."
}
},
"dRepData": {
Expand Down Expand Up @@ -694,7 +694,7 @@
"description": "Looks like you have already successfully completed your registration and you currently are a DRep.\n\nYou can view your details in the DRep Directory.",
"viewDetails": "View your DRep details"
},
"becomeADrep": "Become a DRep",
"becomeADRep": "Become a DRep",
"descriptionStepTwo": "By clicking register you create your DRep ID within your wallet and become a DRep.\n\nOnce the registration has completed your DRep ID will be shown on your dashboard. You will be able to share your DRep ID so that other ada holders can delegate their voting power to you.",
"headingStepTwo": "Confirm DRep registration",
"register": "Register",
Expand All @@ -721,7 +721,7 @@
}
},
"retirement": {
"notADrep": {
"notADRep": {
"title": "You are not a DRep",
"description": "Looks like you cannot retire, because currently you are not a DRep."
},
Expand Down Expand Up @@ -769,7 +769,7 @@
},
"noConfidence": {
"heading": "No confidence",
"paragraphOne": "If you don't have trust in the current constitutional committee you signal 'No-confidence'. By voting 'No' means you don't want governance actions to be ratified."
"paragraphOne": "If you dont have trust in the current constitutional committee you signal No-confidence. By voting ‘No’ means you dont want governance actions to be ratified."
},
"todRep": {
"heading": "Delegation to DRep",
Expand All @@ -782,7 +782,7 @@
},
"expiryDate": {
"heading": "Expiry Date",
"paragraphOne": "The date when the governance action will expiry if it doesn't reach ratification thresholds.",
"paragraphOne": "The date when the governance action will expiry if it doesnt reach ratification thresholds.",
"paragraphTwo": "IMPORTANT: If the governance action is ratified before the expiry date it will be considered ratified and it will not be available to vote on afterwards."
},
"submissionDate": {
Expand All @@ -796,7 +796,7 @@
}
},
"wallet": {
"cantSeeWalletQuestion": "Can't see your wallet? Check what wallets are currently compatible with GovTool ",
"cantSeeWalletQuestion": "Cant see your wallet? Check what wallets are currently compatible with GovTool ",
"chooseWallet": "Choose the wallet you want to connect with:",
"connect": "Connect",
"connectWallet": "Connect Wallet",
Expand Down Expand Up @@ -833,7 +833,7 @@
},
"intersectWebsite": {
"title": "Intersect website",
"description": "Intersect is a member-based organization for the Cardano ecosystem — putting the community at the center of Cardano's development",
"description": "Intersect is a member-based organization for the Cardano ecosystem — putting the community at the center of Cardanos development",
"link": "Intersect website"
}
},
Expand All @@ -855,18 +855,7 @@
"cip129DrepId": "(CIP-129) DRep ID",
"cip105DRepId": "Legacy DRep ID (CIP-105)",
"email": "Email",
"feedback": {
"title": "Feedback",
"reportBug": "Report a Bug",
"suggestIdea": "Suggest a New Idea",
"sentimentFeedback": "Sentiment Feedback",
"sentimentScore": "How would you rate your experience?",
"additionalNotes": "Additional Notes",
"submit": "Submit Feedback",
"reportBugDescription": "Something is not working as expected",
"suggestIdeaDescription": "Share your ideas for improvement",
"sentimentFeedbackDescription": "Rate your experience and provide feedback"
},
"feedback": "Feedback",
"filter": "Filter",
"goBack": "Go back",
"goToMainnet": "Go to Mainnet",
Expand Down Expand Up @@ -898,4 +887,4 @@
"viewDetails": "View details",
"votingPower": "Voting power",
"yourself": "Yourself"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -187,27 +187,4 @@ test.describe("Submit Usersnap", () => {

await expect(page.getByText("Thank you!")).toBeVisible();
});

test("10F. Should submit sentiment feedback", async ({ page }) => {
// Intercept Usersnap submit API
await interceptUsersnap(page);
await interceptBucket(page);

await page
.getByRole("button", { name: "Share Your Experience" })
.click();

// Select a rating
await page.getByLabel("How would you rate your experience?").click();
await page.getByRole("button", { name: "4" }).click();

// Add additional notes
await page
.getByPlaceholder("Additional Notes")
.fill(faker.lorem.paragraph(2));

await page.getByRole("button", { name: "Submit Feedback" }).click();

await expect(page.getByText("Thank you!")).toBeVisible();
});
});
});