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

Migrate table #1834

Merged
merged 11 commits into from
Oct 17, 2023
Merged

Migrate table #1834

merged 11 commits into from
Oct 17, 2023

Conversation

kenk2
Copy link
Contributor

@kenk2 kenk2 commented Oct 13, 2023

Summary

What was changed:
Migrate New Terra Table to Framework from feature branch in Terra Core.

Why it was changed:
We want the Terra Table package to live inside Terra Framework as it will be consumed by Data Grid.

Testing

This change was tested using:

  • WDIO
  • Jest
  • Visual testing (please attach a screenshot or recording)
  • Other (please describe below)
  • No tests are needed

Reviews

In addition to engineering reviews, this PR needs:

  • UX review
  • Accessibility review
  • Functional review

Additional Details

This PR resolves:

UXPLATFORM-9540


Thank you for contributing to Terra.
@cerner/terra

@kenk2 kenk2 self-assigned this Oct 13, 2023
@kenk2 kenk2 marked this pull request as ready for review October 13, 2023 21:56
@kenk2 kenk2 requested a review from a team October 13, 2023 21:56
"keycode-js": "^3.1.0",
"prop-types": "^15.5.8",
"resize-observer-polyfill": "^1.4.1",
"terra-content-container": "^3.39.1",
Copy link
Contributor

Choose a reason for hiding this comment

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

We are not using a Terra ContentContainer component in the Terra Table project that I can see.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed.

"resize-observer-polyfill": "^1.4.1",
"terra-content-container": "^3.39.1",
"terra-icon": "^3.54.0",
"terra-mixins": "^1.40.0",
Copy link
Contributor

Choose a reason for hiding this comment

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

Are we using terra-mixins in this project? If not, it should not be a dependency.

"name": "terra-table",
"main": "lib/index.js",
"version": "4.36.0",
"description": "The terra-table component provides user a way to render selectable data in a tabular format",
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think that the description should mention selectable data since this is the Table component. That would be the purpose of a grid not a table.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated the description.

{
"name": "terra-table",
"main": "lib/index.js",
"version": "4.36.0",
Copy link
Contributor

Choose a reason for hiding this comment

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

I thought we were doing a major version bump with this update.

Copy link
Contributor

Choose a reason for hiding this comment

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

This will be automatically updated once we do the release.

"name": "terra-table",
"main": "lib/index.js",
"version": "4.36.0",
"description": "The terra-table component provides user a way to render selectable data in a tabular format",
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be "The Terra Table component ..."

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated the description.

"Table",
"UI"
],
"author": "Cerner Corporation",
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be Oracle instead of Cerner?

Copy link
Contributor

Choose a reason for hiding this comment

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

We haven't been given guidance on changing this but if this needs to be changed, we can probably go ahead do it and and update the rest of the packages in a separate PR.

