Skip to content

feat(ui): connect pause scheduling to health service API and state - #891

Merged
andrzejfudro merged 1 commit into
feat/admin-panel-pause-scheduling-uifrom
feat/admin-panel-pause-scheduling-api
Sep 17, 2026
Merged

andrzejfudro merged 1 commit into
feat/admin-panel-pause-scheduling-uifrom
feat/admin-panel-pause-scheduling-api

Conversation

@andrzejfudro

@andrzejfudro andrzejfudro commented Sep 16, 2026 •

Copy link
Copy Markdown
Collaborator

This PR forms PR 2 of the pause scheduling stack (built on top of #889). It connects the visual toggle and modal to the backend HealthService endpoints and manages state synchronization.

Summary

Connects the Admin Panel pause scheduling toggle to the backend HealthService.PauseScheduling and HealthService.ResumeScheduling endpoints.

image

Key Changes

  • HealthService Client: Added pauseScheduling() and resumeScheduling() POST requests to /v1/health/scheduling:pause and /v1/health/scheduling:resume with credentials.
  • State Management: Connected scheduling pause state to healthStatus using Angular linkedSignal for reactive in-place mutation without modifying constructor or toSignal pipelines.
  • Feedback & Guarding: Added in-flight request disabling on the slide toggle and snackbar notifications on success or failure.
  • Synchronization: Automatically revalidates status against the backend via refreshTrigger$ on toggle success and on manual refresh.
  • Testing: Added unit tests in health_service_test.ts for the new endpoints and in admin_panel_test.ts for pause, resume, error handling, and refresh synchronization.

TAG=agy
CONV=c33b49d4-fef7-4401-a7d4-d5cadcef9d6e

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request implements backend-driven scheduling pause and resume functionality in the admin panel by replacing local state tracking with API calls to pauseScheduling and resumeScheduling. It also introduces an isPauseToggling state to disable the toggle button during active requests and updates the health status signal locally upon success. Feedback highlights a high-severity issue in admin_panel.ts where this.lastKnownStatus is not updated during a toggle, which could cause the UI to revert to a stale state if a subsequent refresh fails.

Comment thread cmd/ui/app/admin_panel/admin_panel.ts Resolved
@andrzejfudro
andrzejfudro force-pushed the feat/admin-panel-pause-scheduling-api branch from de220bf to 3f51037 Compare September 16, 2026 09:13
@andrzejfudro
andrzejfudro added this pull request to stack #892 September 16, 2026 09:30
@andrzejfudro
andrzejfudro force-pushed the feat/admin-panel-pause-scheduling-api branch 3 times, most recently from 21acd0e to 36b52e7 Compare September 17, 2026 08:19
@andrzejfudro
andrzejfudro marked this pull request as ready for review September 17, 2026 08:21
@github-actions
github-actions Bot requested a review from janzak-dev September 17, 2026 08:21
Integrate Admin Panel scheduling pause toggle with backend endpoints:
- Call HealthService.pauseScheduling and resumeScheduling on toggle confirm
- Track asynchronous in-flight state with isUpdatingPauseState and disable toggle
- Display user feedback notifications via SnackbarService
- Add unit tests for pause/resume API execution, in-flight state, and error handling

TAG=agy
CONV=c33b49d4-fef7-4401-a7d4-d5cadcef9d6e
@andrzejfudro
andrzejfudro force-pushed the feat/admin-panel-pause-scheduling-api branch from 36b52e7 to 2b3ddfb Compare September 17, 2026 10:34
@andrzejfudro
andrzejfudro added this pull request to the merge queue Sep 17, 2026
Merged via the queue into main with commit 16948dc Sep 17, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants