Skip to content
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

Closed
wants to merge 1 commit into from

Conversation

kmacart
Copy link

@kmacart kmacart commented Jul 19, 2019

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:

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}}
Copy link
Contributor

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

Copy link
Author

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

Copy link
Contributor

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 :)

@paglias
Copy link
Contributor

paglias commented Sep 9, 2019

Hi @kmacart ! do you have any update on the status of this PR? thanks!

@paglias
Copy link
Contributor

paglias commented Sep 20, 2019

Hi @kmacart , I'm going to close this one but if you want to work again on this just leave a comment

@paglias paglias closed this Sep 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants