Comment serialization cleanup part 1: Break out basic definition.

Review Request #13655 — Created March 21, 2024 and submitted — Latest diff uploaded

Information

Review Board
release-7.x

Reviewers

The way comments are serialized for use in Review UIs and the diff
viewer is extremely messy. This change is the first step of cleaning
that up.

When I first converted the comment models to TypeScript, I mistakenly
marked the comment editor and comment dialog view's publishedComments
as being BaseComment[]. These are in fact the serialized comment data
arrays. This change moves the definition of the serialized comment
interface out of abstractCommentBlockModel.ts into its own file, where
we can import it anywhere we need, and makes use of that definition
where appropriate.

Ran js-tests.

Diff Revision 1

This is not the most recent revision of the diff. The latest diff is revision 2. See what's changed.

orig
1
2

Commits

First Last Summary ID Author
Comment serialization cleanup part 1: break out basic definition.
The way comments are serialized for use in Review UIs and the diff viewer is extremely messy. This change is the first step of cleaning that up. When I first converted the comment models to TypeScript, I mistakenly marked the comment editor and comment dialog view's `publishedComments` as being `BaseComment[]`. These are in fact the serialized comment data arrays. This change moves the definition of the serialized comment interface out of `abstractCommentBlockModel.ts` into its own file, where we can import it anywhere we need, and makes use of that definition where appropriate. Testing Done: Ran js-tests.
5e57a8ca3244423afcde23aed6e109570943e931 David Trowbridge
reviewboard/static/rb/js/reviews/models/abstractCommentBlockModel.ts
reviewboard/static/rb/js/reviews/models/abstractReviewableModel.ts
reviewboard/static/rb/js/reviews/models/commentData.ts
reviewboard/static/rb/js/reviews/models/commentEditorModel.ts
reviewboard/static/rb/js/reviews/models/diffCommentBlockModel.ts
reviewboard/static/rb/js/reviews/models/fileAttachmentReviewableModel.ts
reviewboard/static/rb/js/reviews/models/screenshotReviewableModel.ts
reviewboard/static/rb/js/reviews/views/commentDialogView.ts
Loading...