"react-intl": "2 || 3 || 4 || 5"
},
"dependencies": {
"@cerner/terra-docs": "^1.9.0",
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't believe that terra-docs should be a dependency. At most it is a devDependency, if needed.

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think it should be needed at all.

Comment on lines +39 to +40
"terra-theme-context": "^1.0.0",
"terra-visually-hidden-text": "^2.36.0"
Copy link
Contributor

Choose a reason for hiding this comment

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

Should our Terra components be peer and dev dependencies?

Copy link
Contributor Author

@kenk2 kenk2 Oct 16, 2023

Choose a reason for hiding this comment

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

I think for now since this is used directly in Cell.jsx (until we remove the cell dive logic) that we should probably keep this as a dependency. Once the Cell Dive logic is removed we could probably remove this package altogether.

Copy link
Contributor

Choose a reason for hiding this comment

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

Is this the correct changelog? We won't have this release history in this repository, correct?

Copy link
Contributor

Choose a reason for hiding this comment

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

It will still point to the same package on NPM, so the version history is still valid for the doc site and npm page.

@@ -0,0 +1,13 @@
Copyright 2017 - 2019 Cerner Innovation, Inc.
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this correct now that we are Oracle?

Copy link
Contributor

Choose a reason for hiding this comment

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

We should update the year at least.

Copy link
Contributor

Choose a reason for hiding this comment

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

You can use depcheck to find and remove unused dependencies.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.


## Table Props

<TablePropsTable />
Copy link
Contributor

Choose a reason for hiding this comment

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

Your examples should not have the property table for the Terra Table or its dependencies. That would be part of the main About document.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed from all examples.

@cm9361
Copy link
Contributor

cm9361 commented Oct 15, 2023

You should have a separate example for the Default Terra Table based on similar component strategies.

it('Validates the default table is not interactable', () => {
browser.url('/raw/tests/cerner-terra-framework-docs/table/no-interaction-table');
browser.keys(['Tab']);
$('#focused-button').isFocused();
Copy link
Contributor

Choose a reason for hiding this comment

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

You should be doing an expect on this, right? This code does not actually validate that this button is focused.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

…r default table. Remove obsolete packages. Fix wdio test.
@kenk2 kenk2 requested a review from cm9361 October 16, 2023 15:44
@chrismichalewicz
Copy link

@kenk2 It was hard to fully verify this for accessibility and functionally based on how early in the development of Table we are. Functionally with what was there looked good, my only issue was not being able to scroll the examples via keyboard that as you mentioned that is addressed via UXPLATFORM-9729.

I feel like it's too early to fully perform accessibility test so I went ahead removed those labels. I did try testing it with Jaws. One issue I will call out that I encountered is the values of each cell are being communicated as 1 value rather than 3 values. For example, the Default Table example the Heart Rate Monitor row has values 68, 66, and 67 the screen reader will read it as 686,667. If you think this is unexpected at this point and we can explore how best to account for this, whether it's a part of this story or I create a new story specifically to get the AT stuff ironed out.

@kenk2
Copy link
Contributor Author

kenk2 commented Oct 16, 2023

@chrismichalewicz I think for now given how early everything is, we can create another story to get the screen reader functionality up to par.

@cm9361
Copy link
Contributor

cm9361 commented Oct 16, 2023

@chrismichalewicz I think for now given how early everything is, we can create another story to get the screen reader functionality up to par.

I would not expect the screen reader to be off in the initial release. We don't have this issue in the DataGrid, right?

@chrismichalewicz
Copy link

@kenk2 @cm9361 I retested this morning with Jaws in Edge and am not able to recreate what I was seeing yesterday. Each individual cell value is being read individually now as I would expect. This is working the same in Data Grid as well.


# Terra Table

Terra Table is a structural component used to create data tables. Table provides means to handle row selection and hooks for sortable columns.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Terra Table is a structural component used to create data tables. Table provides means to handle row selection and hooks for sortable columns.
Terra Table is a structural component used to display tabular data. Table provides means to handle row selection and hooks for sortable columns.

{ content: '' },
{ content: 'Quinzell, Harleen' },
{ content: '' },
{ isMasked: true },
Copy link
Contributor

Choose a reason for hiding this comment

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

Table examples shouldn't include masked cells. That feature should only be advertised for Worklist Data Grid unless a need for masking in ordinary tables is established.

{ id: 'Column-7', displayName: 'Patient Age' },
{ id: 'Column-8', displayName: 'Medication History' },
{ id: 'Column-9', displayName: 'My Relationship' },
{ id: 'Column-10', displayName: 'Not Selectable' },
Copy link
Contributor

Choose a reason for hiding this comment

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

Selectable/Not selectable isn't a feature of table and shouldn't be in the examples. I know this data is likely to change anyway to reflect typical use for a table, but better to catch this early.

Comment on lines +97 to +98
isSelectable: false,
isMasked: false,
Copy link
Contributor

Choose a reason for hiding this comment

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

Not needed

Copy link
Contributor

Choose a reason for hiding this comment

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

Why would consumers not be able to mask a cell for a Terra Table? That should not break any accessibility, right?

Comment on lines +54 to +67
/**
* Boolean indicating if cell contents are masked.
*/
isMasked: PropTypes.bool,

/**
* Boolean value indicating whether or not the column header is selectable.
*/
isSelectable: PropTypes.bool,

/**
* Boolean indicating whether the Cell is currently selected.
*/
isSelected: PropTypes.bool,
Copy link
Contributor

Choose a reason for hiding this comment

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

Not needed

Copy link
Contributor

Choose a reason for hiding this comment

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

We need this prop for grid support. The subcomponents are reused.

Comment on lines 11 to 19
isMasked: PropTypes.bool,
/**
* Boolean value indicating whether or not the column header is selectable.
*/
isSelectable: PropTypes.bool,
/**
* Boolean value indicating whether or not the cell should render as selected.
*/
isSelected: PropTypes.bool,
Copy link
Contributor

Choose a reason for hiding this comment

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

Not needed

Copy link
Contributor

Choose a reason for hiding this comment

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

This will be needed because it is reused by the grid components. However, we do not have to publicize in the Table API documentation.

@eawww
Copy link
Contributor

eawww commented Oct 17, 2023

@cm9361 I've advised @kenk2 that mentions of API features like Cell Selection and Masking shouldn't appear in the documentation for Terra Table, even if they're needed for components that consume it. That might include making props private.

@cm9361
Copy link
Contributor

cm9361 commented Oct 17, 2023

@cm9361 I've advised @kenk2 that mentions of API features like Cell Selection and Masking shouldn't appear in the documentation for Terra Table, even if they're needed for components that consume it. That might include making props private.

I agree with this statement. "onCellSelect" should not be part of the "public API". I am not certain removing masked cells is necessary though. If a team desires to use it for some reason, it would still be accessible.

…table examples. Private grid-only props in cell shape.
@github-actions github-actions bot temporarily deployed to preview-pr-1834 October 17, 2023 20:46 Destroyed
@kenk2 kenk2 merged commit 8b84401 into main Oct 17, 2023
21 checks passed
@kenk2 kenk2 deleted the migrate-table branch October 17, 2023 21:03
@sdadn sdadn added ⭐ UX Reviewed UX Reviewed and approved. Major Version Bump This issue requires a major version bump to the associated packages and removed UX Review Required labels Oct 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Major Version Bump This issue requires a major version bump to the associated packages 📦 terra-table ⭐ Functionally Reviewed ⭐ UX Reviewed UX Reviewed and approved.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants