Skip to content

Commit

Permalink
chore: release 2.10.0
Browse files Browse the repository at this point in the history
chore: release 2.10.0
  • Loading branch information
arsenijesavic authored Aug 29, 2022
2 parents 400bab6 + df78df0 commit 6b3860d
Show file tree
Hide file tree
Showing 13 changed files with 143 additions and 82 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changelog

## [2.9.1](https://github.com/hypha-dao/dho-web-client/compare/v2.9.0...v2.9.1) (2022-08-23)


### Bug Fixes

* revert to claim all with multiple transaction ([#1509](https://github.com/hypha-dao/dho-web-client/issues/1509)) ([2e1ed55](https://github.com/hypha-dao/dho-web-client/commit/2e1ed55fb7f21c3b35f56ca418ba40d3e7499710))
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dho-web-client",
"version": "2.9.0",
"version": "2.9.1",
"description": "Governance, payroll and treasury tools for distributed HUMAN organizations (DHO)",
"productName": "Hypha DHO",
"author": "Max <[email protected]>",
Expand Down
1 change: 1 addition & 0 deletions src/components/dao/settings-communication.vue
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ export default {
v-model="announcement.message"
)
q-editor.full-width(
:disable="!isAdmin"
:toolbar="[['bold', 'italic', /*'strike', 'underline'*/],['token', 'hr', 'link', 'custom_btn'],['quote', 'unordered', 'ordered']]"
flat
placeholder="Max 140 characters"
Expand Down
5 changes: 3 additions & 2 deletions src/components/dao/settings-design.vue
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,7 @@ ${backgroundImage
this.$watch(() => [this.form.pattern, this.form.patternColor, this.form.patternOpacity],
async ([pattern, patternColor, patternOpacity]) => {
if (!pattern) {
this.$emit('change', 'patternBase64', '')
return
}
Expand Down Expand Up @@ -506,18 +507,18 @@ ${backgroundImage
:style="{'background': pattern.color, 'border': form.pattern === pattern.cid ? '1px solid #242F5D' : '1px solid transparent', 'padding': '1px'}"
@click="form.pattern = pattern.cid"
flat
padding="1px"
round
)
q-avatar(size="40px")
img(:src="pattern.href" :style="{'transform': 'scale(2)'}")

q-btn(
:disable="!isAdmin"
:style="{'border': form.pattern === '' ? '1px solid #242F5D' : '1px solid #84878E'}"
@click="form.pattern = null"
color='primary'
flat
round
color='primary'
text-color="black"
)
q-icon.q-pa-xs(size="xs" name="fas fa-ban").text-h-gray
Expand Down
89 changes: 46 additions & 43 deletions src/components/proposals/proposal-card.vue
Original file line number Diff line number Diff line change
Expand Up @@ -110,50 +110,53 @@ widget.cursor-pointer.card(
div(
:style="{ 'min-height': card ? '344px': '145px', 'max-width': card ? '302px' : '940px', 'full-width': list, 'background': 'white' }"
:class="{'q-px-lg': card, 'q-py-xl': card, 'q-px-xl': list, 'col': list}"
).row.items-center.justify-between.round-corners
//- q-btn.absolute-top-right.vote-btn(v-if="vote" :color="vote.color" round :icon="vote.icon" size="sm" padding="sm")
q-tooltip(anchor="top middle" self="bottom middle" :content-style="{ 'font-size': '1em' }"
) You voted '{{ vote.vote }}' on this proposal
.col-8(:class="{ 'col-12': card}" :style="{ height: list ? 'inherit' : '145px' }")
.row.items-center
proposal-card-chips(:type="type" :state="status" :showVotingState="false" :accepted="isAccepted" :compensation="compensation" :salary="salary" :commit="commit && commit.value")
//- .q-my-auto.h-b3.text-italic.text-body(v-if="subtitle && list") {{ subtitle }} //- Removed subtitle
//- .row.two-lines
//- .q-mb-xxs.h-b3.text-italic.text-body(v-if="subtitle && card") {{ subtitle }} //- Removed subtitle
.h-h5.two-lines(v-if="title" :class="{ 'one-line': list }") {{ title }}
.row.items-center
.row.q-mr-md
profile-picture(
:username="creator"
showName
lightName
size="20px"
)
.row.items-center.q-ml-sm(v-if="list")
q-icon(v-show="status !== 'drafted'" name="fas fa-hourglass-half")
.h-b2.text-center.text-body.q-ml-xs.q-mr-md.q-mr-xxxl(v-show="status !== 'drafted'") {{ timeLeftString() }}
q-icon(name="far fa-comment-alt")
).round-corners.overflow-hidden.relative
q-skeleton(v-if="proposal.loading").absolute-full.round-corners

.row.items-center.justify-between(v-else)
//- q-btn.absolute-top-right.vote-btn(v-if="vote" :color="vote.color" round :icon="vote.icon" size="sm" padding="sm")
q-tooltip(anchor="top middle" self="bottom middle" :content-style="{ 'font-size': '1em' }"
) You voted '{{ vote.vote }}' on this proposal
.col-8(:class="{ 'col-12': card}" :style="{ height: list ? 'inherit' : '145px' }")
.row.items-center
proposal-card-chips(:type="type" :state="status" :showVotingState="false" :accepted="isAccepted" :compensation="compensation" :salary="salary" :commit="commit && commit.value")
//- .q-my-auto.h-b3.text-italic.text-body(v-if="subtitle && list") {{ subtitle }} //- Removed subtitle
//- .row.two-lines
//- .q-mb-xxs.h-b3.text-italic.text-body(v-if="subtitle && card") {{ subtitle }} //- Removed subtitle
.h-h5.two-lines(v-if="title" :class="{ 'one-line': list }") {{ title }}
.row.items-center
.row.q-mr-md
profile-picture(
:username="creator"
showName
lightName
size="20px"
)
.row.items-center.q-ml-sm(v-if="list")
q-icon(v-show="status !== 'drafted'" name="fas fa-hourglass-half")
.h-b2.text-center.text-body.q-ml-xs.q-mr-md.q-mr-xxxl(v-show="status !== 'drafted'") {{ timeLeftString() }}
q-icon(name="far fa-comment-alt")
.h-b2.text-center.text-body.q-ml-xs {{ getCommentCount() }}
.col-4(v-show="status !== 'drafted'" :class="{ 'col-12': card }")
voting-result(v-if="(!isVotingExpired && !isAccepted) || (!isVotingExpired && isAccepted)"
v-bind="voting"
:expired="isVotingExpired"
:colorConfig="colorConfig"
:colorConfigQuorum="colorConfigQuorum").q-my-xl
.row.status-border.q-pa-xs.justify-center.q-my-xxxl(v-else :class="{'text-positive' : isVotingExpired && isAccepted, 'text-negative': isVotingExpired && !isAccepted }")
.col-1.flex.items-center.justify-center
q-icon(:name="isVotingExpired && isAccepted ? 'fas fa-check' : 'fas fa-times'").q-ml-xs
.col
.h-b2.text-center(:class="{ 'text-positive': isVotingExpired && isAccepted, 'text-negative': isVotingExpired && !isAccepted }") {{ proposalStatus }}
.col-1
.col-12(v-if="card").justify-between
.row.items-center.float-left
q-icon(v-show="status !== 'drafted'" name="fas fa-hourglass-half" size="11px")
.h-b2.text-center.text-body.q-ml-xs(v-show="status !== 'drafted'") {{ timeLeftString() }}
.row.items-center.float-right
q-icon(name="far fa-comment-alt")
.h-b2.text-center.text-body.q-ml-xs {{ getCommentCount() }}
.col-4(v-show="status !== 'drafted'" :class="{ 'col-12': card }")
voting-result(v-if="(!isVotingExpired && !isAccepted) || (!isVotingExpired && isAccepted)"
v-bind="voting"
:expired="isVotingExpired"
:colorConfig="colorConfig"
:colorConfigQuorum="colorConfigQuorum").q-my-xl
.row.status-border.q-pa-xs.justify-center.q-my-xxxl(v-else :class="{'text-positive' : isVotingExpired && isAccepted, 'text-negative': isVotingExpired && !isAccepted }")
.col-1.flex.items-center.justify-center
q-icon(:name="isVotingExpired && isAccepted ? 'fas fa-check' : 'fas fa-times'").q-ml-xs
.col
.h-b2.text-center(:class="{ 'text-positive': isVotingExpired && isAccepted, 'text-negative': isVotingExpired && !isAccepted }") {{ proposalStatus }}
.col-1
.col-12(v-if="card").justify-between
.row.items-center.float-left
q-icon(v-show="status !== 'drafted'" name="fas fa-hourglass-half" size="11px")
.h-b2.text-center.text-body.q-ml-xs(v-show="status !== 'drafted'") {{ timeLeftString() }}
.row.items-center.float-right
q-icon(name="far fa-comment-alt")
.h-b2.text-center.text-body.q-ml-xs {{ getCommentCount() }}
.h-b2.text-center.text-white.indicator(v-if="card || list" :class="{ 'rotate-text': list }") {{ voteTitle }}
.h-b2.text-center.text-white.indicator(v-if="card || list" :class="{ 'rotate-text': list }") {{ voteTitle }}
</template>

<style lang="stylus" scoped>
Expand Down
12 changes: 5 additions & 7 deletions src/pages/dho/Explore.vue
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<script>
import ipfsy from '~/utils/ipfsy'
import { mapGetters } from 'vuex'
import ipfsy from '~/utils/ipfsy'
export default {
name: 'page-explore',
components: {
BaseBanner: () => import('~/components/common/base-banner.vue'),
CreateDhoWidget: () => import('~/components/organization/create-dho-widget.vue'),
DhoCard: () => import('~/components/navigation/dho-card.vue'),
BaseBanner: () => import('~/components/common/base-banner.vue'),
FilterWidget: () => import('~/components/filters/filter-widget.vue')
},
async mounted () {
Expand Down Expand Up @@ -60,9 +60,8 @@ export default {
},
computed: {
...mapGetters('dao', ['daoSettings']),
...mapGetters('dao', ['daoSettings', 'isHypha']),
...mapGetters('accounts', ['isAdmin', 'isProduction']),
...mapGetters('dao', ['isHypha', 'daoSettings']),
banner () {
return {
Expand Down Expand Up @@ -155,9 +154,8 @@ export default {
.row.full-width(v-if="isShowingExploreBanner")
base-banner(v-bind="banner" @onClose="hideExploreBanner")
template(v-slot:buttons)
q-btn.q-px-lg.h-btn1(v-show="!isProduction && isHypha && isAdmin" no-caps rounded unelevated color="secondary" :to="{ name: 'dho-creation' }") Create your own DAO
a(target="_tab" href='https://hypha.earth/')
q-btn.h-h7(color="white" no-caps flat rounded label="More about Hypha" href='https://hypha.earth/')
q-btn.q-px-lg.h-btn1(no-caps rounded unelevated color="secondary" href="https://hypha.earth/" target="_blank") Discover More
.row.q-mt-sm(:class="{ 'column-sm': !$q.screen.gt.sm }")
.col-12.col-md.col-lg.col-xl.q-py-md(ref="scrollContainer")
q-infinite-scroll(@load="onLoad" :offset="250" :scroll-target="$refs.scrollContainer" ref="scroll")
Expand All @@ -177,7 +175,7 @@ export default {
@update:textFilter="updateDaoName",
:debounce="1000"
)
create-dho-widget(v-show="!isProduction && isHypha && isAdmin").z-10
create-dho-widget(v-show="isHypha").z-10
</template>
<style lang="stylus" scoped>
Expand Down
7 changes: 5 additions & 2 deletions src/pages/proposals/ProposalCreate.vue
Original file line number Diff line number Diff line change
Expand Up @@ -293,17 +293,20 @@ export default {
async stageProposal () {
try {
this.isStaging = true
if (this.status === 'drafted') await this.updateProposal()
else await this.createProposal()
const data = { ...this.$store.state.proposals.draft }
const draftId = this.$store.state.proposals.draft.draftId || undefined
if (draftId) {
this.deleteDraft(this.$store.state.proposals.draft)
}
this.$store.commit('proposals/reset')
setTimeout(() => this.$router.push({ name: 'proposals', query: { refetch: true } }), 700)
this.$router.push({ name: 'proposals', params: { data }, query: { refetch: true } })
// setTimeout(() => this.$router.push({ name: 'proposals', query: { data, refetch: true } }), 700)
} catch (e) {
const message = e.message || e.cause.message
// this.saveDraft()
Expand Down
35 changes: 28 additions & 7 deletions src/pages/proposals/ProposalDetail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ export default {
votes: [],
supplyTokens: undefined,
coefficientBase: 10000,
cycleDurationSec: 2629800
cycleDurationSec: 2629800,
state: 'WAITING'
}
},
Expand Down Expand Up @@ -149,6 +151,23 @@ export default {
})
},
state: {
handler: function (state) {
if (state === 'PUBLISHING') {
const pull = setInterval(() => {
if (this.proposal.details_state_s !== 'drafted') {
this.state = 'PUBLISHED'
clearInterval(pull)
}
this.$apollo.queries.proposal.refetch()
}, 300)
}
},
deep: true,
immediate: true
},
async votesList () {
this.votes = await this.loadVotes(this.votesList)
},
Expand Down Expand Up @@ -324,10 +343,8 @@ export default {
async onPublish (proposal) {
try {
this.state = 'PUBLISHING'
await this.publishProposal(proposal.docId)
setTimeout(() => {
this.$apollo.queries.proposal.refetch()
}, 300)
} catch (e) {
const message = e.message || e.cause.message
this.showNotification({ message, color: 'red' })
Expand Down Expand Up @@ -502,7 +519,7 @@ export default {
<template lang="pug">
.proposal-detail.full-width
.row(v-if="$apollo.queries.proposal.loading") Loading...
.row(v-if="!$apollo.queries.proposal") Loading...
.row(v-else-if="proposal")
.col-12.col-md-9
proposal-item.bottom-no-rounded(
Expand Down Expand Up @@ -559,13 +576,17 @@ export default {
)
.col-12.col-md-3(:class="{ 'q-pl-md': $q.screen.gt.sm }")
widget.bg-primary(v-if="proposalParsing.status(proposal) === 'drafted' && isCreator")
widget.bg-primary(v-if="proposalParsing.status(proposal) === 'drafted' && isCreator && state === 'WAITING'")
h2.h-h4.text-white.leading-normal.q-ma-none Your proposal is on staging
p.h-b2.q-mt-xl.text-disabled That means your proposal is not published to the blockchain yet. You can still make changes to it, when you feel ready click "Publish" and the voting period will start.
q-btn.q-mt-xl.text-primary.text-bold.full-width( @click="onPublish(proposal)" color="white" text-color='primary' no-caps rounded) Publish
q-btn.q-mt-xs.text-bold.full-width( @click="onEdit(proposal)" flat text-color='white' no-caps rounded) Edit proposal
div(v-else)
widget.bg-primary(v-else-if="proposalParsing.status(proposal) === 'drafted' && isCreator && state === 'PUBLISHING'")
h2.h-h4.text-white.leading-normal.q-ma-none Publishing
p.h-b2.q-mt-xl.text-disabled ...Please wait...
div(v-else-if="proposalParsing.status(proposal) !== 'drafted'")
voting.q-mb-sm(v-if="$q.screen.gt.sm" :proposal="proposal" @voting="onVoting" @on-apply="onApply(proposal)" @on-suspend="onSuspend(proposal)" @on-active="onActive(proposal)" @change-prop="modifyData" @on-withdraw="onWithDraw(proposal)" :activeButtons="isMember")
voter-list.q-my-md(:votes="votes" @onload="onLoad" :size="voteSize")
Expand Down
29 changes: 24 additions & 5 deletions src/pages/proposals/ProposalList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,9 @@ export default {
],
filtersToEvaluate: undefined,
showStagedProposals: true
showStagedProposals: true,
state: 'LOADING'
}
},
Expand Down Expand Up @@ -185,7 +187,9 @@ export default {
filteredStagedProposals () {
if (!this.stagedProposals) return []
const proposals = []
const proposals = [
...(this.state === 'CREATING' ? [{ loading: true }] : [])
]
this.stagedProposals.forEach((proposal) => {
let found = false
this.filters.forEach((filter) => {
Expand Down Expand Up @@ -216,8 +220,23 @@ export default {
watch: {
'$route.query.refetch': {
handler: function (refetch) {
if (refetch) {
this.$apollo.queries.stagedProposals.refetch()
const createdProposal = this.$route.params.data
if (refetch && createdProposal) {
this.state = 'CREATING'
const pullStagedProposals = setInterval(() => {
const isCreated = this.stagedProposals.find(_ =>
_.details_title_s === createdProposal.title &&
_.details_description_s === createdProposal.description
)
if (isCreated) {
this.state = 'CREATED'
this.$router.replace({ params: { data: null }, query: {} })
clearInterval(pullStagedProposals)
}
this.$apollo.queries.stagedProposals.refetch()
}, 300)
}
},
deep: true,
Expand Down Expand Up @@ -385,7 +404,7 @@ export default {
base-placeholder.q-mr-sm(v-if="!filteredProposals.length && !filteredStagedProposals.length && !$apollo.loading" title= "No Proposals" 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'}]" )
.q-mb-xl(v-show="showStagedProposals && filteredStagedProposals.length > 0")
proposal-list(:username="account" :proposals="filteredStagedProposals" :supply="supply" :view="view")
proposal-list(:username="account" :proposals="filteredStagedProposals" :supply="supply" :view="view" :loading="state !== 'CREATING'" count="1")
q-infinite-scroll(@load="onLoad" :offset="500" ref="scroll" :initial-index="1" v-if="filteredProposals.length").scroll
proposal-list(:username="account" :proposals="filteredProposals" :supply="supply" :view="view")
.col-3
Expand Down
5 changes: 3 additions & 2 deletions src/pages/proposals/create/StepDescription.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<script>
import { validation } from '~/mixins/validation'
// import { isURL } from 'validator'
import { toHTML, toMarkdown } from '~/utils/turndown'
const TITLE_MAX_LENGTH = 50
const DESCRIPTION_MAX_LENGTH = 2000
Expand Down Expand Up @@ -53,11 +54,11 @@ export default {
description: {
get () {
return this.$store.state.proposals.draft.description || ''
return toHTML(this.$store.state.proposals.draft.description) || ''
},
set (value) {
this.$store.commit('proposals/setDescription', value)
this.$store.commit('proposals/setDescription', toMarkdown(value))
}
},
Expand Down
7 changes: 7 additions & 0 deletions src/router/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,20 @@ export default function ({ store }) {

Router.beforeEach((to, from, next) => {
const isAuthenticated = localStorage.getItem('autoLogin')
const isHypha = store.getters['dao/isHypha']
const isMember = localStorage.getItem('isMember')
const daoName = to.params.dhoname

// Only show dho-creation wizard to the hypha members
if (to.name && to.name === 'dho-creation' && !isHypha) {
next({ path: `/${daoName}/` })
}

// Temporal redirection for hypha explorer page
if (to.name && to.name === 'root') {
next({ path: '/hypha/explore' })
}

if (to.matched.some(record => record.meta.requiresAuth) || to.matched.some(record => record.meta.requiresAuthMember)) {
if (!isAuthenticated) {
next({ path: `/${daoName}/login` })
Expand Down
Loading

0 comments on commit 6b3860d

Please sign in to comment.