Skip to content
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

[FIX] Issues on selecting users when importing CSV #24253

Merged
merged 15 commits into from
Feb 8, 2022

Conversation

guijun13
Copy link
Contributor

@guijun13 guijun13 commented Jan 21, 2022

Proposed changes (including videos or screenshots)

  • Fix users selecting by fixing their _id
  • Add condition to disable 'Start importing' button if usersCount, channelsCount and messageCount equals 0, or if messageCount is alone
  • Remove disabled={usersCount === 0} on user Tab

Steps to test or reproduce

For user selection error fix:

  1. Create a CSV file (e.g. users.csv) with the following content:
bradley.hilton,bradley.hilton@example.com,Bradley Hilton
billy.bob, billy.bob@example.com, Billy Bob Jr.
graywolf336,graywolf336@example.com,GrayWolf336
  1. Create a ZIP file containing only the CSV file you created in the previous step;

  2. Go to Administration > Import > Import New File, then choose CSV as the Import Type and upload the ZIP file from your computer;

  3. Click on Import. Expected behavior: 3 users should be displayed with all the info given in the CSV file.

  4. Click on Start Importing. Expected behavior: all 3 users should be successfully imported with their corresponding real names (what can be checked in Administration > Users);

  5. Delete the 3 users and repeat this process using a CSV with a single user. No error should be displayed in the whole process.

For disabled 'Start Importing' button:

  1. Repeat steps 1 to 4 on the previous task.
  2. Unselect all 3 users. Expected behavior: the 'Start Importing' button should be unable to click. Can also test with channels.
  3. If the import .zip file contains messages, 'Start Importing' button should only be disabled when there were not any user or channel import in the same import file.

For removed disabled={usersCount === 0} on user Tab:

  1. Create a CSV file (e.g. users.csv) with the following content:
bradley.hilton,bradley.hilton@example.com,Bradley Hilton
billy.bob, billy.bob@example.com, Billy Bob Jr.
graywolf336,graywolf336@example.com,GrayWolf336
  1. Create a CSV file (e.g. channels.csv) with the following content:
"general","bradley.hilton","public",""
"otherChannelName","billy.bob","public",""
"random","bradley.hilton","public","billy.bob;graywolf336"
"privateArea","bradley.hilton","private","graywolf336"
  1. Create a ZIP file containing both CSVs file you created (users.csv and channels.csv) in the previous step;

  2. Go to Administration > Import > Import New File, then choose CSV as the Import Type and upload the ZIP file from your computer;

  3. Click on Import. Expected behavior: 3 users and 4 channels should be displayed with all the info given in the CSV file (in different tabs);

  4. Unselect all users. Expect behavior: the 'users' tab should not be disabled.

Further comments

May fix #23772 issue

@CLAassistant
Copy link

CLAassistant commented Jan 21, 2022

CLA assistant check
All committers have signed the CLA.

@tassoevan tassoevan requested a review from a team January 26, 2022 15:02
@tassoevan tassoevan changed the base branch from develop to master January 26, 2022 15:45
@tassoevan tassoevan changed the base branch from master to develop January 26, 2022 15:46
remove u, c, m from respective convert function
@pierre-lehnen-rc pierre-lehnen-rc merged commit 8fdde19 into RocketChat:develop Feb 8, 2022
@pierre-lehnen-rc pierre-lehnen-rc mentioned this pull request Mar 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CSV import of users is failing
5 participants