Skip to content

Commit

Permalink
Fix/tsv csv (#1026)
Browse files Browse the repository at this point in the history
* Remove Netlify link from README

* Removed Facebook eventPrompt; Fixed typo in application submission; Added phone number field to account creation. (#1005)

Co-authored-by: Joshua Zhou <[email protected]>

* Fix/fixed phone number input (#1006)

* Removed Facebook eventPrompt; Fixed typo in application submission; Added phone number field to account creation.

* Initialize phone number as inputted value in sign up form so it doesn't default to 11111111111

---------

Co-authored-by: Joshua Zhou <[email protected]>

* MLH Form Changes (#1016)

* Updated level of study options to match MLH requirements

* #1000 - Update export from .tsv to .csv

* Changed hacker account form 'birthdate' field to 'age' #1003

* Added country of residence field to Other/Personal Details section of hacker application #1009

* Added country of residence field to the hacker application.

* add back CEGEP level of study.

---------

Co-authored-by: allennatang <[email protected]>

* Add 3rd checkbox to Terms and Conditions (#1012)

* Add 3rd checkbox to Terms and Conditions #1010

* MLH Form Changes (#1016)

* Updated level of study options to match MLH requirements

* #1000 - Update export from .tsv to .csv

* Changed hacker account form 'birthdate' field to 'age' #1003

* Added country of residence field to Other/Personal Details section of hacker application #1009

* Added country of residence field to the hacker application.

* add back CEGEP level of study.

---------

Co-authored-by: allennatang <[email protected]>

* Added Jamie's changes for MLH checkbox, fixed merge conflicts.

* fixed dumb rebase error

---------

Co-authored-by: Tavi Pollard <[email protected]>
Co-authored-by: allennatang <[email protected]>
Co-authored-by: Tavi Pollard <[email protected]>

* Clear the fields and add success message after sending account invite (#1008)

* change-mchacks12

* change-mchacks12

* Remove Netlify link from README

* Removed Facebook eventPrompt; Fixed typo in application submission; Added phone number field to account creation. (#1005)

Co-authored-by: Joshua Zhou <[email protected]>

* Fix/fixed phone number input (#1006)

* Removed Facebook eventPrompt; Fixed typo in application submission; Added phone number field to account creation.

* Initialize phone number as inputted value in sign up form so it doesn't default to 11111111111

---------

Co-authored-by: Joshua Zhou <[email protected]>

* add success message and reset fields after an invite is successfully sent

* MLH Form Changes (#1016)

* Updated level of study options to match MLH requirements

* #1000 - Update export from .tsv to .csv

* Changed hacker account form 'birthdate' field to 'age' #1003

* Added country of residence field to Other/Personal Details section of hacker application #1009

* Added country of residence field to the hacker application.

* add back CEGEP level of study.

---------

Co-authored-by: allennatang <[email protected]>

* Add 3rd checkbox to Terms and Conditions (#1012)

* Add 3rd checkbox to Terms and Conditions #1010

* MLH Form Changes (#1016)

* Updated level of study options to match MLH requirements

* #1000 - Update export from .tsv to .csv

* Changed hacker account form 'birthdate' field to 'age' #1003

* Added country of residence field to Other/Personal Details section of hacker application #1009

* Added country of residence field to the hacker application.

* add back CEGEP level of study.

---------

Co-authored-by: allennatang <[email protected]>

* Added Jamie's changes for MLH checkbox, fixed merge conflicts.

* fixed dumb rebase error

---------

Co-authored-by: Tavi Pollard <[email protected]>
Co-authored-by: allennatang <[email protected]>
Co-authored-by: Tavi Pollard <[email protected]>

* change-mchacks12

---------

Co-authored-by: Mika Vohl <[email protected]>
Co-authored-by: Joshua Zhou <[email protected]>
Co-authored-by: Joshua Zhou <[email protected]>
Co-authored-by: Tavi Pollard <[email protected]>
Co-authored-by: allennatang <[email protected]>
Co-authored-by: Tavi Pollard <[email protected]>

* Fix/update grad years (#1015)

* Add 3rd checkbox to Terms and Conditions #1010

* Update Grad Years in Filter

* MLH Form Changes (#1016)

* Updated level of study options to match MLH requirements

* #1000 - Update export from .tsv to .csv

* Changed hacker account form 'birthdate' field to 'age' #1003

* Added country of residence field to Other/Personal Details section of hacker application #1009

* Added country of residence field to the hacker application.

* add back CEGEP level of study.

---------

Co-authored-by: allennatang <[email protected]>

* Clear the fields and add success message after sending account invite (#1008)

* change-mchacks12

* change-mchacks12

* Remove Netlify link from README

* Removed Facebook eventPrompt; Fixed typo in application submission; Added phone number field to account creation. (#1005)

Co-authored-by: Joshua Zhou <[email protected]>

* Fix/fixed phone number input (#1006)

* Removed Facebook eventPrompt; Fixed typo in application submission; Added phone number field to account creation.

* Initialize phone number as inputted value in sign up form so it doesn't default to 11111111111

---------

Co-authored-by: Joshua Zhou <[email protected]>

* add success message and reset fields after an invite is successfully sent

* MLH Form Changes (#1016)

* Updated level of study options to match MLH requirements

* #1000 - Update export from .tsv to .csv

* Changed hacker account form 'birthdate' field to 'age' #1003

* Added country of residence field to Other/Personal Details section of hacker application #1009

* Added country of residence field to the hacker application.

* add back CEGEP level of study.

---------

Co-authored-by: allennatang <[email protected]>

* Add 3rd checkbox to Terms and Conditions (#1012)

* Add 3rd checkbox to Terms and Conditions #1010

* MLH Form Changes (#1016)

* Updated level of study options to match MLH requirements

* #1000 - Update export from .tsv to .csv

* Changed hacker account form 'birthdate' field to 'age' #1003

* Added country of residence field to Other/Personal Details section of hacker application #1009

* Added country of residence field to the hacker application.

* add back CEGEP level of study.

---------

Co-authored-by: allennatang <[email protected]>

* Added Jamie's changes for MLH checkbox, fixed merge conflicts.

* fixed dumb rebase error

---------

Co-authored-by: Tavi Pollard <[email protected]>
Co-authored-by: allennatang <[email protected]>
Co-authored-by: Tavi Pollard <[email protected]>

* change-mchacks12

---------

Co-authored-by: Mika Vohl <[email protected]>
Co-authored-by: Joshua Zhou <[email protected]>
Co-authored-by: Joshua Zhou <[email protected]>
Co-authored-by: Tavi Pollard <[email protected]>
Co-authored-by: allennatang <[email protected]>
Co-authored-by: Tavi Pollard <[email protected]>

---------

Co-authored-by: Tavi Pollard <[email protected]>
Co-authored-by: allennatang <[email protected]>
Co-authored-by: Mika Vohl <[email protected]>
Co-authored-by: Joshua Zhou <[email protected]>
Co-authored-by: Joshua Zhou <[email protected]>
Co-authored-by: Tavi Pollard <[email protected]>

* Accomodate intl phone numbers in account creation

* Changed conditional rendering for editing phone number in ManageAccountForm.tsx

* Updated hacker export by removing/commenting out fields that don't exist anymore, and adding new fields to match current account/application form.

* switch csv export to tsv to avoid input errors

* fixed the comma separation, changed to csv

---------

Co-authored-by: Mika Vohl <[email protected]>
Co-authored-by: Joshua Zhou <[email protected]>
Co-authored-by: Joshua Zhou <[email protected]>
Co-authored-by: Tavi Pollard <[email protected]>
Co-authored-by: Jamie Xiao <[email protected]>
Co-authored-by: Tavi Pollard <[email protected]>
  • Loading branch information
7 people authored Dec 7, 2024
1 parent 6a16472 commit 903210b
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/features/Search/Search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ class SearchContainer extends React.Component<{}, ISearchState> {
headers.forEach((header) => {
tempHeaders.push(header.label);
});
const csvData: string[] = [tempHeaders.join('\t')]; // actually in tsv format
const csvData: string[] = [tempHeaders.join(',')];
this.filter().forEach((result) => {
if (result.selected) {
const row: string[] = [];
Expand All @@ -289,15 +289,22 @@ class SearchContainer extends React.Component<{}, ISearchState> {
if (header.key.indexOf('.') >= 0) {
const nestedAttr = header.key.split('.');
value = getNestedAttr(result.hacker, nestedAttr);
if (/[,"\n]/.test(value)) {
value = `"${value.replace(/"/g, '""')}"`;
}
} else {
value = result.hacker[header.key];
if (/[,"\n]/.test(value)) {
value = `"${value.replace(/"/g, '""')}"`;
}
}
row.push(value);
});
csvData.push(row.join('\t'));
}
});
fileDownload(csvData.join('\n'), 'hackerData.tsv', 'text/tsv');

fileDownload(csvData.join('\n'), 'hackerData.csv', 'text/csv;charset=utf-8');
}

private async triggerSearch(): Promise<void> {
Expand Down

0 comments on commit 903210b

Please sign in to comment.