-
Notifications
You must be signed in to change notification settings - Fork 5
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
Add Comment#timestamp #58
Conversation
As a note, the 4 first commits are commits on theia/master not yet available on eclipsesource/master. Only 2df36ae is relevant |
2df36ae
to
65bd265
Compare
if (timeStamp === undefined) { | ||
return ''; | ||
} | ||
return timeStamp.toLocaleDateString(); |
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.
When I test this rebased onto v1.27.0
, timestamp
was already a string
here. Thus, this method did not exist and an exception was thrown.
From the console:
comments-contribution.ts:114 Uncaught (in promise) TypeError: timeStamp.toLocaleDateString is not a function
at ReviewComment.timeStamp (comment-thread-widget.tsx:504:26)
at ReviewComment.render (comment-thread-widget.tsx:480:58)
at finishClassComponent (react-dom.development.js:17160:1)
at updateClassComponent (react-dom.development.js:17110:1)
at beginWork (react-dom.development.js:18620:1)
at HTMLUnknownElement.callCallback (react-dom.development.js:188:1)
at Object.invokeGuardedCallbackDev (react-dom.development.js:237:1)
at invokeGuardedCallback (react-dom.development.js:292:1)
at beginWork$1 (react-dom.development.js:23203:1)
at performUnitOfWork (react-dom.development.js:22157:1)
New 'basic' version of timestamp support using a string rather than a date. |
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.
Showing the timestamp works now, thanks!
However, I think a better way to serialize the date is using the ISO date format instead of serializing the full JSON object.
See inline suggestions for changing this and other minor fixes
cfe4978
to
e29c860
Compare
Thanks for your review, @lucas-koehler. I tested again the branch on 1.27.0, the timestamp is still displayed with your last suggestions. |
376dbca
to
5d615cd
Compare
Contributed on behalf of STMicroelectronics Fixes eclipse-theia#11702
5d615cd
to
6895086
Compare
close PR as the one on main fork has been merged (eclipse-theia#12007) |
What it does
Add Comment#timestamp optional property
This adds the timeStamp optional property from Comment to improve vscode api coverage. It also displays the timestamp of each comments in the Comment Thread widget
Fixes eclipse-theia#11702
Contributed on behalf of ST Microelectronics
How to test
Note: there are currently some issues with menus, since theia 1.28.0. This is due to eclipse-theia#11290, integrated in 1.28.0. Prior to this change, the comment sample works on theia 1.27.0. So to test this change, I cherry-picked my commit on top of 1.27.0 tag. Please see also eclipse-theia#11730 for this menu issues.
Install forked extension #comment-sample-0.0.1 vsix file
Create a comment using the side bar while comparing 2 test files.
The timestamp should be displayed along the user name.
Review checklist
Reminder for reviewers