FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

feat(Wizard): add support for in page rendering by atiratree · Pull Request #2830 · patternfly/patternfly-react · GitHub

feat(Wizard): add support for in page rendering - #2830

Merged
jschuler merged 1 commit into
patternfly:masterfrom
atiratree:inpageWizard
Sep 5, 2019
Merged

feat(Wizard): add support for in page rendering#2830
jschuler merged 1 commit into
patternfly:masterfrom
atiratree:inpageWizard

Conversation

atiratree commented Sep 4, 2019
edited
Loading

Copy link
Copy Markdown

fixes #2751

Copy link
Copy Markdown
Author

The css require at least "@patternfly/patternfly": "2.28.0" dependency but only has "@patternfly/patternfly": "2.27.3". Should it be resolved in this PR?

height?: number | string;
/** The wizard title */
title: string;
title?: string;

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

title is now optional, because the header is not rendered in in-page wizard

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

The default wizard requires a title currently, and per conversations with @mcarrano here (patternfly/patternfly#2191) I believe we want to keep it that way. Making it optional creates these 2 scenarios:

Title/description is undefined renders an empty header, and the header is required at a minimum to position the close button.

Title is undefined but a description exists, which seems to work OK, but we haven't really accounted for that in core and I'm not sure we want to allow that per the design:

Can we make this optional if isInPage is true? And technically it isn't optional - the entire header shouldn't render if using an in-page wizard, so title and description shouldn't be allowed.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

We can change the title to optional here since it technically is not always required. However, can you generate a warning if the title is not provided AND isModal is true.

const newId = Wizard.currentId++;
this.titleId = `pf-wizard-title-${newId}`;
this.descriptionId = `pf-wizard-description-${newId}`;
this.isModal = !props.isInPage;

atiratree Sep 4, 2019
edited
Loading

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

user should not have an ability to change the inpage wizard to modal one after it is constructed

if (this.isModal) {
this.titleId = `pf-wizard-title-${newId}`;
this.descriptionId = `pf-wizard-description-${newId}`;
}

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

not sure if this is needed, but the titleId/descriptionId are not used when in-page

Copy link
Copy Markdown
Author

I guess we need to update @patternfly/patternfly" dependency for the tests to pass (fails on missing inPage modifier ).

should I do it in this PR?

kmcfaul commented Sep 4, 2019

Copy link
Copy Markdown
Contributor

There's a PR up to bump the version to 2.28 so when that merges in it should resolve your issues.

kmcfaul commented Sep 4, 2019

Copy link
Copy Markdown
Contributor

@suomiy Version bump PR has been merged, try updating and that should solve the build error!

Copy link
Copy Markdown
Collaborator

PatternFly-React preview: https://patternfly-react-pr-2830.surge.sh

Copy link
Copy Markdown
Author

updated & tests passed

mcarrano previously approved these changes Sep 4, 2019

mcarrano left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Looks good

Copy link
Copy Markdown

@suomiy this looks awesome, thanks for doing this so quickly!

matthewcarleton previously approved these changes Sep 5, 2019
kmcfaul previously approved these changes Sep 5, 2019

mcoker left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Looks great @suomiy! One bit of feedback about the title/description.

height?: number | string;
/** The wizard title */
title: string;
title?: string;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

The default wizard requires a title currently, and per conversations with @mcarrano here (patternfly/patternfly#2191) I believe we want to keep it that way. Making it optional creates these 2 scenarios:

Title/description is undefined renders an empty header, and the header is required at a minimum to position the close button.

Title is undefined but a description exists, which seems to work OK, but we haven't really accounted for that in core and I'm not sure we want to allow that per the design:

Can we make this optional if isInPage is true? And technically it isn't optional - the entire header shouldn't render if using an in-page wizard, so title and description shouldn't be allowed.

Copy link
Copy Markdown
Author

Can we make this optional if isInPage is true? And technically it isn't optional - the entire header shouldn't render if using an in-page wizard, so title and description shouldn't be allowed.

@mcoker

These two are mutually exclusive from the type perspective. I.e. having title optional in page and required in modal.

Our options are:

Quick Patch

  • leave it required. Users will be force to specify the title and this will have no effects
  • leave it optional. Users will have mentioned positioning problems if they do not specify it

Fix Patch

  • pass WizardHeader component to the wizard (breaking changes)
  • fix css

mcoker commented Sep 5, 2019

Copy link
Copy Markdown
Contributor

leave it required. Users will be force to specify the title and this will have no effects
leave it optional. Users will have mentioned positioning problems if they do not specify it

I'm not sure between the two, what do you think @tlabaj?

height?: number | string;
/** The wizard title */
title: string;
title?: string;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

We can change the title to optional here since it technically is not always required. However, can you generate a warning if the title is not provided AND isModal is true.

jschuler commented Sep 5, 2019

Copy link
Copy Markdown
Contributor

Alternative workaround to optional title, in WizardHeader render empty non-breaking space if not provided

{title ? (
        <Title
          size="3xl"
          className={css(styles.wizardTitle)}
          aria-label={title}
          id={titleId}
        >
          {title}
        </Title>
      ) : (
        <Title
          size="3xl"
          className={css(styles.wizardTitle)}
          aria-label={title}
          id={titleId}
        >
          &nbsp;
        </Title>
      )}

jschuler previously approved these changes Sep 5, 2019

jschuler left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM. We can take this in and update the docs to let the user know that they should pass in a title for the modal

Copy link
Copy Markdown
Author

I decided to go the &nbsp; route. Should I still add the warning?

Copy link
Copy Markdown
Author

Also, should I create an issue for that (to fix it properly and remove the non breaking space)?

jschuler commented Sep 5, 2019

Copy link
Copy Markdown
Contributor

@suomiy that would be great thanks. can you just also update the prop documentation for the title prop to say that it is required unless isInPage is set to true?

Copy link
Copy Markdown
Author

added the warning and the documentation

jschuler left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

awesome, thanks for making these updates @suomiy

tlabaj left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM

mcoker left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

@suomiy looks great! Thanks for all your hard work on this!!

jschuler merged commit bf96474 into patternfly:master Sep 5, 2019

Copy link
Copy Markdown
Collaborator

Your changes have been released in:

  • @patternfly/react-core@3.97.0
  • @patternfly/react-docs@4.11.1
  • @patternfly/react-inline-edit-extension@2.11.19
  • demo-app-ts@2.21.22
  • @patternfly/react-table@2.19.19
  • @patternfly/react-topology@2.8.18
  • @patternfly/react-virtualized-extension@1.2.7

Thanks for your contribution! 🎉

Copy link
Copy Markdown
Author

nice! 🎉

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Provide In-page wizard demo

9 participants


Back | FazBrowse Home | New Git URL