Skip to content

Commit

Permalink
fix(proposal-creation): links in the proposal creation (#DEV-846)
Browse files Browse the repository at this point in the history
  • Loading branch information
evgenibir committed Sep 7, 2023
1 parent 182a504 commit 1369e89
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 24 deletions.
5 changes: 3 additions & 2 deletions src/components/proposals/proposal-view.vue
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ export default {
parentQuest: Object,
votingMethod: String,
circle: Object,
parentCircle: Array
parentCircle: Array,
hidePolicyHistory: Boolean
},
data () {
return {
Expand Down Expand Up @@ -213,7 +214,7 @@ widget.proposal-view.q-mb-sm
.column
.text-h5.text-bold {{ title }}
.text-italic.text-body {{ subtitle }}
version-history(v-if="type === PROPOSAL_TYPE.POLICY" :proposalId="proposal?.docId ? proposal.docId : docId")
version-history(v-if="type === PROPOSAL_TYPE.POLICY && !hidePolicyHistory" :proposalId="proposal?.docId ? proposal.docId : docId")
quest-progression(v-if="type === PROPOSAL_TYPE.QUEST_START" :proposalId="proposal?.docId ? proposal.docId : docId")
.q-my-sm(:class="{ 'row':$q.screen.gt.md }" v-if="type === PROPOSAL_TYPE.ROLE || type === PROPOSAL_TYPE.EDIT || type === PROPOSAL_TYPE.PAYOUT || type === PROPOSAL_TYPE.ABILITY || type === PROPOSAL_TYPE.BADGE")
.col.bg-internal-bg.rounded-border(:class="{ 'q-mr-xs':$q.screen.gt.md, 'q-mb-sm':$q.screen.lt.md || $q.screen.md }" v-if="icon")
Expand Down
42 changes: 21 additions & 21 deletions src/components/proposals/version-history.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export default {
return {
state: policy.details_state_s,
originalApprovedDate: policy.system_originalApprovedDate_t,
masterpolicy: policy.masterpolicy
masterpolicy: policy?.masterpolicy
}
},
skip () { return !this.selectedDao?.docId || !this.proposalId },
Expand All @@ -43,29 +43,29 @@ export default {
}
</script>
<template lang="pug">
.version-history(v-if="versionHistory.state !== PROPOSAL_STATE.DRAFTED")
.version-history(v-if="versionHistory?.state !== PROPOSAL_STATE.DRAFTED")
.text-grey.text-italic.q-mb-sm(:style="{ 'font-size': '12px' }") {{ $t('proposals.version-history.versionHistory') }}
.row
.bg-internal-bg.q-mr-md.q-mb-md.rounded-border.q-pa-md(v-if="versionHistory.masterpolicy.length" :style="{ 'min-width': '160px', 'position': 'relative' }" :class="{ 'selected-card': !versionHistory.masterpolicy[0].system_originalApprovedDate_t, 'rejected-card': versionHistory.masterpolicy[0].details_state_s === PROPOSAL_STATE.REJECTED }")
q-icon.absolute(v-if="versionHistory.masterpolicy[0].system_originalApprovedDate_t" name="fas fa-arrow-right" :style="{ 'right': '20px', 'top': '28px' }")
div(:style="{ 'border-radius': '50%', 'background': '#242F5D', 'width': '30px', 'height': '30px', 'display': 'flex', 'justify-content': 'center', 'align-items': 'center' }" :class="{ 'selected-icon': !versionHistory.masterpolicy[0].system_originalApprovedDate_t }")
q-icon(name="fas fa-check" :color="versionHistory.masterpolicy[0].system_originalApprovedDate_t ? 'white' : versionHistory.state === PROPOSAL_STATE.REJECTED ? 'negative' : 'primary'")
.h-h5.text-weight-700.q-mt-sm.q-mb-md(:class="{ 'selected-title': !versionHistory.masterpolicy[0].system_originalApprovedDate_t }") {{ $t('proposals.version-history.original') }}
div {{ parsedDate(versionHistory.masterpolicy[0].system_originalApprovedDate_t) }}
.bg-internal-bg.q-mr-md.q-mb-md.rounded-border.q-pa-md(v-else :style="{ 'min-width': '160px', 'position': 'relative' }" :class="{ 'selected-card': !versionHistory.masterpolicy.length, 'rejected-card': versionHistory.state === PROPOSAL_STATE.REJECTED }")
div(:style="{ 'border-radius': '50%', 'background': '#242F5D', 'width': '30px', 'height': '30px', 'display': 'flex', 'justify-content': 'center', 'align-items': 'center' }" :class="{ 'selected-icon': !versionHistory.masterpolicy.length }")
q-icon(name="fas fa-check" :color="versionHistory.masterpolicy.length ? 'white' : versionHistory.state === PROPOSAL_STATE.REJECTED ? 'negative' : 'primary'")
.h-h5.text-weight-700.q-mt-sm.q-mb-md(:class="{ 'selected-title': !versionHistory.masterpolicy.length }") {{ $t('proposals.version-history.original') }}
div(v-if="versionHistory.state === PROPOSAL_STATE.PROPOSED") {{ $t('proposals.version-history.currentOnVoting') }}
div(v-else-if="versionHistory.state === PROPOSAL_STATE.REJECTED") {{ $t('proposals.version-history.rejected') }}
div(v-else) {{ parsedDate(versionHistory.originalApprovedDate) }}
.bg-internal-bg.q-mr-md.q-mb-md.rounded-border.q-pa-md(v-if="versionHistory.masterpolicy.length" :style="{ 'min-width': '160px', 'position': 'relative' }" :class="{ 'selected-card': versionHistory.masterpolicy[0].system_originalApprovedDate_t, 'rejected-card': versionHistory.state === PROPOSAL_STATE.REJECTED }")
div(:style="{ 'border-radius': '50%', 'background': '#242F5D', 'width': '30px', 'height': '30px', 'display': 'flex', 'justify-content': 'center', 'align-items': 'center' }" :class="{ 'selected-icon': versionHistory.masterpolicy[0].system_originalApprovedDate_t }")
.bg-internal-bg.q-mr-md.q-mb-md.rounded-border.q-pa-md(v-if="versionHistory?.masterpolicy.length" :style="{ 'min-width': '160px', 'position': 'relative' }" :class="{ 'selected-card': !versionHistory?.masterpolicy[0].system_originalApprovedDate_t, 'rejected-card': versionHistory?.masterpolicy[0].details_state_s === PROPOSAL_STATE.REJECTED }")
q-icon.absolute(v-if="versionHistory?.masterpolicy[0].system_originalApprovedDate_t" name="fas fa-arrow-right" :style="{ 'right': '20px', 'top': '28px' }")
div(:style="{ 'border-radius': '50%', 'background': '#242F5D', 'width': '30px', 'height': '30px', 'display': 'flex', 'justify-content': 'center', 'align-items': 'center' }" :class="{ 'selected-icon': !versionHistory?.masterpolicy[0].system_originalApprovedDate_t }")
q-icon(name="fas fa-check" :color="versionHistory?.masterpolicy[0].system_originalApprovedDate_t ? 'white' : versionHistory?.state === PROPOSAL_STATE.REJECTED ? 'negative' : 'primary'")
.h-h5.text-weight-700.q-mt-sm.q-mb-md(:class="{ 'selected-title': !versionHistory?.masterpolicy[0].system_originalApprovedDate_t }") {{ $t('proposals.version-history.original') }}
div {{ parsedDate(versionHistory?.masterpolicy[0].system_originalApprovedDate_t) }}
.bg-internal-bg.q-mr-md.q-mb-md.rounded-border.q-pa-md(v-else :style="{ 'min-width': '160px', 'position': 'relative' }" :class="{ 'selected-card': !versionHistory?.masterpolicy.length, 'rejected-card': versionHistory?.state === PROPOSAL_STATE.REJECTED }")
div(:style="{ 'border-radius': '50%', 'background': '#242F5D', 'width': '30px', 'height': '30px', 'display': 'flex', 'justify-content': 'center', 'align-items': 'center' }" :class="{ 'selected-icon': !versionHistory?.masterpolicy.length }")
q-icon(name="fas fa-check" :color="versionHistory?.masterpolicy.length ? 'white' : versionHistory?.state === PROPOSAL_STATE.REJECTED ? 'negative' : 'primary'")
.h-h5.text-weight-700.q-mt-sm.q-mb-md(:class="{ 'selected-title': !versionHistory?.masterpolicy.length }") {{ $t('proposals.version-history.original') }}
div(v-if="versionHistory?.state === PROPOSAL_STATE.PROPOSED") {{ $t('proposals.version-history.currentOnVoting') }}
div(v-else-if="versionHistory?.state === PROPOSAL_STATE.REJECTED") {{ $t('proposals.version-history.rejected') }}
div(v-else) {{ parsedDate(versionHistory?.originalApprovedDate) }}
.bg-internal-bg.q-mr-md.q-mb-md.rounded-border.q-pa-md(v-if="versionHistory?.masterpolicy.length" :style="{ 'min-width': '160px', 'position': 'relative' }" :class="{ 'selected-card': versionHistory?.masterpolicy[0].system_originalApprovedDate_t, 'rejected-card': versionHistory?.state === PROPOSAL_STATE.REJECTED }")
div(:style="{ 'border-radius': '50%', 'background': '#242F5D', 'width': '30px', 'height': '30px', 'display': 'flex', 'justify-content': 'center', 'align-items': 'center' }" :class="{ 'selected-icon': versionHistory?.masterpolicy[0].system_originalApprovedDate_t }")
q-icon(name="fas fa-check" :color="versionHistory.masterpolicy[0].system_originalApprovedDate_t ? 'primary' : 'white'")
.h-h5.text-weight-700.q-mt-sm.q-mb-md(:class="{ 'selected-title': versionHistory.masterpolicy[0].system_originalApprovedDate_t }") Version 2
div(v-if="versionHistory.state === PROPOSAL_STATE.PROPOSED") {{ $t('proposals.version-history.currentOnVoting') }}
div(v-else-if="versionHistory.state === PROPOSAL_STATE.REJECTED") {{ $t('proposals.version-history.rejected') }}
div(v-else) {{ parsedDate(versionHistory.originalApprovedDate) }}
.h-h5.text-weight-700.q-mt-sm.q-mb-md(:class="{ 'selected-title': versionHistory?.masterpolicy[0].system_originalApprovedDate_t }") Version 2
div(v-if="versionHistory?.state === PROPOSAL_STATE.PROPOSED") {{ $t('proposals.version-history.currentOnVoting') }}
div(v-else-if="versionHistory?.state === PROPOSAL_STATE.REJECTED") {{ $t('proposals.version-history.rejected') }}
div(v-else) {{ parsedDate(versionHistory?.originalApprovedDate) }}
</template>
<styles lang="stylus">
Expand Down
2 changes: 1 addition & 1 deletion src/pages/proposals/create/StepReview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ export default {
<template lang="pug">
.step-review
proposal-view(preview="preview" v-bind="draft" :withToggle="withToggle" :isBadge="isBadge")
proposal-view(preview="preview" v-bind="draft" :withToggle="withToggle" :isBadge="isBadge" hidePolicyHistory)
template(v-slot:bottom)
nav.full-width.row.justify-end.q-mt-xl.q-gutter-xs(v-if="$q.screen.gt.md")
q-btn.h-btn2.q-px-xl(v-if="!disablePrevButton" @click="$emit('prev')" color="primary" :label="$t('pages.proposals.create.stepreview.back')" no-caps outline rounded flat)
Expand Down

0 comments on commit 1369e89

Please sign in to comment.