From a4fbd5e30182867365f6e864a8ff9b017f297288 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arsenije=20Savi=C4=87?= Date: Sat, 15 Jul 2023 08:07:24 -0600 Subject: [PATCH] fix(proposal-history): remove autoApproved proposals (#2336) --- src/pages/proposals/ProposalHistory.vue | 15 ++++++++------- src/query/proposals/dao-proposals-history.gql | 3 +++ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/pages/proposals/ProposalHistory.vue b/src/pages/proposals/ProposalHistory.vue index 9ba7c7261..a8ea15f3a 100644 --- a/src/pages/proposals/ProposalHistory.vue +++ b/src/pages/proposals/ProposalHistory.vue @@ -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 }, @@ -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 () { @@ -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") diff --git a/src/query/proposals/dao-proposals-history.gql b/src/query/proposals/dao-proposals-history.gql index db184bf26..8e71cba37 100644 --- a/src/query/proposals/dao-proposals-history.gql +++ b/src/query/proposals/dao-proposals-history.gql @@ -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 @@ -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