-
Couldn't load subscription status.
- Fork 373
feat(ApplicationLauncher): Add Application Launcher Component #319
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
Conversation
| > | ||
| <li className={classes} role="menuitem"> | ||
| <a className="applauncher-pf-link" href="#" onClick={e => onClick(e)}> | ||
| <i className={icon} aria-hidden="true" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<Icon name="home" className="applauncher-pf-link-icon" />e0a2f88 to
e2f217f
Compare
Pull Request Test Coverage Report for Build 1441
💛 - Coveralls |
e2f217f to
a6e73df
Compare
|
e11ae7b to
cea99b6
Compare
| import { Button } from '../Button'; | ||
|
|
||
| const ApplicationLauncherToggle = ({ onClick, tooltipPlacement }) => { | ||
| const tooltip = <Tooltip id="tooltip">Application Launcher</Tooltip>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Application Launcher should be replaced with a passed in prop.
|
|
||
| this.state = { | ||
| showLauncher: false, | ||
| type: props.type |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why add type to state rather than simply using the prop? It should only be mutable by the caller
| { | ||
| 'applauncher-pf dropdown dropdown-kebab-pf': this.state.type === 'list' | ||
| }, | ||
| { open: this.state.showLauncher } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be better to always specify applauncher-pf dropdown dropdown-kebab-pf and add applauncher-pf-block-list if type === grid.
| /** Icon Type */ | ||
| icon: PropTypes.string.isRequired, | ||
| /** App Tooltip */ | ||
| tooltip: PropTypes.string.isRequired, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be required? I'm not sure all items will need a tooltip.
| }; | ||
| ApplicationLauncherWrapper.propTypes = { | ||
| /** Array of App Objects */ | ||
| apps: PropTypes.array.isRequired, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we define a shape for this so callers no what fields are required?
3059dbe to
e876cac
Compare
|
e876cac to
76189cf
Compare
| /** Children Node */ | ||
| children: PropTypes.node.isRequired, | ||
| /** tooltipPlacement */ | ||
| tooltipPlacement: PropTypes.string, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to take a tooltip as well otherwise it will always be Application Launcher
| /** Grid instead of List (List is Default) */ | ||
| grid: PropTypes.bool, | ||
| /** Tooltip Placement */ | ||
| tooltipPlacement: PropTypes.string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should take a tooltip to pass to the ApplicationLauncher to pass to the ApplicationLauncherToggle
0c11d60 to
2196974
Compare
|
|
@patternfly/patternfly-react-ux |
|
@jgiardino I'll review this afternoon. |
|
@gilad215 Thanks for this addition! A few comments based on a UX review:
@jgiardino @Rohoover @terezanovotna anything else you guys want to add? Thanks, |
2196974 to
0c2a6a7
Compare
Thanks for the review @lizsurette
|
|
@lizsurette Can you open an issue against the design documentation to remove the arrow pointing to the icon when opened from the images included there? |
|
@lizsurette Looks like what is here is correct then. Are you OK with this now? |
|
@mcarrano Thanks for confirming the correct design, Matt! @gilad215 @jeff-phillips-18 Yep, this is good to go now from a UX point of view :) @jeff-phillips-18 I logged the issue in angular-patternfly: patternfly/angular-patternfly#741 |
|
Great work on this, @gilad215! I have a few questions about it, and then some requests listed below…
Requested updates:
|
|
I opened an issue about the incorrect roles (item # 5 in my previous comment): patternfly/patternfly#1063 |
d80e8eb to
cbc761c
Compare
Should be possible, in your example the launcher should not be rendered at a certain width, its the responsibility of the consumer to handle these kind of behaviours.
@jeff-phillips-18 I also changed the storybook structure to match the PF one, let me know what you think |
cbc761c to
43b797a
Compare
|
Hi @gilad215, Thanks for making updates requested above! There's just one element that still doesn't match what's included in pf core:
|
43b797a to
a1409c3
Compare
|
@jgiardino fixed the element :) |
| onClick={onClick} | ||
| bsStyle="link" | ||
| className="nav-item-iconic dropdown-toggle" | ||
| aria-describedby="tooltip" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is this value coming from? This should the the same value that displays as the tooltip id value, but it isn't obvious to me where the tooltip id value is being defined. When I look at the react-bootstrap documentation, they show examples of tooltip like this <Tooltip id={id}> with id as a required prop.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, ill just change it:
overlay={<Tooltip id={tooltip}>{tooltip}</Tooltip>}
in the OverlayTrigger
|
@gilad215 I had to build your branch locally to see the updates, and they match what I was expecting. Thanks for the updates! I did have a question about about the tooltip, that I included in an inline comment. Do you happen to know why the storybook isn't showing the latest updates? (adding @priley86 and @jeff-phillips-18 in case this is an issue with something in the repo, and also for feedback on my next comment...) Re: @dabeng's comment:
This behavior comes from pf-core css—the css from core will not show the app launcher icon at a width less than 768px. But in pf-core, the menu items in the app launcher menu will also get added to the vertical nav when the window is less than 768px in width. I'm assuming that this component is intended to support only the toggle and menu that display when the window is greater than 768px. But my question for everyone (@gilad215, @priley86, @jeff-phillips-18, @mturley) is how should the menu items be added to the vertical nav? Would that functionality be added to the vertical nav component? Is that something the consumer would manage? Do we need another issue to capture this aspect of the app launcher behavior? |
|
The items in right of the masthead (app launcher, help, user menu, notification drawer trigger) are meant to be added to the vertical nav at less than 768px. This is described in http://www.patternfly.org/pattern-library/navigation/vertical-navigation/#design in the Responsive States section. |
affects: patternfly-react fix patternfly#184 ISSUES CLOSED: patternfly#184
a1409c3 to
2db104a
Compare
|
@jgiardino changed |
|
Awesome! Thanks, @gilad215! No further comments from me. Great job on this! We also have issue #382 to address getting the app launcher into the vertical nav at smaller window sizes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks @gilad215!




fix #184
What:
Add an Application Launcher Component.
Managed to show all the launcher types in one storybook:
Grid/List Icons/No Iconswith the help of the knobsLink to Storybook:
Storybook
Additional issues:
e.g. -
applauncher-pf-link-icon pficon pficon-domain- What is the name prop that i need to give to<Icon />in order to render this icon?TODO: