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

upcoming: [M3-9006] - Update Table Component with Design Tokens #11461

Conversation

hasyed-akamai
Copy link
Contributor

@hasyed-akamai hasyed-akamai commented Dec 26, 2024

Description 📝

  • Use design tokens to update table styles at the theme level.
  • Ensure nested tables are handled appropriately with table design token variants.
  • Ensure hover states are updated for tables.
  • Removed a lot of styled components with one-off table styles

Major Changes

  • Added zebra striping for most tables with large data
    • ❗ This is a preference setting that can be toggled
    • This works for nested tables such as VPC (nested tables don't have striping)
  • Added hover background color to tables rows
  • There's now a selected state for plans table

Target release date 🗓️

1/14 ⚠️

Preview 📷

Before After
Before After
Screenshot 2024-12-27 at 2 24 01 PM Screenshot 2024-12-27 at 2 23 35 PM
Screenshot 2024-12-27 at 2 05 21 PMScreenshot 2024-12-27 at 2 05 31 PM Screenshot 2024-12-27 at 2 05 41 PMScreenshot 2024-12-27 at 2 13 07 PM
Screenshot 2024-12-30 at 9 34 13 PM

How to test 🧪

Verification steps

  • Check that table styles are updated with design tokens at the theme level.
  • Check nested tables for correct styling with table token variants.
  • Check hover states on table rows are working as expected.
  • Check tables with Pagination component

As an Author I have considered 🤔

Check all that apply

  • 👀 Doing a self review
  • ❔ Our contribution guidelines
  • 🤏 Splitting feature into small PRs
  • ➕ Adding a changeset
  • 🧪 Providing/Improving test coverage
  • 🔐 Removing all sensitive information from the code and PR description
  • 🚩 Using a feature flag to protect the release
  • 👣 Providing comprehensive reproduction steps
  • 📑 Providing or updating our documentation
  • 🕛 Scheduling a pair reviewing session
  • 📱 Providing mobile support
  • ♿ Providing accessibility support

@hasyed-akamai hasyed-akamai added the Design Tokens Laying the groundwork for Design Tokens label Dec 26, 2024
@hasyed-akamai hasyed-akamai self-assigned this Dec 26, 2024
</StyledTableBody>
</StyledTable>
</TableBody>
</Table>
</StyledContainer>
)}
<StyledCanvasContainer>
Copy link
Contributor

Choose a reason for hiding this comment

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

LineGraph which is a deprecated component used in Longview is much cleaner... pretty much all deletions. Test via yarn storybook and search for LineGraph unless you have actual Longview data.

