Skip to content

Allow action buttons in empty state for a card/list/table view - #511

Merged
cdcabrera merged 4 commits into
patternfly:masterfrom
rhwood:empty-state-action-buttons
Jul 11, 2017
Merged

Allow action buttons in empty state for a card/list/table view#511
cdcabrera merged 4 commits into
patternfly:masterfrom
rhwood:empty-state-action-buttons

Conversation

@rhwood

@rhwood rhwood commented Jul 3, 2017

Copy link
Copy Markdown
Contributor

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


This change is Reviewable

@dtaylor113 dtaylor113 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.

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
Copy Markdown
Member

Other than the one issue I raised, LGTM!

@rhwood

rhwood commented Jul 7, 2017

Copy link
Copy Markdown
Contributor Author

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
Copy Markdown
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'
            },

@dtaylor113 dtaylor113 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.

LGTM, thanks!

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

@cdcabrera cdcabrera 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.

@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