-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
fix: Show "Free" instead of $0.00 in ticket price #5369
fix: Show "Free" instead of $0.00 in ticket price #5369
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/eventyay/open-event-frontend/p8leld8kn |
Codecov Report
@@ Coverage Diff @@
## development #5369 +/- ##
===============================================
- Coverage 22.78% 22.72% -0.06%
===============================================
Files 491 491
Lines 5245 5245
Branches 37 37
===============================================
- Hits 1195 1192 -3
- Misses 4045 4048 +3
Partials 5 5
Continue to review full report at Codecov.
|
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.
@iamareebjamal @mariobehling implemented suggested changes. |
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.
Good Job!
{{t "Free"}} | ||
{{else}} | ||
{{currency-symbol this.eventCurrency}} {{format-money ticket.price}} | ||
{{/if}} |
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.
Make this an HTML only component to avoid repetition. Just move it into its own HTML file and replace ticket.type
and ticket.price
to @ticket.type
and vice versa. Then use that component and pass ticket like @ticket={{ticket}}
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.
Name the component ticket-price.hbs
@sachinchauhan2889 Status? |
@iamareebjamal sir i will implement your suggested changes by tomorrow morning. Sorry for delay sir i was busy in my exam. I will surly commit changes suggested by you by tomorrow morning. |
No issues |
@iamareebjamal sir i have created a new component for solving this issue(as suggested by you). |
import Component from '@ember/component'; | ||
|
||
@classic | ||
export default class TicketPrice extends Component {} |
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.
No need of this file, please remove it
<Orders::TicketPrice | ||
@ticket-type={{ticket.type}} | ||
@display-symbol={{currency-symbol this.eventCurrency}} | ||
@display-price={{format-money ticket.price}} |
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.
Simply pass the ticket. What's the point of creating a component if you'll be doing all calculations here
I have reviewed again. Please read my previous review again and what it is asking to do. You have used a significantly more complex solution |
@iamareebjamal sir, have a look at this. i have done calculations inside ticket-price.hbs. i passesd ticket as @ticket={{ticket}}. |
{{currency-symbol @eventCurrency}} {{format-money @ticket.subTotal}} | ||
{{else if (eq @display 'order-subTotal')}} | ||
{{currency-symbol @eventCurrency}} {{format-money (mult (sub @ticket.price @ticket.discount) (ticket-attendees @attendees @ticket.attendees))}} | ||
{{/if}} |
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.
Why are you making it so so difficult? You just have to check the type and show either free or passed value. Pass the amount as an argument and don't do these complex calculations here. I don't know why everyone likes so much complicated solutions. Passing attendees and multiplying and switch casing. I don't know what to say except changing it myself will take much much less time than reviewing this
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.
@iamareebjamal sorry sir.
Please see the changes now |
@iamareebjamal sir, there is a misunderstanding between us. please look at my previous commits. i have given this solution. but u told me to do calculations inside ticket-price.hbs. |
Because you were formatting money and doing currency conversions here, which can be moved in the component. See the end result. Why would I ask you to write more code than you had written? Is the end result shorter than your version or not? |
18a1215
to
bb2ee2e
Compare
@iamareebjamal sir, yes you are right. I will take care of this from now. |
c2e4472
to
18a1215
Compare
OK, thank you |
Fixes #5364
Short description of what this resolves:
In the column "Price" and "Subtotal" for free tickets show "Free" instead of $0.00.
Changes proposed in this pull request:
-In the column "Price" and "Subtotal" for free tickets show "Free" instead of $0.00.
Checklist
development
branch.screenshots
before
after