Skip to content

Commit

Permalink
fix(quest-progression): check if status exist
Browse files Browse the repository at this point in the history
  • Loading branch information
arsenijesavic committed Sep 20, 2023
1 parent 0e84c12 commit 60f3ab0
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/components/proposals/quest-progression.vue
Original file line number Diff line number Diff line change
Expand Up @@ -97,38 +97,38 @@ export default {
let status = ''
if (card.approvedDate) {
status = this.parsedDate(card.approvedDate)
} else if (card.status === PROPOSAL_STATE.REJECTED) {
} else if (card?.status === PROPOSAL_STATE.REJECTED) {
status = this.parsedDate(card.rejectedDate)
} else if (card.status === PROPOSAL_STATE.PROPOSED) {
} else if (card?.status === PROPOSAL_STATE.PROPOSED) {
status = 'On voting'
}
return status
},
completionCardTitle () {
return this.currentQuest.status === PROPOSAL_STATE.PROPOSED ? 'Not available yet' : 'Create now!'
return this.currentQuest?.status === PROPOSAL_STATE.PROPOSED ? 'Not available yet' : 'Create now!'
}
}
}
</script>
<template lang="pug">
.quest-progression(v-if="currentQuest.status !== PROPOSAL_STATE.DRAFTED")
.quest-progression(v-if="currentQuest?.status !== PROPOSAL_STATE.DRAFTED")
.text-grey.text-italic.q-mb-sm(:style="{ 'font-size': '12px' }") {{ $t('proposals.quest-progression.questProgression') }}
.row
.q-mr-md.q-mb-md.rounded-border.q-pa-md(:style="{ 'min-width': '160px', 'max-width': '160px' }" :class="cardColor(currentQuest.status)")
.icon-container(:class="{ 'bg-primary': currentQuest.status === PROPOSAL_STATE.PENDING }")
q-icon(name="fa fa-map-marker" :color="iconColor(currentQuest.status)")
.q-mr-md.q-mb-md.rounded-border.q-pa-md(:style="{ 'min-width': '160px', 'max-width': '160px' }" :class="cardColor(currentQuest?.status)")
.icon-container(:class="{ 'bg-primary': currentQuest?.status === PROPOSAL_STATE.PENDING }")
q-icon(name="fa fa-map-marker" :color="iconColor(currentQuest?.status)")
.h-h5.text-white(:style="{ 'white-space': 'nowrap', 'text-overflow': 'ellipsis', 'overflow': 'hidden' }") {{ currentQuest.title }}
q-tooltip {{ currentQuest.title }}
.h-h7.text-white.q-mt-md(:class="{ 'text-grey': currentQuest.status === PROPOSAL_STATE.PENDING}") {{ cardStatus(currentQuest) }}
.h-h7.text-white.q-mt-md(:class="{ 'text-grey': currentQuest?.status === PROPOSAL_STATE.PENDING}") {{ cardStatus(currentQuest) }}
template(v-if="claimPayments?.length" v-for="card in claimPayments")
.q-mr-md.q-mb-md.rounded-border.q-pa-md(:style="{ 'min-width': '160px', 'max-width': '160px' }" :class="cardColor(card.status)")
.icon-container(:class="{ 'bg-primary': card.status === PROPOSAL_STATE.PENDING }")
q-icon(name="fa fa-map-marker" :color="iconColor(card.status)")
.q-mr-md.q-mb-md.rounded-border.q-pa-md(:style="{ 'min-width': '160px', 'max-width': '160px' }" :class="cardColor(card?.status)")
.icon-container(:class="{ 'bg-primary': card?.status === PROPOSAL_STATE.PENDING }")
q-icon(name="fa fa-map-marker" :color="iconColor(card?.status)")
.h-h5.text-white(:style="{ 'white-space': 'nowrap', 'text-overflow': 'ellipsis', 'overflow': 'hidden' }") {{ card.title }}
q-tooltip {{ card.title }}
.h-h7.text-white.q-mt-md(:class="{ 'text-grey': card.status === PROPOSAL_STATE.PENDING}") {{ cardStatus(card) }}
.h-h7.text-white.q-mt-md(:class="{ 'text-grey': card?.status === PROPOSAL_STATE.PENDING}") {{ cardStatus(card) }}
.q-mr-md.q-mb-md.rounded-border.q-pa-md(v-if="!claimPayments?.length" :style="{ 'min-width': '160px', 'max-width': '160px' }" :class="cardColor('pending')")
.icon-container.bg-primary
q-icon(name="fa fa-map-marker" :color="iconColor('pending')")
Expand Down

0 comments on commit 60f3ab0

Please sign in to comment.