Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(passport-gated): stamps as optional parameter #4279

Closed
Closed
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
4 changes: 2 additions & 2 deletions src/components/MessageWarningValidation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ const tPath = computed(() => {
<template v-if="validationName === 'passport-gated'">
{{
$t(`${tPath}.passport-gated.invalidMessage`, {
operator: validationParams?.operator === 'AND' ? 'all' : 'one',
stamps: validationParams?.stamps.join(', '),
operator: validationParams?.operator === 'AND' ? 'all' : 'any',
stamps: validationParams?.stamps.length === 0 ? 'any valid Stamp' : validationParams?.stamps.join(', '),
scoreThreshold: validationParams?.scoreThreshold || 0
})
}}
Expand Down
7 changes: 5 additions & 2 deletions src/components/ModalValidation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,11 @@ function handleSelect(n: string) {
}
}

if (n === 'passport-gated' && !input.value.params.operator) {
input.value.params.operator = 'OR';
if (n === 'passport-gated') {
if (!input.value.params.operator)
input.value.params.operator = '';
if (input.value.params.stamps?.[0] === undefined)
input.value.params.stamps = [];
}
}

Expand Down
7 changes: 5 additions & 2 deletions src/components/ModalVoteValidation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,11 @@ function select(n: string) {
}
}

if (n === 'passport-gated' && !input.value.params.operator) {
input.value.params.operator = 'OR';
if (n === 'passport-gated') {
if (!input.value.params.operator)
input.value.params.operator = '';
if (input.value.params.stamps?.[0] === undefined)
input.value.params.stamps = [];
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/locales/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -741,7 +741,7 @@
"passport-gated": {
"label": "Gitcoin Passport gated",
"description": "Protect your space from spam by requiring users to have a Gitcoin Passport to create a proposal.",
"invalidMessage": "You need a Gitcoin Passport with score above {scoreThreshold} and {operator} of the following stamps to vote on this proposal: {stamps}. "
"invalidMessage": "You need a Gitcoin Passport with score above {scoreThreshold} and {operator} of the following stamps to create a proposal: {stamps}. "
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this still be used inside proposal

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"invalidMessage": "You need a Gitcoin Passport with score above {scoreThreshold} and {operator} of the following stamps to create a proposal: {stamps}. "
"invalidMessage": "You need a Gitcoin Passport with a score above {scoreThreshold} and {operator} of the following stamps: {stamps}. "

},
"arbitrum": {
"label": "Arbitrum DAO votable supply",
Expand Down