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

[Resolve Errors] [Review Warnings] Tables - Long character sets handling #461

Closed
shindigira opened this issue May 7, 2024 · 0 comments · Fixed by #521
Closed

[Resolve Errors] [Review Warnings] Tables - Long character sets handling #461

shindigira opened this issue May 7, 2024 · 0 comments · Fixed by #521
Labels
enhancement New feature or request

Comments

@shindigira
Copy link
Contributor

  • UUID's can be 45 characters
  • Certain errors can be 300 characters

Address by using word-break

@shindigira shindigira added the enhancement New feature or request label May 7, 2024
@shindigira shindigira changed the title Tables - Long character sets handling [Resolve Errors] [Review Warnings] Tables - Long character sets handling May 14, 2024
shindigira added a commit that referenced this issue May 21, 2024
closes #461 

Handles long character sets such as UUID

## Note
- `yarn install` to install the latest DSR update

## Changes
- feat(Table): selective cell word wrapping

## How to test
- In `FieldEntry.js`, replace the `columns` value with below to generate
long character set example:
```js
  const columns = [
    {
      header: 'Row',
      cellDisableWordWrap: true,
      headerWordWrap: false,
    },
    { header: 'Unique identifier (uid)', cellWordBreak: true },
    ...additionalColumnHeaders.map(headerName => ({
      header: headerName,
      cellWordBreak: true,
    })),
  ];
  const rows = fieldObject.records.map(object => {
    // eslint-disable-next-line unicorn/no-array-reduce
    const fieldValues = object.fields.reduce(
      (accumulator: Field['name'][], fieldsObject) => [
        ...accumulator,
        '4234000O91BZ2SUPERCALIFRAGILISTICEXPIALI45CHARS4234000O91BZ2SUPERCALIFRAGILISTICEXPIALI45CHARS',
      ],
      [],
    );
    return [object.record_no + 10_000_000, object.uid, ...fieldValues];
  });
```

## Screenshot
<img width="600" alt="Screenshot 2024-05-16 at 1 59 15 PM"
src="https://github.com/cfpb/sbl-frontend/assets/13324863/d6d3f23f-dd94-4ee2-ad28-ac2418642570">
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant