Skip to content

Conversation

@dtaylor113
Copy link
Member

Description

When using the pfEmptyState component and specifying a helpLink, the helpLink will render a <a>. The helpLink can have a url and/or a urlAction. Problem was if url was not specified, it defaulted to <a href which redirects to root /.
This PR ensures that if no helpLink.url specified, that clicking on the <a> only executes the urlAction (ng-click), and does not redirect and change the browser url. This is a requirement for OpenShift.

image

// if no url specified, set url to not redirect. ie. just do urlAction
ctrl.config.helpLink.url = "javascript:void(0)";
}
ctrl.updateConfig();
Copy link
Member

Choose a reason for hiding this comment

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

This needs to be done in $onChanges as well for the case where the helpLink was added to the config object after init. Maybe do this as part of updateConfig.

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed, added a $doCheck since we need to do a deep compare on the config obj.

@dtaylor113 dtaylor113 force-pushed the empty-state-no-helplink-url branch from 8e34368 to 0274412 Compare January 9, 2018 21:02
@jeff-phillips-18 jeff-phillips-18 merged commit c1594ad into patternfly:master Jan 9, 2018
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.

3 participants