Skip to content

fix: Remove order delete functionality #5713

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

Merged
merged 1 commit into from
Nov 22, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 0 additions & 19 deletions app/controllers/events/view/tickets/orders/list.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ export default class extends Controller.extend(EmberTableControllerMixin) {
width : 170,
actions : {
completeOrder : this.completeOrder.bind(this),
deleteOrder : this.deleteOrder.bind(this),
cancelOrder : this.cancelOrder.bind(this),
resendConfirmation : this.resendConfirmation.bind(this)
}
Expand Down Expand Up @@ -86,24 +85,6 @@ export default class extends Controller.extend(EmberTableControllerMixin) {
});
}

@action
deleteOrder(order_id) {
this.set('isLoading', true);
const order = this.store.peekRecord('order', order_id, { backgroundReload: false });
order.destroyRecord()
.then(() => {
this.notify.success(this.l10n.t('Order has been deleted successfully.'));
this.refreshModel.bind(this)();
})
.catch(e => {
console.error('Error while deleting order', e);
this.notify.error(this.l10n.t('An unexpected error has occurred.'));
})
.finally(() => {
this.set('isLoading', false);
});
}

@action
cancelOrder(order_id) {
this.set('isLoading', true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,6 @@
<i class="delete icon"></i>
</UiPopup>
{{/if}}
{{#if (can-modify-order this.record)}}
<UiPopup @content={{t "Delete order"}} @click={{action (confirm (t "Are you sure you would like to delete this Order?") (action this.props.actions.deleteOrder this.record))}} @class="ui icon button" @position="top center">
<i class="trash icon"></i>
</UiPopup>
{{/if}}
<UiPopup @content={{t "Resend order confirmation"}} @click={{action this.props.actions.resendConfirmation this.record}} @class="ui icon button" @position="top center">
<i class="mail outline icon"></i>
</UiPopup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ module('Integration | Component | ui table/cell/events/view/tickets/orders/cell

const props = {
actions: {
deleteOrder : () => {},
cancelOrder : () => {},
resendConfirmation : () => {},
completeOrder : () => {}
Expand Down