mirror of
https://github.com/wassname/talk.git
synced 2026-09-09 11:38:08 +08:00
[next] Reaction Sort (#2260)
* feat: stream sort description to use reaction conf * feat: use full custom translation string for the sort label
This commit is contained in:
@@ -829,7 +829,8 @@ type ReactionConfiguration {
|
||||
icon: String!
|
||||
|
||||
"""
|
||||
|
||||
iconActive is the string representing the icon that should be used when the
|
||||
icon should be considered active.
|
||||
"""
|
||||
iconActive: String
|
||||
|
||||
@@ -842,7 +843,13 @@ type ReactionConfiguration {
|
||||
labelActive is the string placed beside the reaction icon to provide better
|
||||
context when it has been selected.
|
||||
"""
|
||||
labelActive: String
|
||||
labelActive: String!
|
||||
|
||||
"""
|
||||
sortLabel is the string placed inside of the sort menu to sort for comment
|
||||
with most reactions.
|
||||
"""
|
||||
sortLabel: String!
|
||||
|
||||
"""
|
||||
color is the hex color code that can be used to change the color of the button.
|
||||
@@ -1792,7 +1799,7 @@ enum COMMENT_SORT {
|
||||
CREATED_AT_DESC
|
||||
CREATED_AT_ASC
|
||||
REPLIES_DESC
|
||||
RESPECT_DESC
|
||||
REACTION_DESC
|
||||
}
|
||||
|
||||
"""
|
||||
|
||||
@@ -487,7 +487,7 @@ function cursorGetterFactory(
|
||||
case GQLCOMMENT_SORT.CREATED_AT_ASC:
|
||||
return comment => comment.createdAt;
|
||||
case GQLCOMMENT_SORT.REPLIES_DESC:
|
||||
case GQLCOMMENT_SORT.RESPECT_DESC:
|
||||
case GQLCOMMENT_SORT.REACTION_DESC:
|
||||
return (_, index) =>
|
||||
(input.after ? (input.after as number) : 0) + index + 1;
|
||||
}
|
||||
@@ -762,7 +762,7 @@ function applyInputToQuery(
|
||||
query.after(input.after as number);
|
||||
}
|
||||
break;
|
||||
case GQLCOMMENT_SORT.RESPECT_DESC:
|
||||
case GQLCOMMENT_SORT.REACTION_DESC:
|
||||
query.orderBy({ "actionCounts.REACTION": -1, createdAt: -1 });
|
||||
if (input.after) {
|
||||
query.after(input.after as number);
|
||||
|
||||
@@ -177,6 +177,7 @@ export async function createTenant(
|
||||
// handshake.
|
||||
label: "Respect",
|
||||
labelActive: "Respected",
|
||||
sortLabel: "Most Respected",
|
||||
icon: "thumb_up",
|
||||
},
|
||||
createdAt: now,
|
||||
|
||||
Reference in New Issue
Block a user