Skip to content
This repository has been archived by the owner on Mar 13, 2024. It is now read-only.

MM-20577 - Migrate 'components/admin_console/system_user_detail/team_list' module and associated tests to TypeScript #4747

Merged
merged 10 commits into from
Feb 17, 2020

Conversation

ikeohachidi
Copy link
Contributor

Summary

Migrate 'components/admin_console/system_user_detail/team_list' module and associated tests to TypeScript

Ticket Link

mattermost/mattermost#13495
https://mattermost.atlassian.net/browse/MM-20577

@ikeohachidi ikeohachidi changed the title migrate from javascript to typescript MM-20577 - Migrate 'components/admin_console/system_user_detail/team_list' module and associated tests to TypeScript Jan 27, 2020
@ikeohachidi ikeohachidi requested review from devinbinnie and removed request for devinbinnie January 27, 2020 02:21
@hanzei hanzei added 2: Dev Review Requires review by a core commiter 3: QA Review Requires review by a QA tester labels Jan 27, 2020
Copy link
Member

@devinbinnie devinbinnie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall, just a few changes :)

i18n/en.json Outdated
@@ -1533,12 +1533,6 @@
"admin.systemUserDetail.teamList.header.name": "Name",
"admin.systemUserDetail.teamList.header.role": "Role",
"admin.systemUserDetail.teamList.header.type": "Type",
"admin.systemUserDetail.teamList.teamRole.admin": "Team Admin",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These translations shouldn't be removed, team_row.tsx is still using them.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes i wanted to ask about this, leaving those makes the i18n-check fail, so i ran make i18n-extract and it removed that, so it honestly got a bit confusing.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, looks like our i18n-extract script isn't taking into account .tsx files...that's a problem.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So what should be the next line of action?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll make a fix to the tool and we'll go from there. Sorry for the delay!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ikeohachidi The fix should be in now. I've merged master into your branch for you, so all you need to do is pull in the latest changes, revert the en.json file and run make i18n-extract and things should be working.

@devinbinnie devinbinnie self-requested a review January 27, 2020 15:53
@srkgupta
Copy link
Contributor

@devinbinnie can you please list down the list of screens affected because of this migration. We will test those screens and ensure nothing is broken because of this change.

@devinbinnie
Copy link
Member

/update-branch

Copy link
Member

@devinbinnie devinbinnie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@devinbinnie can you please list down the list of screens affected because of this migration. We will test those screens and ensure nothing is broken because of this change.

@srkgupta On an Enterprise build, go to System Console > User Management > Users and click on any user to open their page. The Team Membership component of that screen is whats being converted here.

}

export default class TeamRow extends React.Component<Props, {}> {
private renderTeamType = (team: {[x: string]: string}): JSX.Element => {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@devinbinnie sorry to bother you, but i just came upon something. Removing the return type from this function doesn't cause the deleting problem from running make i18n-extract

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's odd, not sure why that is. Is it working now with the updated mmjstool regardless of the return type?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No it isn't.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay go ahead and remove the return type then. It shouldn't be needed anyway since it can be inferred.
We'll have to look into what i18n-extract is doing with respect to typescript files.
Thanks for investigating :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm done with it

@devinbinnie devinbinnie self-requested a review January 30, 2020 14:43
Copy link
Member

@devinbinnie devinbinnie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @ikeohachidi! This looks great :)

@srkgupta
Copy link
Contributor

srkgupta commented Feb 6, 2020

@ikeohachidi
Can you please resolve the merge conflict so that I can verify these changes on top of the latest master.

Conflicting files
components/admin_console/system_user_detail/team_list/team_list_dropdown.jsx

@ikeohachidi
Copy link
Contributor Author

@srkgupta i've done it.

Copy link
Contributor

@srkgupta srkgupta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested the changes locally and there were no issues found in the Team Membership section of User Configuration page. Approving the PR. New Testcases not required.

@srkgupta srkgupta removed the 3: QA Review Requires review by a QA tester label Feb 7, 2020
@ikeohachidi
Copy link
Contributor Author

@sudheerDev please review?

Copy link
Contributor

@sudheerDev sudheerDev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sudheerDev sudheerDev added 4: Reviews Complete All reviewers have approved the pull request and removed 2: Dev Review Requires review by a core commiter labels Feb 17, 2020
@sudheerDev sudheerDev merged commit 3299614 into mattermost:master Feb 17, 2020
@amyblais amyblais added Changelog/Not Needed Does not require a changelog entry Docs/Not Needed Does not require documentation labels Feb 17, 2020
@hanzei hanzei added this to the v5.22.0 milestone Mar 29, 2020
sowmiyamuthuraman pushed a commit to sowmiyamuthuraman/mattermost-webapp that referenced this pull request Apr 10, 2020
…list' module and associated tests to TypeScript (mattermost#4747)

* migrate from javascript to typescript

* migrate snapshot to typescript

* fix types

* just ran i18n extract

* change return type

* Revert "just ran i18n extract"

This reverts commit b38c5e3.

* remove function return type

Co-authored-by: mattermod <[email protected]>
@ikeohachidi ikeohachidi deleted the MM-20577 branch May 16, 2020 15:13
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
4: Reviews Complete All reviewers have approved the pull request Changelog/Not Needed Does not require a changelog entry Docs/Not Needed Does not require documentation QA Review Done
Projects
None yet
7 participants