-
Notifications
You must be signed in to change notification settings - Fork 354
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[CORL-3120]: Add initialStatus to comment and use for pre-mod labels in moderate cards #4589
Conversation
✅ Deploy Preview for gallant-galileo-14878c canceled.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Curious what your thoughts are with respect to storing this in the CommentRevision
instead of an initialStatus
field on the comment.
@@ -42,6 +42,13 @@ const markers: Array< | |||
</Localized> | |||
)) || | |||
null, | |||
(c) => | |||
(c.status !== "PREMOD" && c.initialStatus === "PREMOD" && ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we have string type enums that could be imported here instead of using raw string comparisons?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, updated to use that in all places status is referenced in this component...thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
awesome, thank you!
/** | ||
* initialStatus is the initial Comment Status. | ||
*/ | ||
initialStatus: GQLCOMMENT_STATUS; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thoughts on storing/exposing this in the comment revisions? We follow a history based structure everywhere else in the server, might be cool to have the status per-revision?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I like this idea so that we have access to it for each revision this way. Updated to then use the first revision status to populate initialStatus
for comments then.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
amazing, thank you!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm approving because technically status
is also a persisted computed state that is calculated from the mod actions... so this intialStatus
makes sense in that regard too...
Coral is so weird... I'll leave it up to you which style you prefer cause Coral seems to do both...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updates look great, thank you once again! Approved!
What does this PR do?
These changes add an
initialStatus
field toComment
. This helps have a clearer history from the initial creation of the comment into what its status history is. Astatus
field is added to comment revisions, so we also have status per revision now. Then we use the first revision's status to populateinitialStatus
.These changes will impact:
What changes to the GraphQL/Database Schema does this PR introduce?
This adds an
initialStatus
field to theComment
. It also addsstatus
toCommentRevision
.Does this PR introduce any new environment variables or feature flags?
no
If any indexes were added, were they added to
INDEXES.md
?n/a
How do I test this PR?
You can set a user to pre-mod. Create comments as that user. See that they have the pre-mod label in moderate cards, in moderation queues and in user history drawer. Approve/reject these comments. See that they still have the pre-mod label based on their initial pre-mod status.
Were any tests migrated to React Testing Library?
How do we deploy this PR?