feat: calendar ZIP UX grouping, archive notification polling, service records pagination
Some checks failed
ERP CI/CD Pipeline / test (push) Has been cancelled
ERP CI/CD Pipeline / Deploy (server git pull + compose) (push) Has been cancelled

- Group 'Preuzmi mjesečni izvještaj' and 'Preuzmi ZIP' buttons together in the calendar toolbar
- Close the ZIP modal immediately on action click so the user is no longer blocked in the sidebar
- Backend: include generated_archive_id in the 'requested' notification so the frontend can track the specific archive lifecycle
- Frontend: refresh notifications immediately after archive request and start targeted polling (every 10s) until a completed/failed notification arrives for that archive ID
- Add previous/next pagination to the service records table (page mode) when no service context is selected, showing all records 10 per page (matching the work orders table pattern)
- Tests: assert generated_archive_id is present in both requested and completed notifications

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
mariomitte
2026-08-07 06:08:53 +02:00
parent cb165df30c
commit bf381dcf13
5 changed files with 182 additions and 59 deletions

View File

@@ -499,6 +499,10 @@ class WorkOrderImagesEndpointTests(TestCase):
notifications = VehicleNotification.objects.filter(recipient=self.user).order_by('created_at')
self.assertTrue(notifications.filter(metadata__entity_type='fleet_archive', metadata__stage='requested').exists())
self.assertTrue(notifications.filter(metadata__entity_type='fleet_archive', metadata__stage='completed').exists())
requested_notification = notifications.filter(metadata__entity_type='fleet_archive', metadata__stage='requested').last()
completed_notification = notifications.filter(metadata__entity_type='fleet_archive', metadata__stage='completed').last()
self.assertEqual(str(requested_notification.metadata.get('generated_archive_id')), str(generated.pk))
self.assertEqual(str(completed_notification.metadata.get('generated_archive_id')), str(generated.pk))
def test_monthly_service_tasks_archive_request_ignores_stale_cached_archive(self):
stale = GeneratedFleetArchive.objects.create(
@@ -604,3 +608,10 @@ class WorkOrderImagesEndpointTests(TestCase):
metadata__stage='completed',
).exists()
)
requested_notification = VehicleNotification.objects.filter(
recipient=self.user,
metadata__entity_type='fleet_archive',
metadata__archive_type='work_orders',
metadata__stage='requested',
).order_by('created_at').last()
self.assertEqual(str(requested_notification.metadata.get('generated_archive_id')), str(generated.pk))