Skip to content

Commit

Permalink
Improve the message for non-monetary contributions (#2085)
Browse files Browse the repository at this point in the history
* feat: improve the message for non-monetary contributions

* feat: improved conditions for displaying non-monetary contribution message
  • Loading branch information
Silver-IT authored Jun 18, 2024
1 parent ee046f1 commit 568fa2e
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions frontend/views/pages/Contributions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -88,17 +88,19 @@ page(pageTestName='contributionsPage' pageTestHeaderName='contributionsTitle')
) You can contribute to your group with money or other valuables like teaching skills, sharing your time to help someone. The sky is the limit!

i18n.has-text-1.spacer-around(
v-else-if='noOneToGive'
v-else-if='!someoneNeedsIncome'
data-test='givingParagraph'
tag='p'
) No one needs monetary contributions at the moment. You can still add non-monetary contributions if you would like.

ul(
data-test='givingList'
)
contribution(
v-if='doesGiveMonetary'
)
i18n.has-text-1.spacer-around(
v-else-if='noOneToGive'
data-test='givingParagraph'
tag='p'
) You can add non-monetary contributions for the group here.

ul(data-test='givingList')
contribution(v-if='doesGiveMonetary')
contribution-item(
:what='withCurrency(givingMonetary.total)'
:who='givingMonetary.who'
Expand All @@ -114,11 +116,7 @@ page(pageTestName='contributionsPage' pageTestHeaderName='contributionsTitle')
:initial-value='contribution'
@new-value='handleNonMonetary'
)
contribution-item(
:what='contribution'
type='NON_MONETARY'
action='GIVING'
)
contribution-item(:what='contribution' type='NON_MONETARY' action='GIVING')

contribution(
variant='unfilled'
Expand Down Expand Up @@ -173,13 +171,17 @@ export default ({
'groupProfiles',
'groupMincomeFormatted',
'globalProfile',
'groupIncomeDistribution',
'ourContributionSummary'
]),
upTo () {
const amount = this.ourGroupProfile[this.ourGroupProfile.incomeDetailsType]
if (typeof amount !== 'number') return false
return this.withCurrency(this.needsIncome ? this.groupSettings.mincomeAmount - amount : amount)
},
someoneNeedsIncome () {
return Boolean(this.groupIncomeDistribution.length)
},
needsIncome () {
return this.ourGroupProfile.incomeDetailsType === 'incomeAmount'
},
Expand Down

0 comments on commit 568fa2e

Please sign in to comment.