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

Feature/#226 create table rich component #245

Merged
merged 5 commits into from
Aug 21, 2024

Conversation

oleojake
Copy link
Collaborator

First implement only header and rows (no column size calc).

@oleojake oleojake requested a review from brauliodiez August 21, 2024 10:20
const headerRow = rows[0].split(',').map(header => header.trim());
const dataRows = rows
.slice(1, rows.length)
.map(row => row.split(',').map(cell => cell.trim()));
Copy link
Member

@brauliodiez brauliodiez Aug 21, 2024

Choose a reason for hiding this comment

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

Let's create a table.business.ts file and move this functionallity to simple functions that can be unit tested (and let's add some defensive code), e.g. a given user can enter text with blank content or just one row.

./table.business.ts

export const parseCSVRowsIntoArray = (csvContent : string) : string[]=> {
}

export const extractHeaderColumn = (row : string) => string[] => {
}

export const extractDataRows = (rows : string[]) => string[][] => {
}

@brauliodiez brauliodiez merged commit 3ab41d3 into main Aug 21, 2024
1 check passed
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.

2 participants