Skip to content

Conversation

@rhwood
Copy link
Contributor

@rhwood rhwood commented Jul 3, 2017

Add ability to put action buttons in the empty state view for card, list, or table view.
Addresses #510.


This change is Reviewable

Copy link
Member

@dtaylor113 dtaylor113 left a comment

Choose a reason for hiding this comment

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

Hi, I noticed that clicking on the empty state action buttons do not update the Events textarea. i believe because the callback function for empty state actions only pass an 'action' parameter, and not an 'item' param, so you cannot reuse the existing perfromActions(actions, item) method. Please update to use a correct callback function, thanks!

@dtaylor113
Copy link
Member

Other than the one issue I raised, LGTM!

@rhwood
Copy link
Contributor Author

rhwood commented Jul 7, 2017

For some reason, which I can't figure out, the actionFn property is becoming undefined for the empty state buttons in any/all examples. I have examples that use a different function for the actionFn property, but when the button is clicked in a browser, that property is undefined.

@dtaylor113
Copy link
Member

For some reason, which I can't figure out, the actionFn property is becoming undefined

Hi, you need to put the actionFn above/before the emptyStateActionButtons array/obj definition. This worked for me:

          var performEmptyStateAction = function (action) {
            $scope.eventText = action.name + " executed\r\n" + $scope.eventText;
          };

          $scope.emptyStateActionButtons = [
            {
              name: 'Main Action',
              title: 'Perform an action',
              actionFn: performEmptyStateAction,
              type: 'main'
            },

Copy link
Member

@dtaylor113 dtaylor113 left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@cdcabrera cdcabrera self-requested a review July 10, 2017 15:57
Copy link
Member

@cdcabrera cdcabrera left a comment

Choose a reason for hiding this comment

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

@rhwood looking good on the PR, if you can squash those commits with a rebase we'll go ahead and merge it in

@cdcabrera cdcabrera merged commit 3b4df01 into patternfly:master Jul 11, 2017
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