Add Queue Explorer page for Staff Portal Tech Admin section - #310
Add Queue Explorer page for Staff Portal Tech Admin section#310aaron-rabinowitz wants to merge 3 commits into
Conversation
…ade necessary additions to cellix service-queue-storage to support queue explorer functionality
Reviewer's GuideImplements a staff Tech Admin Queue Explorer feature end-to-end: adds generic registered-queue send/peek/count capabilities to the queue storage service, exposes queue operations through application services and GraphQL, wires permissions, and builds a React UI for staff to inspect and send queue messages to selected queues, plus minor dependency/override updates. Sequence diagram for Tech Admin sending a queue message from the Queue ExplorersequenceDiagram
actor StaffUser
participant UIQueueExplorerContainer
participant GraphQLServer
participant TechAdminQueueService as TechAdmin.Queue
participant QueueStorageService
StaffUser->>UIQueueExplorerContainer: Click "Send Message" (payload, reason)
UIQueueExplorerContainer->>GraphQLServer: techAdminQueueSend(input)
GraphQLServer->>GraphQLServer: verify verifiedUser
GraphQLServer->>TechAdminQueueService: sendMessage(command)
TechAdminQueueService->>TechAdminQueueService: checkCanSendQueueMessages()
TechAdminQueueService->>TechAdminQueueService: sendMessage(queueName, payload, reason)
TechAdminQueueService->>QueueStorageService: sendMessageToRegisteredQueue(queueName, payload, options)
QueueStorageService-->>TechAdminQueueService: Message accepted
TechAdminQueueService-->>GraphQLServer: { status: { success: true } }
GraphQLServer-->>UIQueueExplorerContainer: Mutation result
UIQueueExplorerContainer-->>StaffUser: Show "Queue message sent"
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've found 2 issues, and left some high level feedback:
Fixed security issues:
-
fast-uri (link)
-
In
QueueExploreryou passdestroyOnHiddentoModal, but Ant Design’s Modal usesdestroyOnClose; this prop is likely a no-op and should be updated to avoid confusion and ensure the modal content is actually destroyed when closed. -
The new queue helper modules under
contexts/tech-admin/queue(e.g.queue-operations.tswithregisteredQueueOperationsandensureCanViewQueues) overlap conceptually with thequeue-list/queue-permissionsimplementations and don’t appear to be wired into the rest of the flow—consider removing or consolidating this older helper to avoid dead or duplicate permission logic.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- In `QueueExplorer` you pass `destroyOnHidden` to `Modal`, but Ant Design’s Modal uses `destroyOnClose`; this prop is likely a no-op and should be updated to avoid confusion and ensure the modal content is actually destroyed when closed.
- The new queue helper modules under `contexts/tech-admin/queue` (e.g. `queue-operations.ts` with `registeredQueueOperations` and `ensureCanViewQueues`) overlap conceptually with the `queue-list`/`queue-permissions` implementations and don’t appear to be wired into the rest of the flow—consider removing or consolidating this older helper to avoid dead or duplicate permission logic.
## Individual Comments
### Comment 1
<location path="packages/ocom/application-services/src/contexts/tech-admin/queue/queue-permissions.ts" line_range="3" />
<code_context>
+import type { DataSources } from '@ocom/persistence';
+
+// only needed becasue passport for techadmin is not implemented
+export function checkPermissionOnce(checkPermission: () => Promise<void>): () => Promise<void> {
+ let permissionCheck: Promise<void> | undefined;
</code_context>
<issue_to_address>
**nitpick (typo):** Fix typo in the explanatory comment about the temporary permission helper.
Please correct the spelling from "becasue" to "because" in this comment.
```suggestion
// only needed because passport for techadmin is not implemented
```
</issue_to_address>
### Comment 2
<location path="packages/ocom/service-queue-storage/README.md" line_range="27" />
<code_context>
`ApiContextSpec` should depend on `QueueStorageOperations`, not `ServiceQueueStorage`. The constructor is for bootstrap; the operations type is for application-service injection.
+`QueueStorageOperations` also exposes `sendMessageToRegisteredQueue(queueName, payload)` for controlled operational flows that select a registered physical queue at runtime. It accepts both inbound and outbound queues, validates the payload against the selected schema, and rejects unregistered names. Prefer generated `sendMessageTo...Queue` methods for normal application behavior.
+
Example:
</code_context>
<issue_to_address>
**question:** The documented `sendMessageToRegisteredQueue` signature may be incomplete compared to the usage example elsewhere.
Here you document `sendMessageToRegisteredQueue(queueName, payload)`, but another README example shows a third `options` argument. If options are supported, please update this section to include the parameter and its shape so the API description stays consistent.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
…ue/queue-permissions.ts Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
…and remove deprecated files
…ade necessary additions to cellix service-queue-storage to support queue explorer functionality
Summary by Sourcery
Introduce a Tech Admin queue explorer feature for staff, backed by new queue storage operations, permissions, and GraphQL/application-service endpoints.
New Features:
sendMessageToRegisteredQueueoperation and per-queue poison peek and approximate message count methods from the queue storage layer.Enhancements:
canViewQueuesandcanSendQueueMessagescapabilities.Build:
Tests: