Skip to content

Commit

Permalink
Rename to 'Quorum of rejection' (#4677)
Browse files Browse the repository at this point in the history
  • Loading branch information
ChaituVR authored Apr 15, 2024
1 parent f8e8513 commit cb5ca02
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions src/components/ProposalsItemFooter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@ const quorumText = computed(() => {
return '';
}
const optimisticQuorum = props.proposal.quorumType === 'optimistic';
const quorumOfRejection = props.proposal.quorumType === 'rejection';
const percentage = formatPercentNumber(
optimisticQuorum
quorumOfRejection
? Number(
props.proposal.scores
.filter((c, i) => i === 1)
.reduce((a, b) => a + b, 0) / props.proposal.quorum
)
: Number(props.proposal.scores_total / props.proposal.quorum)
);
return optimisticQuorum
return quorumOfRejection
? `${percentage} quorum rejection`
: `${percentage} quorum reached`;
});
Expand Down
4 changes: 2 additions & 2 deletions src/components/SettingsVotingBlock.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ const { form, validationErrors } = useFormSpaceSettings(props.context);
name: 'Default'
},
{
value: 'optimistic',
name: 'Optimistic'
value: 'rejection',
name: 'Quorum of rejection'
}
]"
:disabled="isViewOnly"
Expand Down
4 changes: 2 additions & 2 deletions src/components/SpaceProposalResultsQuorum.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const { formatCompactNumber, formatPercentNumber } = useIntl();
<div class="pt-2 text-skin-link">
<div class="flex justify-between">
<div class="flex items-center gap-1">
{{ quorumType === 'optimistic' ? 'Optimistic Quorum' : 'Quorum' }}
{{ quorumType === 'rejection' ? 'Quorum of rejection' : 'Quorum' }}
</div>
<LoadingSpinner v-if="loadingQuorum" class="mr-1" />
<div v-else class="flex gap-2">
Expand All @@ -29,7 +29,7 @@ const { formatCompactNumber, formatPercentNumber } = useIntl();
/>
<i-ho-x
v-if="
quorum && quorumType === 'optimistic' && totalQuorumScore >= quorum
quorum && quorumType === 'rejection' && totalQuorumScore >= quorum
"
class="text-red"
/>
Expand Down
2 changes: 1 addition & 1 deletion src/composables/useQuorum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export function useQuorum(props: QuorumProps) {
const quorumType = ref('default');

const totalQuorumScore = computed(() => {
if (props.proposal.quorumType === 'optimistic') {
if (props.proposal.quorumType === 'rejection') {
return props.results.scores
.filter((c, i) => i === 1)
.reduce((a, b) => a + b, 0);
Expand Down
4 changes: 2 additions & 2 deletions src/helpers/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ export interface ExtendedSpace {
hideAbstain: boolean;
period: number | null;
quorum: number | null;
quorumType: 'default' | 'optimistic';
quorumType: 'default' | 'rejection';
type: string | null;
privacy: string | null;
};
Expand Down Expand Up @@ -230,7 +230,7 @@ export interface Proposal {
validation: VoteValidation;
discussion: string;
quorum: number;
quorumType: 'default' | 'optimistic';
quorumType: 'default' | 'rejection';
scores: number[];
scores_state: string;
scores_total: number;
Expand Down

0 comments on commit cb5ca02

Please sign in to comment.