Skip to content

Commit

Permalink
fix(proposal-history): remove autoApproved proposals (#2336)
Browse files Browse the repository at this point in the history
  • Loading branch information
arsenijesavic authored Jul 15, 2023
1 parent a72f930 commit a4fbd5e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/pages/proposals/ProposalHistory.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export default {
optionArray: [{ label: 'Sort by', disable: true }, 'Last added'],
circleArray: ['All circles', 'Circle One'],
pagination: {
first: 10,
first: 50,
offset: 0,
more: true
},
Expand Down Expand Up @@ -72,15 +72,16 @@ export default {
return filter.filter(proposal) &&
proposal.details_state_s !== PROPOSAL_STATE.DRAFTED &&
proposal.details_state_s !== PROPOSAL_STATE.PROPOSED &&
!proposal.details_autoApprove_i &&
proposal.creator !== 'dao.hypha' &&
(!this.textFilter || this.textFilter.length === 0 ||
(proposal.details_title_s?.toLocaleLowerCase() || '').includes(this.textFilter.toLocaleLowerCase()))
})
})
},
hasProposals () {
return this.archivedProposals?.length
}
hasProposals () { return this.archivedProposals?.length },
isLoading () { return this.$apollo.queries.archivedProposals.loading }
},
watch: {
selectedDao () {
Expand Down Expand Up @@ -184,12 +185,12 @@ export default {
q-page.page-proposals
.row.q-py-md
.col-12.col-lg-9
base-placeholder.q-mr-sm(:compact="!$q.screen.gt.md" v-if="!hasProposals" :title="$t('pages.proposals.proposalhistory.noProposals')" subtitle="Your organization has not created any proposals yet. You can create a new proposal by clicking the button below." icon="fas fa-file-medical" :actionButtons="[{label: 'Create a new Proposal', color: 'primary', onClick: () => $router.push(`/${this.daoSettings.url}/proposals/create`), disable: !isMember, disableTooltip: 'You must be a member'}]")
base-placeholder.q-mr-sm(:compact="!$q.screen.gt.md" v-if="!filteredProposals.length && hasProposals" :title="$t('pages.proposals.proposalhistory.oopsNothingCould')" subtitle="Try a different filter or another keyword" icon="far fa-check-square" :actionButtons="[{label: 'Reset filter(s)', color: 'primary', onClick: () => this.$refs.filter.resetFilters() }]")
base-placeholder.q-mr-sm(:compact="!$q.screen.gt.md" v-if="!isLoading && !hasProposals" :title="$t('pages.proposals.proposalhistory.noProposals')" subtitle="Your organization has not created any proposals yet. You can create a new proposal by clicking the button below." icon="fas fa-file-medical" :actionButtons="[{label: 'Create a new Proposal', color: 'primary', onClick: () => $router.push(`/${this.daoSettings.url}/proposals/create`), disable: !isMember, disableTooltip: 'You must be a member'}]")
base-placeholder.q-mr-sm(:compact="!$q.screen.gt.md" v-if="!isLoading && !filteredProposals.length && hasProposals" :title="$t('pages.proposals.proposalhistory.oopsNothingCould')" subtitle="Try a different filter or another keyword" icon="far fa-check-square" :actionButtons="[{label: 'Reset filter(s)', color: 'primary', onClick: () => this.$refs.filter.resetFilters() }]")
proposal-list.q-mb-xxxl(:username="account" :proposals="filteredProposals" :supply="supply" :view="$q.screen.gt.md ? view: 'card'" :compact="!$q.screen.gt.md")
.row.justify-center.q-mb-xxxl(v-if="$apollo.loading")
loading-spinner(color="primary" size="72px")
q-infinite-scroll.scroll(@load="onLoad" :offset="750" ref="scroll" v-if="filteredProposals.length" :disable="!pagination.more" debounce="500" scroll-target=".hide-scrollbar")
q-infinite-scroll.scroll(@load="onLoad" :offset="1000" ref="scroll" v-if="filteredProposals.length" :disable="!pagination.more" debounce="30" scroll-target=".hide-scrollbar")
.col-3(v-if="$q.screen.gt.md")
filter-widget.sticky(ref="filter" :view.sync="view" :defaultOption="1" :sort.sync="sort" :textFilter.sync="textFilter" :circle.sync="circle" :showCircle="false" :optionArray.sync="optionArray" :circleArray.sync="circleArray" :viewSelectorLabel="'View'" :chipsFiltersLabel="'Proposal types'" :showViewSelector="false" :filters.sync="filters")
.row.full-width.q-my-md(v-if="!$q.screen.gt.md")
Expand Down
3 changes: 3 additions & 0 deletions src/query/proposals/dao-proposals-history.gql
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,8 @@ query historyProposals($docId: String!, $first: Int!, $offset: Int!) {
... on Circle {
details_dao_i
details_state_s

details_autoApprove_i

details_title_s
details_description_s
Expand Down Expand Up @@ -369,6 +371,7 @@ query historyProposals($docId: String!, $first: Int!, $offset: Int!) {
}

... on Role {
details_autoApprove_i
ballot_expiration_t
details_title_s
details_description_s
Expand Down

0 comments on commit a4fbd5e

Please sign in to comment.