mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-10 23:07:47 +00:00
Small cleanup and improvements
This commit is contained in:
@@ -13,6 +13,9 @@ export default class extends Controller {
|
||||
document.removeEventListener('modal-close', this.modalClose);
|
||||
}
|
||||
|
||||
// Manually submit request for bulk print invoics since selected orders
|
||||
// cannot be passed directly as params in haml template. So we use JS (#getSelectedIds)
|
||||
// to get selected orders inorder to print the appropriate invoices.
|
||||
printInvoices(e) {
|
||||
const csrfToken = document.querySelector('meta[name="csrf-token"]')?.getAttribute('content');
|
||||
const data = { bulk_ids: this.getSelectedIds() };
|
||||
|
||||
@@ -66,19 +66,6 @@ export default class extends Controller {
|
||||
}, 200);
|
||||
}
|
||||
|
||||
resend_confirmation(event) {
|
||||
fetch("/user/spree_user/confirmation", {
|
||||
method: "POST",
|
||||
body: JSON.stringify({
|
||||
spree_user: { email: this.emailValue },
|
||||
tab: event.currentTarget.dataset.tab,
|
||||
}),
|
||||
headers: { "Content-type": "application/json; charset=UTF-8" },
|
||||
})
|
||||
.then(response => response.text())
|
||||
.then(html => { Turbo.renderStreamMessage(html) });
|
||||
}
|
||||
|
||||
returnHome() {
|
||||
window.location = "/";
|
||||
}
|
||||
|
||||
@@ -951,12 +951,10 @@ RSpec.describe '
|
||||
order.finalize! # ensure order has a payment to capture
|
||||
order.payments << create(:check_payment, order:, amount: order.total)
|
||||
order.payments.first.capture!
|
||||
login_as_admin
|
||||
visit spree.edit_admin_order_path(order)
|
||||
end
|
||||
|
||||
it "ships the order and shipment email is sent" do
|
||||
login_as_admin
|
||||
expect(order.reload.shipped?).to be false
|
||||
|
||||
click_button 'Ship'
|
||||
@@ -974,7 +972,6 @@ RSpec.describe '
|
||||
end
|
||||
|
||||
it "ships the order without sending email" do
|
||||
login_as_admin
|
||||
expect(order.reload.shipped?).to be false
|
||||
|
||||
click_button 'Ship'
|
||||
|
||||
Reference in New Issue
Block a user