Skip to content

Commit

Permalink
feat(passport-gated): update strategy (#4199)
Browse files Browse the repository at this point in the history
  • Loading branch information
santteegt authored Sep 25, 2023
1 parent aae44f1 commit 01ec4e1
Show file tree
Hide file tree
Showing 16 changed files with 17 additions and 88 deletions.
29 changes: 3 additions & 26 deletions src/components/MessageWarningValidation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ const tPath = computed(() => {

<template
v-else-if="
validationName === 'passport-gated' ||
validationName === 'passport-weighted'
validationName === 'passport-gated'
"
>
<template v-if="validationName === 'passport-gated'">
{{
$t(`${tPath}.passport-gated.invalidMessage`, {
operator: validationParams?.operator === 'AND' ? 'all' : 'one',
stamps: validationParams?.stamps.join(', ')
stamps: validationParams?.stamps.join(', '),
scoreThreshold: validationParams?.scoreThreshold || 0,
})
}}
</template>
Expand All @@ -60,27 +60,4 @@ const tPath = computed(() => {
</BaseLink>
</template>
</BaseMessageBlock>

<!-- <template v-if="validationName === 'passport-weighted' && proposal?.validation.params?.stamps.some(p => p.weight > 1)">
<table class="mt-3 w-full">
<caption>
A list of stamps that can be used to increase your weight:
</caption>
<thead>
<tr>
<th class="w-2/3 py-1 text-left text-skin-link">Stamp</th>
<th class="w-1/3 py-1 text-left text-skin-link">Weight</th>
</tr>
</thead>
<tbody>
<tr
v-for="stamp in proposal.validation.params.stamps"
:key="stamp.name"
>
<td class="py-1">{{ stamp.id }}</td>
<td class="py-1">{{ stamp.weight }}</td>
</tr>
</tbody>
</table>
</template> -->
</template>
5 changes: 1 addition & 4 deletions src/locales/ar-SA.json
Original file line number Diff line number Diff line change
Expand Up @@ -595,10 +595,7 @@
"passport-gated": {
"label": "Gitcoin Passport gated",
"description": "Protect your proposals from spam and vote manipulation by requiring users to have a Gitcoin Passport.",
"invalidMessage": "You need a Gitcoin Passport with {amount} of the following stamps to vote on this proposal: {stamps}. "
},
"passport-weighted": {
"label": "Gitcoin Passport weighted"
"invalidMessage": "You need a Gitcoin Passport with score above {scoreThreshold} and {operator} of the following stamps to vote on this proposal: {stamps}. "
}
},
"safeSnap": {
Expand Down
5 changes: 1 addition & 4 deletions src/locales/de-DE.json
Original file line number Diff line number Diff line change
Expand Up @@ -595,10 +595,7 @@
"passport-gated": {
"label": "Gitcoin Passport gated",
"description": "Protect your proposals from spam and vote manipulation by requiring users to have a Gitcoin Passport.",
"invalidMessage": "You need a Gitcoin Passport with {amount} of the following stamps to vote on this proposal: {stamps}. "
},
"passport-weighted": {
"label": "Gitcoin Passport weighted"
"invalidMessage": "You need a Gitcoin Passport with score above {scoreThreshold} and {operator} of the following stamps to vote on this proposal: {stamps}. "
}
},
"safeSnap": {
Expand Down
10 changes: 2 additions & 8 deletions src/locales/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -739,10 +739,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 {operator} of the following stamps to create a proposal: {stamps}"
},
"passport-weighted": {
"label": "Gitcoin Passport weighted"
"invalidMessage": "You need a Gitcoin Passport with score above {scoreThreshold} and {operator} of the following stamps to vote on this proposal: {stamps}. "
},
"arbitrum": {
"label": "Arbitrum DAO votable supply",
Expand Down Expand Up @@ -771,10 +768,7 @@
"passport-gated": {
"label": "Gitcoin Passport gated",
"description": "Protect your proposals from spam and vote manipulation by requiring users to have a Gitcoin Passport.",
"invalidMessage": "You need a Gitcoin Passport with {operator} of the following stamps to vote on this proposal: {stamps}. "
},
"passport-weighted": {
"label": "Gitcoin Passport weighted"
"invalidMessage": "You need a Gitcoin Passport with score above {scoreThreshold} and {operator} of the following stamps to vote on this proposal: {stamps}. "
}
},
"safeSnap": {
Expand Down
5 changes: 1 addition & 4 deletions src/locales/es-ES.json
Original file line number Diff line number Diff line change
Expand Up @@ -595,10 +595,7 @@
"passport-gated": {
"label": "Gitcoin Passport gated",
"description": "Protect your proposals from spam and vote manipulation by requiring users to have a Gitcoin Passport.",
"invalidMessage": "You need a Gitcoin Passport with {amount} of the following stamps to vote on this proposal: {stamps}. "
},
"passport-weighted": {
"label": "Gitcoin Passport weighted"
"invalidMessage": "You need a Gitcoin Passport with score above {scoreThreshold} and {operator} of the following stamps to vote on this proposal: {stamps}. "
}
},
"safeSnap": {
Expand Down
5 changes: 1 addition & 4 deletions src/locales/fil-PH.json
Original file line number Diff line number Diff line change
Expand Up @@ -595,10 +595,7 @@
"passport-gated": {
"label": "Gitcoin Passport gated",
"description": "Protect your proposals from spam and vote manipulation by requiring users to have a Gitcoin Passport.",
"invalidMessage": "You need a Gitcoin Passport with {amount} of the following stamps to vote on this proposal: {stamps}. "
},
"passport-weighted": {
"label": "Gitcoin Passport weighted"
"invalidMessage": "You need a Gitcoin Passport with score above {scoreThreshold} and {operator} of the following stamps to vote on this proposal: {stamps}. "
}
},
"safeSnap": {
Expand Down
5 changes: 1 addition & 4 deletions src/locales/fr-FR.json
Original file line number Diff line number Diff line change
Expand Up @@ -597,10 +597,7 @@
"passport-gated": {
"label": "Accès réservé au Gitcoin Passport",
"description": "Protégez vos propositions contre le spam et la manipulation des votes en exigeant que les utilisateurs aient un Gitcoin Passport.",
"invalidMessage": "You need a Gitcoin Passport with {amount} of the following stamps to vote on this proposal: {stamps}. "
},
"passport-weighted": {
"label": "Pondéré par Gitcoin Passport"
"invalidMessage": "You need a Gitcoin Passport with score above {scoreThreshold} and {operator} of the following stamps to vote on this proposal: {stamps}. "
}
},
"safeSnap": {
Expand Down
5 changes: 1 addition & 4 deletions src/locales/id-ID.json
Original file line number Diff line number Diff line change
Expand Up @@ -595,10 +595,7 @@
"passport-gated": {
"label": "Gitcoin Passport gated",
"description": "Protect your proposals from spam and vote manipulation by requiring users to have a Gitcoin Passport.",
"invalidMessage": "You need a Gitcoin Passport with {amount} of the following stamps to vote on this proposal: {stamps}. "
},
"passport-weighted": {
"label": "Gitcoin Passport weighted"
"invalidMessage": "You need a Gitcoin Passport with score above {scoreThreshold} and {operator} of the following stamps to vote on this proposal: {stamps}. "
}
},
"safeSnap": {
Expand Down
5 changes: 1 addition & 4 deletions src/locales/it-IT.json
Original file line number Diff line number Diff line change
Expand Up @@ -595,10 +595,7 @@
"passport-gated": {
"label": "Gitcoin Passport gated",
"description": "Protect your proposals from spam and vote manipulation by requiring users to have a Gitcoin Passport.",
"invalidMessage": "You need a Gitcoin Passport with {amount} of the following stamps to vote on this proposal: {stamps}. "
},
"passport-weighted": {
"label": "Gitcoin Passport weighted"
"invalidMessage": "You need a Gitcoin Passport with score above {scoreThreshold} and {operator} of the following stamps to vote on this proposal: {stamps}. "
}
},
"safeSnap": {
Expand Down
3 changes: 0 additions & 3 deletions src/locales/ja-JP.json
Original file line number Diff line number Diff line change
Expand Up @@ -596,9 +596,6 @@
"label": "Gitcoin Passport ゲート付き",
"description": "Gitcoin Passportを必要とすることで、スパムや投票操作からあなたの提案を保護します。",
"invalidMessage": "この提案に投票するためには、{amount} 以下の切手を持つGitcoin Passportが必要です:{stamps}。"
},
"passport-weighted": {
"label": "Gitcoin Passport 重み付き"
}
},
"safeSnap": {
Expand Down
5 changes: 1 addition & 4 deletions src/locales/ko-KR.json
Original file line number Diff line number Diff line change
Expand Up @@ -595,10 +595,7 @@
"passport-gated": {
"label": "Gitcoin Passport gated",
"description": "Protect your proposals from spam and vote manipulation by requiring users to have a Gitcoin Passport.",
"invalidMessage": "You need a Gitcoin Passport with {amount} of the following stamps to vote on this proposal: {stamps}. "
},
"passport-weighted": {
"label": "Gitcoin Passport weighted"
"invalidMessage": "You need a Gitcoin Passport with score above {scoreThreshold} and {operator} of the following stamps to vote on this proposal: {stamps}. "
}
},
"safeSnap": {
Expand Down
5 changes: 1 addition & 4 deletions src/locales/pt-PT.json
Original file line number Diff line number Diff line change
Expand Up @@ -596,10 +596,7 @@
"passport-gated": {
"label": "Gitcoin Passport gated",
"description": "Protect your proposals from spam and vote manipulation by requiring users to have a Gitcoin Passport.",
"invalidMessage": "You need a Gitcoin Passport with {amount} of the following stamps to vote on this proposal: {stamps}. "
},
"passport-weighted": {
"label": "Gitcoin Passport weighted"
"invalidMessage": "You need a Gitcoin Passport with score above {scoreThreshold} and {operator} of the following stamps to vote on this proposal: {stamps}. "
}
},
"safeSnap": {
Expand Down
5 changes: 1 addition & 4 deletions src/locales/ro-RO.json
Original file line number Diff line number Diff line change
Expand Up @@ -596,10 +596,7 @@
"passport-gated": {
"label": "Gitcoin Passport gated",
"description": "Protect your proposals from spam and vote manipulation by requiring users to have a Gitcoin Passport.",
"invalidMessage": "You need a Gitcoin Passport with {amount} of the following stamps to vote on this proposal: {stamps}. "
},
"passport-weighted": {
"label": "Gitcoin Passport weighted"
"invalidMessage": "You need a Gitcoin Passport with score above {scoreThreshold} and {operator} of the following stamps to vote on this proposal: {stamps}. "
}
},
"safeSnap": {
Expand Down
5 changes: 1 addition & 4 deletions src/locales/ru-RU.json
Original file line number Diff line number Diff line change
Expand Up @@ -596,10 +596,7 @@
"passport-gated": {
"label": "Gitcoin Passport gated",
"description": "Protect your proposals from spam and vote manipulation by requiring users to have a Gitcoin Passport.",
"invalidMessage": "You need a Gitcoin Passport with {amount} of the following stamps to vote on this proposal: {stamps}. "
},
"passport-weighted": {
"label": "Gitcoin Passport weighted"
"invalidMessage": "You need a Gitcoin Passport with score above {scoreThreshold} and {operator} of the following stamps to vote on this proposal: {stamps}. "
}
},
"safeSnap": {
Expand Down
5 changes: 1 addition & 4 deletions src/locales/tr-TR.json
Original file line number Diff line number Diff line change
Expand Up @@ -596,10 +596,7 @@
"passport-gated": {
"label": "Gitcoin Passport gated",
"description": "Protect your proposals from spam and vote manipulation by requiring users to have a Gitcoin Passport.",
"invalidMessage": "You need a Gitcoin Passport with {amount} of the following stamps to vote on this proposal: {stamps}. "
},
"passport-weighted": {
"label": "Gitcoin Passport weighted"
"invalidMessage": "You need a Gitcoin Passport with score above {scoreThreshold} and {operator} of the following stamps to vote on this proposal: {stamps}. "
}
},
"safeSnap": {
Expand Down
3 changes: 0 additions & 3 deletions src/locales/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -597,9 +597,6 @@
"label": "Gitcoin Passport门槛",
"description": "通过要求用户拥有 Gitcoin Passport 来保护您的提案免受垃圾邮件和投票操纵。",
"invalidMessage": "你需要一本带有 amount个如下邮票的Gitcoin Passport才能对这个提案投票: stamps "
},
"passport-weighted": {
"label": "Gitcoin Passport加权"
}
},
"safeSnap": {
Expand Down

1 comment on commit 01ec4e1

@vercel
Copy link

@vercel vercel bot commented on 01ec4e1 Sep 25, 2023

Choose a reason for hiding this comment

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

Please sign in to comment.