mirror of
https://github.com/Studio-Saelix/sencho.git
synced 2026-08-30 20:29:15 +00:00
feat(notifications): deep-link bell rows to source stack and container logs (#692)
Add stack_name and container_name columns to notification_history so bell rows can act as jump points. Producers (AutoHeal, Docker events) pass the container context through dispatchAlert; the panel renders routable rows as buttons that load the target stack and, when a container name is present, open its logs modal. Non-structural notifications stay as passive display rows.
This commit is contained in:
@@ -214,6 +214,23 @@ describe('NotificationService - routing logic', () => {
|
||||
level: 'info',
|
||||
message: 'Should be logged',
|
||||
timestamp: expect.any(Number),
|
||||
stack_name: undefined,
|
||||
container_name: undefined,
|
||||
});
|
||||
});
|
||||
|
||||
it('persists stackName and containerName context on the history row', async () => {
|
||||
mockGetEnabledNotificationRoutes.mockReturnValue([]);
|
||||
mockGetEnabledAgents.mockReturnValue([]);
|
||||
|
||||
await svc.dispatchAlert('warning', 'Restarted', 'my-app', 'my-app-web-1');
|
||||
|
||||
expect(mockAddNotificationHistory).toHaveBeenCalledWith({
|
||||
level: 'warning',
|
||||
message: 'Restarted',
|
||||
timestamp: expect.any(Number),
|
||||
stack_name: 'my-app',
|
||||
container_name: 'my-app-web-1',
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user