-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Migrate post_list_row component to typescript #6593
Migrate post_list_row component to typescript #6593
Conversation
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.
Thanks for your contribution @sowmiyamuthuraman.
I've added a couple comments for you to review.
@@ -7,7 +7,7 @@ import {bindActionCreators} from 'redux'; | |||
import {getShortcutReactToLastPostEmittedFrom} from 'selectors/emojis'; | |||
import {emitShortcutReactToLastPostFrom} from 'actions/post_actions.jsx'; | |||
|
|||
import PostListRow from './post_list_row.jsx'; | |||
import PostListRow from './post_list_row'; |
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.
This file should also be migrated to TypeScript.
previousListId?: string, | ||
fullWidth?: boolean, | ||
shouldHighlight?: boolean, | ||
loadOlderPosts: () => any, |
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.
These shouldn't return type any
. If we don't need the return type, use void
instead.
isLastPost: PropTypes.bool, | ||
* Function to set or unset emoji picker for last message | ||
*/ | ||
emitShortcutReactToLastPostFrom: (location:string) => any |
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.
Same here.
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.
Looking good now, I have some non-blocking comments but overall it's good.
Thanks @sowmiyamuthuraman!
|
||
import {getShortcutReactToLastPostEmittedFrom} from 'selectors/emojis'; | ||
import {emitShortcutReactToLastPostFrom} from 'actions/post_actions.jsx'; | ||
|
||
import PostListRow from './post_list_row.jsx'; | ||
import {GlobalState} from '../../../types/store'; |
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.
This can just be types/store
, no need to use an explicit directory reference.
|
||
function mapStateToProps(state, ownProps) { | ||
function mapStateToProps(state:GlobalState, ownProps:Props) { |
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.
Nit: spacing between :
and GlobalState
. Also between :
and Props
@@ -19,7 +31,7 @@ function mapStateToProps(state, ownProps) { | |||
}; | |||
} | |||
|
|||
function mapDispatchToProps(dispatch) { | |||
function mapDispatchToProps(dispatch:Dispatch<GenericAction>) { |
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.
Same nit as above
shortcutReactToLastPostEmittedFrom: PropTypes.string, | ||
* Function to set or unset emoji picker for last message | ||
*/ | ||
emitShortcutReactToLastPostFrom: (location:string) => void |
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.
Nit: spacing between :
and string
|
||
blockShortcutReactToLastPostForNonMessages(listId) { | ||
export default class PostListRow extends React.PureComponent<PostListRowProps> { | ||
blockShortcutReactToLastPostForNonMessages(listId:string) { |
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.
Same nit as above
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.
LGTM, thanks @sowmiyamuthuraman!
Test server destroyed |
Thanks @sowmiyamuthuraman! Tested and passed. LGTM. |
…o MM-20462 * 'master' of github.com:Tak-Iwamoto/mattermost-webapp: [MM-22161] - Improve accessibility of channel switcher (mattermost#6199) [MM-20460] Migrate 'components/permissions_gates/channel_permission_gate' module and associated tests to TypeScript (mattermost#6601) [GH-15724] Remove usage of findDOMNode from Create Team screens (mattermost#6621) [MM-29302] Billing Summary Card - No Billing History case (mattermost#6639) /files should target=_blank (mattermost#6616) MM T134 visual verification of tooltips (mattermost#6604) MM-24812 Add e2e tests for adding reactions to existing reactions in archived channel posts (mattermost#6579) [MM-20490] Migrate 'components/post_view/combined_user_activity_post' module and associated tests to TypeScript (mattermost#6632) MM-24810 Add e2e for reactions for archived channel posts (mattermost#6562) [MM-28965] - Prevent link overlap in channel header (mattermost#6546) MM-28780: Migrate dotMenu string refs to functional ones (mattermost#6592) Cypress/E2E: Fix archived channel specs (mattermost#6617) Fixed cypress env for PostgreSQL connection (mattermost#6627) Migrate post_list_row component to typescript (mattermost#6593) Cypress/E2E: Fix managing bot accounts spec (mattermost#6614) Cypress/E2E: Stabilize profile popover spec (mattermost#6612) Migrated string refs in signup_email (mattermost#6602) Renaming diagnostics-to-telemetry (mattermost#5741)
Fixes mattermost/mattermost#15465
JIRA: https://mattermost.atlassian.net/browse/MM-20476