@@ -15,6 +17,7 @@ export interface PaginationProps {
page: number;
pageSize: number;
showAll?: boolean;
sx?: SxProps;
Copy link
Contributor

Choose a reason for hiding this comment

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

Added sx since the Pagination component departs from typical design for filter by tags, and list/grid views. Essentially used to remove the borders.

* Optional boolean to remove the border from the table
* @default false
*/
noBorder?: boolean;
Copy link
Contributor

Choose a reason for hiding this comment

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

Got rid of noBorder for tables. This can be handled via sx and we should rarely depart from our new table styles to keep things clean.

* parent column will either be the name of the column this
* TableCell is listed under
*/
parentColumn?: string;
Copy link
Contributor

Choose a reason for hiding this comment

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

parentColumn seemed like a pretty useless prop to me. Maybe I'm missing something but it looks like it was just used for identifying table cells easier?

paddingRight: actionCell ? 0 : '',
textAlign: actionCell ? 'right' : center ? 'center' : '',
textTransform: statusCell ? 'capitalize' : '',
whiteSpace: noWrap ? 'nowrap' : '',
Copy link
Contributor

Choose a reason for hiding this comment

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

Narrowed classes down to essentials via sx

@@ -77,7 +79,7 @@ export const ImageRow = (props: Props) => {
};

return (
<TableRow data-qa-image-cell={id} key={id}>
<TableRow data-qa-image-cell={id} hover={hover} key={id}>
Copy link
Contributor

Choose a reason for hiding this comment

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

Added hover background transitions to tables, we need to do this is more places.

>
<GridView />
</StyledToggleButton>
</IconButton>
Copy link
Contributor

Choose a reason for hiding this comment

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

Converted both the List View and Tag View to IconButton. Allowed me to remove lots of styles and simplify this.

':hover': {
color: theme.tokens.color.Brand[60],
},
color: theme.tokens.table.HeaderFilled.Icon,
Copy link
Contributor

Choose a reason for hiding this comment

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

Using table tokens because it's in a table header

display="flex"
gap={3}
justifyContent="flex-end"
paddingRight={1.5}
Copy link
Contributor

Choose a reason for hiding this comment

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

This allowed me to get pretty close (design-wise) when swapping views

export interface FolderTableRowProps extends TableRowProps {
displayName: string;
folderName: string;
handleClickDelete: (objectName: string) => void;
manuallyCreated: boolean;
Copy link
Contributor

Choose a reason for hiding this comment

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

This seemed to be a really old prop that doesn't appear to be in use anymore. I looked through the history and it appears this was used to add a fill to the EntityIcon. Most the time it was missing or just set to false.

_shouldDisplayObject: boolean;
}

export const extendObject = (
object: ObjectStorageObject,
prefix: string,
manuallyCreated = false
Copy link
Contributor

Choose a reason for hiding this comment

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

See comment above about manuallyCreated

<Hidden lgDown>
<StyledTableDataCell />
</Hidden>
)}
Copy link
Contributor

Choose a reason for hiding this comment

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

This was used only in Longview, it's the little arrow next to the selected row. If we decide to keep this, it just adds more logic for a deprecated product since it utilizes the selected prop we want to use elsewhere.

sx={{
border: 0,
width: '100%',
}}
Copy link
Contributor

@jaalah-akamai jaalah-akamai Dec 27, 2024

Choose a reason for hiding this comment

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

Unlike standard table layouts where the Pagination component follows the Table, invoices require totals to be embedded within the table structure itself.

@jaalah-akamai jaalah-akamai marked this pull request as ready for review December 30, 2024 16:22
@jaalah-akamai jaalah-akamai requested a review from a team as a code owner December 30, 2024 16:22
@jaalah-akamai jaalah-akamai requested review from bnussman-akamai, carrillo-erik, abailly-akamai, mjac0bs and hana-akamai and removed request for a team December 30, 2024 16:22
@jaalah-akamai jaalah-akamai requested a review from a team as a code owner December 30, 2024 22:19
@jaalah-akamai jaalah-akamai requested review from jdamore-linode and removed request for a team December 30, 2024 22:19
Copy link

github-actions bot commented Dec 30, 2024

Coverage Report:
Base Coverage: 86.94%
Current Coverage: 86.9%

…ithub.com:hasyed-akamai/manager into M3-9006-update-table-component-with-design-tokens
@linode-gh-bot
Copy link
Collaborator

Cloud Manager UI test results

🔺 1 failing test on test run #15 ↗︎

❌ Failing✅ Passing↪️ Skipped🕐 Duration
1 Failing468 Passing2 Skipped117m 24s

Details

Failing Tests
SpecTest
smoke-linode-landing-table.spec.tslinode landing checks » checks the landing page side menu items

Troubleshooting

Use this command to re-run the failing tests:

yarn cy:run -s "cypress/e2e/core/linodes/smoke-linode-landing-table.spec.ts"

@jaalah-akamai jaalah-akamai merged commit b7a8e87 into linode:cds-redesign-2025 Dec 31, 2024
7 of 11 checks passed
@jaalah-akamai jaalah-akamai mentioned this pull request Dec 31, 2024
4 tasks
abailly-akamai added a commit that referenced this pull request Feb 6, 2025
* upcoming: [M3-9001] - Footer Update (#11446)

* upcoming: [M3-9002] - Footer Update

* global tokens formatting

* fix

* left align for desktop - center for mobile

---------

Co-authored-by: Jaalah Ramos <jaalah.ramos@gmail.com>

* Adjust dev tools icon to the right

* UX Request: Reduce spacing between footer items

* upcoming: [M3-8982] - Update Left Navigation  (#11463)

* upcoming: [M3-9002] - Left Navigation Update

* removed akamai color logo

* updated pin icon tooltip text

* upcoming: [M3-8982] - Update Left Navigation

* updated theme file's format

* updated standby values

* corrected badge width and fixed colors for product family

* Revert "corrected badge width and fixed colors for product family"

This reverts commit 6fcb80b.

* Fix font styles for side nav, adjust spacing, revert active states

* Update product family icons

* integrated footer updates and updated icon's svg colors to be dynamic

* Fix borders for mobile

---------

Co-authored-by: Jaalah Ramos <jaalah.ramos@gmail.com>

* upcoming: [M3-9006] - Update Table Component with Design Tokens (#11461)

* upcoming: [9006] - Update Table Component with Design Tokens

* Change unit tests for `CollapsibleRow` component

* Complete table overhaul

* Second pass through tables

* Update linode groups

* Cleanup

* Add hover background transitions to tables - `Part1`

* Add zebra striping and selected states

* Add selected state for plan table

* Fix dark mode styles

* Add hover background transitions to tables - `Part2`

* Add hover background transitions to tables - `Part3`

* Revert "Add hover background transitions to tables - `Part3`"

This reverts commit bffeef5.

* Revert "Add hover background transitions to tables - `Part2`"

This reverts commit 0ecfc55.

* Revert "Add hover background transitions to tables - `Part1`"

This reverts commit 8f87cb6.

* Make hover the default for TableRow

* Add table striping as a setting preference

* Add border to table attachment headers

---------

Co-authored-by: Jaalah Ramos <jaalah.ramos@gmail.com>
Co-authored-by: Jaalah Ramos <125309814+jaalah-akamai@users.noreply.github.com>

* upcoming: [M3-9002] - Replace hamburger icon in left navigation (#11462)

* upcoming: [M3-9002] - Left Navigation Update

* removed akamai color logo

* updated pin icon tooltip text

* Fix table focus state and global header background

* Update logo color

* Revert logo change

---------

Co-authored-by: Jaalah Ramos <jaalah.ramos@gmail.com>

* [CDS Updates] - Handle cds sticky sidebar (#11479)

* Handle dynamic sidebar

* SideMenu temp fonts

* Toggler

* Toggler

* better handling

* better util

* cleanup

* cleanup

* icon fix

* remove chips and improve preference managing (#11492)

* Simplify footer/toggle

* change: [M3-9003] – CDS: Restructure Top Menu Design with Akamai Logo and CDS Compass Updates (#11452)

* Initial changes: top menu spans full width of app, logo moved to top menu, rearrangement of top menu elements, reordering of components in MainConent.tsx & Root.tsx, addition of new icons for top menu

* Update icon svg's; match mockups more closely and fix colors; implement hamburger icon in tablet/mobile view when side menu disappears; implement company name truncation

* Adjust import path

* Update MuiButton padding, remove minWidth on buttons; use GlobalHeader tokens; fix icon and text colors for Search bar; use chevron icons for KeyboardArrowUp & KeyboardArrowDown (color still needs adjusting)

* Remove sx prop from CreateMenu button

* Fix KeyboardArrowUp and KeyboardArrowDown color in UserMenu.tsx

* MaxWidth initial

* Remove search bar border on hover

* Stop container holding x button in search bar from spilling outside of the bar

* Reduce zIndex of <Box /> wrapping <SideMenu /> to prevent the side menu from covering up the search dropdown

* Mock preference in PrimaryNav.test.tsx so items are expanded by default to prevent failures

* Saving...

* Saving...

* Saving...

* Final cleanup of top menu

* Cleanup UserMenu

* Remove commented code

* Fix TS errors

---------

Co-authored-by: Dajahi Wiley <dwiley@linode.com>
Co-authored-by: Jaalah Ramos <jaalah.ramos@gmail.com>
Co-authored-by: Jaalah Ramos <125309814+jaalah-akamai@users.noreply.github.com>

* new sidebar styles

* responsiveness adjustments

* Remove parentColumn - No longer need

* chore: [M3-9054] - CDS: Update all the fonts (#11517)

* Initial commit: all the font things

* smooth it all

* side nav and some captions

* small changes

* more instances

* more instances and linting rules + defensive props

* ubuntu no longer

* Update the footer and add hover to product families

* Update fonts from fontsource; Hide logo for mobile < 430

* Add yarn lock

* Fix the bolding of the active link

* Use theme for tokens

* cleanup and fixes

* moar cleanup and fixes

* fix test & linting errors

* update snapshots

* fix the e2e

* small style adjustments

* Revert "fix the e2e"

This reverts commit 35ba8aa.

* fix: [M3-9124] - Link styles in KubernetesClusterRow and clean up one-off styles  (#11523)

Cleans up one-off styles in KubernetesClusterRow
Uses Link from src/components/Link rather than react-router-dom directly so that colors are correct
In dark mode, the raw react-router-dom link is too dark


Co-authored-by: Banks Nussman <banks@nussman.us>

* CDS Feedback & Review Fixes

* Footer & Notification Updates

* Updates to Search, Search Menu, Accordion Icons

* Algolia Search

* Fix pin border issue

* Badge Padding, Pin Toggle Adjustments

* Small styling fixes

* fix beta chip getting cut off

* top nav responsiveness adjustments and fixes

* dark mode table label link and padding fixes

* refactor: [M3-8801] - Remove Individual Product Entity Icons (#11537)

* refactor: [M3-8801] - Remove unused product icons and rename remaining SVG files to reflect product families

* Replace EntityIcons with Product Family Icon and Update EntityIcon Story Accordingly

* Added changeset: Remove Individual Product Entity Icons and Update Story Accordingly

* Fix failed unit test cases

* fix in-progress chip border radius

* more dark mode table fixes

* side nav refinements

* update warning icon and notice component accordingly

* default akamai accounts to blue

* Update table header color

* Finishing Touches

* Fix issue with mobile visibility for search bar

* Increase product icons in nav and search menu, adjust top menu spacing, search placeholder italicized

* Padding around search

* Update our primary nav headings

* Update search final

* Fix issue with product names disappearing

* Prevent icon from shrinking when names are two lines, add padding

* Convert product icon to span

* fix lke-update.spec.ts

* fix unit fail

* fix remainning e2e tests- thx @jdamore-linode

---------

Co-authored-by: Harsh Shankar Rao <hrao@akamai.com>
Co-authored-by: Jaalah Ramos <jaalah.ramos@gmail.com>
Co-authored-by: hasyed-akamai <hasyed@akamai.com>
Co-authored-by: Alban Bailly <130582365+abailly-akamai@users.noreply.github.com>
Co-authored-by: Alban Bailly <abailly@akamai.com>
Co-authored-by: Dajahi Wiley <114682940+dwiley-akamai@users.noreply.github.com>
Co-authored-by: Dajahi Wiley <dwiley@linode.com>
Co-authored-by: Banks Nussman <115251059+bnussman-akamai@users.noreply.github.com>
Co-authored-by: Banks Nussman <banks@nussman.us>
Co-authored-by: Hana Xu <hxu@akamai.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Design Tokens Laying the groundwork for Design Tokens Ready for Review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants