-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Front-end change for the null gem option. #11275
Conversation
Changes it to be a 0 when null in the challenge page only. Still working on the other pages.
@@ -30,7 +30,7 @@ | |||
.details(v-once) {{$t('participantsTitle')}} | |||
.box | |||
.svg-icon.gem-icon(v-html="icons.gemIcon") | |||
| {{challenge.prize}} | |||
challenge.prize(v-if=null) {{challenge.prize = 0}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this necessary with the other PR + migration going to make it impossible to have challenges with a prize of 0? I'd only add a new check when creating the challenge
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you mean? The reason I did this was because that way the currently null challenge prizes that haven't been changed would show up as 0 gem prize - do you mind elaborating a bit? Thanks heaps! =)
Kira
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure! The reason why I don't think this is necessary is that when the other PR will be merged we'll also run a migration to convert all existing null prize challenges to having a prize of 0.
Also, there's a problem with this code: in vue templates there should only be view logic (for example show a 0 if challenge.prize is null) while in this case it would be modifying the value of challenge.prize. Also the syntax of the v-if is wrong because it checks if the value passed to it is converted to true or false and null is always false.
It should be used like this at the existing like 33
| {{challenge.prize || 0}}
which means should challenge.prize or 0 if the value is absent
let me know if anything is not clear :)
Hi @kmacart ! do you have any update on the status of this PR? thanks! |
Hi @kmacart , I'm going to close this one but if you want to work again on this just leave a comment |
Changes it to be a 0 when null in the challenge page only. Still working on the other pages.
//: #11264 Front-end fix for null gem prize
Changes
//: # Changed lines 33 and 34 to be challenge.prize(v-if=null) {{challenge.prize = 0}}
.details(v-once) {{$t('prize')}}
//: # 0fb3db86-7009-46d6-9eea-485a8f7e6734
UUID: