mirror of
https://github.com/wassname/talk.git
synced 2026-09-10 12:43:11 +08:00
[CORL-166] Live Updates on Mod Queues (#2368)
* feat: client implementation of subscriptions and modqueue live counts * fix: unit tests * feat: live status update in moderation * feat: live update of new comments in moderation * chore: View New instead of View More * feat: fade in transition for new comments * chore: turn websocket proxy back on * feat: initial server impl * fix: make it work :-) * fix: add box shadow * chore: make test subscriptions only support 1 top level field following the spec * fix: linting * feat: support clientID * fix: linting * feat: support commentStatusUpdated subscription * fix: disabled styles for approve and reject button * feat: show moderated by system and update flags * feat: support metrics recording on websocket connections * fix: handle when same comment enters but leaves again
This commit is contained in:
@@ -1,16 +1,24 @@
|
||||
import { ConnectionHandler, RecordSourceSelectorProxy } from "relay-runtime";
|
||||
import {
|
||||
ConnectionHandler,
|
||||
RecordProxy,
|
||||
RecordSourceProxy,
|
||||
RecordSourceSelectorProxy,
|
||||
} from "relay-runtime";
|
||||
|
||||
type Queue = "reported" | "pending" | "unmoderated" | "rejected";
|
||||
import {
|
||||
GQLCOMMENT_STATUS,
|
||||
GQLMODERATION_QUEUE_RL,
|
||||
} from "coral-framework/schema";
|
||||
|
||||
export default function getQueueConnection(
|
||||
store: RecordSourceSelectorProxy,
|
||||
queue: Queue,
|
||||
storyID?: string
|
||||
) {
|
||||
store: RecordSourceSelectorProxy | RecordSourceProxy,
|
||||
queue: GQLMODERATION_QUEUE_RL | "REJECTED",
|
||||
storyID?: string | null
|
||||
): RecordProxy | null {
|
||||
const root = store.getRoot();
|
||||
if (queue === "rejected") {
|
||||
if (queue === "REJECTED") {
|
||||
return ConnectionHandler.getConnection(root, "RejectedQueue_comments", {
|
||||
status: "REJECTED",
|
||||
status: GQLCOMMENT_STATUS.REJECTED,
|
||||
storyID,
|
||||
});
|
||||
}
|
||||
@@ -19,7 +27,7 @@ export default function getQueueConnection(
|
||||
return null;
|
||||
}
|
||||
return ConnectionHandler.getConnection(
|
||||
queuesRecord.getLinkedRecord(queue),
|
||||
queuesRecord.getLinkedRecord(queue.toLowerCase()),
|
||||
"Queue_comments"
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user