Skip to content

Commit 49d5114

Browse files
authored
Merge pull request #8357 from pc-beast/fix-8481
chore: hide cancel button if user is not owner of order
2 parents f1e2849 + b845268 commit 49d5114

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

app/routes/my-tickets/upcoming/list.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ export default class ListRoute extends Route {
114114
}
115115

116116
return this.infinity.model('orders', {
117-
include : 'event,attendees.ticket',
117+
include : 'event,attendees.ticket,user',
118118
filter : filterOptions,
119119
perPage : 10,
120120
startingPage : 1,

app/templates/components/order-card.hbs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,12 @@
1212
{{#each-in (group-by 'name' (map-by 'ticket' this.order.attendees)) as |name tickets|}}
1313
<div class="ui green large label">{{tickets.length}} x {{name}}</div>
1414
{{/each-in}}
15-
{{#if (not @restrictTicketCancellation)}}
16-
<UiPopup @content={{t "Cancel Order"}} @click={{action (confirm (t "This action will cancel the entire order. If there is more than one ticket in this order the other tickets will also be canceled. Are you sure you would like to cancel this order now? Yes, cancel order now. / No, do not cancel the order.") (action 'cancelOrder' this.order.identifier))}} @class="ui gray large label button" @position="top center">
17-
{{t 'Cancel Order'}}
18-
</UiPopup>
15+
{{#if (eq this.order.user.email this.authManager.currentUser.email)}}
16+
{{#if (not @restrictTicketCancellation)}}
17+
<UiPopup @content={{t "Cancel Order"}} @click={{action (confirm (t "This action will cancel the entire order. If there is more than one ticket in this order the other tickets will also be canceled. Are you sure you would like to cancel this order now? Yes, cancel order now. / No, do not cancel the order.") (action 'cancelOrder' this.order.identifier))}} @class="ui gray large label button" @position="top center">
18+
{{t 'Cancel Order'}}
19+
</UiPopup>
20+
{{/if}}
1921
{{/if}}
2022
</div>
2123
<SmartOverflow @class="header">

0 commit comments

Comments
 (0)