Skip to content

Conversation

@priley86
Copy link
Contributor

@priley86 priley86 commented Jul 11, 2019

start detail table conversion in #1986 for all detail tables in Cluster Settings.

  • split out detail table into a new component. Virtualized table "@patternfly/react-virtualized-extension" and "@patternfly/react-table" have different APIs due to the nature of virtualized table body. Their row definitions are different, as well as the expected markup/jsx. Also, checking virtualized everywhere in the current Table abstraction just seems wrong. This was never my original intent... had previously called the rows Vr and Vd (virtual row), but I still think this component should be split out into two components.

Table:
https://patternfly-react.surge.sh/patternfly-4/components/table/
Virtual Table:
https://patternfly-react.surge.sh/patternfly-4/virtual%20scroll/virtualized/

cc: @TheRealJon @jcaianirh @spadgett

also, filed 2045 upstream in pf-next today. Currently, the CSS is here in overrides for this. Fixed by rescoping the following styles to virtualized tables only:

.pf-c-table.pf-c-virtualized tbody > tr > :first-child::before {
  content: none;
  width: 0 !important;
}

Codepen: https://codepen.io/priley86-the-sans/pen/JQgNrW

@openshift-ci-robot openshift-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Jul 11, 2019
@openshift-ci-robot openshift-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 14, 2019
@priley86 priley86 force-pushed the cluster-settings-table branch from f1001e1 to 36f8c30 Compare July 15, 2019 15:04
@openshift-ci-robot openshift-ci-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Jul 15, 2019
@priley86 priley86 changed the title feat(detail-table): start detail table conversion, cluster settings feat(virtual-table): split virtualized table, cluster settings table Jul 15, 2019
@priley86 priley86 marked this pull request as ready for review July 15, 2019 15:09
@openshift-ci-robot openshift-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 15, 2019
@priley86
Copy link
Contributor Author

updated... @spadgett PTAL

@spadgett
Copy link
Member

cc @christianvogt @vojtechszocs

Copy link
Member

Choose a reason for hiding this comment

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

Again this is probably OK, although this table wasn't virtualized before.

Copy link
Member

Choose a reason for hiding this comment

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

This table was also not virtualized previously, but probably OK.

cc @jtomasek

Copy link
Member

Choose a reason for hiding this comment

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

@dtaylor113 Let me know if you think this might be a problem as this table wasn't virtualized before

Copy link
Contributor

Choose a reason for hiding this comment

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

This is a standard list view so probably ok.

Copy link
Member

Choose a reason for hiding this comment

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

Are these table columns all equal width? How does that look? Is there a way to specify different widths?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this should currently match the default pf4 table behavior (w/ any CSS overrides we have for pf-c-table). I am not explicitly overriding column widths for Table at the moment though, so the default pf4 responsive behavior would apply.

https://pf4.patternfly.org/components/Table/examples/
https://pf4.patternfly.org/components/Table/examples-full/?component=Simple%20table

Copy link
Member

Choose a reason for hiding this comment

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

this should currently match the default pf4 table behavior (w/ any CSS overrides we have for pf-c-table).

So equal width columns? We might look at this since many of our tables have columns with data significantly wider than other columns. Nodes page comes to mind (image name and size).

Copy link
Contributor Author

@priley86 priley86 Jul 16, 2019

Choose a reason for hiding this comment

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

Please see the "Table w/ width modifiers" example:
https://pf4.patternfly.org/components/Table/examples/

.pf-m-width-[10, 15, 20, 25, 30, 35, 40, 45, 50, 60, 70, 80, or 90], that is the default functionality for PF4 table width modifiers at the moment.

The existing Bootstrap column width modifiers you have should also work similarly to PF's .pf-u-w-25{-on-[breakpoint]} modifiers, however I don't think you'd want to use mobile modifiers now that we are stacking here and using the default PF4 mobile behavior.
https://pf4.patternfly.org/utilities/Sizing/examples/ (we did not load these since they do the same thing as Bootstrap though)

We should probably file anything upstream in PF if we determine something else is needed on this.

Copy link
Contributor Author

@priley86 priley86 Jul 16, 2019

Choose a reason for hiding this comment

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

so we could pass:

{ title: <CamelCaseWrap value={condition.type} />, props: { className: 'pf-m-width-50` },

or

{ title: <CamelCaseWrap value={condition.type} />, props: { className: 'col-md-6` },

for example...

Copy link
Member

Choose a reason for hiding this comment

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

We're adding a fair amount of duplicate code here to make this change :/

Copy link
Contributor Author

Choose a reason for hiding this comment

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

hmm, yea i see this both ways. The value being, we aren't overabstracting and the API should be easier to follow and consume (and test).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure if Redux state should be shared now...

Copy link
Contributor Author

@priley86 priley86 Jul 15, 2019

Choose a reason for hiding this comment

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

FWIW, we are prepping to convert React-Table to Typescript next in PF #1950. Making some good progress w/ this locally... this should make API typings more consistent from the PF side. Will be sure to test this out here downstream before anything goes up...

Copy link
Member

Choose a reason for hiding this comment

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

@priley86 If the stateToProps should be identical between these two tables, we can share the implementation as a common tableStateToProps function?

My only hesitation with this change is that we're copying this complicated chunk of code between the two tables.

Copy link
Member

Choose a reason for hiding this comment

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

Ah I guess it doesn't work because it uses the props from the component. Hm

Copy link
Contributor Author

Choose a reason for hiding this comment

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

extracted this logic to a common tableStateToProps function

@spadgett
Copy link
Member

/assign

@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: priley86
To complete the pull request process, please assign spadgett
You can assign the PR to them by writing /assign @spadgett in a comment when ready.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@priley86 priley86 force-pushed the cluster-settings-table branch from 55da779 to b94ceaa Compare July 16, 2019 12:46
@openshift-ci-robot openshift-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 16, 2019
@priley86 priley86 force-pushed the cluster-settings-table branch from b94ceaa to e3c1575 Compare July 18, 2019 16:50
@openshift-ci-robot openshift-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 18, 2019
@priley86
Copy link
Contributor Author

  • rebased

@priley86
Copy link
Contributor Author

/test e2e-aws

@openshift-ci-robot
Copy link
Contributor

@priley86: The following test failed, say /retest to rerun them all:

Test name Commit Details Rerun command
ci/prow/e2e-aws e3c1575 link /test e2e-aws

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@vojtechszocs
Copy link
Contributor

FYI @jelkosz @gnehapk

@priley86
Copy link
Contributor Author

@spadgett - let me know when you'd like this rebased again. thanks!

@openshift-ci-robot openshift-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 19, 2019
@openshift-ci-robot
Copy link
Contributor

@priley86: PR needs rebase.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants