mirror of
https://github.com/wassname/talk.git
synced 2026-09-12 13:01:11 +08:00
[CORL-233] Create a user drawer with comment streams (#2395)
* Create preliminary user history drawer with user fragment CORL-233 * Set font size for the user details to match spec at 16 px CORL-233 * Update username font style/size, add horizontal rule for user history drawer CORL-233 * Set user detail min width to align the copy buttons in user history drawer CORL-233 * Set min width of the user history drawer to match spec CORL-233 * Remove min width for detail area and card to allow responsive sizing Allows the copy buttons to sit just to the right of the user details text. CORL-233 * Update snapshots to handle clickable username in moderation comment cards CORL-233 * Create initial pagination of all comments in user history drawer Shows all comments with a rubbish "load more" button as we haven't decided if we want to do a load more button or infinite scrolling solution. Flex layout helps it create a scroll bar when needed to traverse through the comment stream. CORL-233 * Create preliminary user history drawer with user fragment CORL-233 * Set font size for the user details to match spec at 16 px CORL-233 * Update username font style/size, add horizontal rule for user history drawer CORL-233 * Set user detail min width to align the copy buttons in user history drawer CORL-233 * Set min width of the user history drawer to match spec CORL-233 * Remove min width for detail area and card to allow responsive sizing Allows the copy buttons to sit just to the right of the user details text. CORL-233 * Update snapshots to handle clickable username in moderation comment cards CORL-233 * Let the user history drawer fill full height of page CORL-233 * Add a close button to the user history drawer CORL-233 * Preliminarily get all and rejected comments showing in the user drawer CORL-233 * Create preliminary user history drawer with user fragment CORL-233 * Set font size for the user details to match spec at 16 px CORL-233 * Update username font style/size, add horizontal rule for user history drawer CORL-233 * Set user detail min width to align the copy buttons in user history drawer CORL-233 * Set min width of the user history drawer to match spec CORL-233 * Remove min width for detail area and card to allow responsive sizing Allows the copy buttons to sit just to the right of the user details text. CORL-233 * Update snapshots to handle clickable username in moderation comment cards CORL-233 * Let the user history drawer fill full height of page CORL-233 * Add a close button to the user history drawer CORL-233 * Set the user history drawer to fill full height of window CORL-233 * Convert ModerateCardContainer to a FunctionComponent CORL-233 * Show spinner while all comments are loading in user history drawer CORL-233 * Style tabs within the user history drawer to be secondary CORL-233 * Center load more button in the comments for the user history drawer CORL-233 * Fix scroll bars on nested flexboxes in the user history drawer CORL-233 * Tweak styling for the user history drawer comments section Add margins where necessary. Style the Load More button to match the comment feed elsewhere. CORL-233 * Fix background of copy buttons to match the user history drawer CORL-233 * Preliminarily get rejected comments showing in the user history tabs Still need to consolidate any duplication between the all and rejected comments containers/queries, but this works correctly as is. CORL-233 * Show hover and active background color on moderate card usernames CORL-233 * Hide load more buttons on comment streams when no comments available CORL-233 * Handle when no comments are available in user history drawer streams CORL-233 * Actually show all comments in the user history all comments tab Previously was filtering out rejected and other pre-mod status-ed comments. CORL-233 * Style the user history drawer cards to match the spec CORL-233 * Add localizations around user history drawer tabs CORL-233 * Allow a mini mode for moderate cards that are shown in the user drawer CORL-233 * Style user drawer comment tabs to match the spec CORL-233 * Update snapshots to account for mini moderate cards Updates the fact that a separator on regular sized cards now has an additional class name to turn on the divider's visible border. CORL-233 * Add user drawer to the queue instead of childed to the moderate card Prevents the user drawer from prematurely closing when we approve all items in the moderate queue. CORL-233 * Update snapshots to account for user drawer on queues CORL-233 * Set mini and username defaults more cleanly on ModerateCardContainer CORL-233 * Rename usernameClicked to onUsernameClicked CORL-233 * Use callback on loadMore calls within user drawer queries CORL-233 * Localize the no comment text for the user drawer comment streams CORL-233 * Localize the user not found callout in the user drawer comment streams CORL-233 * Remove superfluous curly braces CORL-233 * Extract user history drawer internals into a distinct query component CORL-233 * Move comments conditional below useCallback initializations CORL-233 * feat: fixed consistency issues * Use a concrete tab type on user drawer comment stream tabs CORL-233 * Use <hr/> instead of <HorizontalRule> CORL-233 * Clarify logic for showing horizontal rule after comments in user drawer CORL-233 * Remover bottom border on user drawer tab bar CORL-233
This commit is contained in:
@@ -657,6 +657,57 @@ export const retrieveCommentUserConnection = (
|
||||
},
|
||||
});
|
||||
|
||||
/**
|
||||
* retrieveAllCommentUserConnection returns a Connection<Comment> for a given User's
|
||||
* comments regardless of comment status.
|
||||
*
|
||||
* @param mongo database connection
|
||||
* @param tenantID the Tenant's ID
|
||||
* @param userID the User id for the comment to retrieve
|
||||
* @param input connection configuration
|
||||
*/
|
||||
export const retrieveAllCommentsUserConnection = (
|
||||
mongo: Db,
|
||||
tenantID: string,
|
||||
userID: string,
|
||||
input: CommentConnectionInput
|
||||
) =>
|
||||
retrieveCommentConnection(mongo, tenantID, {
|
||||
...input,
|
||||
filter: {
|
||||
...input.filter,
|
||||
authorID: userID,
|
||||
},
|
||||
});
|
||||
|
||||
/**
|
||||
* retrieveRejectedCommentUserConnection returns a Connection<Comment> for a given User's
|
||||
* rejected comments.
|
||||
*
|
||||
* @param mongo database connection
|
||||
* @param tenantID the Tenant's ID
|
||||
* @param userID the User id for the comment to retrieve
|
||||
* @param input connection configuration
|
||||
*/
|
||||
export const retrieveRejectedCommentUserConnection = (
|
||||
mongo: Db,
|
||||
tenantID: string,
|
||||
userID: string,
|
||||
input: CommentConnectionInput
|
||||
) =>
|
||||
retrieveStatusCommentConnection(
|
||||
mongo,
|
||||
tenantID,
|
||||
[GQLCOMMENT_STATUS.REJECTED],
|
||||
{
|
||||
...input,
|
||||
filter: {
|
||||
...input.filter,
|
||||
authorID: userID,
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
/**
|
||||
* retrieveVisibleCommentConnection will retrieve a connection that contains
|
||||
* comments that are visible.
|
||||
|
||||
Reference in New Issue
Block a user