diff --git a/src/table/tableview/examples/table-view-basic.js b/src/table/tableview/examples/table-view-basic.js index 57005ad5d..050bc91c1 100644 --- a/src/table/tableview/examples/table-view-basic.js +++ b/src/table/tableview/examples/table-view-basic.js @@ -34,6 +34,7 @@ *
  • .actionFn - (function(action)) Function to invoke when the action selected * * @param {object} emptyStateConfig Optional configuration settings for the empty state component. See the {@link patternfly.views.component:pfEmptyState Empty State} component + * @param {array} emptyStateActionButtons Optional buttons to display under the icon, title, and informational paragraph in the empty state component. See the {@link patternfly.views.component:pfEmptyState Empty State} component * @example @@ -46,7 +47,8 @@ columns="columns" items="items" action-buttons="actionButtons" - menu-actions="menuActions"> + menu-actions="menuActions" + empty-state-action-buttons="emptyStateActionButtons">
    @@ -101,6 +103,10 @@ showCheckboxes: true }; + var performEmptyStateAction = function (action) { + $scope.eventText = action.name + "\r\n" + $scope.eventText; + }; + $scope.emptyStateConfig = { icon: 'pficon-warning-triangle-o', title: 'No Items Available', @@ -112,6 +118,30 @@ } }; + $scope.emptyStateActionButtons = [ + { + name: 'Main Action', + title: 'Perform an action', + actionFn: performEmptyStateAction, + type: 'main' + }, + { + name: 'Secondary Action 1', + title: 'Perform an action', + actionFn: performEmptyStateAction + }, + { + name: 'Secondary Action 2', + title: 'Perform an action', + actionFn: performEmptyStateAction + }, + { + name: 'Secondary Action 3', + title: 'Perform an action', + actionFn: performEmptyStateAction + } + ]; + function handleCheckBoxChange (item) { $scope.eventText = item.name + ' checked: ' + item.selected + '\r\n' + $scope.eventText; }; diff --git a/src/table/tableview/examples/table-view-with-toolbar.js b/src/table/tableview/examples/table-view-with-toolbar.js index 3b1233adf..af2172669 100644 --- a/src/table/tableview/examples/table-view-with-toolbar.js +++ b/src/table/tableview/examples/table-view-with-toolbar.js @@ -33,6 +33,7 @@ *
  • .actionFn - (function(action)) Function to invoke when the action selected * * @param {object} emptyStateConfig Optional configuration settings for the empty state component. See the {@link patternfly.views.component:pfEmptyState Empty State} component + * @param {array} emptyStateActionButtons Optional buttons to display under the icon, title, and informational paragraph. See the {@link patternfly.views.component:pfEmptyState Empty State} component * @example diff --git a/src/table/tableview/table-view.component.js b/src/table/tableview/table-view.component.js index 000d5f2c7..ff12a128b 100644 --- a/src/table/tableview/table-view.component.js +++ b/src/table/tableview/table-view.component.js @@ -7,7 +7,8 @@ angular.module('patternfly.table').component('pfTableView', { items: '<', actionButtons: ' - + diff --git a/src/views/cardview/card-view.component.js b/src/views/cardview/card-view.component.js index 4702b46f6..1a6191340 100644 --- a/src/views/cardview/card-view.component.js +++ b/src/views/cardview/card-view.component.js @@ -24,6 +24,7 @@ *
  • .itemsAvailable - (boolean) If 'false', displays the {@link patternfly.views.component:pfEmptyState Empty State} component. * * @param {object} emptyStateConfig Optional configuration settings for the empty state component. See the {@link patternfly.views.component:pfEmptyState Empty State} component + * @param {array} emptyStateActionButtons Optional buttons to display under the icon, title, and informational paragraph in the empty state component. See the {@link patternfly.views.component:pfEmptyState Empty State} component * @param {Array} items the data to be shown in the cards
    * * @example @@ -41,7 +42,7 @@
    - +
    {{item.name}}
    @@ -193,6 +194,10 @@ }, ] + var performEmptyStateAction = function (action) { + $scope.eventText = action.name + "\r\n" + $scope.eventText; + }; + $scope.emptyStateConfig = { icon: 'pficon-warning-triangle-o', title: 'No Items Available', @@ -203,6 +208,30 @@ url : '#/api/patternfly.views.component:pfEmptyState' } }; + + $scope.emptyStateActionButtons = [ + { + name: 'Main Action', + title: 'Perform an action', + actionFn: performEmptyStateAction, + type: 'main' + }, + { + name: 'Secondary Action 1', + title: 'Perform an action', + actionFn: performEmptyStateAction + }, + { + name: 'Secondary Action 2', + title: 'Perform an action', + actionFn: performEmptyStateAction + }, + { + name: 'Secondary Action 3', + title: 'Perform an action', + actionFn: performEmptyStateAction + } + ]; } ]); @@ -212,6 +241,7 @@ angular.module('patternfly.views').component('pfCardView', { bindings: { config: '=?', emptyStateConfig: '=?', + emptyStateActionButtons: '=?', items: '=', eventId: '@id' }, diff --git a/src/views/cardview/card-view.html b/src/views/cardview/card-view.html index b38190d4a..6981e8562 100755 --- a/src/views/cardview/card-view.html +++ b/src/views/cardview/card-view.html @@ -12,5 +12,5 @@
    - + diff --git a/src/views/listview/examples/list-view.js b/src/views/listview/examples/list-view.js index dde919a86..554a97938 100644 --- a/src/views/listview/examples/list-view.js +++ b/src/views/listview/examples/list-view.js @@ -58,6 +58,7 @@ * @param {function (action, item))} updateMenuActionForItemFn function(action, item) Used to update a menu action based on the current item * @param {object} customScope Object containing any variables/functions used by the transcluded html, access via $ctrl.customScope. * @param {object} emptyStateConfig Optional configuration settings for the empty state component. See the {@link patternfly.views.component:pfEmptyState Empty State} component + * @param {array} emptyStateActionButtons Optional buttons to display under the icon, title, and informational paragraph in the empty state component. See the {@link patternfly.views.component:pfEmptyState Empty State} component * @example @@ -93,7 +94,8 @@ menu-actions="menuActions" update-menu-action-for-item-fn="updateMenuActionForItemFn" menu-class-for-item-fn="getMenuClass" - hide-menu-for-item-fn="hideMenuActions"> + hide-menu-for-item-fn="hideMenuActions" + empty-state-action-buttons="emptyStateActionButtons">
    {{item.name}} @@ -307,6 +309,10 @@ onDblClick: handleDblClick }; + var performEmptyStateAction = function (action) { + $scope.eventText = action.name + "\r\n" + $scope.eventText; + }; + $scope.emptyStateConfig = { icon: 'pficon-warning-triangle-o', title: 'No Items Available', @@ -318,6 +324,30 @@ } }; + $scope.emptyStateActionButtons = [ + { + name: 'Main Action', + title: 'Perform an action', + actionFn: performEmptyStateAction, + type: 'main' + }, + { + name: 'Secondary Action 1', + title: 'Perform an action', + actionFn: performEmptyStateAction + }, + { + name: 'Secondary Action 2', + title: 'Perform an action', + actionFn: performEmptyStateAction + }, + { + name: 'Secondary Action 3', + title: 'Perform an action', + actionFn: performEmptyStateAction + } + ]; + $scope.items = [ { name: "Fred Flintstone", @@ -534,7 +564,7 @@
    - + angular.module('patternfly.views').controller('CompoundExanspansionCtrl', ['$scope', '$templateCache', function ($scope, $templateCache) { $scope.eventText = ''; diff --git a/src/views/listview/list-view.component.js b/src/views/listview/list-view.component.js index 052a3a084..a6d36ccbd 100644 --- a/src/views/listview/list-view.component.js +++ b/src/views/listview/list-view.component.js @@ -11,7 +11,8 @@ angular.module('patternfly.views').component('pfListView', { actions: '=?', updateActionForItemFn: '=?', customScope: '=?', - emptyStateConfig: '=?' + emptyStateConfig: '=?', + emptyStateActionButtons: '=?' }, transclude: { expandedContent: '?listExpandedContent' diff --git a/src/views/listview/list-view.html b/src/views/listview/list-view.html index 731bed42b..e0a9952a8 100644 --- a/src/views/listview/list-view.html +++ b/src/views/listview/list-view.html @@ -66,5 +66,5 @@ - +