Skip to content

Commit

Permalink
Add download icon (#31) (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jleagle committed Apr 1, 2020
1 parent 3e5d1f0 commit b90e821
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/Enums/Cards/CardActionTooltip.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ class CardActionTooltip extends AbstractUiEnum
const REMOVE = 'Remove';
const RESTORE = 'Restore';
const VIEW = 'View';
const DOWNLOAD = 'Download';
const IS_DEFAULT = 'Is default';
const SET_DEFAULT = 'Set as default';
const PAUSE = 'Pause';
Expand Down
3 changes: 2 additions & 1 deletion src/GlobalElements/Cards/Card.php
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,8 @@ protected function _getSortedActions()
$sorted = [];
$sortOrder = [
self::ACTION_TYPE_VIEW => 1,
self::ACTION_TYPE_EDIT => 2,
self::ACTION_TYPE_DOWNLOAD => 2,
self::ACTION_TYPE_EDIT => 3,
// custom actions can appear after here
self::ACTION_TYPE_IS_DEFAULT => 100,
self::ACTION_TYPE_MAKE_DEFAULT => 110,
Expand Down
4 changes: 4 additions & 0 deletions src/GlobalElements/Cards/CardAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@ protected function _prepareFromType()
$this->_icon = FaIcon::create(FaIcon::EYE);
$this->_tooltip = CardActionTooltip::VIEW;
break;
case self::ACTION_TYPE_DOWNLOAD:
$this->_icon = FaIcon::create(FaIcon::DOWNLOAD);
$this->_tooltip = CardActionTooltip::DOWNLOAD;
break;
case self::ACTION_TYPE_DELETE:
$this->_icon = FaIcon::create(FaIcon::TRASH);
$this->_tooltip = CardActionTooltip::DELETE;
Expand Down
1 change: 1 addition & 0 deletions src/GlobalElements/Cards/ICardActionType.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ interface ICardActionType
const ACTION_TYPE_DELETE = 'delete';
const ACTION_TYPE_RESTORE = 'restore';
const ACTION_TYPE_VIEW = 'view';
const ACTION_TYPE_DOWNLOAD = 'download';
const ACTION_TYPE_DISABLE = 'disable';
const ACTION_TYPE_ENABLE = 'enable';
const ACTION_TYPE_APPROVE = 'approve';
Expand Down

0 comments on commit b90e821

Please sign in to comment.