From 51f4e5315cba51476cf0209c30df136796c7ca11 Mon Sep 17 00:00:00 2001 From: Ganes556 Date: Thu, 20 Feb 2025 08:08:21 +0800 Subject: [PATCH 01/10] index dispatched email table --- .../Comms/DispatchedEmail/UI/IndexDispatchedEmails.php | 4 ++-- app/Actions/Comms/Outbox/UI/ShowOutbox.php | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/Actions/Comms/DispatchedEmail/UI/IndexDispatchedEmails.php b/app/Actions/Comms/DispatchedEmail/UI/IndexDispatchedEmails.php index a99bb5a55c..bc4090cde9 100644 --- a/app/Actions/Comms/DispatchedEmail/UI/IndexDispatchedEmails.php +++ b/app/Actions/Comms/DispatchedEmail/UI/IndexDispatchedEmails.php @@ -38,7 +38,7 @@ public function handle(Group|Mailshot|Outbox|PostRoom|Organisation|Shop $parent, { $globalSearch = AllowedFilter::callback('global', function ($query, $value) { $query->where(function ($query) use ($value) { - $query->orWhereWith('dispatched_emails.email_address', $value); + $query->orWhereWith('email_addresses.email', $value); }); }); @@ -96,7 +96,7 @@ public function handle(Group|Mailshot|Outbox|PostRoom|Organisation|Shop $parent, $query->where('dispatched_emails.group_id', $parent->id); } }) - ->allowedSorts(['dispatched_emails.state', 'sent_at' ,'dispatched_emails.number_reads', 'mask_as_spam' ,'dispatched_emails.number_clicks']) + ->allowedSorts(['email_address', 'sent_at' ,'number_reads', 'mask_as_spam' ,'number_clicks']) ->allowedFilters([$globalSearch]) ->withPaginator($prefix, tableName: request()->route()->getName()) ->withQueryString(); diff --git a/app/Actions/Comms/Outbox/UI/ShowOutbox.php b/app/Actions/Comms/Outbox/UI/ShowOutbox.php index 9ba4c5d70a..5a33abb370 100644 --- a/app/Actions/Comms/Outbox/UI/ShowOutbox.php +++ b/app/Actions/Comms/Outbox/UI/ShowOutbox.php @@ -152,12 +152,12 @@ public function htmlResponse(Outbox $outbox, ActionRequest $request): Response : Inertia::lazy(fn () => GetOutboxShowcase::run($outbox)), OutboxTabsEnum::MAILSHOTS->value => $this->tab == OutboxTabsEnum::MAILSHOTS->value ? - fn () => MailshotResource::collection(IndexMailshots::run($outbox)) - : Inertia::lazy(fn () => MailshotResource::collection(IndexMailshots::run($outbox))), + fn () => MailshotResource::collection(IndexMailshots::run($outbox, OutboxTabsEnum::MAILSHOTS->value)) + : Inertia::lazy(fn () => MailshotResource::collection(IndexMailshots::run($outbox, OutboxTabsEnum::MAILSHOTS->value))), OutboxTabsEnum::DISPATCHED_EMAILS->value => $this->tab == OutboxTabsEnum::DISPATCHED_EMAILS->value ? - fn () => DispatchedEmailResource::collection(IndexDispatchedEmails::run($outbox)) - : Inertia::lazy(fn () => DispatchedEmailResource::collection(IndexDispatchedEmails::run($outbox))), + fn () => DispatchedEmailResource::collection(IndexDispatchedEmails::run($outbox, OutboxTabsEnum::DISPATCHED_EMAILS->value)) + : Inertia::lazy(fn () => DispatchedEmailResource::collection(IndexDispatchedEmails::run($outbox, OutboxTabsEnum::DISPATCHED_EMAILS->value))), // OutboxTabsEnum::EMAIL_BULK_RUNS->value => $this->tab == OutboxTabsEnum::EMAIL_BULK_RUNS->value ? // fn () => EmailBulkRunsResource::collection(IndexEmailBulkRuns::run($outbox)) From a2a6b7626be49a8e2dae84eb138f382920c4f6d2 Mon Sep 17 00:00:00 2001 From: aqordeon Date: Thu, 20 Feb 2025 08:30:36 +0800 Subject: [PATCH 02/10] fix: PR Pallet + Stored Item: submit button --- app/Actions/Fulfilment/PalletReturn/UI/ShowPalletReturn.php | 4 ++-- .../Fulfilment/PalletReturn/UI/ShowStoredItemReturn.php | 2 +- .../Tables/Grp/Org/Fulfilment/TablePalletReturnPallets.vue | 4 ++-- resources/js/Pages/Grp/Org/Fulfilment/PalletReturn.vue | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/Actions/Fulfilment/PalletReturn/UI/ShowPalletReturn.php b/app/Actions/Fulfilment/PalletReturn/UI/ShowPalletReturn.php index 3dda3bbd37..ae412f3b8f 100644 --- a/app/Actions/Fulfilment/PalletReturn/UI/ShowPalletReturn.php +++ b/app/Actions/Fulfilment/PalletReturn/UI/ShowPalletReturn.php @@ -105,13 +105,13 @@ public function htmlResponse(PalletReturn $palletReturn, ActionRequest $request) } else { $tooltipSubmit = __('Submit'); } - + $buttonSubmit = [ 'type' => 'button', 'style' => 'save', 'tooltip' => $tooltipSubmit, 'label' => __('Submit') . ' (' . $palletReturn->stats->number_pallets . ')', - 'key' => 'submit', + 'key' => 'submit-pallet', 'route' => [ 'method' => 'post', 'name' => 'grp.models.fulfilment-customer.pallet-return.submit_and_confirm', diff --git a/app/Actions/Fulfilment/PalletReturn/UI/ShowStoredItemReturn.php b/app/Actions/Fulfilment/PalletReturn/UI/ShowStoredItemReturn.php index 669dd0d0cb..4aeb37e1b8 100644 --- a/app/Actions/Fulfilment/PalletReturn/UI/ShowStoredItemReturn.php +++ b/app/Actions/Fulfilment/PalletReturn/UI/ShowStoredItemReturn.php @@ -106,7 +106,7 @@ public function htmlResponse(PalletReturn $palletReturn, ActionRequest $request) 'style' => 'save', 'tooltip' => $tooltipSubmit, // 'label' => __('Confirm') . ' (' . $palletReturn->storedItems()->count() . ')', - 'key' => 'submit', + 'key' => 'submit-stored-items', 'route' => [ 'method' => 'post', 'name' => 'grp.models.fulfilment-customer.pallet-return.submit_and_confirm', diff --git a/resources/js/Components/Tables/Grp/Org/Fulfilment/TablePalletReturnPallets.vue b/resources/js/Components/Tables/Grp/Org/Fulfilment/TablePalletReturnPallets.vue index 13b9cf1e34..6031e938dd 100644 --- a/resources/js/Components/Tables/Grp/Org/Fulfilment/TablePalletReturnPallets.vue +++ b/resources/js/Components/Tables/Grp/Org/Fulfilment/TablePalletReturnPallets.vue @@ -140,9 +140,9 @@ const setUpChecked = () => { const debounceReloadBoxStats = debounce(() => { router.reload({ - only: ['box_stats'], // Only reload the props with dynamic name tabSlug (i.e props.showcase, props.menu) + only: ['pageHead', 'box_stats'], }) -}, 500) +}, 700) const onCheckTable = async (item: {}) => { if (item.is_checked) { diff --git a/resources/js/Pages/Grp/Org/Fulfilment/PalletReturn.vue b/resources/js/Pages/Grp/Org/Fulfilment/PalletReturn.vue index 4565234d76..1d5db8d89c 100644 --- a/resources/js/Pages/Grp/Org/Fulfilment/PalletReturn.vue +++ b/resources/js/Pages/Grp/Org/Fulfilment/PalletReturn.vue @@ -443,7 +443,7 @@ const isModalUploadFileOpen = ref(false) -