Skip to content

Implement read-only view of individual collection page#3636

Merged
dvail merged 3 commits intomasterfrom
dv/ROX-12601-implement-view-mode-for-collections
Nov 2, 2022
Merged

Implement read-only view of individual collection page#3636
dvail merged 3 commits intomasterfrom
dv/ROX-12601-implement-view-mode-for-collections

Conversation

@dvail
Copy link
Contributor

@dvail dvail commented Oct 31, 2022

Description

This implements the read-only "view" mode of individual collection pages.

Form controls will be disabled and non-interactive, extraneous UI components (trash buttons) will not be visible, and the collection attacher component will be replaced with a read-only alternative display.

Checklist

  • Investigated and inspected CI test results
  • Unit test and regression tests added
  • Evaluated and added CHANGELOG entry if required
  • Determined and documented upgrade steps
  • Documented user facing changes (create PR based on openshift/openshift-docs and merge into rhacs-docs)

If any of these don't apply, please comment below.

Testing Performed

Visit the collection page and select a collection from the table. The browser will navigate to the read only view for that collection with the constraints in the above description.
Clicking on disabled UI controls will have no effect. Tab-navigation will skip over the disabled controls.
image
image

When viewing a collection with no embedded collections in read-only mode, an empty state component will appear in place of the table:
image

Mobile layout views:
image
image
image
image

@openshift-ci
Copy link

openshift-ci bot commented Oct 31, 2022

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@dvail
Copy link
Contributor Author

dvail commented Oct 31, 2022

Base automatically changed from dv/ROX-12597-implement-attach-collections-table to master November 1, 2022 14:18
@dvail dvail force-pushed the dv/ROX-12601-implement-view-mode-for-collections branch from 0905fb8 to bf65ad2 Compare November 1, 2022 14:19
}

/* Un-override the above override when the <Select> component is disabled */
.pf-c-select__toggle.pf-m-disabled::before {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Before this change:
image

After this change:
image

Disabled <Select> styles on the PatternFly site:
image

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also note the subtle color difference between the top and bottom dropdowns. This is due to an opacity: 0.5; rule from the ui-components package that is applying to <button> elements. The top <Select> uses a button as the main element while the bottom uses a <div> due to the difference PF options in use.

@dvail dvail marked this pull request as ready for review November 1, 2022 15:05
@dvail dvail requested review from bradr5 and pedrottimark November 1, 2022 15:06
<Title headingLevel="h4">
There are no other collections attached to this collection
</Title>
</EmptyState>
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 consistent with many other empty state titles. However, a question for PatternFly Developer Office Hours is pro and con for accessibility of h4 element versus p element with the identical style.

In a video for a past day of learning with theme of accessibility, the screen reader user used heading structure of page quite a bit to form a mental model of the information hierarchy (and commented on any skips in heading levels). This page has intuitive hierarchy for h1 and h2 but not so much for this heading.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

True I agree, especially with the screen reader comment since this bit of text doesn't really communicate hierarchy. The page has h1 and h2, but there isn't anything semantically that makes this a h3, h4, etc. I'll update to a <p> with styles.

{isReadOnly ? (
<>
<Title className="pf-u-mb-xs" headingLevel="h2">
Attached collections
Copy link
Contributor

Choose a reason for hiding this comment

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

Bravo! Does Add new collection rules deserve similar treatment?

Copy link
Contributor

Choose a reason for hiding this comment

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

On the other side of the coin, consistent Attached collections heading is better for docs team seems clearer (to me, at least).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point. How about "Attached collections" in both modes, but conditional rendering of "Extend this collection by attaching other sets." which only applies in the edit modes? I think that would be a good call to action in combination with the "Attach" and "Detach" buttons below.

I'll take a look at the collection rules text too.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, indeed.

@ghost
Copy link

ghost commented Nov 1, 2022

Images are ready for the commit at a8ca9d0.

To use with deploy scripts, first export MAIN_IMAGE_TAG=3.72.x-472-ga8ca9d0d5c.

Copy link
Contributor

@pedrottimark pedrottimark left a comment

Choose a reason for hiding this comment

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

How did we ever survive without conditional rendering via React?

2 comments for your consideration.

@dvail dvail force-pushed the dv/ROX-12601-implement-view-mode-for-collections branch from ee2cea2 to a8ca9d0 Compare November 2, 2022 13:20
@dvail dvail requested a review from pedrottimark November 2, 2022 13:25
@dvail dvail enabled auto-merge (squash) November 2, 2022 13:48
@dvail dvail merged commit 4697e52 into master Nov 2, 2022
@dvail dvail deleted the dv/ROX-12601-implement-view-mode-for-collections branch November 2, 2022 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants