-
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: Hide currency when amount is 0 #5447
fix: Hide currency when amount is 0 #5447
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/eventyay/open-event-frontend/cksudvdip |
@mariobehling @iamareebjamal please see the changes made and let me know to do any more changes. |
Codecov Report
@@ Coverage Diff @@
## development #5447 +/- ##
===============================================
- Coverage 23.23% 23.19% -0.04%
===============================================
Files 493 493
Lines 5169 5182 +13
Branches 38 38
===============================================
+ Hits 1201 1202 +1
- Misses 3963 3975 +12
Partials 5 5
Continue to review full report at Codecov.
|
@mariobehling @iamareebjamal Please let me know if this is not the issue what I am thinking of. |
Please go ahead with this logic and solve other places in this PR as well |
app/templates/components/events/view/overview/event-tickets.hbs
Outdated
Show resolved
Hide resolved
@iamareebjamal You mean that like I have used if statement in different files, so there should be only one if or condition statement that should handle this globally? |
Yes |
@iamareebjamal is this the correct way? |
app/templates/components/events/view/overview/event-tickets.hbs
Outdated
Show resolved
Hide resolved
@iamareebjamal I have added the component pls see to it |
app/templates/components/events/view/overview/event-tickets.hbs
Outdated
Show resolved
Hide resolved
@@ -0,0 +1 @@ | |||
{{#if (gt @amount 0)}} {{@currency}} {{/if}}{{@amount}} |
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.
There is no space between currency and amount
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.
its there
Half files are using component, half are not. |
@iamareebjamal in some places I have to take care of only currency symbol where theres is no amount to be rendered, so for that I think I should not call the comp. and just do it there only? |
Let's say you have a function which returns x^2 if x is odd and 1/x if x is even. Choose what the function and function call should look like:
|
3 |
@amount={{this.model.eventDetail.paymentCurrency}}
@amount={{sub ticket.price ticket.discount}}
@amount={{mult ticket.orderStatistics.tickets.completed ticket.price}} so now there are diff cases where sometimes there is only arg directly passing or sometimes evaluating before and then passing as a single arg doing mul or sub |
@iamareebjamal I have some changes in the component |
No |
|
||
await render(hbs`{{currency-amount}}`); | ||
|
||
assert.equal(this.element.textContent.trim(), ''); |
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.
Add tests for different cases
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.
ok and rest changes in file is ok?
Ensure there is a space between symbol and amount |
@iamareebjamal I have added test, please let me know to make any changes. |
Fixes #5442
Fixes #5453
Short description of what this resolves:
$ sign was shown even when amount was 0 so fixed this issue.
Changes proposed in this pull request:
Checklist
development
branch.BEFORE
AFTER