Skip to content

Commit

Permalink
chore: sync master to develop
Browse files Browse the repository at this point in the history
chore: sync master to develop
  • Loading branch information
arsenijesavic authored Oct 3, 2023
2 parents b3c8d4c + 9a5df47 commit 20855f7
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 21 deletions.
5 changes: 3 additions & 2 deletions src/components/login/register-user-with-captcha-view.vue
Original file line number Diff line number Diff line change
Expand Up @@ -194,14 +194,15 @@ export default {
const query = await this.$apollo.watchQuery({
query: require('~/query/dao-created.gql'),
variables: { regexp: '/^' + daoUrl + '$/i' },
variables: { regexp: '/^' + daoUrl + '$/i', username: this.account },
pollInterval: 100,
fetchPolicy: 'no-cache'
})
query.subscribe(({ data, loading }) => {
const value = data.queryDao
if (value.length > 0) {
if (value.length > 0 && value[0]?.admin?.length > 0) {
this.$router.push({ path: `/${daoUrl}/` })
}
})
Expand Down
7 changes: 2 additions & 5 deletions src/components/proposals/voter-list.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@ export default {
},
props: {
proposalId: String
proposalId: String,
voteCount: Number
},
data () {
return {
page: 0,
size: 5,
voices: {},
voteCount: 0,
votes: []
}
},
Expand All @@ -58,9 +58,6 @@ export default {
}
},
result ({ data }) {
this.voteCount = data.queryVote[0].voteonAggregate.count
},
// fetchPolicy: 'no-cache',
pollInterval: 1000
// subscribeToMore: {
Expand Down
2 changes: 2 additions & 0 deletions src/const.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,3 +126,5 @@ export const PLAN_STATUS = Object.freeze({
ACTIVE: 'active'

})

export const NUMBER_OF_SYSTEM_PROPOSALS = 2
2 changes: 1 addition & 1 deletion src/layouts/MultiDhoLayout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -908,7 +908,7 @@ export default {
profile-sidebar-guest(v-if="!account && ($q.screen.gt.lg || !$q.screen.gt.sm) && !loadingAccount" :dhoTitle="dao?.title" :daoName="dao?.title" @close="right = false" :registrationEnabled="daoSettings.registrationEnabled")
q-footer.bg-white(v-if="$q.screen.lt.lg && $route.name !== ROUTE_NAMES.PROPOSAL_DETAIL && $route.name !== ROUTE_NAMES.CREATE_YOUR_DAO" :style="{ height: '74px' }")
bottom-navigation
q-drawer(v-else v-model="left" side="left" :width="80" persistent="persistent" :show-if-above="true")
q-drawer(v-else-if="$q.screen.gt.md" v-model="left" side="left" :width="80" persistent="persistent" :show-if-above="true")
left-navigation(:dho="dao" :dhos="dhos")
</template>
Expand Down
4 changes: 2 additions & 2 deletions src/pages/proposals/ProposalDetail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1685,7 +1685,7 @@ export default {
@on-withdraw="onWithDraw(proposal)"
:activeButtons="isMember"
)
voter-list.q-my-md(:proposalId="docId")
voter-list.q-my-md(:proposalId="docId" :voteCount="proposal.voteAggregate.count")
widget.full-width(:style="{ 'margin-top': '-40px'}" v-if="isBadge && proposalParsing.status(proposal) !== PROPOSAL_STATE.DRAFTED" :title="$t('pages.proposals.proposaldetail.badgeHolders')")
template(v-if="paginatedHolders?.length")
template(v-for="holderName in paginatedHolders")
Expand Down Expand Up @@ -1749,7 +1749,7 @@ export default {
@voting="onVoting"
v-if="$q.screen.gt.sm"
)
voter-list.q-my-md(:proposalId="docId")
voter-list.q-my-md(:proposalId="docId" :voteCount="proposal.voteAggregate.count")
widget(v-if="isBadge && proposalParsing.status(proposal) !== PROPOSAL_STATE.DRAFTED" :title="$t('pages.proposals.proposaldetail.badgeHolders1')")
template(v-if="paginatedHolders?.length")
template(v-for="holder in paginatedHolders")
Expand Down
3 changes: 2 additions & 1 deletion src/pages/proposals/ProposalList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { mapGetters } from 'vuex'
import ipfsy from '~/utils/ipfsy'
import { getProposalChipFilters } from '../../utils/proposal-filter'
import gql from 'graphql-tag'
import { NUMBER_OF_SYSTEM_PROPOSALS } from '~/const'
const STAGED_PROPOSALS_QUERY = `
queryDao(filter: { docId: { eq: $docId } }) {
Expand Down Expand Up @@ -466,7 +467,7 @@ export default {
return {
active: data.queryDao[0].proposalAggregate.count,
staging: data.queryDao[0].stagingpropAggregate.count,
archived: data.queryDao[0].passedpropsAggregate.count + data.queryDao[0].failedpropsAggregate.count
archived: (data.queryDao[0].passedpropsAggregate.count + data.queryDao[0].failedpropsAggregate.count) - NUMBER_OF_SYSTEM_PROPOSALS
}
},
variables () { return { docId: this.selectedDao.docId } },
Expand Down
1 change: 0 additions & 1 deletion src/pages/proposals/create/OptionsArchetypes.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ const ROLES_QUERY = `
queryRole(
filter: {
details_dao_i: { in: [0, $daoId] },
details_autoApprove_i: { eq: 1 }
}
) {
id: docId
Expand Down
11 changes: 3 additions & 8 deletions src/pages/proposals/create/StepPayout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -264,9 +264,9 @@ export default {
periodsOnCycle () {
return (this.cycleDurationSec / this.daoSettings.periodDurationSec).toFixed(2)
},
cashToken () { return this.calculateToken(this.peg, this.daoSettings.treasuryTokenMultiplier) },
utilityToken () { return this.calculateToken(this.reward, this.daoSettings.utilityTokenMultiplier) },
voiceToken () { return this.calculateToken(this.voice, this.daoSettings.voiceTokenMultiplier) },
cashToken () { return this.getFormatedTokenAmount((this.peg / (this.toggle ? this.periodsOnCycle : 1)).toFixed(2), Number.MAX_VALUE) },
utilityToken () { return this.getFormatedTokenAmount((this.reward / (this.toggle ? this.periodsOnCycle : 1)).toFixed(2), Number.MAX_VALUE) },
voiceToken () { return this.getFormatedTokenAmount((this.voice / (this.toggle ? this.periodsOnCycle : 1)).toFixed(2), Number.MAX_VALUE) },
isAssignment () {
const proposalType = this.$store.state.proposals.draft.category.key
return proposalType === 'assignment' || proposalType === 'archetype'
Expand All @@ -279,11 +279,6 @@ export default {
},
methods: {
calculateToken (token, tokenMultiplier) {
return !this.toggle
? this.getFormatedTokenAmount(token * (tokenMultiplier || 1), Number.MAX_VALUE)
: this.getFormatedTokenAmount((token * (tokenMultiplier || 1) / this.periodsOnCycle).toFixed(2), Number.MAX_VALUE)
},
isValidCommitment (commitment) {
const proposalType = this.$store.state.proposals.draft.category.key
Expand Down
6 changes: 5 additions & 1 deletion src/query/dao-created.gql
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
query activeDaoCreated($regexp: String!) {
query activeDaoCreated($regexp: String!, $username: String!) {
queryDao @cascade(fields: ["settings"]) {
docId
details_daoName_n

admin(filter: { details_member_n: { eq: $username } }) {
docId
}


settings(filter: { settings_daoUrl_s: { regexp: $regexp } }) {
Expand Down

0 comments on commit 20855f7

Please sign in to comment.