-
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
feat: Ticket pre-selected for 1 type of tickets #5591
feat: Ticket pre-selected for 1 type of tickets #5591
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/eventyay/open-event-frontend/jphv0zlb0 |
@iamareebjamal Please see the changes and implementation I have made. |
Codecov Report
@@ Coverage Diff @@
## development #5591 +/- ##
===============================================
- Coverage 23.73% 23.73% -0.01%
===============================================
Files 498 498
Lines 5270 5275 +5
Branches 47 47
===============================================
+ Hits 1251 1252 +1
- Misses 4011 4015 +4
Partials 8 8
Continue to review full report at Codecov.
|
@@ -88,12 +88,19 @@ | |||
@id={{concat ticket.id "_quantity"}} | |||
@value={{ticket.orderQuantity}} /> | |||
<i class="dropdown icon"></i> | |||
<div class="default text">0</div> | |||
<div class="default text">{{if (eq this.tickets.length 1) (if (gt ticket.minOrder 1) ticket.minOrder 1) 0}}</div> |
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 the need of this logic now?
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.
bcz we need to show if no of ticketes type is '1' and minOrer is 0 then it should be 1 else minOrder
we can improve this by
{{if (eq this.tickets.length 1) (max ticket.minOrder 1) 0}}
@iamareebjamal I have also fixed the bug which was coming when minOrder is 0 and types of tickets is more then 1, |
@@ -88,10 +88,10 @@ | |||
@id={{concat ticket.id "_quantity"}} | |||
@value={{ticket.orderQuantity}} /> | |||
<i class="dropdown icon"></i> | |||
<div class="default text">0</div> | |||
<div class="default text">{{if (eq this.tickets.length 1) (max ticket.minOrder 1) 0}}</div> |
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.
Wouldn't {{ticker.orderQuantity}}
work here?
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 bcz the value of ticket.orderQuantity is undefined intially and meantime the dom is rendered completely after that ticket.orderQuantity value is changed.
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.
but I think it should be working but its not. it is showing blank just bcz as i said above
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.
{{or ticket.orderQuantity 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.
this will work OK for more then one type of tickets but in case of only 1 type of tickets still ticket.orderQuanitity is undefined so it will show 0 there also.
and I don't know why in this it is wokring correct
<Input
@type="hidden"
@id={{concat ticket.id "_quantity"}}
@value={{ticket.orderQuantity}} />
but not here
<div class="default text">{{or ticket.orderQuanitity 0}}</div>
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 please let me know
Fixes #5449
Short description of what this resolves:
If there is only one ticket type , pre-select ticket with minOrder.
Changes proposed in this pull request:
BEFORE (no pre-select)
AFTER (pre-selected)
(for minOrder=0)
![Screenshot from 2020-11-12 20-24-42](https://user-images.githubusercontent.com/71120226/98956004-8e848800-2525-11eb-8193-6e29a88a4430.png)
![Screenshot from 2020-11-12 20-28-54](https://user-images.githubusercontent.com/71120226/98956139-b247ce00-2525-11eb-8d06-fe1635464495.png)
(for minOrder=3)
Checklist
development
branch.