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

ListView.InfoItems are not aligned with each other #1393

Closed
martinpitt opened this issue Feb 15, 2019 · 9 comments
Closed

ListView.InfoItems are not aligned with each other #1393

martinpitt opened this issue Feb 15, 2019 · 9 comments
Assignees
Labels

Comments

@martinpitt
Copy link

martinpitt commented Feb 15, 2019

It would be really nice if the InfoItems would behave more like table columns where they would always be aligned properly. This can already be seen in the official storybook:

storybook

You see how the "8 images" is misaligned in the third column as "11" is wider than "7" or "9".

@tlabaj for PR review

@martinpitt martinpitt changed the title ListView.InfoItems are not aligned ListView.InfoItems are not aligned with each other Feb 15, 2019
@stale
Copy link

stale bot commented Jun 6, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the wontfix label Jun 6, 2019
@martinpitt
Copy link
Author

bump

@kmcfaul
Copy link
Contributor

kmcfaul commented Jul 24, 2019

@mcoker Is there something in css we could add for padding for this case?

@mcoker
Copy link
Contributor

mcoker commented Jul 25, 2019

Hmm... the datalist can handle a "grid" type layout to a certain extent, but this is a case where it will be hard to align a group of items in one row with a group in another row. One thing you could do in this case is apply the following, so that the items grow to fill their parent (will change the spacing), but they're all based off of the same flex-basis so they will be equal widths (each item is 25%). So as long as you have the same number of items in each of those groups, they should align with one another on different rows.

.list-view-pf-additional-info-item {
  flex: 1 1 0;
}

Will that work for you?

Another option might be to look into the table component, as it's recommended if you need to display columns of information that need to align this way in a grid.

@kmcfaul
Copy link
Contributor

kmcfaul commented Jul 26, 2019

Adding the flex property to that class will space them out evenly, opposed to the more left aligned items.

Screen Shot 2019-07-26 at 10 19 54 AM

Should this be changed in core or should a separate class be added in core and applied to the items via a flag parameter? @kybaker @mcoker

@mcoker
Copy link
Contributor

mcoker commented Jul 26, 2019

@kmcfaul since this is pf3, we only want to introduce changes for high priority blocking changes (features, bugs, etc).

@martinpitt would the option above help in your case, or can I help you re-work it so that it does? Or could you potentially consider a table for a layout where columns will align with one another in all rows?

@kmcfaul
Copy link
Contributor

kmcfaul commented Jul 26, 2019

@mcoker @kybaker Of the three ListView issues then (#1392, #1393, #1394), are either of the other two besides #1392 slated to change? #1394 I haven't pinged on because it should be able to be done only on the react side, with letting a user has in a null/empty actions parameter to keep the spacing div (just without children).

@rachael-phillips
Copy link
Contributor

Hi @mcoker and @kybaker I'm following up here. What should @kmcfaul 's next steps be here?

@kmcfaul
Copy link
Contributor

kmcfaul commented Aug 19, 2019

Hi @martinpitt. We are not taking on these couple PF3 ListView issues at this time, please refer to the workaround using flex for this spacing issue, and contact @mcoker if you have further questions.

@kmcfaul kmcfaul closed this as completed Aug 19, 2019
wmfgerrit pushed a commit to wikimedia/integration-zuul that referenced this issue Jun 15, 2020
At a lot of place, the duration for an item shows the raw value. It
lacks an indication of the unit (ms, s or minutes??) and is not very
human friendly. `480` is better understood as `8 minutes`.

The `moment-duration-format` package enhance moment duration objects to
ease formatting. It has better options than moment.duration.humanize(),
notably it does not truncate value and trim extra tokens when they are
not needed.
The package does not have any extra dependencies.

https://www.npmjs.com/package/moment-duration-format

Format duration on the pages build, buildset and on the build summary.

The Change panel had custom logic to workaround moment.duration.humanize
over rounding (so that 100 minutes became '1 hour'). The new package
does not have such behavior and offers tuning for all the features we
had:

* `largest: 2`, to only keep the two most significants token. 100
minutes and 30 seconds would thus render as '1 hour 40 minutes',
stripping the extra '30 seconds'.
* `minValue: 1`, based on the least significant token which is minute,
it means any value less than one minute is rendered as:
 < 1 minute
* `usePLural: false`, to disable pluralization since that was not
handled previously.

That reverts https://review.opendev.org/#/c/704191/

Make class="time" to not wrap, they would wrap on the Status page since
the box containing is not large enough.

In the Console, show the duration for each tasks, rounding to 1 second
resolution.  Would ease finding potential slowdown in a play execution.
The tasks do not have a duration property, use moment to compute it
based on start and end times.

Since hostname length might vary, the duration spans might be
misaligned. Use a flex to have them vertically aligned, credits to
mcoker@github:
patternfly/patternfly-react#1393 (comment)

Thanks to Tristan Cacqueray for the React guidances!

Change-Id: I955583713778911a8e50f08dc6d077594da4ae44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants